andreyv / sbupdate

Generate and sign kernel images for UEFI Secure Boot on Arch Linux
GNU General Public License v3.0
225 stars 20 forks source link

support variants of kernels with different cmdlines and/or initrds #17

Closed pschichtel closed 4 years ago

pschichtel commented 4 years ago

This PR implements #16.

I'm not entirely happy with the default configuration yet, so consider this a work-in-progress, but it's final enough for you to have a look at it.

pschichtel commented 4 years ago

Also feel free to nitpick about style. I tried to stay consistent with the existing style, but not sure how well that went.

pschichtel commented 4 years ago

Updated the pull request. Also this is the configuration I'm running successfully on my system:

core_cmd="rd.luks.name=___=cryptroot rd.luks.name=___=cryptswap root=/dev/mapper/cryptroot"

SPLASH="/dev/null"
BACKUP=0
KERNEL_VARIANTS=(linux linux-fallback linux-emergency linux-lts linux-lts-fallback)
CMDLINE_DEFAULT="${core_cmd} resume=/dev/mapper/cryptswap rw i915.fastboot=1 quiet loglevel=3 vga=current systemd.show_status=false udev.log_priority=3"

lts_kernel_cmd="${core_cmd} rw"
emerg_kernel_cmd="${lts_kernel_cmd} systemd.unit=emergency.target"

KERNEL[linux-fallback]="linux"
INITRD[linux-fallback]="/boot/initramfs-linux-fallback.img"

KERNEL[linux-emergency]="linux"
INITRD[linux-emergency]="${INITRD[linux-fallback]}"
CMDLINE[linux-emergency]="$emerg_kernel_cmd"

CMDLINE[linux-lts]="$lts_kernel_cmd"

KERNEL[linux-lts-fallback]="linux-lts"
CMDLINE[linux-lts-fallback]="$lts_kernel_cmd"
INITRD[linux-lts-fallback]="/boot/initramfs-linux-lts-fallback.img"
pschichtel commented 4 years ago

18 should probably be merged first and then this one updated.

pschichtel commented 4 years ago

Updated the PR

andreyv commented 4 years ago

Thanks, similar idea implemented in 0ad2b485439c61aa9519b862ff6b6d2738b9207d.