Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686296 - sys-kernel/linux-firmware[savedconfig] does not run save_config
Summary: sys-kernel/linux-firmware[savedconfig] does not run save_config
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords: PATCH
Depends on: 686348
Blocks:
  Show dependency tree
 
Reported: 2019-05-19 09:20 UTC by Jeroen Roovers (RETIRED)
Modified: 2019-08-16 20:11 UTC (History)
4 users (show)

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


Attachments
Patch (linux-firmware.patch,4.91 KB, patch)
2019-08-16 19:48 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 09:20:15 UTC
src_install() {
    if use !savedconfig; then
        save_config ${PN}.conf
    fi

Yank/paste error?



--- a/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
@@ -267,7 +270,7 @@ src_prepare() {
 }

 src_install() {
-       if use !savedconfig; then
+       if use savedconfig; then
                save_config ${PN}.conf
        fi
        rm ${PN}.conf || die
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 09:47:19 UTC
Since you were doing so well on resolving bug #686288 (and since you're not on the kernel@ alias or listed in metadata.xml).
Comment 2 Ulrich Müller gentoo-dev 2019-05-19 09:47:53 UTC
That's intentional (and like this since 2016), see bug 546690.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 10:06:58 UTC
Um.

So on first install, USE=savedconfig is not actually used to save the config, and then on the next install USE=savedconfig is not actually used to restore the config, because it wasn't installed on the first run.

What?
Comment 4 Ulrich Müller gentoo-dev 2019-05-19 10:16:00 UTC
<[Arfrever]> ulm: This code was in this way for long time, but jer's suggestion seems valid.
<[Arfrever]> ulm: Maybe 'save_config ${PN}.conf' should be called unconditionally.
<[Arfrever]> ulm: It seems to me that restore_config() is intended to be used conditionally (and it already internally has 'use savedconfig || return'), while save_config() is intended to \
be used unconditionally.
<@ulm> [Arfrever]: bug 546690
<+willikins> ulm: https://bugs.gentoo.org/546690 "sys-kernel/linux-firmware: Don't re-save configuration if 'savedconfig' is enabled"; Gentoo Linux, [OLD] Core system; RESO, FIXE; aranea:c\
hithanh                                                                                                                                                                                      
<[Arfrever]> ulm: Maybe the right solution would be (beside unconditional call to save_config()) in savedconfig.eclass...
<[Arfrever]> ulm: restore_config() supports multiple variants of file name: ${PF}, ${P}, ${PN}
<[Arfrever]> ulm: But save_config() always uses ${PF}.
<@ulm> so it would create a new config file for every version bump?
<[Arfrever]> ulm: https://bugs.gentoo.org/546690#c0
<[Arfrever]> ulm: restore_config() could set a private global variable indicating which variant of file name was used. save_config() could check this private global variable...
<[Arfrever]> So if restore_config() has read data from /etc/portage/savedconfig/sys-kernel/linux-firmware then save_config() should write data to ${ED}/portage/savedconfig/sys-kernel/linux\
-firmware
<@ulm> yeah, but IMHO this is a bad time for doing unrelated functional changes to the ebuild
<[Arfrever]> It seems that it is originally a design bug in savedconfig.eclass which was wrought around in that ebuild...
<@ulm> [Arfrever]: can you please file a bug for the eclass?
<@ulm> [Arfrever]: can I post the above to #686296?
<[Arfrever]> Yes
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 10:26:18 UTC
There is a race between installing linux-firmware to find out which blobs you want, and then configuring the saved configuration file to reflect that, so in order to find out what you want to keep/remove, the config should be installed first, then edited, and then applied to the same version on the re-install.

savedconfig.eclass has all kinds of problems that really require an `ebuild ... unpack` to figure out, but this is not the place to solve those.
Comment 6 Arfrever Frehtes Taifersar Arahesis 2019-05-19 23:44:59 UTC
After fix for bug #686348 is applied, the correct solution for sys-kernel/linux-firmware, working for all use cases, will be:

--- a/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
@@ -274,9 +274,7 @@ src_prepare() {
 }
 
 src_install() {
-	if use !savedconfig; then
-		save_config ${PN}.conf
-	fi
+	save_config ${PN}.conf
 	rm ${PN}.conf || die
 
 	if ! ( shopt -s failglob; : * ) 2>/dev/null; then
Comment 7 Arfrever Frehtes Taifersar Arahesis 2019-08-09 00:56:01 UTC
savedconfig.eclass is now properly fixed (bug #686348).
Please apply solution to sys-kernel/linux-firmware described in comment #6.
Comment 8 Arfrever Frehtes Taifersar Arahesis 2019-08-16 19:48:40 UTC
Created attachment 587066 [details, diff]
Patch
Comment 9 Larry the Git Cow gentoo-dev 2019-08-16 20:11:07 UTC
The bug has been closed via the following commit(s):

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

commit d0c32e684cc7579efed02f2b96729eefeb439f5f
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-08-16 20:00:38 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-08-16 20:10:56 +0000

    sys-kernel/linux-firmware: new snapshot
    
    Closes: https://bugs.gentoo.org/686296
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 sys-kernel/linux-firmware/Manifest                 |   1 +
 .../linux-firmware/linux-firmware-20190815.ebuild  | 352 +++++++++++++++++++++
 .../linux-firmware/linux-firmware-99999999.ebuild  |   4 +-
 3 files changed, 354 insertions(+), 3 deletions(-)

Additionally, it has been referenced in the following commit(s):

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

commit 82ac7733be67373d2224206429e8c736e497d05e
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-08-16 20:05:39 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-08-16 20:10:58 +0000

    sys-kernel/linux-firmware: update saveconfig logic
    
    Bug: https://bugs.gentoo.org/686296
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 sys-kernel/linux-firmware/linux-firmware-20190603.ebuild | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)