Commit 82002baf authored by Dermot Bradley's avatar Dermot Bradley Committed by Natanael Copa
Browse files ensure when run in chroot that correct kernel version is used

modinfo is called without the "-k version" argument and so when
running mkinitfs inside a chroot where the version of the kernel
package being installed differs from the version of the host
machine's kernel then modinfo is called (to check firmware
requirements) using the wrong kernel version.

Add the "-k" argument to ensure the correct kernel version is used.

NOTE: Busybox's modinfo does not support the "-k" option. Currently
Alpine is using modinfo from the kmod package, however obviously in
the future Busybox's version is to be used this this will break. It
appears the only solution in that scenario would be to add "-k"
support to Busybox's version.
parent 51954224
......@@ -140,7 +140,7 @@ initfs_firmware() {
# Verify if there are initfs modules
_modules=`find "$tmpdir"/lib/modules -type f -name "*.ko*" -print -quit`
[ -n "$_modules" ] || return 0
find "$tmpdir"/lib/modules -type f -name "*.ko*" | xargs modinfo -F firmware | sort -u | while read FW; do
find "$tmpdir"/lib/modules -type f -name "*.ko*" | xargs modinfo -k $kernel -F firmware | sort -u | while read FW; do
[ -e "${basedir}/lib/firmware/${FW}" ] && install -pD "${basedir}/lib/firmware/${FW}" "$tmpdir"/lib/firmware/$FW
return 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment