Skip to content

Conversation

@val4oss
Copy link
Contributor

@val4oss val4oss commented Jan 8, 2026

The check s.dest in main.config in finalize_default_initrd() is unreliable - initrd_packages is often not present in main.config even when specified in configuration files, causing values to fall through to context.defaults.

When mkosi-initrd/mkosi.conf is parsed, the parser only checks context.config (not context.defaults), so user packages are not seen and cannot be merged. Additionally, during finalization, context.config takes priority over context.defaults, causing user packages to be lost.

Fix by always using context.config for non-CLI initrd settings, ensuring they are visible to the parser and get properly merged with the mkosi-initrd default packages via the list parser.

Fixes #4114

The check `s.dest in main.config` in finalize_default_initrd() is
unreliable - initrd_packages is often not present in main.config even
when specified in configuration files, causing values to fall through
to context.defaults.

When mkosi-initrd/mkosi.conf is parsed, the parser only checks
context.config (not context.defaults), so user packages are not seen
and cannot be merged. Additionally, during finalization, context.config
takes priority over context.defaults, causing user packages to be lost.

Fix by always using context.config for non-CLI initrd settings, ensuring
they are visible to the parser and get properly merged with the
mkosi-initrd default packages via the list parser.

Fixes systemd#4114
@val4oss val4oss force-pushed the fix-initrd-packages-default branch from f55d09d to 4765c49 Compare January 8, 2026 16:28
@val4oss val4oss changed the title config: Fix InitrdPackages not being addedwith default config: Fix InitrdPackages not being added with default Jan 8, 2026
@DaanDeMeyer
Copy link
Contributor

Not quite correct, my pr has the correct fix

@DaanDeMeyer DaanDeMeyer closed this Jan 8, 2026
@val4oss
Copy link
Contributor Author

val4oss commented Jan 15, 2026

Thank you for the correct fix.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

InitrdPackages silently ignored when using the default initrd

2 participants