summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-03 10:52:09 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-08-26 16:41:20 -0700
commitd2ecacf5a6d11c5b2af714e307300a0167fd5f8c (patch)
tree0d6c176852319d1caf8206e6d37fc9f51e288814
parent075fd4c2d29500b1537c477ed79dcc58a3f46147 (diff)
downloadinitramfs-tools-d2ecacf5a6d11c5b2af714e307300a0167fd5f8c.tar.gz
initramfs-tools-d2ecacf5a6d11c5b2af714e307300a0167fd5f8c.zip
Find firmware in /lib/firmware/<kernel-version>
Update hook-functions to search for kernel firmware based on version. This is copied from Ubuntu version of initramfs-tools. (cherry picked from commit 1236df3c797a0404f7050ed5201118e6fa4841e0)
-rw-r--r--hook-functions12
1 files changed, 9 insertions, 3 deletions
diff --git a/hook-functions b/hook-functions
index 90b2ca3..e86f5f2 100644
--- a/hook-functions
+++ b/hook-functions
@@ -62,13 +62,15 @@ manual_add_modules()
continue
fi
for firmware in $firmwares; do
- if [ -e "${DESTDIR}/lib/firmware/${firmware}" ]; then
+ if [ -e "${DESTDIR}/lib/firmware/${firmware}" ] \
+ || [ -e "${DESTDIR}/lib/firmware/${version}/${firmware}" ]; then
continue
fi
# Only print warning for missing fw of loaded module
# or forced loaded module
- if [ ! -e "/lib/firmware/${firmware}" ]; then
+ if [ ! -e "/lib/firmware/${firmware}" ] \
+ && [ ! -e "/lib/firmware/${version}/${firmware}" ]; then
if grep -q "^$(basename "${mam_x}" .ko)" \
/proc/modules \
|| grep -q "^$(basename "${mam_x}" .ko)" \
@@ -83,7 +85,11 @@ manual_add_modules()
copy_exec /lib/udev/firmware.agent
fi
- copy_exec "/lib/firmware/${firmware}"
+ if [ -e "/lib/firmware/${version}/${firmware}" ]; then
+ copy_exec "/lib/firmware/${version}/${firmware}"
+ else
+ copy_exec "/lib/firmware/${firmware}"
+ fi
if [ "${verbose}" = "y" ]; then
echo "Adding firmware ${firmware}"
fi