summaryrefslogtreecommitdiffstats
path: root/hooks/memdisk
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-04-23 23:10:53 +0200
committerDave Reisner <dreisner@archlinux.org>2013-04-24 16:25:25 +0200
commit963e7432c089c6067ecaade146f1a243370100e9 (patch)
tree581720ff086cb3babd2b134f5ff26859b5942413 /hooks/memdisk
parent1a09a8632481ca5ee184ecb379476d2fdcd82fdd (diff)
downloadmkinitcpio-963e7432c089c6067ecaade146f1a243370100e9.tar.gz
mkinitcpio-963e7432c089c6067ecaade146f1a243370100e9.tar.xz
hooks/memdisk: scope variables, use newer syntax
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'hooks/memdisk')
-rw-r--r--hooks/memdisk15
1 files changed, 9 insertions, 6 deletions
diff --git a/hooks/memdisk b/hooks/memdisk
index e3ff345..62790b4 100644
--- a/hooks/memdisk
+++ b/hooks/memdisk
@@ -1,11 +1,14 @@
-# vim:set ft=sh:
-run_hook ()
-{
- MEMDISK=$(memdiskfind)
- if [ $? -eq 0 ]; then
+#!/usr/bin/ash
+
+run_hook() {
+ local disk
+
+ if disk=$(memdiskfind); then
# We found a memdisk, set up phram
- modprobe phram phram=memdisk,${MEMDISK}
+ modprobe phram phram="memdisk,$disk"
# Load mtdblock, the memdisk will be /dev/mtdblock0
modprobe mtdblock
fi
}
+
+# vim: set ft=sh ts=4 sw=4 et: