Bug 1213459 - suse-module-tools: allow to replace regenerate-initrd-posttrans
Summary: suse-module-tools: allow to replace regenerate-initrd-posttrans
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Leap 15.4
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Martin Wilck
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-19 08:46 UTC by Ludwig Nussel
Modified: 2023-09-20 10:03 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludwig Nussel 2023-07-19 08:46:00 UTC
There's currently no integration of dracut with the way the systemd-boot prototype support works (https://en.opensuse.org/Systemd-boot).
So calling dracut to generate an initrd would lead to the initrd in the wrong place aka useless. Instead one would have to call "sdbootutil add-kernel" resp "sdbootutil add-all-kernels".

The interface is still WIP so I wouldn't want to ask for adding those calls actually. Instead I'd like to have a way to override the script.
The rpm scriptlets are already in a subpackage so I can provide alternatives. How about  moving regenerate-initrd-posttrans there too?
Comment 1 Martin Wilck 2023-08-01 09:46:19 UTC
A subpackage seems to be somewhat over-engineered to me. In the long run regenerate-initrd-posttrans should support systemd-boot.

For the time being, perhaps we should simply define an override location, e.g. /etc/module-init-tools/regenerate-initrd-posttrans or /usr/local/bin/regenerate-initrd-posttrans, and execute that if present?
Comment 2 Ludwig Nussel 2023-08-14 07:15:01 UTC
Those locations can't be used by packages. Reserved for the admin.

I wouldn't create a new subpackage either. What about just putting the script alongside the other scriptlets?
Comment 3 Martin Wilck 2023-08-14 09:42:18 UTC
> Those locations can't be used by packages. Reserved for the admin.

That was intentional. As long as you're still experimenting (as I am inferring from comment 1), can't you just create a script as an admin?

That said, we can check both /etc and /usr/etc, of course.
Comment 4 Ludwig Nussel 2023-08-14 11:12:51 UTC
Well, the stuff is entering Factory so even if locations may not be final I still try to avoid hacks that just bite later.


So what about moving /usr/lib/module-init-tools/regenerate-initrd-posttrans into suse-module-tools-scriptlets?
Comment 5 Martin Wilck 2023-08-14 13:18:42 UTC
I'd rather not mix the kernel scriptlets with this. Replacing the scriptlets and replacing regenerate-initrd-posttrans are two independent things.

I think creating another subpackage is the right thing to do, even if I previously said the contrary. It's consistent with the way we've handled this previously.
Comment 6 Ludwig Nussel 2023-08-14 13:28:00 UTC
Well, the package is called suse-module-tools-scriptlets and provides suse-kernel-rpm-scriptlets. So IMO it's perfectly set up to also host other scripts and have more provides, like eg. suse-dracut-rpm-scriptlets
Comment 7 Martin Wilck 2023-08-14 13:30:23 UTC
(In reply to Ludwig Nussel from comment #6)
> Well, the package is called suse-module-tools-scriptlets and provides
> suse-kernel-rpm-scriptlets. So IMO it's perfectly set up to also host other
> scripts and have more provides, like eg. suse-dracut-rpm-scriptlets

True, but as I said, one may very well want to replace the kernel scriptlets but not r-i-p, or vice versa. If we need to make this customizable, the customizations shouldn't be all-or-nothing.
Comment 8 Ludwig Nussel 2023-08-14 13:41:11 UTC
I'd argue the other way around :-) The current use case is to replace all-or-nothing anyway. So no need to make it more complex right now :-)
Comment 9 Martin Wilck 2023-08-14 13:51:12 UTC
Your argument to split off the kernel scriptlets was related to "systems with file triggers only". This one is about replacing dracut with systemd-boot. To my understanding these are two different things, even if _you_ happen to try both at the same time right now. No?

Anyway, https://github.com/openSUSE/suse-module-tools/pull/77
Comment 10 Ludwig Nussel 2023-08-14 15:09:08 UTC
I actually went back to the scriptlets as file triggers can't fail transactions :-( The requirements are the same though. Need to replace code that is meant to be used with grub with something compatible with sd-boot.
Comment 11 Martin Wilck 2023-08-29 19:08:14 UTC
Please have another look at the upstream PR.
Comment 12 Ludwig Nussel 2023-09-05 12:25:26 UTC
reviewed ok, thanks!
Comment 13 OBSbugzilla Bot 2023-09-05 19:45:02 UTC
This is an autogenerated message for OBS integration:
This bug (1213459) was mentioned in
https://build.opensuse.org/request/show/1109139 Factory / suse-module-tools
Comment 14 Martin Wilck 2023-09-18 14:51:43 UTC
Closing per comment 13.
Comment 15 Martin Wilck 2023-09-20 10:03:37 UTC
Closing per comment 13.