Хотя я был мотивирован, чтобы мой кикстарт Ubuntu работал, я нашел решение. Опция --install для debconf-get-selection не работает. Вам нужно пропустить это и использовать просто debconf-get-selection, чтобы получить список для debconf-set-selection. При моей новой установке после «apt install postfix» я получаю этот список:
root@pzi-ub-1:~# debconf-get-selections | grep postfix
postfix postfix/main_mailer_type select Internet with smarthost
postfix postfix/recipient_delim string +
postfix postfix/relay_restrictions_warning boolean
postfix postfix/mydomain_warning boolean
postfix postfix/not_configured error
postfix postfix/retry_upgrade_warning boolean
postfix postfix/mailname string pzi-ub-1.foobar.com
postfix postfix/chattr boolean false
postfix postfix/destinations string pzi-ub-1.foobar.com, $myhostname, pzi-ub-1, localhost.localdomain, localhost
postfix postfix/relayhost string pzi-gw-1.foobar.com
postfix postfix/procmail boolean true
postfix postfix/compat_conversion_warning boolean true
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
postfix postfix/sqlite_warning boolean
postfix postfix/kernel_version_warning boolean
postfix postfix/tlsmgr_upgrade_warning boolean
postfix postfix/mailbox_limit string 0
postfix postfix/dynamicmaps_conversion_warning boolean
postfix postfix/rfc1035_violation boolean false
postfix postfix/protocols select all
postfix postfix/main_cf_conversion_warning boolean true
postfix postfix/root_address string
postfix postfix/bad_recipient_delimiter error
Чтобы скомпилировать список preseed, я обрезал параметры без значений (те, которые установщик не запрашивал) и создал этот скрипт, который я вызываю из раздела %post кикстарта:
pzi@pzi-gw-1:~/Dropbox/notes/ks/post/ub$ cat mail
set -x
# x=mail; cd /var/tmp; wget http://gw/ks/post/ub/$x -O $x; sh ./$x
#
# ref: http://blog.delgurth.com/2009/01/19/pre-loading-debconf-values-for-easy-installation/
d=`grep search /etc/resolv.conf | sed 's/search //'`
hostname=`hostname`
fqdn=$hostname.$d
cat<<EOF | debconf-set-selections
postfix postfix/main_mailer_type select Internet with smarthost
postfix postfix/recipient_delim string +
postfix postfix/mailname string $fqdn
postfix postfix/chattr boolean false
postfix postfix/destinations string $fqdn, \$myhostname, $hostname, localhost.localdomain, localhost
postfix postfix/relayhost string mailhost.foobar.com
postfix postfix/procmail boolean true
postfix postfix/compat_conversion_warning boolean true
postfix postfix/mynetworks string 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
postfix postfix/mailbox_limit string 0
postfix postfix/rfc1035_violation boolean false
postfix postfix/protocols select all
postfix postfix/main_cf_conversion_warning boolean true
postfix postfix/root_address string
EOF
debconf-get-selections | grep postfix
apt-get -qq -y install postfix
А вот раздел %post кикстарта с этим почтовым скриптом:
%post --interpreter=/bin/bash
exec > /root/post.log 2>&1
set -x
scripts="
autofs
rootssh
users
sudo
mail
"
for x in $scripts; do
wget http://gw/ks/post/ub/$x -O $x; sh ./$x
done
person
pzi123
schedule
10.02.2017