tazlito rev 505
fix cleanup_efi_boot
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed May 30 12:08:11 2018 +0200 (2018-05-30) |
parents | 6d164da69145 |
children | 15343f90d12e |
files | tazlito |
line diff
1.1 --- a/tazlito Thu May 24 10:44:24 2018 +0200 1.2 +++ b/tazlito Wed May 30 12:08:11 2018 +0200 1.3 @@ -485,24 +485,20 @@ 1.4 stat -c "%s %n" "$i" 1.5 done 2> /dev/null 1.6 efilinux="/EFI/BOOT/$(basename $1).efi" 1.7 - eficmdline="$efilinux rw root=0x100 autologin\ 1.8 + sed 's|/|\\|g' >> $basedir/efi/boot/startup.nsh <<EOT 1.9 +# start tazlito $efilinux 1.10 +set -v num 0 1.11 +for %i run (1 20) 1.12 + if exist FS%num%:$efilinux then 1.13 + FS%num%: 1.14 + $efilinux rw root=0x100 autologin\ 1.15 $( ( cd $basedir/efi/boot ; ls -r rootfs*gz ) | while read f ; do \ 1.16 [ "$efifile" == "bootx64.efi" -a -s $basedir/efi/boot/${f}64 ] && \ 1.17 -f=${f}64; echo -n " initrd=/EFI/BOOT/$f";done)" 1.18 - sed 's|/|\\|g' >> $basedir/efi/boot/startup.nsh <<EOT 1.19 -# start $efilinux 1.20 -for %i run (1 10) 1.21 +f=${f}64; echo -n " initrd=/EFI/BOOT/$f";done) 1.22 + endif 1.23 set -v num %i 1.24 - if exist FS%num%:$efilinux then 1.25 - FS%num%: 1.26 - $eficmdline 1.27 - endif 1.28 endfor 1.29 -if exist FS0:$efilinux then 1.30 - FS0: 1.31 - $eficmdline 1.32 -endif 1.33 -# stop $efilinux 1.34 +# stop tazlito $efilinux 1.35 EOT 1.36 fi 1.37 shift 1.38 @@ -1279,10 +1275,11 @@ 1.39 cleanup_efi_boot() { 1.40 for i in $1/efi/boot/* ; do 1.41 [ -f $i ] || continue 1.42 - cmp $i ${i/\/efi\//\/} 2> /dev/null || continue 1.43 + b=${i/\/efi\//\/} 1.44 + cmp $i ${b%.efi} || continue 1.45 rm -f $i 1.46 case "$i" in 1.47 - *vmlinuz*) sed -i '/# start /,/# stop /d' \ 1.48 + *vmlinuz*) sed -i '/# start tazlito /,/# stop tazlito /d' \ 1.49 $(dirname $i)/startup.nsh 1.50 esac 1.51 if [ ! -s $(dirname $i)/startup.nsh ]; then