summaryrefslogtreecommitdiff
path: root/packages/initscripts/initscripts-1.0/ramdisk
diff options
context:
space:
mode:
authorPaul Sokolovsky <pmiscml@gmail.com>2007-06-18 00:06:02 +0000
committerPaul Sokolovsky <pmiscml@gmail.com>2007-06-18 00:06:02 +0000
commitf83673e5d989c0259dbf615edaf64a4d6169b46c (patch)
tree452d9b9b5bb8da2037e36f2d6b7f980a0b421b5b /packages/initscripts/initscripts-1.0/ramdisk
parentf881476e2a4f25aa2cc819885950b05f3a0c6784 (diff)
initscripts 1.0: ramdisk: Don't bother to screw up randomly found mtdram partition.
* In the sense, that at least try to make sure it's not completely mad. Though likely, scripts liek this should not be installed by default at all.
Diffstat (limited to 'packages/initscripts/initscripts-1.0/ramdisk')
-rwxr-xr-xpackages/initscripts/initscripts-1.0/ramdisk3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-1.0/ramdisk b/packages/initscripts/initscripts-1.0/ramdisk
index 03ac9bd05b..4dfe53cf61 100755
--- a/packages/initscripts/initscripts-1.0/ramdisk
+++ b/packages/initscripts/initscripts-1.0/ramdisk
@@ -22,6 +22,9 @@ else
RAM_MTDBLK=/dev/mtdblock$RAM_MTD_NO
fi
+if grep -q $RAM_MTDBLK /etc/mtab; then echo "Device $RAM_MTDBLK already mounted"; exit 0; fi
+if test ! -e $RAM_MTD; then echo >&2 "Mtdram device $RAM_MTD does not exist!"; exit 1; fi
+
RAM_MNTPT=/mnt/ram
RAM_MTD_SIZE_HEX=`cat /proc/mtd | grep mtdram | tail -n 1 | cut -d" " -f 2`
RAM_MTD_SIZE=`dc 0x$RAM_MTD_SIZE_HEX 1024 / p`