-
Notifications
You must be signed in to change notification settings - Fork 325
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
mkosi-initrd: add some autodetection logic if output is not specified #3084
base: main
Are you sure you want to change the base?
mkosi-initrd: add some autodetection logic if output is not specified #3084
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced it's a good idea to redo this logic, that's the purview of kernel-install in mkosi-initrd.
I guess suse hasn't adopted kernel-install yet because it doesn't do any of the snapshot stuff that suse needs. But then I wonder if this shouldn't live in the suse packaging scriptlets. How is this handled with dracut? |
18932bb
to
53374fb
Compare
I tend to disagree. |
You're right, kernel-install is not being used yet, but it's always installed and some configuration tweaks are being used with systemd-boot installations. But one thing is installing kernels + initrds, and other is regenerating only the initrd. As you guessed, dracut has it's own auto detection logic of the output file, but I want to be closer to what kernel-install already provides, which is the same as being closer to upstream systemd. |
53374fb
to
96c3d17
Compare
But that's then very specific to how Suse usecase, isn't it? For |
Nope, this does not fix SUSE's btrfs snapshots use case...
This feature is not intended for that, it just wants to regenerate the initrd only of existing boot loader entries. At SUSE we have defined 2 rpm macros (
Thanks for this point, you're right, I was missing the "UKI concept" here, so yes, for UKI's this logic does not make any sense.
I'd say that this auto-detection logic is a nice to have feature, but it's not critical if finally it's not included. |
96c3d17
to
33c612e
Compare
@aafeijoo-suse If you're intending to use this from packaging scriptlets, how do you handle cleanup? Won't the packaging scriptlets need to know the actual output directory regardless so they can clean up old initrds? Usually the kernel version is somehow encoded in the initrd file or path in the ESP so if that changes mkosi wouldn't be able to clean up old initrds itself and this would have to be done by the caller. |
Package scriptlets are just one of the know use cases, and the clean-up is not handled there. I think it's more important now since we are building initrds from packages, if e.g. only the Other common use case is a user who needs to manually rebuild the initrd after a configuration change that can affect the system startup. But of course, he could manually specify the output file. |
The thing I'm worried about is that we just don't have sufficient information to make this work. On Fedora, the initramfs in /boot includes the kernel version in its name. That's just something we can't autodetect in |
Yes, there is a lot of divergence nowadays with the expected output in each distro. Some standardization work has started here: uapi-group/specifications#100 And in my view, I'd like to implement something like this: uapi-group/specifications#100 (comment) But maybe the spec should be written first, and then this PR could implement that. What do you think? |
I think that's a good idea. Having a draft spec and seeing whether we can get others onboard and implementing that, makes sense to me. |
Make use of installation layout (bls or other), `$BOOT_ROOT` partition and entry token provided by `kernel-install`.
33c612e
to
702e236
Compare
Make use of installation layout (bls, uki, other...),
$BOOT_ROOT
partition and entry token provided bykernel-install
.