Bug 27101

Summary: kernel's modules' directory "/lib/modules/5.8.1-desktop-2.mga" gets deleted during the package's re-installation (causing dracut to fail)
Product: Mageia Reporter: Shlomi Fish <shlomif>
Component: RPM PackagesAssignee: Kernel and Drivers maintainers <kernel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: High CC: mageia, ouaurelien, pterjan
Version: Cauldron   
Target Milestone: Mageia 8   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: kernel-5.8.1-2.mga8.src.rpm CVE:
Status comment:

Description Shlomi Fish 2020-08-13 10:23:06 CEST
Description of problem:

After I do `sudo dnf reinstall kernel-desktop-5.8.1-2.mga8-1-1.mga8.x86_64` dracut fails and some of the package's contents are missing:

[shlomif@telaviv1 ~]$ rpm -ql kernel-desktop-5.8.1-2.mga8-1-1.mga8 | perl -nlE 'say if ! -e' | head
/lib/modules/5.8.1-desktop-2.mga8
/lib/modules/5.8.1-desktop-2.mga8/kernel
/lib/modules/5.8.1-desktop-2.mga8/kernel/3rdparty
/lib/modules/5.8.1-desktop-2.mga8/kernel/3rdparty/rtl8821ce
/lib/modules/5.8.1-desktop-2.mga8/kernel/3rdparty/rtl8821ce/8821ce.ko.xz
/lib/modules/5.8.1-desktop-2.mga8/kernel/3rdparty/viahss
/lib/modules/5.8.1-desktop-2.mga8/kernel/3rdparty/viahss/viahss.ko.xz
/lib/modules/5.8.1-desktop-2.mga8/kernel/arch
/lib/modules/5.8.1-desktop-2.mga8/kernel/arch/x86
/lib/modules/5.8.1-desktop-2.mga8/kernel/arch/x86/crypto
[shlomif@telaviv1 ~]$ 

It also happened during the initial install. /boot is mounted. Previous kernels were fine, and I removed dkms and virtualbox, and the problem still happens.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 Aurelien Oudelet 2020-08-13 11:10:40 CEST
Thanks for reporting this.


Assigning to Kernel and Drivers maintainers.

Seems to exist since kernel 5.8.0.

Assignee: bugsquad => kernel
CC: (none) => ouaurelien

Aurelien Oudelet 2020-08-13 11:10:55 CEST

Severity: normal => major
Target Milestone: --- => Mageia 8
Priority: Normal => release_blocker

Comment 2 Pascal Terjan 2020-08-13 14:33:07 CEST
This is likely similar to https://bugzilla.redhat.com/show_bug.cgi?id=1200302

From redaing that bug it seems dnf reinstall asks rpm to do a reinstall operation rather than a remove + install, and this breaks some scriptlets with no generic way to fix them as rpm doesn't expose that properly to the scriptlets.

I have failed to find documentation of what reinstall does at rpm level so I could not confirm if this is still true or if there is now a way to handle it properly.

It seems all packages using conditionals on $1 in scriptlets will need to be reviewed before it is safe to use dnf reinstall on them.

CC: (none) => pterjan

Comment 3 Pascal Terjan 2020-08-13 14:40:13 CEST
Actually even if they don't use such conditional, there is no way when preun gets called to know if the current version will stay (reinstall) or be deleted (update).
Comment 4 Martin Whitaker 2020-08-13 15:28:55 CEST
Looks to be a duplicate of bug 26439 (also reported by Shlomi).

CC: (none) => mageia

Comment 5 Pascal Terjan 2020-08-13 15:35:20 CEST
While discussing on irc some idea came up, in postun files from the package would be already gone in the case of an upgrade and still there in case of reinstall, so we could check that.

This doesn't work for preun but would help here.
Comment 6 Pascal Terjan 2020-08-13 22:26:21 CEST
I have committed something in svn which should make it safer.
Comment 7 Aurelien Oudelet 2020-12-13 11:49:35 CET
(In reply to Martin Whitaker from comment #4)
> Looks to be a duplicate of bug 26439 (also reported by Shlomi).

I do think the same.(In reply to Pascal Terjan from comment #6)
> I have committed something in svn which should make it safer.

Status of the latter?

Priority: release_blocker => High

Thomas Backlund 2020-12-13 13:57:03 CET

Summary: kernel's modules' directory "/lib/modules/5.8.1-desktop-2.mga" gets deleted during the package's installation (causing dracut to fail) => kernel's modules' directory "/lib/modules/5.8.1-desktop-2.mga" gets deleted during the package's re-installation (causing dracut to fail)

Comment 8 Thomas Backlund 2021-02-14 22:36:22 CET
 fixed

Status: NEW => RESOLVED
Resolution: (none) => FIXED