#! /bin/sh

# $Id: create_ramdisk 3036 2005-11-10 23:39:49Z lange $

# create a writeable area on the install client

mount -n -t proc proc /proc
# start devfsd if needed
if [ -c /dev/.devfsd ]; then
    /sbin/devfsd /dev
fi

# if we have shm use it as ramdisk
mount -t tmpfs tmpfs /tmp || {
    ramdevice=/dev/ram0
    mke2fs -q -m 0 $ramdevice && echo "ramdisk $ramdevice created"
    mount -n $ramdevice /tmp
}
mount --bind /tmp /dev/shm
# now create the required subdirectories
mkdir -p /tmp/etc /tmp/target /tmp/var/run/sshd /tmp/var/run/fai /tmp/var/state/discover /tmp/var/lib/discover /dev/shm/network
cd    /tmp/var && mkdir tmp log lock spool
