summaryrefslogtreecommitdiffstats
path: root/setup-alpine
blob: 95f7a1f8bd2eff459a0a10093dff0b6331bb2ff1 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

PROGRAM=setup-alpine
VERSION=0.1

PREFIX=
. $PREFIX/lib/libalpine.sh

while getopts "ah" opt ; do
	case $opt in
		a) ARCHIVE=yes;;
		h) usage;;
		*) usage;;
	esac
done
shift `expr $OPTIND - 1`

if [ "$ARCHIVE" ] ; then
	echo "Creating an Alpine overlay"
	init_tmpdir ROOT
else
	PKGADD=apk_add
fi

$PREFIX/sbin/setup-keymap
$PREFIX/sbin/setup-hostname
$PREFIX/sbin/setup-interfaces

# setup up dns if no dhcp was configured
grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\
	$PREFIX/sbin/setup-dns

# set root password
[ -z "$NOCOMMIT" ] && while ! passwd ; do echo "Please retry." ; done

# add some boot services
rc_add -s 01 hwclock
rc_add -s 04 modutils
rc_add -s 06 procps
rc_add -s 08 hostname

rc_add -s 20 keymap
rc_add -s 20 -k syslog
rc_add -s 22 bootmisc.sh
rc_add -s 24 -k networking

# start up the services
for i in hwclock modutils procps hostname syslog bootmisc.sh networking ; do
	/etc/init.d/$i start
done