summaryrefslogtreecommitdiffstats
path: root/projectroot/etc/init.d/rc-once
blob: bf8473149cc21ac734a738da0f00138e32659f27 (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
30
31
32
33
34
35
36
#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

. /lib/init/initmethod-bbinit-functions.sh
. /usr/lib/init/rc-once.sh

do_start() {
	test -e "$STAMP" && return

	mount_root_rw || exit 1

	run_rc_once && : > "$STAMP"

	if ! mount_root_restore; then
		# remounting rw/ro during the second boot will flush anything
		# left in the filesystem journal
		rm "$STAMP"
		reboot
		sleep 100
	fi
}

case "$1" in

	start)
		do_start >&2
		;;
	*)
		echo "Usage: $0 {start}" >&2
		exit 1
		;;
esac

exit 0