Allow separate kernel cmd for current system
This commit adds the requirement for a new kernel command line file at `/etc/snap-pac-uki/kernel-cmd-current`. When generating current ukis, this file will be used for the non-fallback variant instead of the generic `kernel-cmd`. The reason for this change is hibernating. When saving the system state to RAM, users might not want snapshot varints to resume from there. Previosly, this would not have been a possible configuration.
This commit is contained in:
parent
944e65bdae
commit
107721ef8f
@ -22,6 +22,9 @@ The fallback initramfs (`/boot/initramfs-linux-fallback.img`) and fallback
|
|||||||
command line file (`/etc/snap-pac-uki/kernel-cmd-fallback`) are only required
|
command line file (`/etc/snap-pac-uki/kernel-cmd-fallback`) are only required
|
||||||
on the current system.
|
on the current system.
|
||||||
|
|
||||||
|
Also the current command line file (`/etc/snap-pac-uki/kernel-cmd-current`)
|
||||||
|
needs is only required on the current system.
|
||||||
|
|
||||||
EFI boot options are only created for each snapshot. If you want the UKIs
|
EFI boot options are only created for each snapshot. If you want the UKIs
|
||||||
created for the current system, you'll need to add boot entries yourself:
|
created for the current system, you'll need to add boot entries yourself:
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ function create_uki -d "creates a new uki" -a variant id
|
|||||||
switch $variant
|
switch $variant
|
||||||
case "rolling"
|
case "rolling"
|
||||||
set bd "$CFG_BUILD_DIR/current"
|
set bd "$CFG_BUILD_DIR/current"
|
||||||
|
set current "-current"
|
||||||
case "fallback"
|
case "fallback"
|
||||||
set bd "$CFG_BUILD_DIR/current"
|
set bd "$CFG_BUILD_DIR/current"
|
||||||
set fallback "-fallback"
|
set fallback "-fallback"
|
||||||
@ -80,7 +81,7 @@ function create_uki -d "creates a new uki" -a variant id
|
|||||||
# create uki
|
# create uki
|
||||||
objcopy \
|
objcopy \
|
||||||
--add-section .osrel="$bd/os-release$fallback" --change-section-vma .osrel=0x20000 \
|
--add-section .osrel="$bd/os-release$fallback" --change-section-vma .osrel=0x20000 \
|
||||||
--add-section .cmdline="$bd/kernel-cmd$fallback" --change-section-vma .cmdline=0x30000 \
|
--add-section .cmdline="$bd/kernel-cmd$current$fallback" --change-section-vma .cmdline=0x30000 \
|
||||||
--add-section .splash="$prefix/usr/share/systemd/bootctl/splash-arch.bmp" --change-section-vma .splash=0x40000 \
|
--add-section .splash="$prefix/usr/share/systemd/bootctl/splash-arch.bmp" --change-section-vma .splash=0x40000 \
|
||||||
--add-section .linux="$prefix/boot/vmlinuz-linux" --change-section-vma .linux=0x2000000 \
|
--add-section .linux="$prefix/boot/vmlinuz-linux" --change-section-vma .linux=0x2000000 \
|
||||||
--add-section .initrd="$initrd" --change-section-vma .initrd=0x3000000 \
|
--add-section .initrd="$initrd" --change-section-vma .initrd=0x3000000 \
|
||||||
@ -129,7 +130,7 @@ function create_current_uki -d "creates an uki for the current system"
|
|||||||
|
|
||||||
# create default
|
# create default
|
||||||
cp "/usr/lib/os-release" "$bd/os-release"
|
cp "/usr/lib/os-release" "$bd/os-release"
|
||||||
sed "s/SNAPSHOT/$CFG_DEFAULT_SUBVOL/" <"/etc/snap-pac-uki/kernel-cmd" >"$bd/kernel-cmd"
|
sed "s/SNAPSHOT/$CFG_DEFAULT_SUBVOL/" <"/etc/snap-pac-uki/kernel-cmd-current" >"$bd/kernel-cmd-current"
|
||||||
create_uki rolling
|
create_uki rolling
|
||||||
|
|
||||||
# create fallbac
|
# create fallbac
|
||||||
|
Loading…
Reference in New Issue
Block a user