Bug 1213648

Summary: dracut: implement no implicit initrd location
Product: [openSUSE] openSUSE Tumbleweed Reporter: Ludwig Nussel <lnussel>
Component: BasesystemAssignee: dracut maintainers <dracut-maintainers>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P5 - None CC: antonio.feijoo, lnussel
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Ludwig Nussel 2023-07-25 15:13:14 UTC
I'm working on systemd-boot integration in Factory. An effect of how it's currently done is that dracut basically cannot know where to install the initrd and it should not do it anyway. See https://github.com/lnussel/sdbootutil/blob/main/ARCHITECTURE.md for an overview.

So to avoid users (or scriptlets) generating useless initrds, would it be possible to implement a global config option to disable guessing of the location? Ie always require to specify an output file when that option is set.
Comment 1 Antonio Feijoo 2023-07-26 09:39:15 UTC
(In reply to Ludwig Nussel from comment #0)
> So to avoid users (or scriptlets) generating useless initrds, would it be
> possible to implement a global config option to disable guessing of the
> location? Ie always require to specify an output file when that option is
> set.

You know it could be possible :), the question is whether it'd be accepted upstream (knowing how they breathe...), because specifying an output file already disables guessing.
Comment 2 Ludwig Nussel 2023-07-26 09:52:07 UTC
the point would be to prevent admins to naively type "dracut" from generating an initrd in a useless location
Comment 3 Antonio Feijoo 2023-07-26 12:44:41 UTC
Here it is, but I wouldn't bet a lot of money: https://github.com/dracutdevs/dracut/pull/2448

We had a "similar" PR rejected in the past: https://github.com/dracutdevs/dracut/pull/2020
Comment 4 Antonio Feijoo 2023-08-16 07:24:04 UTC
Changing severity to enhancement, I'd say that the current behavior is not a bug, since the output file can be specified explicitly.
Comment 5 Antonio Feijoo 2024-03-25 08:57:07 UTC
(In reply to Antonio Feijoo from comment #3)
> Here it is, but I wouldn't bet a lot of money:
> https://github.com/dracutdevs/dracut/pull/2448

I'd say that this PR will not be merged. Is there still any interest in keeping this enhancement request open or has sdbootutil already found a workaround for this?
Comment 6 Ludwig Nussel 2024-03-25 09:05:07 UTC
There can't be a workaround in sdbootutil. The issue is people can call dracut manually any time and it would create an initrd. The result is useless as the new initrd won't be used for anything. In the systemd-boot case it's simply not dracut's job to register the initrd with the bootloader. Tooling around dracut takes care to install the generated initrd in the right location.
Anyway dracut generating initrd in random places is not harmful or blocking anything, just useless :-)
Comment 7 Antonio Feijoo 2024-04-18 15:00:05 UTC
The patch from https://github.com/openSUSE/dracut/pull/323 is included since snapshot 20240417.