summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hooks/memdisk11
-rw-r--r--install/memdisk19
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
+}