Bug #1732 » 0005-md_size-can-now-contain-more-flexible-definitions-of.patch
etc/rc.d/diskless | ||
---|---|---|
# $1 = size
|
||
# $2 = mount point
|
||
mount_md() {
|
||
/sbin/mount_tmpfs -s `expr $1 '*' 512` tmpfs $2
|
||
/sbin/mount_tmpfs -s $1 tmpfs $2
|
||
}
|
||
# If there is a global system configuration file, suck it in.
|
||
... | ... | |
rmdir /var/.diskless
|
||
else
|
||
echo "+++ mount_md of /var"
|
||
mount_md ${varsize:=32768} /var
|
||
mount_md ${varsize:=16M} /var
|
||
fi
|
||
if [ ! -d /var/db ]; then
|
||
... | ... | |
echo "dropping into shell, ^D to continue anyway."
|
||
/bin/sh
|
||
else
|
||
mount_md ${tmpsize:=20480} /tmp
|
||
mount_md ${tmpsize:=10M} /tmp
|
||
chmod 01777 /tmp
|
||
fi
|
||
fi
|
etc/rc.d/initdiskless | ||
---|---|---|
# Create a generic memory disk
|
||
#
|
||
mount_md() {
|
||
/sbin/mount_tmpfs -s `expr $1 '*' 512` tmpfs $2
|
||
/sbin/mount_tmpfs -s $1 tmpfs $2
|
||
}
|
||
# Create the memory filesystem if it has not already been created
|
||
... | ... | |
if [ "x`eval echo \\$md_created_$1`" = "x" ]; then
|
||
if [ "x`eval echo \\$md_size_$1`" = "x" ]; then
|
||
if [ "$1" = "etc" ]; then
|
||
md_size=20480
|
||
md_size=12M
|
||
else
|
||
md_size=4096
|
||
md_size=2M
|
||
fi
|
||
else
|
||
md_size=`eval echo \\$md_size_$1`
|
||
# for backwards compatibility ... if it's a number, then it's the number of desired sectors and not bytes!
|
||
if [ "$md_size" = "${md_size%%[!0-9]*}" ]; then
|
||
md_size=`expr $md_size '*' 512`
|
||
fi
|
||
fi
|
||
mount_md $md_size /$1
|
||
/bin/chmod 755 /$1
|
- « Previous
- 1
- 2
- 3
- 4
- Next »