diff options
author | Thomas Bächler <thomas@archlinux.org> | 2010-06-23 00:18:06 +0200 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2010-06-23 00:18:06 +0200 |
commit | 1ef7f115459c49cb1d0669544d5af39930e315ea (patch) | |
tree | 65e1f30dc54429cbeb41ad5578d3542030a8986b | |
parent | be2270384ce03d7a17e2cf6a0ec0c5a1f861c1ff (diff) | |
download | mkinitcpio-1ef7f115459c49cb1d0669544d5af39930e315ea.tar.gz mkinitcpio-1ef7f115459c49cb1d0669544d5af39930e315ea.tar.xz |
Add memdisk hook
This hook creates a block device for virtual disks created
by memdisk (http://syslinux.zytor.com/wiki/index.php/MEMDISK).
-rw-r--r-- | hooks/memdisk | 11 | ||||
-rw-r--r-- | install/memdisk | 19 |
2 files changed, 30 insertions, 0 deletions
diff --git a/hooks/memdisk b/hooks/memdisk new file mode 100644 index 0000000..2c3642e --- /dev/null +++ b/hooks/memdisk @@ -0,0 +1,11 @@ +# vim:set ft=sh: +run_hook () +{ + MEMDISK=$(/usr/bin/memdiskfind) + if [ $? -eq 0 ]; then + # We found a memdisk, set up phram + /sbin/modprobe phram phram=memdisk,${MEMDISK} + # Load mtdblock, the memdisk will be /dev/mtdblock0 + /sbin/modprobe mtdblock + fi +} diff --git a/install/memdisk b/install/memdisk new file mode 100644 index 0000000..9c0ce16 --- /dev/null +++ b/install/memdisk @@ -0,0 +1,19 @@ +# vim:set ft=sh: + +install () +{ + MODULES="phram mtdblock" + BINARIES="/usr/bin/memdiskfind" + FILES="" + SCRIPT="memdisk" +} + +help () +{ +cat <<HELPEOF + This hook detects a virtual disk created by the memdisk + tool (http://syslinux.zytor.com/wiki/index.php/MEMDISK). + + It requires memdiskfind from syslinux 4.00 or newer. +HELPEOF +} |