Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 951538 - sys-kernel/linux-firmware-99999999: fails to install - unknown command-line options
Summary: sys-kernel/linux-firmware-99999999: fails to install - unknown command-line o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-18 12:34 UTC by Jerome C
Modified: 2025-04-11 17:15 UTC (History)
3 users (show)

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


Attachments
build.log (build.log,5.18 KB, text/x-log)
2025-03-18 12:34 UTC, Jerome C
Details
emerge --info (emerge_info.txt,8.58 KB, text/plain)
2025-03-18 12:35 UTC, Jerome C
Details
emerge -pqv (emerge_pqv.txt,170 bytes, text/plain)
2025-03-18 12:35 UTC, Jerome C
Details
environment (environment,148.07 KB, text/plain)
2025-03-18 12:36 UTC, Jerome C
Details
saved_config_file (saved_config_file,776 bytes, text/plain)
2025-03-18 12:36 UTC, Jerome C
Details
Patch file that moves option "--firmware-list" above option "-*)" (linux-firmware-copy-firmware-r9-maybe.patch,2.26 KB, patch)
2025-03-19 07:04 UTC, Jerome C
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome C 2025-03-18 12:34:55 UTC
Created attachment 921075 [details]
build.log

From commit

https://web.git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=588505068c48fe07b1cfa32c5f3acd4395ec9482

it fails src_install due to unknown command line options
Comment 1 Jerome C 2025-03-18 12:35:28 UTC
Created attachment 921076 [details]
emerge --info

emerge --info
Comment 2 Jerome C 2025-03-18 12:35:43 UTC
Created attachment 921077 [details]
emerge -pqv

emerge -pqv
Comment 3 Jerome C 2025-03-18 12:36:00 UTC
Created attachment 921078 [details]
environment

environment
Comment 4 Jerome C 2025-03-18 12:36:21 UTC
Created attachment 921079 [details]
saved_config_file

saved_config_file
Comment 5 Mike Pagano gentoo-dev 2025-03-18 17:17:37 UTC
This error does not make sense a the r8 patch applies that command line option to copyfirmware.sh

Full build log please



--- a/copy-firmware.sh
+++ b/copy-firmware.sh
@@ -66,6 +66,16 @@
             shift
             ;;

+        --firmware-list)
+            if [ -n "$2" ]; then
+                FIRMWARE_LIST=$2
+                shift 2
+            else
+                echo "ERROR: '--firmware-list' requires a non-empty option argument of firmware files to install"
+                exit 1
+            fi
+            ;;
+
         *)
             if test -n "$destdir"; then
                 err "unknown command-line options: $*"

<SNIP>
Comment 6 Jerome C 2025-03-19 02:11:14 UTC
Hi, sorry for long response and yeah it's strange

Looking at "/var/tmp/portage/sys-kernel/linux-firmware-99999999/work/linux-firmware-99999999/copy-firmware.sh" and I can clearly see r8 is applied...

After what you said, I looked at my output again ( attached build.log in first post and this is before attempting to apply that patch )

There is this one line

WARNING: ignoring option --firmware-list

and in the r8 patch, the following code is applied before --firmware-list option


-*)
            # Ignore anything else that begins with - because that confuses
            # the "test" command below
            warn "ignoring option $1"
            shift
            ;;

so I did the following ( not sure how to do it better, just woke up and I'm being simple minded at the moment )

################

cd /var/db/repos/gentoo/sys-kernel/linux-firmware

ebuild linux-firmware-99999999.ebuild clean prepare configure compile

cd /var/tmp/portage/sys-kernel/linux-firmware-99999999/work/linux-firmware-99999999

# inside this file I changed the order so that --firmware-list is both above options "*)" and "-*)"
vim copy-firmware.sh

cd /var/db/repos/gentoo/sys-kernel/linux-firmware

ebuild linux-firmware-99999999.ebuild install

################

and it works

so my guess is bash is processing that before it get's to the --firmware-list option ( option order matters )?
Comment 7 Jerome C 2025-03-19 07:04:58 UTC
Created attachment 921219 [details, diff]
Patch file that moves option "--firmware-list" above option "-*)"

This is a "git diff" patch from linux-firmware repository after apply r8.

It's the same as r8 except it simply moves the option "--firmware-list" above option "-*)"

and src_install works.

was sleep earlier, patch should be easier to work with
Comment 8 Jerome C 2025-03-19 11:30:15 UTC
I forgot to add, the reason why it's failing is because of linux-firmware repository commit

https://web.git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=142c0a71434fa86d41d36f4b6e4cbba43c29b631

The r8 patch is adding "--firmware-list" after the addition of "-*)", hence the removal of the "--firmware-list" option, in turn the next option would be a path to one of the firmware files which is caught by "*)", hence, unknown option
Comment 9 Mike Pagano gentoo-dev 2025-03-19 16:23:15 UTC
Thanks for the details
Comment 10 Larry the Git Cow gentoo-dev 2025-03-19 17:20:12 UTC
The bug has been closed via the following commit(s):

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

commit d8b8a0b6dec519691238ff1e48880feda410bb01
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2025-03-19 17:18:37 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2025-03-19 17:18:37 +0000

    sys-kernel/linux-firmware: copy-firmware patch fix, thanks to Jerome C
    
    Closes: https://bugs.gentoo.org/951538
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../files/linux-firmware-copy-firmware-r9.patch    | 57 ++++++++++++++++++++++
 .../linux-firmware/linux-firmware-99999999.ebuild  |  2 +-
 2 files changed, 58 insertions(+), 1 deletion(-)