Autogenerating preseed example file from debconf files.
authorDaniel Baumann <mail@daniel-baumann.ch>
Tue, 28 May 2013 12:22:27 +0000 (14:22 +0200)
committerDaniel Baumann <mail@daniel-baumann.ch>
Tue, 28 May 2013 12:31:39 +0000 (14:31 +0200)
examples/preseed.cfg
examples/preseed.sh [new file with mode: 0755]

index 0a7427e..43618b5 100644 (file)
@@ -1,4 +1,4 @@
-## live-debconfig (4.0~a19-1)
+# live-debconfig (4.0~a22-1)
 
 live-debconfig live-debconfig/scripts multiselect 
 
@@ -6,19 +6,34 @@ live-debconfig live-debconfig/scripts multiselect
 live-debconfig live-debconfig/passwd/shadow boolean 
 live-debconfig live-debconfig/passwd/root-password password 
 live-debconfig live-debconfig/passwd/root-password-again password 
-live-debconfig live-debconfig/passwd/root-password-crypted string 
+live-debconfig live-debconfig/passwd/root-password-crypted password 
+live-debconfig live-debconfig/passwd/root-key-local string 
+#live-debconfig live-debconfig/passwd/root-key${_KEYS}-local 
 live-debconfig live-debconfig/passwd/user-name string 
 live-debconfig live-debconfig/passwd/user-fullname string 
 live-debconfig live-debconfig/passwd/user-password password 
 live-debconfig live-debconfig/passwd/user-password-again password 
-live-debconfig live-debconfig/passwd/user-password-crypted string 
+live-debconfig live-debconfig/passwd/user-password-crypted password 
+live-debconfig live-debconfig/passwd/user-key-local string 
+#live-debconfig live-debconfig/passwd/user-key${_KEYS}-local 
 live-debconfig live-debconfig/passwd/user-home string 
 live-debconfig live-debconfig/passwd/user-uid string 
 live-debconfig live-debconfig/passwd/user-gid string 
 live-debconfig live-debconfig/passwd/user-default-groups string 
 live-debconfig live-debconfig/passwd/user-login-shell string 
 live-debconfig live-debconfig/passwd/user-system-user boolean 
-#live-debconfig live-debconfig/passwd/user[N]-...
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-name 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-fullname 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-password 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-password-crypted 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-key${_KEYS}-local 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-key-local 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-home 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-uid 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-gid 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-default-groups 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-login-shell 
+#live-debconfig live-debconfig/passwd/user${_NUMBER}-system-user 
 
 # hostname
 live-debconfig live-debconfig/hostname/hostname string 
@@ -26,7 +41,7 @@ live-debconfig live-debconfig/hostname/hostname string
 # ifupdown
 live-debconfig live-debconfig/ifupdown/lo-enable boolean 
 live-debconfig live-debconfig/ifupdown/lo-comment string 
-live-debconfig live-debconfig/ifupdown/eth0-ipv4-method string 
+live-debconfig live-debconfig/ifupdown/eth0-ipv4-method select 
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-comment string 
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-address string 
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-broadcast string 
@@ -35,15 +50,24 @@ live-debconfig live-debconfig/ifupdown/eth0-ipv4-mtu string
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-netmask string 
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-network string 
 live-debconfig live-debconfig/ifupdown/eth0-ipv4-post-up string 
-#live-debconfig live-debconfig/passwd/eth[N]-...
 live-debconfig live-debconfig/ifupdown/nameserver-addresses string 
 live-debconfig live-debconfig/ifupdown/nameserver-domain string 
 live-debconfig live-debconfig/ifupdown/nameserver-search string 
 live-debconfig live-debconfig/ifupdown/nameserver-options string 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-method 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-comment 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-address 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-broadcast 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-gateway 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-mtu 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-netmask 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-network 
+#live-debconfig live-debconfig/ifupdown/eth${_NUMBER}-ipv4-post-up 
 
 # systemd
 live-debconfig live-debconfig/systemd/lxc-enable boolean 
 live-debconfig live-debconfig/systemd/lxc-consoles string 
+live-debconfig live-debconfig/systemd/lxc-disable-services string 
 
 # sysvinit
 live-debconfig live-debconfig/sysvinit/lxc-enable boolean 
@@ -53,6 +77,10 @@ live-debconfig live-debconfig/sysvinit/lxc-disable-services string
 # util-linux
 live-debconfig live-debconfig/util-linux/hwclockaccess boolean 
 
+# procps
+live-debconfig live-debconfig/procps/net.ipv4.ip_forward boolean 
+live-debconfig live-debconfig/procps/vm.swappiness boolean 
+
 # selinux
 live-debconfig live-debconfig/selinux/enable boolean 
 
@@ -60,4 +88,6 @@ live-debconfig live-debconfig/selinux/enable boolean
 live-debconfig live-debconfig/ferm/ipv4-ports string 
 
 # openssh-server
-# n/a
+
+# dbus
+live-debconfig live-debconfig/dbus/oomscoreadjust boolean 
diff --git a/examples/preseed.sh b/examples/preseed.sh
new file mode 100755 (executable)
index 0000000..07c45dc
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+_PRESEED_FILE="preseed.cfg"
+
+cat > "${_PRESEED_FILE}" << EOF
+# live-debconfig ($(cat ../VERSION))
+
+live-debconfig live-debconfig/scripts multiselect 
+EOF
+
+for _SCRIPT in $(ls ../scripts/debconfig/????-* | grep -v ".templates")
+do
+       _SCRIPT_NAME="$(basename ${_SCRIPT} | sed -e 's|^[0-9][0-9][0-9][0-9]-||')"
+
+cat >> "${_PRESEED_FILE}" << EOF
+
+# ${_SCRIPT_NAME}
+EOF
+
+       for _DEBCONF in $(grep db_get ${_SCRIPT} | sed -e 's|.*db_get ||' -e 's|&&.*$||')
+       do
+               if ! grep -qs "live-debconfig ${_DEBCONF}" "${_PRESEED_FILE}"
+               then
+                       if echo "${_DEBCONF}" | grep -qs '\{'
+                       then
+                               _COMMENT="#"
+                               _TYPE=""
+                       else
+                               _COMMENT=""
+                               _TYPE=" $(grep -A1 -m1 "^Template: ${_DEBCONF}" ../scripts/debconfig/*-${_SCRIPT_NAME}.templates | awk '/^Type: / { print $2 }')"
+                       fi
+
+
+                       echo "${_COMMENT}live-debconfig ${_DEBCONF}${_TYPE} " >> "${_PRESEED_FILE}"
+               fi
+       done
+done