File: init.sh

package info (click to toggle)
hatari 2.5.0%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 12,744 kB
  • sloc: ansic: 164,630; cpp: 8,685; python: 6,251; objc: 1,899; asm: 1,742; sh: 1,668; javascript: 146; makefile: 86; xml: 32
file content (32 lines) | stat: -rwxr-xr-x 803 bytes parent folder | download | duplicates (2)
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
30
31
32
#!/bin/sh
#
# NOTE: this expects kernel to be configured with:
#	CONFIG_DEVTMPFS_MOUNT=y
# so that /dev is automounted after root fs is mounted.
#
# Otherwise following is needed too:
#	mount -t devtmpfs udev /dev

# mount special file systems
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t tmpfs tmpfs /run
mount -t tmpfs tmpfs /tmp

mkdir /dev/pts
mount -t devpts devpts /dev/pts

if [ -x /usr/bin/busybox ]; then
	echo "Boot took $(cut -d' ' -f1 /proc/uptime) seconds"
	# hack for running shell so that job control is enabled, see:
	# https://git.busybox.net/busybox/plain/shell/cttyhack.c
	#
	# without -c (controlling terminal) option,
	# hangs *if* 030 caches are enabled
	setsid -c cttyhack sh
else
	# minimal klibc tools
	echo "uptime & idle seconds:"
	cat /proc/uptime
	exec sh
fi