X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/blobdiff_plain/4707b76bb22e1ca60893bb6e9e79ac8331bf68b3..25b055bb0fd320a6fdbe46fb4ba5ef377c2704e2:/DOC/BuildVentoyFromSource.txt diff --git a/DOC/BuildVentoyFromSource.txt b/DOC/BuildVentoyFromSource.txt index 967b809..f93ad7b 100644 --- a/DOC/BuildVentoyFromSource.txt +++ b/DOC/BuildVentoyFromSource.txt @@ -3,7 +3,7 @@ 1. Compile Enviroment ========================================== My build envrioment 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 first. + Because Ventoy is based on many open source projects, so the environment is important. I suggest you test it on a virtual machine firstly. 1.1 Install CentOS 7.8 I use CentOS-7-x86_64-Everything-2003.iso and select Minimal install @@ -14,7 +14,7 @@ mpfr.i686 mpfr-devel.i686 zlib.i686 rsync autogen autoconf automake libtool gettext* bison binutils \ flex device-mapper-devel SDL libpciaccess libusb freetype freetype-devel gnu-free-* qemu-* virt-* \ libvirt* vte* NetworkManager-bluetooth brlapi fuse-devel dejavu* gnu-efi* pesign shim \ - iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static + iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static xorriso @@ -22,9 +22,9 @@ 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 level). + Next I assume that you have unzipped the code into the /home directory (check /home/Ventoy-master/README.md file for the directory layout). -2.2 Download third-part source code +2.2 Download third-part source code and tool 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 @@ -34,6 +34,13 @@ 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 2.3 Prepare third-part tools cd /home/Ventoy-master/DOC/ @@ -43,29 +50,34 @@ tar xf /opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu.tar.xz -C /opt tar xf /opt/aarch64--uclibc--stable-2020.08-1.tar.bz2 -C /opt + tar xf /opt/output.tar.bz2 -C /opt + mv /opt/output /opt/mips64el-linux-musl-gcc730 + 2.4 Set PATH envrioment - 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 + 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:/opt/mips64el-linux-musl-gcc730/bin better to add this line to /root/.bashrc and relogin as root ========================================== 3. All in one script ========================================== - I have made the whole build process in all_in_one.sh, you can run this script to build and pack ventoy. + 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 - It should be noted that, 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. + It should be noted that: + 1. Only grub2/EDK2/IPXE will be recompiled in all_in_one.sh. Other part contains the binaries and are few modified, so will no be recompiled everytime. + You can rebuild these parts separately if you want. + + 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 ========================================== @@ -96,10 +108,10 @@ cd /home/Ventoy-master/VtoyTool sh build.sh -4.8 == Build vtoyfat == - cd /home/Ventoy-master/vtoyfat/fat_io_lib +4.8 == Build vtoycli == + cd /home/Ventoy-master/vtoycli/fat_io_lib sh buildlib.sh - cd /home/Ventoy-master/vtoyfat + cd /home/Ventoy-master/vtoycli sh build.sh 4.9 == Build exfat-util ==