aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Baranov <reagentoo@gmail.com>2024-03-05 17:24:09 +0300
committerBen Kohler <bkohler@gentoo.org>2024-05-20 07:58:59 -0500
commit56c89013f80111143170e62c91dddd55184d6cdb (patch)
treec57403fc9053844e218c249ef9046ae63a6b8528
parentgen_moddeps.sh: always include firmware for built-in modules with ALLFIRMWARE... (diff)
downloadgenkernel-56c89013f80111143170e62c91dddd55184d6cdb.tar.gz
genkernel-56c89013f80111143170e62c91dddd55184d6cdb.tar.bz2
genkernel-56c89013f80111143170e62c91dddd55184d6cdb.zip
gen_moddeps.sh: use KEXT along with default '.ko' extension to prevent modinfo error
Also improved gen_dep_list() and get rid xbasename() Bug: https://bugs.gentoo.org/922663 Closes: #57 Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> Signed-off-by: Ben Kohler <bkohler@gentoo.org>
-rwxr-xr-xgen_moddeps.sh33
1 files changed, 13 insertions, 20 deletions
diff --git a/gen_moddeps.sh b/gen_moddeps.sh
index 7e2e070..ff264f4 100755
--- a/gen_moddeps.sh
+++ b/gen_moddeps.sh
@@ -10,27 +10,17 @@ mod_dep_list() {
cat "${TEMP}/moddeps"
}
-xbasename() {
- local -a moddeplist=( $( </dev/stdin ) )
-
- if (( ${#moddeplist[@]} > 0 ))
- then
- # prepend slash to each moddeplist element
- # to avoid passing elements as basename options
- basename -s "${KEXT}" "${moddeplist[@]/#/\/}"
- fi
-}
-
gen_dep_list() {
+ local -a modlist=() moddeplist=()
local moddir="${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}"
+ # Always include firmware for built-in modules
+ moddeplist=( $(cat "${moddir}/modules.builtin") )
+
if isTrue "${ALLRAMDISKMODULES}"
then
- cat "${moddir}/modules.builtin"
- cat "${moddir}/modules.dep" | cut -d':' -f1
+ moddeplist+=( $(cat "${moddir}/modules.dep" | cut -d':' -f1) )
else
- local -a modlist=() moddeplist=()
-
local mygroups
for mygroups in ${!MODULES_*} GK_INITRAMFS_ADDITIONAL_KMODULES
do
@@ -60,15 +50,18 @@ gen_dep_list() {
local -a rxargs=( "${modlist[@]}" )
rxargs=( "${rxargs[@]/#/-e\/}" )
- rxargs=( "${rxargs[@]/%/${KEXT}:}" )
+ rxargs=(
+ "${rxargs[@]/%/.ko:}"
+ "${rxargs[@]/%/${KEXT}:}"
+ )
cat "${moddir}/modules.dep" \
| grep -F "${rxargs[@]}"
)
+ fi
- # Always include firmware for built-in modules
- cat "${moddir}/modules.builtin"
+ moddeplist=( ${moddeplist[@]##*/} )
+ moddeplist=( ${moddeplist[@]%%.*} )
- printf '%s\n' "${moddeplist[@]}"
- fi | xbasename | sort | uniq
+ printf '%s\n' "${moddeplist[@]}" | sort | uniq
}