summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2010-04-08 08:47:52 +0200
committermaximilian attems <maks@debian.org>2010-04-08 08:49:58 +0200
commit7a26a4d17fe230055966ab8e1e5476e35fe9791a (patch)
tree80b337a5265e2ef392754c594ecc8dbdb13bd4d2 /hook-functions
parenta46c26e0a01a83f41d7e491f1f1a747d5f000c85 (diff)
downloadinitramfs-tools-7a26a4d17fe230055966ab8e1e5476e35fe9791a.tar.gz
initramfs-tools-7a26a4d17fe230055966ab8e1e5476e35fe9791a.zip
hook-functions: manual_add_modules simplify
use meaningful variable s/mam_x/kmod/ loop directly on the modinfo output. Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions26
1 files changed, 11 insertions, 15 deletions
diff --git a/hook-functions b/hook-functions
index 76cbba9..3ba08c5 100644
--- a/hook-functions
+++ b/hook-functions
@@ -42,27 +42,23 @@ add_modules_from_file()
# Add dependent modules + eventual firmware
manual_add_modules()
{
- local mam_x firmwares firmware
+ local kmod firmware
- for mam_x in $(modprobe --set-version="${version}" --ignore-install \
+ for kmod in $(modprobe --set-version="${version}" --ignore-install \
--quiet --show-depends "${1}" | awk '/^insmod/ { print $2 }'); do
# Prune duplicates
- if [ -e "${DESTDIR}/${mam_x}" ]; then
+ if [ -e "${DESTDIR}/${kmod}" ]; then
continue
fi
- mkdir -p "${DESTDIR}/$(dirname "${mam_x}")"
- ln -s "${mam_x}" "${DESTDIR}/$(dirname "${mam_x}")"
+ mkdir -p "${DESTDIR}/$(dirname "${kmod}")"
+ ln -s "${kmod}" "${DESTDIR}/$(dirname "${kmod}")"
if [ "${verbose}" = "y" ]; then
- echo "Adding module ${mam_x}"
+ echo "Adding module ${kmod}"
fi
- # Add firmware files if necessary
- firmwares=$(modinfo -F firmware "${mam_x}")
- if [ -z "${firmwares}" ]; then
- continue
- fi
- for firmware in $firmwares; do
+ # Add required firmware
+ for firmware in $(modinfo -F firmware "${kmod}"); do
if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \
|| [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then
continue
@@ -78,11 +74,11 @@ manual_add_modules()
continue
fi
- if grep -q "^$(basename "${mam_x}" .ko)[[:space:]]" \
+ if grep -q "^$(basename "${kmod}" .ko)[[:space:]]" \
/proc/modules \
- || grep -q "^$(basename "${mam_x}" .ko)" \
+ || grep -q "^$(basename "${kmod}" .ko)" \
"${CONFDIR}/modules"; then
- echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${mam_x} .ko)" >&2
+ echo "W: Possible missing firmware /lib/firmware/${firmware} for module $(basename ${kmod} .ko)" >&2
fi
continue
fi