summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/udev/migrate-udev
blob: a7a24c952e514d7af216dd5949acd85e833f279a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

# This script will create static system-critical device nodes in your /dev
# tree so the initscripts can get by without devfs/udev long enough to start
# up devfs/udev.

STARTDIR=`pwd`
TMPDIR=`mktemp -d`
ROOT=/
[ "$1" != "" ] && ROOT=$1

mount --bind $ROOT $TMPDIR
cd $TMPDIR

echo -n "creating device nodes: "
rm -f dev/console
rm -f dev/null
rm -f dev/zero
mknod dev/console c 5 1
echo -n "console "
mknod -m 666 dev/null c 1 3
echo -n "null "
mknod -m 666 dev/zero c 1 5 
echo -n "zero "
echo

cd $STARTDIR
umount $TMPDIR
rm -rf $TMPDIR