tazlito rev 503
Update cleanup_efi_boot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu May 24 09:49:02 2018 +0200 (2018-05-24) |
parents | 293ad3520cc0 |
children | 6d164da69145 |
files | tazlito |
line diff
1.1 --- a/tazlito Wed May 23 22:58:25 2018 +0200 1.2 +++ b/tazlito Thu May 24 09:49:02 2018 +0200 1.3 @@ -488,6 +488,7 @@ 1.4 [ "$efifile" == "bootx64.efi" -a -s $basedir/efi/boot/${f}64 ] && \ 1.5 f=${f}64; echo -n " initrd=/EFI/BOOT/$f";done)" 1.6 sed 's|/|\\|g' >> $basedir/efi/boot/startup.nsh <<EOT 1.7 +# start $efilinux 1.8 for %i run (1 10) 1.9 set -v num %i 1.10 if exist FS%num%:$efilinux then 1.11 @@ -499,6 +500,7 @@ 1.12 FS0: 1.13 $eficmdline 1.14 endif 1.15 +# stop $efilinux 1.16 EOT 1.17 fi 1.18 shift 1.19 @@ -1278,9 +1280,14 @@ 1.20 cmp $i ${i/\/efi\//\/} 2> /dev/null || continue 1.21 rm -f $i 1.22 case "$i" in 1.23 - *vmlinuz*) sed -i '$d' $(dirname $i)/startup.nsh 1.24 + *vmlinuz*) sed -i '/# start /,/# stop /d' \ 1.25 + $(dirname $i)/startup.nsh 1.26 esac 1.27 - done 1.28 + if [ ! -s $(dirname $i)/startup.nsh ]; then 1.29 + rm $(dirname $i)/startup.nsh 1.30 + rmdir $1/efi/boot && rmdir $1/efi 1.31 + fi 1.32 + done 2> /dev/null 1.33 } 1.34 1.35 1.36 @@ -2174,6 +2181,8 @@ 1.37 cp $TMP_DIR/boot/rootfs*.?z* "$TARGET/rootcd/boot" 1.38 status 1.39 1.40 + cleanup_efi_boot "$TARGET/rootcd" 1.41 + 1.42 # Extract initramfs. 1.43 cd "$TARGET/rootfs" 1.44 action 'Extracting the rootfs...'