Skip to content

install: support grub2/30_console.cfg for console replacement#1360

Merged
prestist merged 1 commit intocoreos:mainfrom
dustymabe:dusty-alternate-grub-cfg
Dec 15, 2023
Merged

install: support grub2/30_console.cfg for console replacement#1360
prestist merged 1 commit intocoreos:mainfrom
dustymabe:dusty-alternate-grub-cfg

Conversation

@dustymabe
Copy link
Member

@dustymabe dustymabe commented Dec 15, 2023

Upstream we are starting to use grub configs that are partially baked into bootupd [1] and partially baked into the image via the OS vendor (in our case a grub2/30_console.cfg file [2]). Let's look first to see if grub2/30_console.cfg exists when trying to write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769

@dustymabe dustymabe force-pushed the dusty-alternate-grub-cfg branch from 00e27f2 to 93ef156 Compare December 15, 2023 13:22
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Looks sane to me

path = mountpoint.join(name);
}
let grub_cfg = fs::read_to_string(&path).context(format!("reading {}", name))?;
let new_grub_cfg = update_grub_cfg_console_settings(&grub_cfg, &grub_commands)
Copy link
Member

Choose a reason for hiding this comment

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

Very very minor but style is usually to use .with_context(|| format!(...)) to avoid string allocation even on non-error paths.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok I updated it.. shamefully I know very little about rust, but have been meaning to change that for a long time :(

Upstream we are starting to use grub configs that are partially
baked into bootupd [1] and partially baked into the image via
the OS vendor (in our case a grub2/30_console.cfg file [2]). Let's
look first to see if grub2/30_console.cfg exists when trying to
write new console settings before falling back to grub2/grub.cfg.

[1] coreos/bootupd#543
[2] coreos/fedora-coreos-config#2769
@dustymabe dustymabe force-pushed the dusty-alternate-grub-cfg branch from 5d31c06 to 9334eb7 Compare December 15, 2023 19:39
@dustymabe
Copy link
Member Author

local tests with this are looking good.

@dustymabe dustymabe changed the title install: support grub2/50_coreos.cfg for console replacement install: support grub2/30_console.cfg for console replacement Dec 15, 2023
Copy link
Contributor

@prestist prestist left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants