Files
openzfs-docs/docs/Getting Started/Arch Linux/Root on ZFS/snippets/43_archiso.txt
Maurice Zhou 6fcf8e76be Fedora: create bpool with compatibility property
update Arch Linux live loader entries

Signed-off-by: Maurice Zhou <jasper@apvc.uk>
2021-08-10 11:38:30 +03:00

59 lines
2.0 KiB
Bash

#!/bin/sh
ESP_MNT=/boot/efi
ISO_REL=/iso
ISO_PATH=${ESP_MNT}/${ISO_REL}
# df command needs warm up due to systemd mount-on-demand
ls $ISO_PATH 1> /dev/null
ESP_UUID=$(blkid -s UUID -o value $(df --output=source ${ISO_PATH} | tail -n +2))
cat <<EOF
submenu 'archiso' {
rmmod tpm
insmod search_fs_uuid
set isorootuuid=$ESP_UUID
search --fs-uuid --no-floppy --set=isopart \$isorootuuid
set isopath=$ISO_REL
configfile \$prefix/archiso.cfg
EOF
ISO_NUM=0
for isofile in $ISO_PATH/archlinux-*.iso; do
if [ "$ISO_NUM" -gt 300 ]; then break; fi
isoname=${isofile##*/}
cat <<EOF
submenu "$isoname" {
menuentry "Arch Linux install medium" {
loopback loop0 (\$isopart)\$isopath/$isoname
linux (loop0)/arch/boot/x86_64/vmlinuz-linux \\
earlymodules=loop img_dev=/dev/disk/by-uuid/\$isorootuuid img_loop=\$isopath/$isoname
initrd (loop0)/arch/boot/intel-ucode.img
initrd (loop0)/arch/boot/amd-ucode.img
initrd (loop0)/arch/boot/x86_64/initramfs-linux.img
}
menuentry "Arch Linux install medium, Copy to RAM" {
loopback loop0 (\$isopart)\$isopath/$isoname
linux (loop0)/arch/boot/x86_64/vmlinuz-linux \\
earlymodules=loop img_dev=/dev/disk/by-uuid/\$isorootuuid img_loop=\$isopath/$isoname \\
copytoram
initrd (loop0)/arch/boot/intel-ucode.img
initrd (loop0)/arch/boot/amd-ucode.img
initrd (loop0)/arch/boot/x86_64/initramfs-linux.img
}
menuentry "Arch Linux install medium with speech" {
loopback loop0 (\$isopart)\$isopath/$isoname
linux (loop0)/arch/boot/x86_64/vmlinuz-linux \\
earlymodules=loop img_dev=/dev/disk/by-uuid/\$isorootuuid img_loop=\$isopath/$isoname \\
accessibility=on
initrd (loop0)/arch/boot/intel-ucode.img
initrd (loop0)/arch/boot/amd-ucode.img
initrd (loop0)/arch/boot/x86_64/initramfs-linux.img
}
}
EOF
ISO_NUM=$(( $ISO_NUM + 1 ))
done
cat <<EOF
}
EOF
# archiso kernel cmdline from
# https://gitlab.archlinux.org/archlinux/archiso/-/tree/master/configs/releng/efiboot/loader/entries