]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
update build scripts
authorlongpanda <admin@ventoy.net>
Fri, 29 Jan 2021 02:11:30 +0000 (10:11 +0800)
committerlongpanda <admin@ventoy.net>
Fri, 29 Jan 2021 02:11:30 +0000 (10:11 +0800)
DOC/BuildVentoyFromSource.txt
EDK2/buildedk.sh
GRUB2/buildgrub.sh
INSTALL/all_in_one.sh

index 967b809ff3bc2bc6b7a760fa7f20f805d0c769f7..51ae5b7598de60ec51a1f6dbfe665fe96b47570a 100644 (file)
@@ -3,7 +3,7 @@
 1. Compile Enviroment\r
 ==========================================\r
     My build envrioment is CentOS 7.8 x86_64. So here I first explain how to create the build environment from scratch.\r
-    Because Ventoy is based on many open source projects, so the environment is important. I suggest you test it on a virtual machine first.\r
+    Because Ventoy is based on many open source projects, so the environment is important. I suggest you test it on a virtual machine firstly.\r
 \r
 1.1 Install CentOS 7.8\r
     I use CentOS-7-x86_64-Everything-2003.iso and select Minimal install\r
@@ -14,7 +14,7 @@
         mpfr.i686 mpfr-devel.i686 zlib.i686 rsync autogen autoconf automake libtool gettext* bison binutils \\r
         flex device-mapper-devel SDL libpciaccess libusb freetype freetype-devel gnu-free-* qemu-* virt-* \\r
         libvirt* vte* NetworkManager-bluetooth brlapi fuse-devel dejavu* gnu-efi* pesign shim \\r
-        iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static\r
+        iscsi-initiator-utils grub2-tools zip nasm acpica-tools glibc-static zlib-static xorriso\r
     \r
 \r
 \r
@@ -22,9 +22,9 @@
 2. Download Source Code\r
 ==========================================\r
 2.1 Download Ventoy source code from github and decompress it. \r
-    Next I assume that you have unzipped the code into the /home directory (check /home/Ventoy-master/README.md file for the directory level).\r
+    Next I assume that you have unzipped the code into the /home directory (check /home/Ventoy-master/README.md file for the directory layout).\r
     \r
-2.2 Download third-part source code\r
+2.2 Download third-part source code and tool\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
 ==========================================\r
 3. All in one script\r
 ==========================================\r
-    I have made the whole build process in all_in_one.sh, you can run this script to build and pack ventoy.\r
+    I have made a all_in_one.sh, you can run this script to build and pack ventoy.\r
     If you want to compile a certain part separately, you can continue to refer to the later chapters of this text.\r
     \r
     cd /home/Ventoy-master/INSTALL\r
     sh all_in_one.sh\r
 \r
-    It should be noted that, some part of Ventoy has 32bit&64bit version (like 4.9 4.10 4.11 follows)\r
-    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.\r
-    Fortunately these parts are few modified, you only need to build once or you can directly use the binary I have built.\r
+    It should be noted that:\r
+    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.\r
+       You can rebuild these parts separately if you want.\r
+       \r
+    2. some part of Ventoy has 32bit&64bit version (like 4.9 4.10 4.11 follows)\r
+       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.\r
+       Fortunately these parts are few modified, you only need to build once or you can directly use the binary I have built.\r
 \r
     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.\r
 \r
-\r
-\r
 ==========================================\r
 4. Build every part of Ventoy\r
 ==========================================\r
index 5197b0d1222681dba6d4ce47ad29e1c1bb70cf75..b00fb14fb22d041b05180611474c7e31748988fc 100644 (file)
@@ -7,34 +7,10 @@ unzip edk2-edk2-stable201911.zip
 /bin/cp -a ./edk2_mod/edk2-edk2-stable201911  ./
 
 cd edk2-edk2-stable201911
-
-VTEFI_PATH=Build/MdeModule/RELEASE_GCC48/X64/MdeModulePkg/Application/Ventoy/Ventoy/OUTPUT/Ventoy.efi
-DST_PATH=../../INSTALL/ventoy/ventoy_x64.efi
-
-VTEFI_PATH2=Build/MdeModule/RELEASE_GCC48/IA32/MdeModulePkg/Application/Ventoy/Ventoy/OUTPUT/Ventoy.efi
-DST_PATH2=../../INSTALL/ventoy/ventoy_ia32.efi
-
-rm -f $VTEFI_PATH
-rm -f $DST_PATH
-rm -f $VTEFI_PATH2
-rm -f $DST_PATH2
-
 make -j 4 -C BaseTools/
