]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Update CI
authorlongpanda <admin@ventoy.net>
Fri, 29 Jan 2021 09:54:04 +0000 (17:54 +0800)
committerlongpanda <admin@ventoy.net>
Fri, 29 Jan 2021 09:54:04 +0000 (17:54 +0800)
EDK2/build.sh
EDK2/buildedk.sh
GRUB2/buildgrub.sh
INSTALL/all_in_one.sh
INSTALL/ventoy_pack.sh
IPXE/buildipxe.sh
LiveCD/docker_ci.sh [new file with mode: 0644]
LiveCD/livecd.sh

index 7e659c54f764d9f63249ebd0f5fe4f326a526171..c802f849d4b5641c205af7ec763e90e6ddb38589 100644 (file)
@@ -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'
index b00fb14fb22d041b05180611474c7e31748988fc..ee6a5d2c9a0bd4a18267c38164a6af7d8b67ee36 100644 (file)
@@ -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
 
index 7aefe1bc5efa2db62f56687fa3a068e6a8127abc..c1878f09b9c93f58939e1e237c8740f6b5f59b9b 100644 (file)
@@ -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
index d50f15f243c76bc5752415ea284929f706807b77..8fbb7aed1cdbf1e33906e2778dc30e115399a657 100644 (file)
@@ -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'
index b88515ab8713ce068bf0f1dd60169f6085fd32c5..5614fdfd2d8a60373b23b854064be047146e6499 100644 (file)
@@ -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
 
index 27bbdee7d1fb94e36a73116b58c0c09f1bb79bc3..ce8e789d3f93a8093ba979f443bc29704f452d56 100644 (file)
@@ -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 (file)
index 0000000..762d988
--- /dev/null
@@ -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
index 7c4d587f64fc3533859f7282517b5a802c94e05d..5bb8fc590e42ec2c9fd8bb4f8971589fbf4f3028 100644 (file)
@@ -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