Bug 12361 - kernel-firmware-nonfree removed by urpme --auto-orphans
Summary: kernel-firmware-nonfree removed by urpme --auto-orphans
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: release_blocker normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords: 6sta2, PATCH
Depends on:
Blocks:
 
Reported: 2014-01-19 20:41 CET by Bit Twister
Modified: 2016-12-06 23:24 CET (History)
6 users (show)

See Also:
Source RPM: urpme, draklive-install, drakxtools
CVE:
Status comment:


Attachments
do not consider firmware-nonfree when looking for regular kernels (897 bytes, text/plain)
2016-11-11 22:28 CET, Martin Whitaker
Details
tell urpme --auto-orphan to not consider wanted packages (1.82 KB, patch)
2016-11-12 08:51 CET, Thierry Vignaud
Details | Diff
prevent wanted packages to be later removed (1.93 KB, patch)
2016-11-12 08:55 CET, Thierry Vignaud
Details | Diff
skip kernel-firmware-nonfree too when considering real kernels (1.02 KB, patch)
2016-11-12 09:01 CET, Thierry Vignaud
Details | Diff

Description Bit Twister 2014-01-19 20:41:31 CET
Description of problem:

urpme --auto-orphans wants to remove kernel-firmware-nonfree-20131230-2.mga4.nonfree.noarch

$ lspci | grep Radeon
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Oland PRO [Radeon R7 240]
01:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]

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


How reproducible: Always


Steps to Reproduce:
1. urpmi kernel-firmware-nonfree
2. urpme --auto-orphans

above assumes you have Radeon hardware.


Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2014-01-20 02:35:21 CET
This is _NOT_ an urpmi bug.
Something has to tag it as requested

CC: (none) => thierry.vignaud, tmb
Source RPM: urpmi-7.30-1.mga4.src.rpm => (none)

Rémi Verschelde 2014-12-02 09:52:46 CET

Summary: 4_rc: kernel-firmware removed by urpme --auto-orphans => kernel-firmware-nonfree removed by urpme --auto-orphans

Comment 2 Rémi Verschelde 2014-12-02 09:57:24 CET
I agree with Thierry that it is not an urpmi bug, but this is a major letdown for a number of users that we keep harassing with "These packages are now orphaned, you can remove them with urpme --auto-orphans", and that end up with unrecognized hardware.

Please correct me if I'm wrong, but I guess most users with nonfree repos enabled would like to have kernel-firmware-nonfree. Maybe recommending this package would be enough to prevent it from being orphaned?

CC: (none) => ennael1, remi

