diff options
author | Dave Reisner <dreisner@archlinux.org> | 2013-04-23 23:10:53 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2013-04-24 16:25:25 +0200 |
commit | 963e7432c089c6067ecaade146f1a243370100e9 (patch) | |
tree | 581720ff086cb3babd2b134f5ff26859b5942413 /hooks/memdisk | |
parent | 1a09a8632481ca5ee184ecb379476d2fdcd82fdd (diff) | |
download | mkinitcpio-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/memdisk | 15 |
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: |