summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2007-09-09 12:36:49 +0200
committermaximilian attems <max@stro.at>2007-09-09 12:36:49 +0200
commitadeba36e5baeefa704eaa18fa6a1edb2acfc1783 (patch)
tree3e041cbe99fad1ba981e377191884d8a6df04401 /hook-functions
parent475b09a738d329624e34e5f82e01ebaf3c16a708 (diff)
downloadinitramfs-tools-adeba36e5baeefa704eaa18fa6a1edb2acfc1783.tar.gz
initramfs-tools-adeba36e5baeefa704eaa18fa6a1edb2acfc1783.zip
hook-functions: protect sys_walk_modalias()
check that the modalias really exists, otherwise no need to add anything.
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions4
1 files changed, 3 insertions, 1 deletions
diff --git a/hook-functions b/hook-functions
index 9becfe2..55fb342 100644
--- a/hook-functions
+++ b/hook-functions
@@ -207,7 +207,9 @@ sys_walk_modalias()
device_path="$(dirname "${1}")"
device_path="$(dirname "${device_path}")"
- modalias=$(cat "${device_path}/modalias")
+ if [ -e "${device_path}/modalias" ]; then
+ modalias=$(cat "${device_path}/modalias")
+ fi
if [ -n "${modalias}" ]; then
force_load "${modalias}"