1 |
commit: c9855842ac422b8d3a6e7265b6a3c00efe3891e7 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 12 13:48:30 2016 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 12 13:48:30 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=c9855842 |
7 |
|
8 |
FIRMWARE_INSTALL control option. |
9 |
|
10 |
Prefer sys-kernel/linux-firmware to be installed and used rather than |
11 |
always running firmware_install and overwriting the root copy. |
12 |
|
13 |
Defaults to FIRMWARE_INSTALL=no, with ebuild updated to RDEPEND on |
14 |
sys-kernel/linux-firmware, via IUSE='+firmware' |
15 |
|
16 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
17 |
|
18 |
doc/genkernel.8.txt | 4 ++++ |
19 |
gen_cmdline.sh | 6 ++++++ |
20 |
gen_compile.sh | 20 ++++++++++++-------- |
21 |
gen_determineargs.sh | 1 + |
22 |
genkernel.conf | 4 ++++ |
23 |
5 files changed, 27 insertions(+), 8 deletions(-) |
24 |
|
25 |
diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt |
26 |
index bab1034..071eecc 100644 |
27 |
--- a/doc/genkernel.8.txt |
28 |
+++ b/doc/genkernel.8.txt |
29 |
@@ -384,6 +384,10 @@ OUTPUT SETTINGS |
30 |
Specifies specific firmware files to copy. This overrides *--firmware-dir*. |
31 |
For multiple files, separate the filenames with a comma. |
32 |
|
33 |
+*--*[*no-*]*firmware-install*:: |
34 |
+ Enable or disables installation of firmware onto root filesystem. |
35 |
+ Installing sys-kernel/linux-firmware should be preferred instead. |
36 |
+ |
37 |
*--*[*no-*]*integrated-initramfs*:: |
38 |
Builds or does not build the generated initramfs into the kernel instead |
39 |
of keeping it as a separate file. |
40 |
|
41 |
diff --git a/gen_cmdline.sh b/gen_cmdline.sh |
42 |
index 94ff68c..e9f323c 100755 |
43 |
--- a/gen_cmdline.sh |
44 |
+++ b/gen_cmdline.sh |
45 |
@@ -160,6 +160,8 @@ longusage() { |
46 |
echo " Specifies specific firmware files to copy. This" |
47 |
echo " overrides --firmware-dir. For multiple files," |
48 |
echo " separate the filenames with a comma" |
49 |
+ echo " --firmware-install" |
50 |
+ echo " Enable installation firmware onto root filesystem." |
51 |
echo " --integrated-initramfs, --no-integrated-initramfs" |
52 |
echo " Include/exclude the generated initramfs in the kernel" |
53 |
echo " instead of keeping it as a separate file" |
54 |
@@ -600,6 +602,10 @@ parse_cmdline() { |
55 |
CMD_FIRMWARE=1 |
56 |
print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}" |
57 |
;; |
58 |
+ --firmware-install|--no-firmware-install) |
59 |
+ CMD_FIRMWARE_INSTALL=`parse_optbool "$*"` |
60 |
+ print_info 2 "CMD_FIRMWARE_INSTALL: ${CMD_FIRMWARE_INSTALL}" |
61 |
+ ;; |
62 |
--integrated-initramfs|--no-integrated-initramfs) |
63 |
CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"` |
64 |
print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}" |
65 |
|
66 |
diff --git a/gen_compile.sh b/gen_compile.sh |
67 |
index 0bb1399..3a77a75 100755 |
68 |
--- a/gen_compile.sh |
69 |
+++ b/gen_compile.sh |
70 |
@@ -333,15 +333,19 @@ compile_kernel() { |
71 |
compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel |
72 |
fi |
73 |
|
74 |
- local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config` |
75 |
- if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ] |
76 |
- then |
77 |
- print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..." |
78 |
- [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH |
79 |
- [ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH |
80 |
- MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel |
81 |
+ if isTrue "${FIRMWARE_INSTALL}" ; then |
82 |
+ local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${KERNEL_OUTPUTDIR}"/.config` |
83 |
+ if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" != CONFIG_FIRMWARE_IN_KERNEL=y ] |
84 |
+ then |
85 |
+ print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..." |
86 |
+ [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH |
87 |
+ [ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH |
88 |
+ MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel |
89 |
+ else |
90 |
+ print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." |
91 |
+ fi |
92 |
else |
93 |
- print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." |
94 |
+ print_info 1 " >> Not installing firmware as requested by configuration FIRMWARE_INSTALL=no..." |
95 |
fi |
96 |
|
97 |
local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}}) |
98 |
|
99 |
diff --git a/gen_determineargs.sh b/gen_determineargs.sh |
100 |
index 522996d..5402b45 100755 |
101 |
--- a/gen_determineargs.sh |
102 |
+++ b/gen_determineargs.sh |
103 |
@@ -132,6 +132,7 @@ determine_real_args() { |
104 |
set_config_with_override BOOL FIRMWARE CMD_FIRMWARE |
105 |
set_config_with_override STRING FIRMWARE_DIR CMD_FIRMWARE_DIR "/lib/firmware" |
106 |
set_config_with_override STRING FIRMWARE_FILES CMD_FIRMWARE_FILES |
107 |
+ set_config_with_override BOOL FIRMWARE_INSTALL CMD_FIRMWARE_INSTALL "no" |
108 |
set_config_with_override BOOL INTEGRATED_INITRAMFS CMD_INTEGRATED_INITRAMFS |
109 |
set_config_with_override BOOL WRAP_INITRD CMD_WRAP_INITRD |
110 |
set_config_with_override BOOL GENZIMAGE CMD_GENZIMAGE |
111 |
|
112 |
diff --git a/genkernel.conf b/genkernel.conf |
113 |
index 6b974e1..e62d294 100644 |
114 |
--- a/genkernel.conf |
115 |
+++ b/genkernel.conf |
116 |
@@ -102,6 +102,10 @@ USECOLOR="yes" |
117 |
# Add BTRFS support. |
118 |
#BTRFS="no" |
119 |
|
120 |
+# Install firmware onto root filesystem |
121 |
+# Will conflict with sys-kernel/linux-firmware package |
122 |
+#FIRMWARE_INSTALL="no" |
123 |
+ |
124 |
# Enable copying of firmware into initramfs |
125 |
#FIRMWARE="no" |
126 |
# Specify directory to pull from |