File: create_ramdisk

package info (click to toggle)
fai 2.8.4sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,284 kB
  • ctags: 176
  • sloc: sh: 3,362; perl: 1,591; makefile: 142
file content (22 lines) | stat: -rw-r--r-- 653 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /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