[go: up one dir, main page]

File: linuxrc

package info (click to toggle)
initrd-tools 0.1.32woody.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 96 kB
  • ctags: 10
  • sloc: sh: 591; makefile: 37
file content (29 lines) | stat: -rw-r--r-- 566 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
23
24
25
26
27
28
29
#!/bin/sh
#
# $Id: linuxrc,v 1.6 2002/10/11 10:12:12 herbert Exp $

export PATH=/sbin:/bin

. /linuxrc.conf

if [ $DELAY -gt 0 ]; then
	echo "Waiting for $DELAY seconds, press ENTER to obtain a shell."

	trap "timeout=yes" USR1
	timeout=
	{ sleep $DELAY; kill -USR1 $$ 2> /dev/null; }&
	pid=$!
	read line
	trap "" USR1
	kill $pid
	wait

	[ $timeout ] || exec sh
fi

mount -nt proc proc proc
root=$(cat proc/sys/kernel/real-root-dev)
echo 256 > proc/sys/kernel/real-root-dev
umount -n proc
mount -nt tmpfs tmpfs tmp || mount -nt ramfs ramfs tmp
echo $root > tmp/root