File: init.sh

package info (click to toggle)
hatari 2.4.1%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 13,840 kB
  • sloc: ansic: 161,233; python: 5,787; objc: 1,900; asm: 1,679; sh: 1,629; javascript: 145; makefile: 86; xml: 32
file content (32 lines) | stat: -rwxr-xr-x 818 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 /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 option, dies to illegal instruction
	# and BAD KERNEL TRAP *if* 030 caches are enabled
	setsid -c cttyhack sh
else
	# minimal klibc tools
	echo "uptime & idle seconds:"
	cat /proc/uptime
	exec sh
fi