]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Rebuild some binaries with musl-libc to avoid virus false positive (issue #660)
authorlongpanda <admin@ventoy.net>
Tue, 22 Dec 2020 13:21:44 +0000 (21:21 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 22 Dec 2020 13:21:44 +0000 (21:21 +0800)
26 files changed:
BUSYBOX/build.txt
BUSYBOX/chmod/build.sh
BUSYBOX/chmod/vtchmod64_musl [new file with mode: 0644]
DMSETUP/build.txt
DMSETUP/dmsetup64
DOC/BuildVentoyFromSource.txt
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy.c
IMG/cpio/sbin/init
IMG/cpio/ventoy/busybox/64h
IMG/cpio/ventoy/busybox/vtchmod64_musl [new file with mode: 0644]
IMG/cpio/ventoy/busybox/vtchmod64_uclibc [deleted file]
IMG/cpio/ventoy/busybox/xzminidec64_musl [new file with mode: 0644]
IMG/cpio/ventoy/busybox/xzminidec64_uclibc [deleted file]
INSTALL/EFI/BOOT/BOOTAA64.EFI
INSTALL/EFI/BOOT/grubia32_real.efi
INSTALL/EFI/BOOT/grubx64_real.efi
INSTALL/grub/i386-pc/core.img
INSTALL/tool/x86_64/ash
INSTALL/tool/x86_64/hexdump
INSTALL/tool/x86_64/xzcat
INSTALL/ventoy/ventoy.cpio
INSTALL/ventoy/vtloopex.cpio
LANGUAGES/languages.ini
Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefile64_musl [new file with mode: 0644]
Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefileaa64 [new file with mode: 0644]
VtoyTool/vtoytool/01/vtoytool_64 [deleted file]

index 6578f680ffd65db65e864dff243b1bee0d723a51..538e7ea9e48f72bca99dee20f99ac31dfa44c51f 100644 (file)
@@ -1,20 +1,36 @@
-======== Build busybox 1.32 for aarch64 ======== \r
-\r
-ARCH=arm64 CROSS_COMPILE=aarch64-linux- make defconfig\r
-ARCH=arm64 CROSS_COMPILE=aarch64-linux- make menuconfig \r
-----> enable static build\r
-----> enable ar\r
-----> enable inotifyd\r
-\r
-\r
+======== How to build ash/hexdump/xzcat for aarch64 ======== \r
+#How to get ash.config/hexdump.cofig/xzcat.config\r
+#ARCH=arm64 CROSS_COMPILE=aarch64-linux- make allnoconfig\r
+#ARCH=arm64 CROSS_COMPILE=aarch64-linux- make menuconfig \r
+#----> enable static build\r
+#----> enable xzcat\r
+#get aarch64_xzcat.config\r
+\r
+tar xf busybox-1.32.0.tar.bz2\r
+cd busybox-1.32.0\r
+copy aarch64_xzcat.config as .config\r
 ARCH=arm64 CROSS_COMPILE=aarch64-linux- make \r
+rename ./busybox to xzcat\r
 \r
 \r
 \r
+======== How to build ash/hexdump/xzcat for x86_64 ==========\r
+#How to get ash.config/hexdump.cofig/xzcat.config\r
+#make allnoconfig\r
+#make menuconfig \r
+#----> enable static build\r
+#----> enable xzcat\r
+#get x86_64_xzcat.config\r
 \r
-ARCH=arm64 CROSS_COMPILE=aarch64-linux- make allnoconfig \r
 \r
+tar xf busybox-1.32.0.tar.bz2\r
+cd busybox-1.32.0\r
+copy x86_64_xzcat.config as .config\r
+modify Makefile\r
+CC             = gcc -specs "/usr/local/musl/lib/musl-gcc.specs"\r
+MODFLAGS       = -DMODULE -specs "/usr/local/musl/lib/musl-gcc.specs"\r
+make\r
+rename ./busybox to xzcat\r
 \r
-======== use mini-native-x86_64 uclibc to build ash/hexdump/busybox for x86_64 ==========\r
 \r
 \r
index 5b5edebdd86eb4487f0a4552b0f9555cffeac05b..0478deccd70d93d4234a1b9f257e41990bcc5d0f 100644 (file)
@@ -2,7 +2,7 @@
 
 DSTDIR=../../IMG/cpio/ventoy/busybox
 
-rm -f vtchmod32 vtchmod64 vtchmodaa64
+rm -f vtchmod32 vtchmod64 vtchmod64_musl vtchmodaa64
 rm -f $DSTDIR/vtchmod32 $DSTDIR/vtchmod64 $DSTDIR/vtchmodaa64
 
 /opt/diet32/bin/diet  gcc  -Os -m32  vtchmod.c -o  vtchmod32
@@ -10,12 +10,16 @@ rm -f $DSTDIR/vtchmod32 $DSTDIR/vtchmod64 $DSTDIR/vtchmodaa64
 aarch64-linux-gcc -Os -static vtchmod.c -o  vtchmodaa64
 aarch64-linux-strip --strip-all vtchmodaa64
 
+gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -Os -static vtchmod.c -o  vtchmod64_musl
+strip --strip-all vtchmod64_musl
 
 chmod 777 vtchmod32
 chmod 777 vtchmod64
 chmod 777 vtchmodaa64
+chmod 777 vtchmod64_musl
 
 cp -a vtchmod32 $DSTDIR/
 cp -a vtchmod64 $DSTDIR/
 cp -a vtchmodaa64 $DSTDIR/
+cp -a vtchmod64_musl $DSTDIR/
 
diff --git a/BUSYBOX/chmod/vtchmod64_musl b/BUSYBOX/chmod/vtchmod64_musl
new file mode 100644 (file)
index 0000000..d4cd5c6
Binary files /dev/null and b/BUSYBOX/chmod/vtchmod64_musl differ
index 998eff1a1fd6fd7d57b3b2d0631329d204535250..6585e599f77b7e6d959db32eb473ff431d181a58 100644 (file)
@@ -36,20 +36,16 @@ build for 32bit, static linked with dietlibc
 \r
 \r
 ======================== Build for 64bit dmsetup =========================\r
-https://www.uclibc.org/downloads/binaries/0.9.30.1/mini-native-x86_64.tar.bz2\r
 1. extract device mapper source code\r
-2. extract mini-native-x86_64.tar.bz2\r
-3. chroot to mini-native-x86_64\r
-3. ./configure --disable-nls  --disable-selinux --disable-shared  --enable-static_link\r
+2. ./configure --disable-nls  --disable-selinux --disable-shared  --enable-static_link CC='gcc -specs /usr/local/musl/lib/musl-gcc.specs'\r
+3. touch include/linux/limits.h include/linux/types.h   \r
+   echo '#include <sys/mount.h>' > include/linux/fs.h\r
 4. make\r
-5. strip dmsetup/dmsetup.static\r
+5. strip --strip-all dmsetup/dmsetup.static\r
 6. get dmsetup/dmsetup.static as the dmsetup64 binary file\r
 \r
 \r
-\r
-\r
 ======================== Build for arm64 dmsetup =========================\r
-https://www.uclibc.org/downloads/binaries/0.9.30.1/mini-native-x86_64.tar.bz2\r
 1. extract device mapper source code\r
 2. ./configure CC=aarch64-linux-gcc --target=arm --host=x86_64-linux-gnu --disable-nls  --disable-selinux --disable-shared  --enable-static_link\r
 3. modify include/configure.h file\r
index 1da213e2ccc1a2bd181698e1aca5c4d664ff0a16..4d39074523017550a1a121a20fd2ed76e61bdd01 100644 (file)
Binary files a/DMSETUP/dmsetup64 and b/DMSETUP/dmsetup64 differ
index eb04b196f7f81a3aad36e5a5f09ee1b6b3c6b425..967b809ff3bc2bc6b7a760fa7f20f805d0c769f7 100644 (file)
@@ -27,6 +27,7 @@
 2.2 Download third-part source code\r
     \r
     https://www.fefe.de/dietlibc/dietlibc-0.34.tar.xz                    ===>  /home/Ventoy-master/DOC/dietlibc-0.34.tar.xz\r
+    https://musl.libc.org/releases/musl-1.2.1.tar.gz                     ===>  /home/Ventoy-master/DOC/musl-1.2.1.tar.gz\r
     https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz                        ===>  /home/Ventoy-master/GRUB2/grub-2.04.tar.xz\r
     https://codeload.github.com/tianocore/edk2/zip/edk2-stable201911     ===>  /home/Ventoy-master/EDK2/edk2-edk2-stable201911.zip\r
     https://codeload.github.com/relan/exfat/zip/v1.3.0                   ===>  /home/Ventoy-master/ExFAT/exfat-1.3.0.zip\r
     https://releases.linaro.org/components/toolchain/binaries/7.4-2019.02/aarch64-linux-gnu/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz           ===>  /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz\r
     https://toolchains.bootlin.com/downloads/releases/toolchains/aarch64/tarballs/aarch64--uclibc--stable-2020.08-1.tar.bz2 ===> /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2\r
 \r
+2.3 Prepare third-part tools\r
+    cd /home/Ventoy-master/DOC/\r
+    tar xf musl-1.2.1.tar.gz\r
+    cd musl-1.2.1\r
+    ./configure && make install\r
+\r
+    tar xf /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz  -C /opt\r
+    tar xf /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2  -C /opt\r
+\r
+2.4 Set PATH envrioment\r
+    export PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin:/opt/aarch64--uclibc--stable-2020.08-1/bin\r
+    better to add this line to /root/.bashrc and relogin as root\r
+\r
 \r
 ==========================================\r
 3. All in one script\r
index feacbe0be12bbf47cd35a843f051d64f2a0b17c4..5dd57e484951ff3b3a13cab51266058f3bd9d903 100644 (file)
@@ -1709,6 +1709,7 @@ int ventoy_check_device_result(int ret)
 
 int ventoy_check_device(grub_device_t dev)
 {
+    int workaround = 0;
     grub_file_t file;
     grub_uint64_t offset;
     char devname[64];
@@ -1726,11 +1727,29 @@ int ventoy_check_device(grub_device_t dev)
         0 == ventoy_check_file_exist("(%s,2)/grub/localboot.cfg", dev->disk->name) ||
         0 == ventoy_check_file_exist("(%s,2)/tool/mount.exfat-fuse_aarch64", dev->disk->name))
     {
-        return ventoy_check_device_result(2 | 0x1000);
+        #ifndef GRUB_MACHINE_EFI
+        if (0 == ventoy_check_file_exist("(ventoydisk)/ventoy/ventoy.cpio", dev->disk->name) ||
+            0 == ventoy_check_file_exist("(ventoydisk)/grub/localboot.cfg", dev->disk->name) ||
+            0 == ventoy_check_file_exist("(ventoydisk)/tool/mount.exfat-fuse_aarch64", dev->disk->name))
+        {
+            return ventoy_check_device_result(2 | 0x1000);
+        }
+        else
+        {
+            workaround = 1;
+        }
+        #endif
     }
 
     /* We must have partition 2 */
-    file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(%s,2)/ventoy/ventoy.cpio", dev->disk->name);
+    if (workaround)
+    {
+        file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "%s", "(ventoydisk)/ventoy/ventoy.cpio");
+    }
+    else
+    {
+        file = ventoy_grub_file_open(VENTOY_FILE_TYPE, "(%s,2)/ventoy/ventoy.cpio", dev->disk->name);        
+    }
     if (!file)
     {
         return ventoy_check_device_result(3 | 0x1000);
@@ -1748,37 +1767,55 @@ int ventoy_check_device(grub_device_t dev)
         return ventoy_check_device_result(5);
     }
 
-    offset = partition->start + partition->len;
-    partition = file->device->disk->partition;
-    if ((partition->number != 1) || (partition->len != 65536) || (offset != partition->start))
+    if (workaround)
     {
-        grub_file_close(file);
-        return ventoy_check_device_result(6);
+        ventoy_part_table *PartTbl = g_ventoy_part_info->MBR.PartTbl;
+        if (PartTbl[1].StartSectorId != PartTbl[0].StartSectorId + PartTbl[0].SectorCount ||
+            PartTbl[1].SectorCount != 65536)
+        {
+            grub_file_close(file);
+            return ventoy_check_device_result(6);
+        }
     }
-    grub_file_close(file);
-
-    grub_snprintf(devname, sizeof(devname), "%s,2", dev->disk->name);
-    dev2 = grub_device_open(devname);
-    if (!dev2)
+    else
     {
-        return ventoy_check_device_result(7);
+        offset = partition->start + partition->len;
+        partition = file->device->disk->partition;
+        if ((partition->number != 1) || (partition->len != 65536) || (offset != partition->start))
+        {
+            grub_file_close(file);
+            return ventoy_check_device_result(7);
+        }
     }
 
-    fs = grub_fs_probe(dev2);
-    if (!fs)
-    {
-        grub_device_close(dev2);
-        return ventoy_check_device_result(8);
-    }
+    grub_file_close(file);
 
-    fs->fs_label(dev2, &label);
-    if ((!label) || grub_strncmp("VTOYEFI", label, 7))
+    if (workaround == 0)
     {
-        grub_device_close(dev2);
-        return ventoy_check_device_result(9);
-    }
+        grub_snprintf(devname, sizeof(devname), "%s,2", dev->disk->name);
+        dev2 = grub_device_open(devname);
+        if (!dev2)
+        {
+            return ventoy_check_device_result(8);
+        }
 
-    grub_device_close(dev2);    
+        fs = grub_fs_probe(dev2);
+        if (!fs)
+        {
+            grub_device_close(dev2);
+            return ventoy_check_device_result(9);
+        }
+
+        fs->fs_label(dev2, &label);
+        if ((!label) || grub_strncmp("VTOYEFI", label, 7))
+        {
+            grub_device_close(dev2);
+            return ventoy_check_device_result(10);
+        }
+
+        grub_device_close(dev2);    
+    }
+    
     return ventoy_check_device_result(0);
 }
 
