preseed/late_command 甚至 ubiquity/success_command 不起作用

preseed/late_command 甚至 ubiquity/success_command 不起作用

我正在尝试构建一个 ubuntu 18.04 iso 以使用 Preseed 文件自动安装。不知何故,preseed/late_command 和 ubiquity/success_command 似乎都没有生效。

我无法在目标系统上安装 iptables-persistent 或 docker。

这是我的预置文件。

*### Unattended Installation

d-i auto-install/enable boolean true
d-i debconf/priority select critical

d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/supported-locales multiselect en_US.UTF-8
d-i console-setup/ask_detect boolean false

d-i /choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i hw-detect/load_firmware boolean true

d-i     netcfg/wireless_wep     string

d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string

d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true

d-i base-installer/install-recommends boolean true
d-i base-installer/kernel/override-image    string linux-server
d-i base-installer/kernel/override-image    string linux-image-amd64
d-i debconf debconf/frontend select Noninteractive

d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
d-i apt-setup/backports boolean true
d-i apt-setup/use_mirror boolean false
d-i apt-setup/services-select multiselect security, updates
d-i apt-setup/security_host string security.ubuntu.com
d-i apt-setup/security_path string /ubuntu

d-i tasksel/first multiselect none
d-i pkgsel/install-recommends boolean true
d-i pkgsel/include string openssh-server python
d-i pkgsel/upgrade select full-upgrade
d-i pkgsel/update-policy select unattended-upgrades


iptables-persistent iptables-persistent/autosave_v4 boolean true

iptables-persistent iptables-persistent/autosave_v6 boolean false
d-i pkgsel/include string openssh-server \
    vim \
    git \
    build-essential \
    wget \
    curl \
    python3 \
    iptables-persistent \
    netfilter-persistent \
    docker \
    docker-compose

#d-i preseed/late_command string \
ubiquity ubiquity/success_command string \
 in-target apt-get update; \
 in-target apt-get -y upgrade; \
 in-target apt-get -y autoremove ; \
 in-target apt-get autoclean ; \
 in-target apt-get -y install iptables-persistent netfilter-persistent; \
 in-target apt-get -y install docker*; \
 in-target sh -c 'sed -i "s/^#PermitRootLogin.*\$/PermitRootLogin no/g" /etc/ssh/sshd_config'
d-i debian-installer/splash boolean false
d-i cdrom-detect/eject boolean true*

尝试了 preseed late_command 和 ubiquity/success_command,但都不起作用。由于一个旧错误,也找不到任何日志E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)

openssh 安装后,将直接应用无人值守安全升级。

相关内容