aboutsummaryrefslogtreecommitdiffstats
path: root/setup-alpine.in
diff options
context:
space:
mode:
Diffstat (limited to 'setup-alpine.in')
-rwxr-xr-xsetup-alpine.in55
1 files changed, 44 insertions, 11 deletions
diff --git a/setup-alpine.in b/setup-alpine.in
index 1de6ee8..ce9b138 100755
--- a/setup-alpine.in
+++ b/setup-alpine.in
@@ -51,16 +51,44 @@ fi
if [ "$CREATEANSWERFILE" != "" ]; then
touch "$CREATEANSWERFILE" || echo "Cannot touch file $CREATEANSWERFILE"
cat <<__EOF__ > "$CREATEANSWERFILE"
-KEYMAPOPTS=""
-HOSTNAMEOPTS=""
-INTERFACESOPTS=""
-DNSOPTS=""
-TIMEZONEOPTS=""
-APKREPOSOPTS=""
-SSHDOPTS=""
-NTPOPTS=""
-DISKOPTS=""
-APKLBUOPTS=""
+# Example answer file for setup-alpine script
+# If you don't want to use a certain option, then comment it out
+
+# Use US layout with US variant
+KEYMAPOPTS="us us"
+
+# Set hostname to alpine-test
+HOSTNAMEOPTS="-n alpine-test"
+
+# Contents of /etc/network/interfaces
+INTERFACESOPTS="auto lo
+iface lo inet loopback
+
+auto eth0
+iface eth0 inet dhcp
+ hostname alpine-test
+"
+
+# Search domain of example.com, Google public nameserver
+DNSOPTS="-d example.com -n 8.8.8.8"
+
+# Set timezone to UTC
+TIMEZONEOPTS="-z UTC"
+
+# Add a random mirror
+APKREPOSOPTS="-r"
+
+# Install Openssh
+SSHDOPTS="-c openssh"
+
+# Use openntpd
+NTPOPTS="-c openntpd"
+
+# Use /dev/sda as a data disk
+DISKOPTS="-m data /dev/sda"
+
+# Setup in /media/sdb1
+APKLBUOPTS="-m sdb1"
__EOF__
echo "Answer file $CREATEANSWERFILE has been created. Please add or remove options as desired in that file"
exit 0
@@ -75,7 +103,12 @@ fi
$PREFIX/sbin/setup-keymap ${KEYMAPOPTS}
$PREFIX/sbin/setup-hostname ${HOSTNAMEOPTS}
-$PREFIX/sbin/setup-interfaces ${INTERFACEOPTS}
+
+if [ -n "$INTERFACESOPTS" ]; then
+ printf "$INTERFACESOPTS" | $PREFIX/sbin/setup-interfaces -i
+else
+ $PREFIX/sbin/setup-interfaces
+fi
# setup up dns if no dhcp was configured
grep '^iface.*dhcp' $ROOT/etc/network/interfaces > /dev/null ||\