From 519fac719ed4c31dad0618520afedc5be24af2c2 Mon Sep 17 00:00:00 2001 From: longpanda Date: Fri, 29 Jan 2021 17:54:04 +0800 Subject: [PATCH] Update CI --- EDK2/build.sh | 4 ++-- EDK2/buildedk.sh | 5 +++++ GRUB2/buildgrub.sh | 6 +++++- INSTALL/all_in_one.sh | 2 +- INSTALL/ventoy_pack.sh | 41 ++++++++++++++++++++++++++--------------- IPXE/buildipxe.sh | 3 ++- LiveCD/docker_ci.sh | 11 +++++++++++ LiveCD/livecd.sh | 19 +++++++++++++++++-- 8 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 LiveCD/docker_ci.sh diff --git a/EDK2/build.sh b/EDK2/build.sh index 7e659c54..c802f849 100644 --- a/EDK2/build.sh +++ b/EDK2/build.sh @@ -33,7 +33,7 @@ rm -f $DST_PATH rm -f $VTEFI_PATH2 rm -f $DST_PATH2 rm -f $VTEFI_PATH3 -rm -f $DST_PATH3 +[ -d ../../VDiskChain ] && rm -f $DST_PATH3 source ./edksetup.sh @@ -48,7 +48,7 @@ if [ -e $VTEFI_PATH ] && [ -e $VTEFI_PATH2 ] && [ -e $VTEFI_PATH3 ]; then echo -e '\n\n====================== SUCCESS ========================\n\n' cp -a $VTEFI_PATH $DST_PATH cp -a $VTEFI_PATH2 $DST_PATH2 - cp -a $VTEFI_PATH3 $DST_PATH3 + [ -d ../../VDiskChain ] && cp -a $VTEFI_PATH3 $DST_PATH3 cd .. else echo -e '\n\n====================== FAILED ========================\n\n' diff --git a/EDK2/buildedk.sh b/EDK2/buildedk.sh index b00fb14f..ee6a5d2c 100644 --- a/EDK2/buildedk.sh +++ b/EDK2/buildedk.sh @@ -10,7 +10,12 @@ cd edk2-edk2-stable201911 make -j 4 -C BaseTools/ cd .. +echo '======== build EDK2 for i386-efi ===============' sh ./build.sh ia32 || exit 1 + +echo '======== build EDK2 for arm64-efi ===============' sh ./build.sh aa64 || exit 1 + +echo '======== build EDK2 for x86_64-efi ===============' sh ./build.sh || exit 1 diff --git a/GRUB2/buildgrub.sh b/GRUB2/buildgrub.sh index 7aefe1bc..c1878f09 100644 --- a/GRUB2/buildgrub.sh +++ b/GRUB2/buildgrub.sh @@ -11,7 +11,7 @@ mkdir SRC mkdir NBP mkdir PXE -tar -xvf grub-2.04.tar.xz -C ./SRC/ +tar -xf grub-2.04.tar.xz -C ./SRC/ /bin/cp -a ./MOD_SRC/grub-2.04 ./SRC/ @@ -19,6 +19,7 @@ cd ./SRC/grub-2.04 # build for x86_64-efi +echo '======== build grub2 for x86_64-efi ===============' make distclean ./autogen.sh ./configure --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/ @@ -27,6 +28,7 @@ sh install.sh uefi #build for i386-efi +echo '======== build grub2 for i386-efi ===============' make distclean ./autogen.sh ./configure --target=i386 --with-platform=efi --prefix=$VT_GRUB_DIR/INSTALL/ @@ -36,6 +38,7 @@ sh install.sh i386efi #build for arm64 EFI +echo '======== build grub2 for arm64-efi ===============' PATH=$PATH:/opt/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu/bin make distclean ./autogen.sh @@ -54,6 +57,7 @@ sh install.sh arm64 # build for i386-pc +echo '======== build grub2 for i386-pc ===============' ./autogen.sh ./configure --prefix=$VT_GRUB_DIR/INSTALL/ make -j 16 diff --git a/INSTALL/all_in_one.sh b/INSTALL/all_in_one.sh index d50f15f2..8fbb7aed 100644 --- a/INSTALL/all_in_one.sh +++ b/INSTALL/all_in_one.sh @@ -67,6 +67,6 @@ if [ "$1" = "CI" ]; then sed "s/VENTOY_VERSION=.*/VENTOY_VERSION=\"$Ver\"/" -i ./grub/grub.cfg fi -sh ventoy_pack.sh || exit 1 +sh ventoy_pack.sh $1 || exit 1 echo -e '\n============== SUCCESS ==================\n' diff --git a/INSTALL/ventoy_pack.sh b/INSTALL/ventoy_pack.sh index b88515ab..5614fdfd 100644 --- a/INSTALL/ventoy_pack.sh +++ b/INSTALL/ventoy_pack.sh @@ -1,5 +1,11 @@ #!/bin/sh +if [ "$1" = "CI" ]; then + OPT='' +else + OPT='-a' +fi + dos2unix -q ./tool/ventoy_lib.sh dos2unix -q ./tool/VentoyWorker.sh @@ -49,21 +55,21 @@ mount ${LOOP}p2 $tmpmnt mkdir -p $tmpmnt/grub # First copy grub.cfg file, to make it locate at front of the part2 -cp -a ./grub/grub.cfg $tmpmnt/grub/ +cp $OPT ./grub/grub.cfg $tmpmnt/grub/ ls -1 ./grub/ | grep -v 'grub\.cfg' | while read line; do - cp -a ./grub/$line $tmpmnt/grub/ + cp $OPT ./grub/$line $tmpmnt/grub/ done -cp -a ./ventoy $tmpmnt/ -cp -a ./EFI $tmpmnt/ -cp -a ./tool/ENROLL_THIS_KEY_IN_MOKMANAGER.cer $tmpmnt/ +cp $OPT ./ventoy $tmpmnt/ +cp $OPT ./EFI $tmpmnt/ +cp $OPT ./tool/ENROLL_THIS_KEY_IN_MOKMANAGER.cer $tmpmnt/ mkdir -p $tmpmnt/tool -cp -a ./tool/i386/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_i386 -cp -a ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64 -cp -a ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64 +cp $OPT ./tool/i386/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_i386 +cp $OPT ./tool/x86_64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_x86_64 +cp $OPT ./tool/aarch64/mount.exfat-fuse $tmpmnt/tool/mount.exfat-fuse_aarch64 rm -f $tmpmnt/grub/i386-pc/*.img @@ -79,12 +85,12 @@ dd if=$LOOP of=$tmpdir/boot/boot.img bs=1 count=512 status=none dd if=$LOOP of=$tmpdir/boot/core.img bs=512 count=2047 skip=1 status=none xz --check=crc32 $tmpdir/boot/core.img -cp -a ./tool $tmpdir/ +cp $OPT ./tool $tmpdir/ rm -f $tmpdir/ENROLL_THIS_KEY_IN_MOKMANAGER.cer -cp -a Ventoy2Disk.sh $tmpdir/ -cp -a README $tmpdir/ -cp -a plugin $tmpdir/ -cp -a CreatePersistentImg.sh $tmpdir/ +cp $OPT Ventoy2Disk.sh $tmpdir/ +cp $OPT README $tmpdir/ +cp $OPT plugin $tmpdir/ +cp $OPT CreatePersistentImg.sh $tmpdir/ dos2unix -q $tmpdir/Ventoy2Disk.sh dos2unix -q $tmpdir/CreatePersistentImg.sh @@ -120,8 +126,8 @@ tar -czvf ventoy-${curver}-linux.tar.gz $tmpdir rm -f ventoy-${curver}-windows.zip -cp -a Ventoy2Disk*.exe $tmpdir/ -cp -a $LANG_DIR/languages.ini $tmpdir/ventoy/ +cp $OPT Ventoy2Disk*.exe $tmpdir/ +cp $OPT $LANG_DIR/languages.ini $tmpdir/ventoy/ rm -rf $tmpdir/tool rm -f $tmpdir/*.sh rm -f $tmpdir/README @@ -132,6 +138,11 @@ zip -r ventoy-${curver}-windows.zip $tmpdir/ rm -rf $tmpdir cd ../LiveCD +if [ "$1" = "CI" ]; then + echo "=============== run docker_ci.sh ===============" + sh docker_ci.sh +fi +echo "=============== run livecd.sh ===============" sh livecd.sh cd $CurDir diff --git a/IPXE/buildipxe.sh b/IPXE/buildipxe.sh index 27bbdee7..ce8e789d 100644 --- a/IPXE/buildipxe.sh +++ b/IPXE/buildipxe.sh @@ -2,7 +2,7 @@ rm -rf ipxe-3fe683e -tar -xvf ipxe_org_code/ipxe-3fe683e.tar.bz2 -C ./ +tar -xf ipxe_org_code/ipxe-3fe683e.tar.bz2 -C ./ rm -rf ./ipxe-3fe683e/src/bin rm -rf ./ipxe-3fe683e/src/drivers @@ -11,6 +11,7 @@ rm -rf ./ipxe-3fe683e/src/drivers cd ipxe-3fe683e/src +echo '========= build IPXE ==========' sh build.sh cd ../../ diff --git a/LiveCD/docker_ci.sh b/LiveCD/docker_ci.sh new file mode 100644 index 00000000..762d9887 --- /dev/null +++ b/LiveCD/docker_ci.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +VENTOY_PATH=$PWD/../ + +for i in vmlinuz core.gz modules.gz; do + wget -q -P ISO/EFI/boot/ http://www.tinycorelinux.net/11.x/x86/release/distribution_files/$i +done + +for i in glib2.tcz libffi.tcz liblvm2.tcz ncursesw.tcz parted.tcz readline.tcz udev-lib.tcz; do + wget -q -P VTOY/ventoy/tcz/ http://distro.ibiblio.org/tinycorelinux/11.x/x86/tcz/$i +done diff --git a/LiveCD/livecd.sh b/LiveCD/livecd.sh index 7c4d587f..5bb8fc59 100644 --- a/LiveCD/livecd.sh +++ b/LiveCD/livecd.sh @@ -17,10 +17,25 @@ fi rm -rf ISO_TMP cp -a ISO ISO_TMP -cp -a VTOY VTOY_TMP && cd VTOY_TMP +cp -a VTOY VTOY_TMP + +ls -la +if ! [ -d ISO_TMP ]; then + echo "Copy ISO_TMP failed" + exit 1 +fi + +if ! [ -d VTOY_TMP ]; then + echo "Copy VTOY_TMP failed" + exit 1 +fi + +mkdir -p ISO_TMP/EFI/ventoy +cd VTOY_TMP + gcc -O2 -m32 ./ventoy/disksize.c -o ./ventoy/disksize rm -f ./ventoy/disksize.c -find . | cpio -o -H newc | gzip -9 > ../ISO_TMP/EFI/ventoy/ventoy.gz +find . | cpio -o -H newc | gzip -c -9 > ../ISO_TMP/EFI/ventoy/ventoy.gz cd .. && rm -rf VTOY_TMP