#! /bin/sh

# $Id: create_ramdisk,v 1.3 2004/07/01 20:22:39 lange Exp $

# 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
}
# now create the required subdirectories
mkdir -p /tmp/etc /tmp/target /tmp/var/run/sshd /tmp/var/state/discover
cd    /tmp/var && mkdir tmp log lock spool
