Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 886788 Details for
Bug 922663
sys-kernel/genkernel-4.3.10 modinfo error
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix modinfo error patch
Fix-modinfo-error.patch (text/plain), 6.51 KB, created by
Dmitriy Baranov
on 2024-03-06 09:13:17 UTC
(
hide
)
Description:
Fix modinfo error patch
Filename:
MIME Type:
Creator:
Dmitriy Baranov
Created:
2024-03-06 09:13:17 UTC
Size:
6.51 KB
patch
obsolete
>From 1f673cd3ea08b898f71da561c08a07be81c26443 Mon Sep 17 00:00:00 2001 >From: Dmitriy Baranov <reagentoo@gmail.com> >Date: Tue, 5 Mar 2024 17:24:09 +0300 >Subject: [PATCH] gen_moddeps.sh: always include firmware for built-in modules > with ALLFIRMWARE="no" > >These do not occur in the "modules.dep" file so they won't be caught by the >dependency scanning loop in gen_dep_list() - they need to be manually added >to the module list. > >Closes: #54 >Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> > >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> > >gen_initramfs.sh: copy compressed firmwares > >Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> > >gen_initramfs.sh: unpack compressed modules/firmwares to reduce image size > >Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> > >gen_initramfs.sh: fix gen_die message in append_modules() > >Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> > >gen_configkernel.sh: add priority kernel config in determine_kernel_config_file() > >This is useful for building an image with sys-kernel/gentoo-kernel. > >Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> >--- > gen_configkernel.sh | 1 + > gen_funcs.sh | 34 ++++++++++++++++++++++++++++++++++ > gen_initramfs.sh | 22 +++++++++++++++++++--- > gen_moddeps.sh | 36 ++++++++++++++---------------------- > 4 files changed, 68 insertions(+), 25 deletions(-) > >diff --git a/gen_configkernel.sh b/gen_configkernel.sh >index 17f9eaf..40f7eeb 100755 >--- a/gen_configkernel.sh >+++ b/gen_configkernel.sh >@@ -25,6 +25,7 @@ determine_kernel_config_file() { > local -a kconfig_candidates > > local -a gk_kconfig_candidates >+ gk_kconfig_candidates+=( "${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}/source/.config" ) > gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${KV}" ) > gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/kernel-config-${VER}.${PAT}" ) > gk_kconfig_candidates+=( "${GK_SHARE}/arch/${ARCH}/generated-config" ) >diff --git a/gen_funcs.sh b/gen_funcs.sh >index c31e15a..dacd95d 100755 >--- a/gen_funcs.sh >+++ b/gen_funcs.sh >@@ -2054,6 +2054,40 @@ expand_file() { > echo "${expanded_file}" > } > >+find_and_upack() { >+ local flist >+ >+ local fmt >+ for fmt in "$@" >+ do >+ case "${fmt}" in >+ "gz"|"xz"|"zstd") >+ flist=( $(find -type f -name "*.${fmt}") ) >+ ;; >+ *) >+ gen_die "unknown compression format: ${fmt}" >+ ;; >+ esac >+ >+ if [ ${#flist[@]} -lt 1 ] >+ then >+ continue >+ fi >+ >+ case "${fmt}" in >+ "gz") >+ gunzip "${flist[@]}" >+ ;; >+ "xz") >+ unxz "${flist[@]}" >+ ;; >+ "zstd") >+ unzstd "${flist[@]}" >+ ;; >+ esac >+ done >+} >+ > find_kernel_binary() { > local kernel_binary=${*} > local kernel_binary_found= >diff --git a/gen_initramfs.sh b/gen_initramfs.sh >index 2cfa0fd..c087d67 100755 >--- a/gen_initramfs.sh >+++ b/gen_initramfs.sh >@@ -1773,6 +1773,7 @@ append_firmware() { > fwlist=( "${FIRMWARE_FILES[@]}" ) > else > local myfw= >+ local -a myfw_f=() > while IFS= read -r -u 3 myfw > do > if [ -z "${myfw}" ] >@@ -1780,13 +1781,20 @@ append_firmware() { > gen_die "modinfo error!" > fi > >- if [ ! -f "${FIRMWARE_DIR}/${myfw}" ] >+ myfw_f=( $(compgen -G "${FIRMWARE_DIR}/${myfw}*") ) >+ >+ if [ ${#myfw_f[@]} -gt 1 ] >+ then >+ gen_die "excessive number of firmwares!" >+ fi >+ >+ if [ ${#myfw_f[@]} -lt 1 ] > then > print_warning 3 "$(get_indent 3) - ${myfw} is missing; Ignoring ..." > continue > fi > >- fwlist+=( "${myfw}" ) >+ fwlist+=( "${myfw_f#${FIRMWARE_DIR}/}" ) > done 3< <( ( > modinfo -b "${KERNEL_MODULES_PREFIX%/}" -k "${KV}" -F firmware $(mod_dep_list) 2>/dev/null || echo > ) | sort | uniq ) >@@ -1798,6 +1806,10 @@ append_firmware() { > cp -rL --parents --target-directory="${TDIR}/lib/firmware" "${fwlist[@]}" 2>/dev/null \ > || gen_die "Failed to copy firmware files to '${TDIR}/lib/firmware'!" > popd &>/dev/null || gen_die "Failed to chdir!" >+ >+ pushd "${TDIR}/lib/firmware" &>/dev/null || gen_die "Failed to chdir to '${TDIR}/lib/firmware'!" >+ find_and_upack xz zstd >+ popd &>/dev/null || gen_die "Failed to chdir!" > fi > > cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" >@@ -1911,7 +1923,7 @@ append_modules() { > > if [ ! -f "${mymod}" ] > then >- gen_die "Module '${i}${KEXT}' is missing!" >+ gen_die "Module '${mymod}' is missing!" > fi > > modlist+=( "${mymod/#${modules_srcdir}\//}" ) >@@ -1932,6 +1944,10 @@ append_modules() { > cp -ax --parents --target-directory "${modules_dstdir}" modules* 2>/dev/null \ > || gen_die "Failed to copy '${modules_srcdir}/modules*' to '${modules_dstdir}'!" > >+ pushd "${modules_dstdir}" &>/dev/null || gen_die "Failed to chdir to '${modules_dstdir}'!" >+ find_and_upack gz xz zstd >+ popd &>/dev/null || gen_die "Failed to chdir!" >+ > print_info 2 "$(get_indent 2)modules: Updating modules.dep ..." > local depmod_cmd=( depmod -a -b "${TDIR}" ${KV} ) > print_info 3 "COMMAND: ${depmod_cmd[*]}" 1 0 1 >diff --git a/gen_moddeps.sh b/gen_moddeps.sh >index 070131c..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,16 +50,18 @@ gen_dep_list() { > local -a rxargs=( "${modlist[@]}" ) > > rxargs=( "${rxargs[@]/#/-e\/}" ) >- rxargs=( "${rxargs[@]/%/${KEXT}:}" ) >- >- cat "${moddir}/modules.builtin" \ >- | xargs printf '%s:\n' \ >- | grep -F "${rxargs[@]}" >+ rxargs=( >+ "${rxargs[@]/%/.ko:}" >+ "${rxargs[@]/%/${KEXT}:}" >+ ) > > cat "${moddir}/modules.dep" \ > | grep -F "${rxargs[@]}" > ) >+ fi >+ >+ moddeplist=( ${moddeplist[@]##*/} ) >+ moddeplist=( ${moddeplist[@]%%.*} ) > >- printf '%s\n' "${moddeplist[@]}" >- fi | xbasename | sort | uniq >+ printf '%s\n' "${moddeplist[@]}" | sort | uniq > } >-- >2.44.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 922663
:
882858
|
882859
|
882863
|
882904
|
882910
|
883090
|
883135
|
883198
|
883199
| 886788