From 5ac4f35c93d07f2c5de718deb6c870aff6d9ce6b Mon Sep 17 00:00:00 2001 From: brent s Date: Wed, 20 Jan 2021 17:45:05 -0500 Subject: [PATCH] okay, sysresc refined a little bit... --- TODO | 7 +++ _base.py | 2 +- tpl/arch_grub.conf.j2 | 11 +++-- tpl/sysresccd_grub.conf.j2 | 89 +++++++++++++++++++++++++++----------- 4 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..1c9ac52 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +- logging +- GPG sig checking +- incorporate bootsync integration +- config file... i think i unfortunately need it +- insmod loopback before setting root + +fallback works but main one doesn't for bootsync... main one keeps using grub.cfg from /boot/grub instead of /mnt/boot1/grub (but fallback doesn't for some reason) diff --git a/_base.py b/_base.py index 25ff5c1..7aca0b7 100644 --- a/_base.py +++ b/_base.py @@ -142,7 +142,7 @@ class BaseUpdater(object): fh.write(tpl.render(iso_path = os.path.abspath( os.path.expanduser( os.path.join(self.grub_iso_dir, - self.dest_file))), + self.dest_file))).lstrip('/'), disk_uuid = self.boot_uuid)) os.chmod(self.grub_cfg, 0o0755) cmd = subprocess.run(['grub-mkconfig', diff --git a/tpl/arch_grub.conf.j2 b/tpl/arch_grub.conf.j2 index 63a4309..e865314 100644 --- a/tpl/arch_grub.conf.j2 +++ b/tpl/arch_grub.conf.j2 @@ -1,8 +1,11 @@ #!/bin/sh # Copy this file to /etc/grub.d/40_custom_arch with mode 0755 and run grub-mkconfig -o /boot/grub/grub.cfg exec tail -n +3 $0 -# Arch ISO -# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Arch_Linux_monthly_release +# Arch Vanilla ISO +# Project: https://archlinux.org/ +# Details: +# https://wiki.archlinux.org/index.php/Multiboot_USB_drive#Arch_Linux_monthly_release +# https://git.archlinux.org/archiso.git/tree/docs/README.bootparams submenu 'Arch Install ISO' { menuentry 'Default Options' { @@ -11,7 +14,7 @@ submenu 'Arch Install ISO' { probe -u $root --set=imgdevuuid set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" loopback loop (${root})/${isofile} - linux (loop)/arch/boot/x86_64/vmlinuz-linux archisobasedir=arch img_dev=$imgdevpath img_loop=$isofile earlymodules=loop + linux (loop)/arch/boot/x86_64/vmlinuz-linux archisobasedir=arch img_dev=$imgdevpath img_loop=${isofile} earlymodules=loop initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img } @@ -21,7 +24,7 @@ submenu 'Arch Install ISO' { probe -u $root --set=imgdevuuid set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" loopback loop (${root})/${isofile} - linux (loop)/arch/boot/x86_64/vmlinuz-linux archisobasedir=arch img_dev=$imgdevpath img_loop=$isofile earlymodules=loop accessibility=on + linux (loop)/arch/boot/x86_64/vmlinuz-linux archisobasedir=arch img_dev=$imgdevpath img_loop=${isofile} earlymodules=loop accessibility=on initrd (loop)/arch/boot/intel-ucode.img (loop)/arch/boot/amd-ucode.img (loop)/arch/boot/x86_64/initramfs-linux.img } diff --git a/tpl/sysresccd_grub.conf.j2 b/tpl/sysresccd_grub.conf.j2 index 80ff511..5a2f3c4 100644 --- a/tpl/sysresccd_grub.conf.j2 +++ b/tpl/sysresccd_grub.conf.j2 @@ -2,66 +2,105 @@ # Copy this file to /etc/grub.d/40_custom_sysresccd with mode 0755 and run grub-mkconfig -o /boot/grub/grub.cfg exec tail -n +3 $0 # System Rescue CD -# https://www.system-rescue.org/ +# Project: https://www.system-rescue.org/ +# Details: +# https://www.system-rescue.org/manual/Installing_SystemRescue_on_the_disk/#first-approach-using-grub2-with-isoloop +# https://www.system-rescue.org/manual/Booting_SystemRescueCd/ submenu 'System Rescue CD' { menuentry 'Default options' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img } menuentry 'Run from RAM' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop copytoram + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop copytoram initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img } menuentry 'Confirm/verify checksum' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop checksum + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop checksum initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img } menuentry 'Use basic display drivers' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop nomodeset + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop nomodeset initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img } menuentry 'Find and boot a locally installed Linux' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop findroot + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop findroot initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img } menuentry 'Stop during boot before the root filesystem is mounted' { - search --no-floppy --fs-uuid --set=root {{ disk_uuid }} + load_video + insmod gzio + insmod part_gpt + insmod part_msdos + insmod ext2 + insmod loopback + search --no-floppy --fs-uuid {{ disk_uuid }} --set=root set isofile='{{ iso_path }}' - probe -u $root --set=imgdevuuid - set imgdevpath="/dev/disk/by-uuid/$imgdevuuid" + probe -u ${root} --set=imgdevuuid + set imgdevpath="/dev/disk/by-uuid/${imgdevuuid}" loopback loop (${root})/${isofile} - linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=$imgdevpath img_loop=$isofile earlymodules=loop break + linux (loop)/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd img_dev=${imgdevpath} img_loop=${isofile} earlymodules=loop break initrd (loop)/sysresccd/boot/intel_ucode.img (loop)/sysresccd/boot/amd_ucode.img (loop)/sysresccd/boot/x86_64/sysresccd.img }