debian: 虚拟机使用 cloud 内核
This commit is contained in:
parent
8a7aa18a81
commit
5c5b2ae81c
@ -69,12 +69,14 @@ d-i preseed/early_command string \
|
|||||||
debconf-set mirror/http/hostname $hostname
|
debconf-set mirror/http/hostname $hostname
|
||||||
|
|
||||||
d-i partman/early_command string \
|
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)"; \
|
confhome="$(grep -o 'extra\.confhome=[^ ]*' /proc/cmdline | cut -d= -f2)"; \
|
||||||
ttys=$(wget $confhome/ttys.sh -O- | sh -s console=); \
|
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/ 文件夹
|
# debian 10 没有 /target/etc/ssh/sshd_config.d/ 文件夹
|
||||||
d-i preseed/late_command string \
|
d-i preseed/late_command string \
|
||||||
|
@ -260,6 +260,12 @@ setos() {
|
|||||||
eval ${step}_initrd=$mirror/initrd.gz
|
eval ${step}_initrd=$mirror/initrd.gz
|
||||||
fi
|
fi
|
||||||
eval ${step}_ks=$confhome/debian.cfg
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -861,7 +867,7 @@ build_finalos_cmdline() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_extra_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}
|
value=${!key}
|
||||||
if [ -n "$value" ]; then
|
if [ -n "$value" ]; then
|
||||||
extra_cmdline+=" extra.$key='$value'"
|
extra_cmdline+=" extra.$key='$value'"
|
||||||
|
Loading…
Reference in New Issue
Block a user