Build Ventoy From Source
Build Ventoy From Source
1. Compile Environment
==========================================
My build environment is CentOS 7.8 x86_64. So here I first explain how to
create the build environment from scratch.
Because Ventoy is based on many open source projects, so the environment is
important. I suggest you test it on a virtual machine firstly.
==========================================
2. Download Source Code
==========================================
2.1 Download Ventoy source code from github and decompress it.
Next I assume that you have unzipped the code into the /home directory
(check /home/Ventoy-master/README.md file for the directory layout).
https://www.fefe.de/dietlibc/dietlibc-0.34.tar.xz ===>
/home/Ventoy-master/DOC/dietlibc-0.34.tar.xz
https://musl.libc.org/releases/musl-1.2.1.tar.gz ===>
/home/Ventoy-master/DOC/musl-1.2.1.tar.gz
https://ftp.gnu.org/gnu/grub/grub-2.04.tar.xz ===>
/home/Ventoy-master/GRUB2/grub-2.04.tar.xz
https://codeload.github.com/tianocore/edk2/zip/edk2-stable201911 ===>
/home/Ventoy-master/EDK2/edk2-edk2-stable201911.zip
https://codeload.github.com/relan/exfat/zip/v1.3.0 ===>
/home/Ventoy-master/ExFAT/exfat-1.3.0.zip
https://codeload.github.com/libfuse/libfuse/zip/fuse-2.9.9 ===>
/home/Ventoy-master/ExFAT/libfuse-fuse-2.9.9.zip
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
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
http://ftp.loongnix.cn/toolchain/gcc/release/mips/gcc7/mips-loongson-gcc7.3-
2019.06-29-linux-gnu.tar.gz ===> /opt/mips-loongson-gcc7.3-2019.06-29-linux-
gnu.tar.gz
https://github.com/ventoy/musl-cross-make/releases/download/latest/
output.tar.bz2 ===> /opt/output.tar.bz2
http://www.tinycorelinux.net/11.x/x86_64/release/distribution_files/vmlinuz64
===> /home/Ventoy-master/LiveCD/ISO/EFI/boot/vmlinuz64
http://www.tinycorelinux.net/11.x/x86_64/release/distribution_files/
corepure64.gz ===> /home/Ventoy-master/LiveCD/ISO/EFI/boot/corepure64.gz
http://www.tinycorelinux.net/11.x/x86_64/release/distribution_files/
modules64.gz ===> /home/Ventoy-master/LiveCD/ISO/EFI/boot/modules64.gz
==========================================
3. All in one script
==========================================
I have made a all_in_one.sh, you can run this script to build and pack ventoy.
If you want to compile a certain part separately, you can continue to refer to
the later chapters of this text.
cd /home/Ventoy-master/INSTALL
sh all_in_one.sh
2. some part of Ventoy has 32bit&64bit version (like 4.9 4.10 4.11 follows)
all_in_one.sh only build 64bit version of them, if you want to rebuild the
32bit verison. You should create a 32bit CentOS environment and build them.
Fortunately these parts are few modified, you only need to build once or you
can directly use the binary I have built.
Besides, after a fully compile and pack, you can only build the part you
modified (for example grub2) and run ventoy_pack.sh to generate the package.
==========================================
4. Build every part of Ventoy
==========================================
4.1 == Build grub2 ==
cd /home/Ventoy-master/GRUB2
sh buildgrub.sh
Use the same build step to build exfat-util 32bit in a 32bit CentOS system and
get mkexfatfs_32 and mount.exfat-fuse_32
Use the same build step to build in a 32bit CentOS system and get
vtoy_fuse_iso_32
Use the same build step to build in a 32bit CentOS system and get unsquashfs_32
4.18 IMG/cpio/ventoy/busybox/64h
https://www.uclibc.org/downloads/binaries/0.9.30.1/mini-native-x86_64.tar.bz2
https://busybox.net/downloads/busybox-1.32.0.tar.bz2
use BUSYBOX/x86_64_ash.config and uclibc to build busybox-1.32
#aarch64
./configure --disable-nls CC='aarch64-buildroot-linux-uclibc-gcc -static'
make
aarch64-buildroot-linux-uclibc-strip --strip-all lunzip
==========================================
5. Binaries
==========================================
There some binaries in Ventoy install package. These files are downloaded from
other open source project's website, such as busybox.
Here is the list of the binaries, their SHA-256 and the download urls:
5.1 IMG/cpio/ventoy/tool/lz4cat
https://create.stephan-brumme.com/smallz4 smallz4cat-x32-v1.4
SHA-256: 13d293ddeedb469f51da41167f79b2cbdb904e681716f6e6191b233dbb162438
5.2 IMG/cpio/ventoy/tool/ar
https://busybox.net/downloads/binaries/1.30.0-i686 busybox_AR
SHA-256: f29b7d81a983c0c85d22496f4a833c18f2528a1b666eb7d47c93084c1ed66ae0
5.3 IMG/cpio/ventoy/tool/inotifyd
https://busybox.net/downloads/binaries/1.30.0-i686 busybox_INOTIFYD
SHA-256: 3532162a8695e91a1ed9ddea28b2cb22259a90e93d5d9c4a517b6c36842c686f
5.4 IMG/cpio/ventoy/busybox/ash
https://busybox.net/downloads/binaries/1.27.1-i686 busybox_ASH
SHA-256: 44a6274bca580c2758ffc173fc76d18bb855b1fe8dcf70efd9ee75cbd57dee97
5.5 IMG/cpio/ventoy/busybox/tmpxz
https://busybox.net/downloads/binaries/1.27.1-i686 busybox_XZ
SHA-256: f6cdb6293680424c29b89bde0685ca27f455166c9b302cd6082ef90681456291
5.6 INSTALL/tool/i386/xzcat
https://busybox.net/downloads/binaries/1.30.0-i686/ busybox_XZCAT
SHA-256: 7399db642c2beaf52a16ab5264ffc55cfd1ff5699a524f63e5d48edf84e20f44
5.7 INSTALL/tool/i386/hexdump
https://busybox.net/downloads/binaries/1.30.0-i686/ busybox_HEXDUMP
SHA-256: cde08b6a2cf5ad914f05203e18e3f7c2ed6060a63604e3d75536f19b55e8e0af
5.8 imdisk
download http://www.ltr-data.se/files/imdiskinst.exe and extract it by 7zip.
5.9 INSTALL/ventoy/memdisk
https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-
6.03.tar.gz
decompress it and memdisk is at syslinux-6.03/bios/memdisk/memdisk
SHA-256: 3f6cd656b8a14109cd3f906fee2dd2e75418f983a5e1bfdb64f44f7765588cbb
5.10 UEFIinSecureBoot
https://github.com/ValdikSS/Super-UEFIinSecureBoot-Disk/releases Super-
UEFIinSecureBoot-Disk_minimal_v3.zip
unzip it and get Super-UEFIinSecureBoot-Disk_minimal.img, extract the img by 7zip.
5.11 INSTALL/tool/ash
https://busybox.net/downloads/binaries/1.31.0-i686-uclibc/ busybox_ASH
SHA-256: 2943f02f85fee0c9551aec47110a558a73f919c032b3c51e56d6f197b5ec4d7b
5.12 7za.exe
download from https://www.7-zip.org/a/7z1900-extra.7z
ISNTALL/ventoy/7z/64/7za.exe SHA-256:
8117e40ee7f824f63373a4f5625bb62749f69159d0c449b3ce2f35aad3b83549
ISNTALL/ventoy/7z/32/7za.exe SHA-256:
ea308c76a2f927b160a143d94072b0dce232e04b751f0c6432a94e05164e716d