Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkg/features/embedded/grub-config/etc/elemental/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ function set_loopdevice {
loopback ${volume} ${1}
}

## Sources bootargs from the current volume
function source_bootargs {
source (${volume})/etc/cos/bootargs.cfg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this failing if the file is not there? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not when I tried it.. I was going to check if the file existed first but seems like it's not needed 🤷

source (${volume})/etc/elemental/bootargs.cfg
}

## Defines the volume and image to boot from for active or passive boots
function set_volume {
if [ "${snapshotter}" == "btrfs" ]; then
Expand All @@ -78,7 +84,7 @@ menuentry "${display_name}" --id active {
set mode=active
search --no-floppy --label --set=root ${state_label}
set_volume
source (${volume})/etc/cos/bootargs.cfg
source_bootargs
linux (${volume})${kernel} ${kernelcmd} ${extra_cmdline} ${extra_active_cmdline}
initrd (${volume})${initramfs}
}
Expand All @@ -88,7 +94,7 @@ for passive_snap in ${passive_snaps}; do
set mode=passive
search --no-floppy --label --set=root ${state_label}
set_volume ${passive_snap}
source (${volume})/etc/cos/bootargs.cfg
source_bootargs
linux (${volume})${kernel} ${kernelcmd} ${extra_cmdline} ${extra_passive_cmdline}
initrd (${volume})${initramfs}
}
Expand All @@ -105,7 +111,7 @@ menuentry "${display_name} recovery" --id recovery {
fi

set_loopdevice ${img}
source (${volume})/etc/cos/bootargs.cfg
source_bootargs
linux (${volume})${kernel} ${kernelcmd} ${extra_cmdline} ${extra_recovery_cmdline}
initrd (${volume})${initramfs}
}