+cd ..
 
-source ./edksetup.sh
-build -p MdeModulePkg/MdeModulePkg.dsc -a  X64 -b RELEASE -t GCC48
-build -p MdeModulePkg/MdeModulePkg.dsc -a IA32 -b RELEASE -t GCC48
-
-if [ -e $VTEFI_PATH ] && [ -e $VTEFI_PATH2 ]; then
-    echo -e '\n\n====================== SUCCESS ========================\n\n'    
-    cp -a $VTEFI_PATH  $DST_PATH
-    cp -a $VTEFI_PATH2 $DST_PATH2
-    cd ..
-else
-    echo -e '\n\n====================== FAILED ========================\n\n'
-    cd ..
-    exit 1
-fi
-
-
+sh ./build.sh ia32 || exit 1
+sh ./build.sh aa64 || exit 1
+sh ./build.sh      || exit 1
 
index f04f2f5cb2a0b6315e60f46a65123c7cb4314480..7aefe1bc5efa2db62f56687fa3a068e6a8127abc 100644 (file)
@@ -17,13 +17,8 @@ tar -xvf grub-2.04.tar.xz -C ./SRC/
 
 cd ./SRC/grub-2.04
 
-# build for Legacy BIOS 
-./autogen.sh
-./configure  --prefix=$VT_GRUB_DIR/INSTALL/
-make -j 16
-sh install.sh
 
-# build for UEFI
+# build for x86_64-efi
 make distclean
 ./autogen.sh
 ./configure  --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/
@@ -31,7 +26,7 @@ make -j 16
 sh install.sh  uefi
 
 
-#build for IA32 EFI
+#build for i386-efi
 make distclean
 ./autogen.sh
 ./configure --target=i386 --with-platform=efi  --prefix=$VT_GRUB_DIR/INSTALL/
@@ -39,5 +34,32 @@ make -j 16
 sh install.sh  i386efi
 
 
+
+#build for arm64 EFI
+PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin
+make distclean
+./autogen.sh
+./configure  --prefix=$VT_GRUB_DIR/INSTALL/ \
+--target=aarch64 --with-platform=efi \
+--host=x86_64-linux-gnu  \
+HOST_CC=x86_64-linux-gnu-gcc \
+BUILD_CC=gcc \
+TARGET_CC=aarch64-linux-gnu-gcc   \
+TARGET_OBJCOPY=aarch64-linux-gnu-objcopy \
+TARGET_STRIP=aarch64-linux-gnu-strip TARGET_NM=aarch64-linux-gnu-nm \
+TARGET_RANLIB=aarch64-linux-gnu-ranlib
+make -j 16
+sh install.sh arm64
+
+
+
+# build for i386-pc
+./autogen.sh
+./configure  --prefix=$VT_GRUB_DIR/INSTALL/
+make -j 16
+sh install.sh
+
+
+
 cd ../../
 
index f191645d06360d4497ee5031adab164f7ee0389c..a90d967c5cc068f565e3eb4890f114b5fb97097f 100644 (file)
@@ -14,24 +14,29 @@ sh buildipxe.sh || exit 1
 cd $VTOY_PATH/EDK2
 sh buildedk.sh || exit 1
 
-cd $VTOY_PATH/VtoyTool
-sh build.sh || exit 1
 
-cd $VTOY_PATH/vtoyfat/fat_io_lib
-sh buildlib.sh
 
-cd $VTOY_PATH/vtoyfat
-sh build.sh || exit 1
+#
+# We almost rarely modifiy these code, so no need to build them everytime
+# If you want to rebuild them, just uncomment them.
+#
 
-cd $VTOY_PATH/vtoygpt
-sh build.sh || exit 1
+#cd $VTOY_PATH/VtoyTool
+#sh build.sh || exit 1
 
-cd $VTOY_PATH/FUSEISO
-sh build_libfuse.sh
-sh build.sh
+#cd $VTOY_PATH/vtoyfat/fat_io_lib
+#sh buildlib.sh
 
+#cd $VTOY_PATH/vtoyfat
+#sh build.sh || exit 1
+
+#cd $VTOY_PATH/vtoygpt
+#sh build.sh || exit 1
+
+#cd $VTOY_PATH/FUSEISO
+#sh build_libfuse.sh
+#sh build.sh
 
-# We almost rarely modifiy these code, so no need to build them everytime
 
 # cd $VTOY_PATH/ExFAT
 # sh buidlibfuse.sh || exit 1