|
@@ -20,57 +20,73 @@ set -ex
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
while [ $# -gt 0 ]; do
|
|
|
case $1 in
|
|
case $1 in
|
|
|
- -c)
|
|
|
|
|
|
|
+ -c|--country)
|
|
|
COUNTRY=$2
|
|
COUNTRY=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -h)
|
|
|
|
|
|
|
+ -h|--hostname)
|
|
|
HOST=$2
|
|
HOST=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -x)
|
|
|
|
|
|
|
+ -x|--transport|--protocol)
|
|
|
TRANSPORT=$2
|
|
TRANSPORT=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -m)
|
|
|
|
|
|
|
+ -m|--mirror|--host)
|
|
|
MIRROR=$2
|
|
MIRROR=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -d)
|
|
|
|
|
|
|
+ -d|--dir|--path|--directory)
|
|
|
DIRECTORY=${2%/}
|
|
DIRECTORY=${2%/}
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -r)
|
|
|
|
|
|
|
+ -r|--suite|--release)
|
|
|
SUITE=$2
|
|
SUITE=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -u)
|
|
|
|
|
|
|
+ -u|--user|--username)
|
|
|
USERNAME=$2
|
|
USERNAME=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -p)
|
|
|
|
|
|
|
+ -p|--pass|--password)
|
|
|
PASSWORD=$2
|
|
PASSWORD=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -z)
|
|
|
|
|
|
|
+ -z|--time|--zone|--timezone)
|
|
|
TIMEZONE=$2
|
|
TIMEZONE=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -t)
|
|
|
|
|
|
|
+ -t|--ntp|--ntpserver)
|
|
|
NTPSERVER=$2
|
|
NTPSERVER=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -s)
|
|
|
|
|
|
|
+ -s|--security)
|
|
|
SECURITY=$2
|
|
SECURITY=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
- -l)
|
|
|
|
|
|
|
+ -l|--link|--linked|--linking)
|
|
|
LINKED=true
|
|
LINKED=true
|
|
|
;;
|
|
;;
|
|
|
- -g)
|
|
|
|
|
|
|
+ -g|--upgrade)
|
|
|
UPGRADE=$2
|
|
UPGRADE=$2
|
|
|
shift
|
|
shift
|
|
|
;;
|
|
;;
|
|
|
|
|
+ --addr|--ipaddr)
|
|
|
|
|
+ IPADDR=$2
|
|
|
|
|
+ shift
|
|
|
|
|
+ ;;
|
|
|
|
|
+ --mask|--netmask)
|
|
|
|
|
+ NETMASK=$2
|
|
|
|
|
+ shift
|
|
|
|
|
+ ;;
|
|
|
|
|
+ --gate|--gateway)
|
|
|
|
|
+ GATEWAY=$2
|
|
|
|
|
+ shift
|
|
|
|
|
+ ;;
|
|
|
|
|
+ --dns|--dnserver|--dnsserver)
|
|
|
|
|
+ DNS=$2
|
|
|
|
|
+ shift
|
|
|
|
|
+ ;;
|
|
|
*)
|
|
*)
|
|
|
echo "Illegal option $1"
|
|
echo "Illegal option $1"
|
|
|
exit 1
|
|
exit 1
|
|
@@ -147,6 +163,24 @@ d-i keyboard-configuration/xkb-keymap select us
|
|
|
# 2. Network configuration: HOST
|
|
# 2. Network configuration: HOST
|
|
|
|
|
|
|
|
d-i netcfg/choose_interface select auto
|
|
d-i netcfg/choose_interface select auto
|
|
|
|
|
+EOF
|
|
|
|
|
+
|
|
|
|
|
+if [ -n "$IPADDR" ]; then
|
|
|
|
|
+ echo "d-i netcfg/disable_autoconfig boolean true" >> preseed.cfg
|
|
|
|
|
+ echo "d-i netcfg/get_ipaddress string $IPADDR" >> preseed.cfg
|
|
|
|
|
+ if [ -n "$NETMASK" ]; then
|
|
|
|
|
+ echo "d-i netcfg/get_netmask string $NETMASK" >> preseed.cfg
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ -n "$GATEWAY" ]; then
|
|
|
|
|
+ echo "d-i netcfg/get_gateway string $GATEWAY" >> preseed.cfg
|
|
|
|
|
+ fi
|
|
|
|
|
+ if [ -n "$DNS" ]; then
|
|
|
|
|
+ echo "d-i netcfg/get_nameservers string $DNS" >> preseed.cfg
|
|
|
|
|
+ fi
|
|
|
|
|
+ echo "d-i netcfg/confirm_static boolean true" >> preseed.cfg
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+cat >> preseed.cfg << EOF
|
|
|
d-i netcfg/get_hostname string unassigned-hostname
|
|
d-i netcfg/get_hostname string unassigned-hostname
|
|
|
d-i netcfg/get_domain string unassigned-domain
|
|
d-i netcfg/get_domain string unassigned-domain
|
|
|
d-i netcfg/hostname string {{-HOST-}}
|
|
d-i netcfg/hostname string {{-HOST-}}
|