Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passive snapshots listing in grub.cfg #2022

Merged
merged 1 commit into from
Mar 21, 2024
Merged
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
4 changes: 2 additions & 2 deletions pkg/features/embedded/grub-config/etc/elemental/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ menuentry "${display_name}" --id active {
}

for passive_snap in ${passive_snaps}; do
menuentry "${display_name} (snapshot ${passive_snap})" --id ${passive_snap} {
menuentry "${display_name} (snapshot ${passive_snap})" --id passive${passive_snap} ${passive_snap} {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ensuring the ID is not set to a number, as then it turns to be confusing with the fallback values, which is just a counter of the menu items, starting from 0 at top. So if a menu is chosen by ID it will not definitely be a number. If a number is used, then menu counter applies.

set mode=passive
search --no-floppy --label --set=root ${state_label}
set_volume ${passive_snap}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This variable inside the menu is not expanded when looping, in fact it is expanded when choosing the actual menu item and it takes the value of the last assignement in the loop. Should have been passed as an argument to the menuentry call.

set_volume ${2}
source_bootargs
linux (${volume})${kernel} ${kernelcmd} ${extra_cmdline} ${extra_passive_cmdline}
initrd (${volume})${initramfs}
Expand Down
Loading