diff --git a/debian.cfg b/debian.cfg index 9c30ba3..d7064a9 100644 --- a/debian.cfg +++ b/debian.cfg @@ -69,12 +69,14 @@ d-i preseed/early_command string \ debconf-set mirror/http/hostname $hostname d-i partman/early_command string \ - debconf-set partman-auto/disk "$(list-devices disk | head -n1)" + debconf-set partman-auto/disk "$(list-devices disk | head -n1)"; \ -d-i partman/early_command string \ confhome="$(grep -o 'extra\.confhome=[^ ]*' /proc/cmdline | cut -d= -f2)"; \ ttys=$(wget $confhome/ttys.sh -O- | sh -s console=); \ - debconf-set debian-installer/add-kernel-opts "$ttys" + debconf-set debian-installer/add-kernel-opts "$ttys"; \ + + kernel="$(grep -o 'extra\.kernel=[^ ]*' /proc/cmdline | cut -d= -f2)"; \ + debconf-set base-installer/kernel/image "$kernel" # debian 10 没有 /target/etc/ssh/sshd_config.d/ 文件夹 d-i preseed/late_command string \ diff --git a/reinstall.sh b/reinstall.sh index dee9ed0..964472a 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -260,6 +260,12 @@ setos() { eval ${step}_initrd=$mirror/initrd.gz fi eval ${step}_ks=$confhome/debian.cfg + + is_virt && flavour=-cloud + # 甲骨文 debian 10 amd64 cloud 内核 vnc 没有显示 + [ "$releasever" -eq 10 ] && [ "$basearch_alt" = amd64 ] && flavour= + # shellcheck disable=SC2034 + kernel=linux-image$flavour-$basearch_alt fi } @@ -861,7 +867,7 @@ build_finalos_cmdline() { } build_extra_cmdline() { - for key in localtest confhome sleep cloud_image; do + for key in localtest confhome sleep cloud_image kernel; do value=${!key} if [ -n "$value" ]; then extra_cmdline+=" extra.$key='$value'"