2005-08-24 09:33:13 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2005-09-13 00:07:10 +02:00
|
|
|
# CD boottime initializations.
|
2006-04-04 13:52:57 +02:00
|
|
|
|
2015-09-14 21:46:48 +02:00
|
|
|
echo -n "Creating ramdisks:"
|
|
|
|
|
|
|
|
# Set up a ramdisk to make a read-only part of the directory tree writable
|
|
|
|
# $1 : ramdisk dev node to use
|
|
|
|
# $2 : path to make writeable
|
|
|
|
# $3 : ramdisk size in blocks
|
|
|
|
create_ramdisk()
|
|
|
|
{
|
|
|
|
echo -n " $2"
|
|
|
|
ramdisk $3 /dev/$1 > /dev/null
|
|
|
|
mkfs.mfs /dev/$1 > /dev/null
|
|
|
|
|
|
|
|
# copy files
|
|
|
|
mount /dev/$1 /mnt > /dev/null
|
|
|
|
(cd $2 && pax -rw . /mnt)
|
|
|
|
|
|
|
|
umount /mnt > /dev/null
|
|
|
|
mount /dev/$1 $2 > /dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
# Create /var ramdisk
|
|
|
|
create_ramdisk ram0 /var 256
|
|
|
|
create_ramdisk ram1 /tmp 128
|
|
|
|
create_ramdisk ram2 /usr/run 64
|
|
|
|
create_ramdisk ram3 /root 512
|
|
|
|
|
|
|
|
echo
|