wok-current view tazlito/stuff/support-efi.patch @ rev 25696

Update tazlito to use grub2-efi-x64 for EFI boot
author Stanislas Leduc <shann@slitaz.org>
date Thu Apr 04 12:30:52 2024 +0000 (7 weeks ago)
parents
children
line source
1 ---a/tazlito
2 +++ b/tazlito
3 @@ -509,21 +509,18 @@
4 if [ ! -s $basedir/EFI/boot/$efifile ] &&
5 [ $(get $((0x82)) "$1") = $((0x4550)) ]; then
6 mkdir -p $basedir/EFI/boot 2> /dev/null
7 - ln "$1" "$basedir/EFI/boot/$efifile"
8 + ln "$1" "$basedir/EFI/boot/vmlinuz"
9 + ## Add grub bootloader stuff
10 + for i in "source/grub2-efi-x64-2.04/bootx64-live.efi,$efifile" "stuff/grub-live.cfg,grub.cfg"; do
11 + ln "/home/slitaz/wok/grub2-efi-x64/${i%,*}" "$basedir/EFI/boot/${i#*,}" &&
12 + stat -c "%s %n" "/home/slitaz/wok/grub2-efi-x64/${i%,*}"
13 + done 2> /dev/null
14 stat -c "%s %n" "$1"
15 for i in $basedir/boot/rootfs* ; do
16 ln "$i" $basedir/EFI/boot/ &&
17 stat -c "%s %n" "$i"
18 done 2> /dev/null
19 - if [ ! -s $basedir/EFI/boot/linux.cmdline ]; then
20 - sed 's|/|\\|g' > $basedir/EFI/boot/linux.cmdline <<EOT
21 -rw root=0x100$(sed '/bzImage/!d;s|.*root=[^ ]*||;q' $basedir/boot/isolinux/isolinux.cfg)\
22 -$( ( cd $basedir/EFI/boot ; ls -r rootfs*gz ) | while read f ; do \
23 -echo -n " initrd=/EFI/boot/$f";done)
24 -EOT
25 - stat -c "%s %n" $basedir/EFI/boot/linux.cmdline
26 fi
27 - fi
28 shift
29 done; } | sort | uniq | awk '{ n+=int(($1+2047)/2048) } END { print n }')
30 [ ${fclust:-0} -eq 0 ] && return
31 @@ -666,7 +663,7 @@
32 deduplicate
33 sed -i "s|20[1-9][0-9]|$(date +%Y)|" $2/README $2/index.html
35 - [ $(ls $2/boot/grub* 2> /dev/null | wc -l) -lt 2 ] && rm -rf $2/boot/grub*
36 +# [ $(ls $2/boot/grub* 2> /dev/null | wc -l) -lt 2 ] && rm -rf $2/boot/grub*
37 make_bzImage_hardlink $2/boot
38 alloc_uefi_part $(ls -r $2/boot/vmlinuz*slitaz*)