Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913049 - sys-kernel/linux-firmware cycles through all files with a savedconfig
Summary: sys-kernel/linux-firmware cycles through all files with a savedconfig
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2023-08-26 11:29 UTC by ta2002
Modified: 2024-02-20 19:26 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
linux-firmware-20240115-r1 savedconfig (linux-firmware-20240115-r1,19.58 KB, text/plain)
2024-02-11 02:03 UTC, franklyfrank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ta2002 2023-08-26 11:29:21 UTC
I have a savedconfig with about a dozen entries.

The log produces (acknowledging the savedconfig):

"Building using saved configfile "/etc/portage/savedconfig/sys-kernel/linux-firmware"

Yet the ebuild insists on copying/compressing all ~2800 files in the archive, creating ~575 symbolic links, and THEN removing all of the files not listed in the savedconfig.

The emerge takes over 50 minutes to complete on this machine - a ridiculous amount of time to essentially extract about dozen files from an archive. Does some way exist to remove the unnecessary files BEFORE copying/compressing and linking? That would save a huge amount of time.
Comment 1 Rick Farina (Zero_Chaos) gentoo-dev 2023-08-28 01:38:38 UTC
It looks like it's safe to move the deleting the unwanted firmware to src_prepare as far as I can tell.  I think we should do that.  I don't understand all the of savedconfig related calls though, so for now I'm leaving this to someone who does.  that said the `./copy-firmware.sh` call at the start of src_install will behave exactly as mentioned in this bug, and that seems very expensive for anyone with savedconfig turned on.
Comment 2 Larry the Git Cow gentoo-dev 2024-01-20 19:57:51 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cc19234cf0cf7b82b5902b870648aedcd8420ae

commit 5cc19234cf0cf7b82b5902b870648aedcd8420ae
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-01-20 19:56:38 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-01-20 19:57:28 +0000

    package.mask: Mask linux-firmware-20250115-r1 for testing
    
    Modifications to USE=savedconfig  to only install files from
    there instead of deleting them afterwards.
    
    Bug: https://bugs.gentoo.org/913049
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 profiles/package.mask | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 3 Larry the Git Cow gentoo-dev 2024-01-20 20:01:30 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=df7daea6e021ab74a4ff7d0c662e428b5cf2b995

commit df7daea6e021ab74a4ff7d0c662e428b5cf2b995
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-01-20 20:00:08 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-01-20 20:01:25 +0000

    sys-kernel/linux-firmware: Modifications to USE=savedconfig
    
    Modified to only install files from the config file instead of
    deleting them afterwards.
    
    Bug: https://bugs.gentoo.org/913049
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware.patch       |  59 +++
 .../linux-firmware-20240115-r1.ebuild              | 403 +++++++++++++++++++++
 2 files changed, 462 insertions(+)