index 65bf10cc7ac21cb0347adaeb7542a33ebc5130bf..14cf22e6b4fa9d867c62e13f9d562847a871b855 100644 (file)
@@ -47,8 +47,8 @@ if [ -e $BUSYBOX_PATH/32h ]; then
         if [ -s $BUSYBOX_PATH/busybox ]; then
             $BUSYBOX_PATH/vtchmod64 $BUSYBOX_PATH/busybox
         else
-            $BUSYBOX_PATH/xzminidec64_uclibc < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox 
-            $BUSYBOX_PATH/vtchmod64_uclibc $BUSYBOX_PATH/busybox
+            $BUSYBOX_PATH/xzminidec64_musl < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox 
+            $BUSYBOX_PATH/vtchmod64_musl $BUSYBOX_PATH/busybox
         fi
     fi
 else
index 32379432ff176620f437fae50568e9687ba2f2c6..a137ff35bc58f9f4665aaf3f9a885b983ba04c13 100644 (file)
Binary files a/IMG/cpio/ventoy/busybox/64h and b/IMG/cpio/ventoy/busybox/64h differ
diff --git a/IMG/cpio/ventoy/busybox/vtchmod64_musl b/IMG/cpio/ventoy/busybox/vtchmod64_musl
new file mode 100644 (file)
index 0000000..d4cd5c6
Binary files /dev/null and b/IMG/cpio/ventoy/busybox/vtchmod64_musl differ
diff --git a/IMG/cpio/ventoy/busybox/vtchmod64_uclibc b/IMG/cpio/ventoy/busybox/vtchmod64_uclibc
deleted file mode 100644 (file)
index 2e99850..0000000
Binary files a/IMG/cpio/ventoy/busybox/vtchmod64_uclibc and /dev/null differ
diff --git a/IMG/cpio/ventoy/busybox/xzminidec64_musl b/IMG/cpio/ventoy/busybox/xzminidec64_musl
new file mode 100644 (file)
index 0000000..de7fa3d
Binary files /dev/null and b/IMG/cpio/ventoy/busybox/xzminidec64_musl differ
diff --git a/IMG/cpio/ventoy/busybox/xzminidec64_uclibc b/IMG/cpio/ventoy/busybox/xzminidec64_uclibc
deleted file mode 100644 (file)
index c60663f..0000000
Binary files a/IMG/cpio/ventoy/busybox/xzminidec64_uclibc and /dev/null differ
index 9098523892e005bdae94a7ec849879897176b201..12bbd7a90226018df445b4533fb03a49fd28d9b3 100644 (file)
Binary files a/INSTALL/EFI/BOOT/BOOTAA64.EFI and b/INSTALL/EFI/BOOT/BOOTAA64.EFI differ
index eb989570cc17c897ba9539e7df9759dbab2dfcea..23755733dcb152f23a6483638d48d0e6b5a79604 100644 (file)
Binary files a/INSTALL/EFI/BOOT/grubia32_real.efi and b/INSTALL/EFI/BOOT/grubia32_real.efi differ
index 5d5336505547a201f2a971acaa72f8799ac76490..cfe495bfa6014b5d1dfbad6c8c7e496413b9813c 100644 (file)
Binary files a/INSTALL/EFI/BOOT/grubx64_real.efi and b/INSTALL/EFI/BOOT/grubx64_real.efi differ
index f542bded980a3a6f490d2e61d6ae9968c7f87fff..0a448a34d75dee966a25e252da6081197dff1755 100644 (file)
Binary files a/INSTALL/grub/i386-pc/core.img and b/INSTALL/grub/i386-pc/core.img differ
index 32379432ff176620f437fae50568e9687ba2f2c6..a137ff35bc58f9f4665aaf3f9a885b983ba04c13 100644 (file)
Binary files a/INSTALL/tool/x86_64/ash and b/INSTALL/tool/x86_64/ash differ
index 1a3ddc27b963d0c9a361568327e44a3dd4cb6896..c6ce5823fce4baa29fc2b360e4585c157cefa18e 100644 (file)
Binary files a/INSTALL/tool/x86_64/hexdump and b/INSTALL/tool/x86_64/hexdump differ
index 19e0d7b1dc3121d403f75c98a14aa5a7ae039c12..210f96093eda9df66ca43234ee6abf9839bdca8a 100644 (file)
Binary files a/INSTALL/tool/x86_64/xzcat and b/INSTALL/tool/x86_64/xzcat differ
index 35d8203ec48c2ebe38325db98be77ac3d9679506..e8ca7fe4efd8ddeb9b66e9016f7d67c2479ebe2d 100644 (file)
Binary files a/INSTALL/ventoy/ventoy.cpio and b/INSTALL/ventoy/ventoy.cpio differ
index cda156edda411d307940b266353b7f7c260497af..40a86b212c394d33cd4d753e079ec2d94285835b 100644 (file)
Binary files a/INSTALL/ventoy/vtloopex.cpio and b/INSTALL/ventoy/vtloopex.cpio differ
index f74709bc29855deefa9612758e136992d477a8f6..0af2c4b0b2a764d3769bfda3b91737f575b1cee7 100644 (file)
Binary files a/LANGUAGES/languages.ini and b/LANGUAGES/languages.ini differ
diff --git a/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefile64_musl b/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefile64_musl
new file mode 100644 (file)
index 0000000..b4839ff
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Makefile
+#
+# Author: Lasse Collin <lasse.collin@tukaani.org>
+#
+# This file has been put into the public domain.
+# You can do whatever you want with this file.
+#
+
+CC = gcc -specs "/usr/local/musl/lib/musl-gcc.specs" -Os -static  -std=gnu89
+BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \
+               -DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC
+CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK
+CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra
+RM = rm -f
+VPATH = ../linux/include/linux ../linux/lib/xz
+COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c
+COMMON_OBJS = $(COMMON_SRCS:.c=.o)
+XZMINIDEC_OBJS = xzminidec.o
+BYTETEST_OBJS = bytetest.o
+BUFTEST_OBJS = buftest.o
+BOOTTEST_OBJS = boottest.o
+XZ_HEADERS = xz.h xz_private.h xz_stream.h xz_lzma2.h xz_config.h
+PROGRAMS = xzminidec bytetest buftest boottest
+
+ALL_CPPFLAGS = -I../linux/include/linux -I. $(BCJ_CPPFLAGS) $(CPPFLAGS)
+
+all: $(PROGRAMS)
+
+%.o: %.c $(XZ_HEADERS)
+       $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
+xzminidec: $(COMMON_OBJS) $(XZMINIDEC_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(XZMINIDEC_OBJS)
+
+bytetest: $(COMMON_OBJS) $(BYTETEST_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BYTETEST_OBJS)
+
+buftest: $(COMMON_OBJS) $(BUFTEST_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BUFTEST_OBJS)
+
+boottest: $(BOOTTEST_OBJS) $(COMMON_SRCS)
+       $(CC) $(ALL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTTEST_OBJS)
+
+.PHONY: clean
+clean:
+       -$(RM) $(COMMON_OBJS) $(XZMINIDEC_OBJS) $(BUFTEST_OBJS) \
+               $(BOOTTEST_OBJS) $(PROGRAMS)
diff --git a/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefileaa64 b/Ventoy2Disk/Ventoy2Disk/xz-embedded-20130513/userspace/ventoy_makefileaa64
new file mode 100644 (file)
index 0000000..710bf82
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# Makefile
+#
+# Author: Lasse Collin <lasse.collin@tukaani.org>
+#
+# This file has been put into the public domain.
+# You can do whatever you want with this file.
+#
+
+CC = /opt/aarch64--uclibc--stable-2020.08-1/bin/aarch64-linux-gcc -Os -static  -std=gnu89
+BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \
+               -DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC
+CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK
+CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra
+RM = rm -f
+VPATH = ../linux/include/linux ../linux/lib/xz
+COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c
+COMMON_OBJS = $(COMMON_SRCS:.c=.o)
+XZMINIDEC_OBJS = xzminidec.o
+BYTETEST_OBJS = bytetest.o
+BUFTEST_OBJS = buftest.o
+BOOTTEST_OBJS = boottest.o
+XZ_HEADERS = xz.h xz_private.h xz_stream.h xz_lzma2.h xz_config.h
+PROGRAMS = xzminidec bytetest buftest boottest
+
+ALL_CPPFLAGS = -I../linux/include/linux -I. $(BCJ_CPPFLAGS) $(CPPFLAGS)
+
+all: $(PROGRAMS)
+
+%.o: %.c $(XZ_HEADERS)
+       $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
+
+xzminidec: $(COMMON_OBJS) $(XZMINIDEC_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(XZMINIDEC_OBJS)
+
+bytetest: $(COMMON_OBJS) $(BYTETEST_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BYTETEST_OBJS)
+
+buftest: $(COMMON_OBJS) $(BUFTEST_OBJS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BUFTEST_OBJS)
+
+boottest: $(BOOTTEST_OBJS) $(COMMON_SRCS)
+       $(CC) $(ALL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTTEST_OBJS)
+
+.PHONY: clean
+clean:
+       -$(RM) $(COMMON_OBJS) $(XZMINIDEC_OBJS) $(BUFTEST_OBJS) \
+               $(BOOTTEST_OBJS) $(PROGRAMS)
diff --git a/VtoyTool/vtoytool/01/vtoytool_64 b/VtoyTool/vtoytool/01/vtoytool_64
deleted file mode 100644 (file)
index f11765c..0000000
Binary files a/VtoyTool/vtoytool/01/vtoytool_64 and /dev/null differ