Comment 3 Bit Twister 2014-12-02 10:17:41 CET
(In reply to Rémi Verschelde from comment #2)
> I agree with Thierry that it is not an urpmi bug, but this is a major
> letdown for a number of users that we keep harassing with "These packages
> are now orphaned, you can remove them with urpme --auto-orphans", and that
> end up with unrecognized hardware.

I agree hole hearty with anything keeping the user from breaking their install.

> Please correct me if I'm wrong, but I guess most users with nonfree repos
> enabled would like to have kernel-firmware-nonfree. Maybe recommending this
> package would be enough to prevent it from being orphaned?

Not sure what "recommending" is doing, but somewhere in the past someone made a patch which keep other firmware from being automagically orphaned without the user having to manually urpmi a package to keep it out of the orphan scan.

IIRC it was because wifi/link connections failed because the wifi/nic firmware was shown orphaned and therefore removed by the user.  :(
Comment 4 Samuel Verschelde 2016-10-16 15:59:54 CEST
We should have asked you installation logs and other debug information to find out how it happened, but now I think it's too late so I'm closing this bug report as OLD. Reopen if it happens again.

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

Comment 5 Martin Whitaker 2016-11-11 22:28:57 CET
Created attachment 8649 [details]
do not consider firmware-nonfree when looking for regular kernels

I encountered this when checking for orphans on the Live DVDs. kernel-firmware-nonfree is installed because it is recommended by kernel-firmware, but is immediately listed as an orphan. This is a bug in urpm/orphans.pm, which incorrectly adds kernel-firmware-nonfree to the list of old kernels, which then stops it being removed from the list of potential orphans.

The attached patch fixes this.

CC: (none) => mageia

Martin Whitaker 2016-11-11 22:29:42 CET

Status: RESOLVED => REOPENED
Keywords: (none) => PATCH
Resolution: OLD => (none)

Comment 6 Thomas Backlund 2016-11-11 22:43:04 CET
No it should not be affected, unless we have broken drakx again.

pretty much all firmwares are (supposed to be) protected by: 
perl-install/pkgs.pm:    @wanted_hardware_packages


Unless this fix broke it again:
http://gitweb.mageia.org/software/drakx/commit/?id=7ed5bd23d63bd4031f2a2f3055b0d0a19a65906d
Comment 7 Martin Whitaker 2016-11-11 23:16:02 CET
Well, kernel-firmware-nonfree is installed on my normal system (installed by the classic installer), but is listed as an orphan after installing from the Live installer on the same hardware. Having said that, removing the orphans had no obviously bad effect, so this may not be the best of examples.
Comment 8 Martin Whitaker 2016-11-11 23:47:31 CET
I have just tried the same thing on my laptop. After installing from the Live DVD, urpme --auto-orphans removed kernel-firmware-nonfree. A second run removed iwlwifi-agn-ucode, rtlwifi-firmware, and ralink-firmware, which meant I had no wired or wireless connection after the next reboot.

So if this is meant to be protected a different way, it's broken.
Comment 9 Thierry Vignaud 2016-11-12 08:42:27 CET
(In reply to Thomas Backlund from comment #6)
This only pre-select kernel-firmware-nonfree if needed. At installation time.
Like we install mdadm, ... if needed

This has nothing to do with draklive-install removing unused packages (protection in pkgs.pm).

Which again is different from urpme --auto-orphan

The above code in pkgs.pm is code for draklive-install to not remove those package.
draklive-install should also tell urpmi that those are not orphan packages by running sg like:
urpmi <wanted_packages>
Comment 10 Thierry Vignaud 2016-11-12 08:51:28 CET
Created attachment 8650 [details]
tell urpme --auto-orphan to not consider wanted packages

aka something like this (totally untested)

That being said, I'm not against Martin's patch as this urpm code really is about considering real kernels, excluding other pkgs such as doc, firmware, ...

But my patch is more generic and is about the greater good.
I think we may want both.
Comment 11 Thierry Vignaud 2016-11-12 08:55:47 CET
Created attachment 8651 [details]
prevent wanted packages to be later removed

slight reworded description

Attachment 8650 is obsolete: 0 => 1

Thierry Vignaud 2016-11-12 08:56:15 CET

Attachment 8649 description: Patch to fix bug => do not consider firmware-nonfree when looking for regular kernels

Comment 12 Thierry Vignaud 2016-11-12 09:01:28 CET
Created attachment 8652 [details]
skip kernel-firmware-nonfree too when considering real kernels

I've locally applied martin's patch with an altered description in order to make it easier to understand when looking back in 6 months

Attachment 8649 is obsolete: 0 => 1

Thierry Vignaud 2016-11-12 09:02:08 CET

Source RPM: (none) => urpme, draklive-install, drakxtools

Comment 13 Thomas Backlund 2016-11-12 10:43:51 CET
(In reply to Thierry Vignaud from comment #9)
> (In reply to Thomas Backlund from comment #6)
> This only pre-select kernel-firmware-nonfree if needed. At installation time.
> Like we install mdadm, ... if needed
> 
> This has nothing to do with draklive-install removing unused packages
> (protection in pkgs.pm).
> 
> Which again is different from urpme --auto-orphan
> 
> The above code in pkgs.pm is code for draklive-install to not remove those
> package.
> draklive-install should also tell urpmi that those are not orphan packages
> by running sg like:
> urpmi <wanted_packages>

In that case I've misunderstood the @wanted_hardware_packages...
We extended that list with pretty much all firmware packages as we want them to never get orphaned.

The reasoning for never removing firmwares, wpa_supplicant and some of the bluetooth stuff was/is we need them to be able to support hotplugging of hw needing firmware to get network access...

Think a user goes to a site to fix a sytem, when he gets there he plugs in a usb wifi (or bluetooth tethering) to get fixes from the net and woops...
Comment 14 Martin Whitaker 2016-11-12 11:03:23 CET
For the 5.1 Live ISOs, I propose to add kernel-firmware-nonfree to the 'default_packages' list in auto_inst.cfg.pl as a temporary fix. We can aim for a better solution in mga6.
Comment 15 Thierry Vignaud 2016-11-12 12:58:27 CET
(In reply to Thomas Backlund from comment #13)

Sorry, this list is just "substracted" from the unused hw pkgs list, then draklive-install runs urpme --auto on the remaining pkgs

But it doesn't do anything more so a later call to "urpme --auto-orphans" can still remove those packages.
My suggested patch would do what you were expecting...
But it needs testing
Comment 16 Mageia Robot 2016-11-12 13:03:48 CET
commit fe789c71982f311efa12e1cb50ad74e05a0662d7
Author: Martin Whitaker <mageia@...>
Date:   Fri Nov 11 21:15:11 2016 +0000

    skip kernel-firmware-nonfree too
    
    ...when considering real kernels
    
    Thus preventing kernel-firmware-nonfree being falsely detected as an
    orphan package (mga#12361).
    
    It should be handled by generic orphan mechanism
---
 Commit Link:
   http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=fe789c71982f311efa12e1cb50ad74e05a0662d7
Comment 17 Mageia Robot 2016-11-12 20:38:24 CET
commit 5eb274c2692271b593b873fdf7d2ce8644030f86
Author: Martin Whitaker <mageia@...>
Date:   Sat Nov 12 12:03:33 2016 +0000

    Workaround for mga#12361 - ensure kernel-firmware-nonfree can't be orphaned.
---
 Commit Link:
   http://gitweb.mageia.org/software/build-system/draklive-config/commit/?id=5eb274c2692271b593b873fdf7d2ce8644030f86
Comment 18 Thomas Andrews 2016-12-06 01:14:14 CET
I believe this is the correct bug. It certainly reads like it...

After a Plasma install from the first round of Mga6 sta2 64-bit iso, getting updates, and installing some software, kernel-firmware-nonfree is being reported as an orphan. If this is removed, other firmware packages are reported as orphans, one of which is iwlwifi - which is needed by this system if wifi is to work. 

Either this patch isn't working with the sta2 installs, or it never made it to them. Either way, it has the potential to be disastrous  for users who go ahead and remove the orphans using urpme.

Adding the keyword 6sta2, and re-marking it as a release blocker.

Keywords: (none) => 6sta2
Priority: Normal => release_blocker
CC: (none) => andrewsfarm

Comment 19 Rémi Verschelde 2016-12-06 09:42:37 CET
Thanks for checking Thomas, the fix mentioned in comment 16 had indeed not been released yet in urpmi. Thierry just fixed that with urpmi 8.106, which should be available on the next set of ISOs.
Comment 20 Thierry Vignaud 2016-12-06 10:32:56 CET
Closing

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

Comment 21 Thomas Andrews 2016-12-06 23:24:11 CET
Confirmed fixed. 

On a second install of x86_64 Mageia 6 sta2 on the same hardware as Comment 18, urpmi is now the first update, and the problem has now disappeared.

Note You need to log in before you can comment on or make changes to this bug.