Comment 4 Mike Pagano gentoo-dev 2024-01-20 20:04:39 UTC
It's masked for now, but if someone can test linux-firmware-20240115-r1 and let me know of any disasters that would be helpful.
Comment 5 Mike Pagano gentoo-dev 2024-01-28 13:43:41 UTC
Am I the only one who tested this ?
Comment 6 Matt Turner gentoo-dev 2024-01-29 03:22:23 UTC
Looks like your commit made a massive difference. Nice work. Works great here.
Comment 7 Mike Pagano gentoo-dev 2024-01-29 18:58:17 UTC
(In reply to Matt Turner from comment #6)
> Looks like your commit made a massive difference. Nice work. Works great
> here.

Thanks, Matt.
Comment 8 A. Wilcox (awilfox) 2024-02-04 03:32:29 UTC
Works a treat on my headless systems that only need amd-ucode.  It brings the merge time down by 6x!

host01 /etc/portage # qlop sys-kernel/linux-firmware
2024-02-03T11:14:14 >>> sys-kernel/linux-firmware: 1′11″
2024-02-03T11:18:40 >>> sys-kernel/linux-firmware: 1′01″
2024-02-04T03:26:23 >>> sys-kernel/linux-firmware: 10s

However, I noticed on the system where I use +libarchive for app-alternatives/cpio, app-arch/cpio is now being pulled in, whereas before it depended on app-alternatives/cpio:

host02 /etc/portage # emerge -avu linux-firmware

These are the packages that would be merged, in order:

Calculating dependencies                ... done!
Dependency resolution took 1.03 s (backtrack: 0/20).

[ebuild  N     ] app-arch/cpio-2.14::gentoo  USE="-nls" 1486 KiB
[ebuild     U ~] sys-kernel/linux-firmware-20240115-r1::gentoo [20240115::gentoo] USE="initramfs redistributable savedconfig -compress-xz -compress-zstd -deduplicate (-unknown-license)" 0 KiB

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 1486 KiB

Is there a reason for this dependency change?
Comment 9 Mike Pagano gentoo-dev 2024-02-04 18:42:35 UTC
(In reply to A. Wilcox (awilfox) from comment #8)
> Works a treat on my headless systems that only need amd-ucode.  It brings
> the merge time down by 6x!
> 
> host01 /etc/portage # qlop sys-kernel/linux-firmware
> 2024-02-03T11:14:14 >>> sys-kernel/linux-firmware: 1′11″
> 2024-02-03T11:18:40 >>> sys-kernel/linux-firmware: 1′01″
> 2024-02-04T03:26:23 >>> sys-kernel/linux-firmware: 10s
> 
> However, I noticed on the system where I use +libarchive for
> app-alternatives/cpio, app-arch/cpio is now being pulled in, whereas before
> it depended on app-alternatives/cpio:
> 
> host02 /etc/portage # emerge -avu linux-firmware
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies                ... done!
> Dependency resolution took 1.03 s (backtrack: 0/20).
> 
> [ebuild  N     ] app-arch/cpio-2.14::gentoo  USE="-nls" 1486 KiB
> [ebuild     U ~] sys-kernel/linux-firmware-20240115-r1::gentoo
> [20240115::gentoo] USE="initramfs redistributable savedconfig -compress-xz
> -compress-zstd -deduplicate (-unknown-license)" 0 KiB
> 
> Total: 2 packages (1 upgrade, 1 new), Size of downloads: 1486 KiB
> 
> Is there a reason for this dependency change?

Thanks for the catch, fixing that now
Comment 10 Larry the Git Cow gentoo-dev 2024-02-04 18:46:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e9df627447ac1afff3715be904a8be6d6391ee

commit 35e9df627447ac1afff3715be904a8be6d6391ee
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-02-04 18:45:02 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-02-04 18:45:02 +0000

    sys-kernel/linux-firmware: Fix cpio dependency
    
    Thanks to awifox for reporting
    
    Bug: https://bugs.gentoo.org/913049
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/linux-firmware/linux-firmware-20240115-r1.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 11 franklyfrank 2024-02-10 13:37:02 UTC
This update had the exact opposite effect for me when it comes to merge time. My savedconfig contains 853 entries built from grepping anything amd, radeon and rtl_nic from an already downloaded distfile. The past dozen merge times have been around a minute to a minute and a half. Now it's been running for half an hour with copy-firmware.sh at 100% CPU usage and seemingly stuck at "copying/compressing file amd-ucode/README" and only some LICENSE.* files left. I have only redistributable and savedconfig USE flags set.
Comment 12 Mike Pagano gentoo-dev 2024-02-10 18:51:55 UTC
(In reply to franklyfrank from comment #11)
> This update had the exact opposite effect for me when it comes to merge
> time. My savedconfig contains 853 entries built from grepping anything amd,
> radeon and rtl_nic from an already downloaded distfile. The past dozen merge
> times have been around a minute to a minute and a half. Now it's been
> running for half an hour with copy-firmware.sh at 100% CPU usage and
> seemingly stuck at "copying/compressing file amd-ucode/README" and only some
> LICENSE.* files left. I have only redistributable and savedconfig USE flags
> set.

attach your saved config
Comment 13 franklyfrank 2024-02-11 02:03:51 UTC
Created attachment 884699 [details]
linux-firmware-20240115-r1 savedconfig
Comment 14 Mike Pagano gentoo-dev 2024-02-14 18:32:31 UTC
(In reply to franklyfrank from comment #13)
> Created attachment 884699 [details]
> linux-firmware-20240115-r1 savedconfig

It appears to be barfing on the LICENSE files


# ./copy-firmware.sh -v --firmware-list LICENSE.amd-ucode amd/amd_sev_fam17h_model0xh.sbin --ignore-duplicates /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware

ERROR: unknown command-line options: /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware

# ./copy-firmware.sh -v --firmware-list  amd/amd_sev_fam17h_model0xh.sbin --ignore-duplicates /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware
copying/compressing file amd/amd_sev_fam17h_model0xh.sbin

#
Comment 15 Mike Pagano gentoo-dev 2024-02-14 18:44:06 UTC
(In reply to Mike Pagano from comment #14)
> (In reply to franklyfrank from comment #13)
> > Created attachment 884699 [details]
> > linux-firmware-20240115-r1 savedconfig
> 
> It appears to be barfing on the LICENSE files
> 
> 
> # ./copy-firmware.sh -v --firmware-list LICENSE.amd-ucode
> amd/amd_sev_fam17h_model0xh.sbin --ignore-duplicates
> /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware
> 
> ERROR: unknown command-line options:
> /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware
> 
> # ./copy-firmware.sh -v --firmware-list  amd/amd_sev_fam17h_model0xh.sbin
> --ignore-duplicates
> /tmp/portage/sys-kernel/linux-firmware-20240115-r1/image/lib/firmware
> copying/compressing file amd/amd_sev_fam17h_model0xh.sbin
> 
> #

Ignore this, I can replicate your issue
Comment 16 Larry the Git Cow gentoo-dev 2024-02-15 20:22:17 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f12fcc927ba762bac9cfa8ccd7f699e61b262d3c

commit f12fcc927ba762bac9cfa8ccd7f699e61b262d3c
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-02-15 20:20:51 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-02-15 20:20:51 +0000

    sys-kernel/linux-firmware: savedconfig update, r2
    
    Bug: https://bugs.gentoo.org/913049
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware-r2.patch    |  60 +++
 .../linux-firmware-20240115-r2.ebuild              | 401 +++++++++++++++++++++
 2 files changed, 461 insertions(+)
Comment 17 Mike Pagano gentoo-dev 2024-02-15 20:23:15 UTC
(In reply to franklyfrank from comment #11)
> This update had the exact opposite effect for me when it comes to merge
> time. My savedconfig contains 853 entries built from grepping anything amd,
> radeon and rtl_nic from an already downloaded distfile. The past dozen merge
> times have been around a minute to a minute and a half. Now it's been
> running for half an hour with copy-firmware.sh at 100% CPU usage and
> seemingly stuck at "copying/compressing file amd-ucode/README" and only some
> LICENSE.* files left. I have only redistributable and savedconfig USE flags
> set.

Can you test -r2, please?  May take a little time to sync to the mirrors.
Comment 18 franklyfrank 2024-02-15 22:15:13 UTC
Yep, -r2 works fine now and finishes in line with previous versions.
Comment 19 Larry the Git Cow gentoo-dev 2024-02-15 23:20:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f00488d02e9bb9d5c85dbdee80bd5b1a780a4100

commit f00488d02e9bb9d5c85dbdee80bd5b1a780a4100
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-02-15 23:18:55 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-02-15 23:18:55 +0000

    sys-kernel/linux-firmware: Update savedconfig patch
    
    Bug: https://bugs.gentoo.org/913049
    Closes: https://bugs.gentoo.org/924679
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware-r3.patch    |  59 +++
 .../linux-firmware-20240115-r3.ebuild              | 401 +++++++++++++++++++++
 2 files changed, 460 insertions(+)
Comment 20 Mike Pagano gentoo-dev 2024-02-15 23:22:32 UTC
(In reply to franklyfrank from comment #18)
> Yep, -r2 works fine now and finishes in line with previous versions.

Thanks for testing, I think the next linux-firmware should have this, which should be out any day now.
Comment 21 Larry the Git Cow gentoo-dev 2024-02-20 19:26:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a64e2b27009e5b30f57d0270c7d9390e36ba041d

commit a64e2b27009e5b30f57d0270c7d9390e36ba041d
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-02-20 19:25:02 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-02-20 19:25:02 +0000

    sys-kernel/linux-firmware: add 20240220, more accurate savedconfig support
    
    Closes: https://bugs.gentoo.org/913049
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 sys-kernel/linux-firmware/Manifest                 |   1 +
 .../linux-firmware/linux-firmware-20240220.ebuild  | 401 +++++++++++++++++++++
 2 files changed, 402 insertions(+)