Bug 1190026 - Uninstalling haveged doesn't trigger the rebuild of initrd
Summary: Uninstalling haveged doesn't trigger the rebuild of initrd
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Martin Schreiner
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-31 15:49 UTC by Franck Bui
Modified: 2024-07-12 09:48 UTC (History)
2 users (show)

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


Attachments
zypper.log after `zypper rm haveged` (60.85 KB, text/plain)
2021-11-19 09:35 UTC, Franck Bui
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Franck Bui 2021-08-31 15:49:26 UTC
Doing `zypper rm haveged` doesn't recreate the initrd. This is happening with haveged-1.9.14-1.5.
Comment 1 Marcus Meissner 2021-11-19 08:54:51 UTC
hmm, do you have a zypper logfile?

we have 
%posttrans
%{?regenerate_initrd_posttrans}

%postun
%service_del_postun %{name}.service
%service_del_postun %{name}-switch-root.service
%{?regenerate_initrd_post}
Comment 2 Franck Bui 2021-11-19 09:35:23 UTC
Created attachment 853869 [details]
zypper.log after `zypper rm haveged`

Here it is.
Comment 3 Marcus Meissner 2021-11-19 10:47:58 UTC
can repro on tumbleweed
Comment 4 Otto Hollmann 2022-03-11 08:39:15 UTC
I can reproduce it as well on different product and with different packages. If you install haveged, initrd is rebuild, but if you uninstall it, initrd is not rebuild. However do we really need to rebuild initrd?

In another bug I found comment that could explain this behavior.

(In reply to Martin Wilck from bug 966057#c5)
> Rebuilding the intird is always risky business. 
> Normally, when you do package management operations (except system
> installation and offline upgrade), you have booted the system successfully
> with the existing initrd. Replacing it has a non-zero risk of breaking the
> system; perhaps so badly that it won't boot any more.
> 
> When uninstalling, it may actually be beneficial _not_ to rebuild the initrd
> in many cases.
> 
> Thinking about it, IMO it'd be good policy to regenerate the initrd only
> when (un)installing or upgrading the kernel, or (relevant) kernel modules.
> In other cases it'd be sufficient to have the user rebuild the initrd if she
> so desires.

So unless any objection I will close this bug. Because this is not a bug in haveged but rather feature in zypper/rpm.
Comment 5 Franck Bui 2022-03-14 12:46:30 UTC
(In reply to Otto Hollmann from comment #4)
> is not rebuild. However do we really need to rebuild initrd?

I think we do: uninstalling haveged leads to errors because in this case haveged started from initrd tries to reload/restart from the host (I don't remember the exact details) but fails since haveged stuff are missing from the host.

And IMHO the argument that claims that regenerating initrd only when updating the kernel is wrong. If someone uninstalls a component from the system he doesn't expect it to be left in initrd and half uninstalled. Furthermore there're other components, such as systemd, udevd, that does need to have the same version in both initrd and the host.