Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add support for disk-based deployment mode for Debian 11 #272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions builds/linux/debian/11/data/ks.pkrtpl.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,9 @@ d-i pkgsel/include string openssh-server open-vm-tools python3-apt perl
d-i preseed/late_command string \
echo '${build_username} ALL=(ALL) NOPASSWD: ALL' > /target/etc/sudoers.d/${build_username} ; \
in-target chmod 440 /etc/sudoers.d/${build_username} ;

%{ if common_data_source == "disk" ~}
# Umount preseed media early
d-i preseed/early_command string \
umount /media && echo 1 > /sys/block/sr1/device/delete ;
%{ endif ~}
13 changes: 11 additions & 2 deletions builds/linux/debian/11/linux-debian.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ locals {
vm_guest_os_language = var.vm_guest_os_language
vm_guest_os_keyboard = var.vm_guest_os_keyboard
vm_guest_os_timezone = var.vm_guest_os_timezone
common_data_source = var.common_data_source
})
}
data_source_command = var.common_data_source == "http" ? "url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" : "file=/media/ks.cfg"
Expand Down Expand Up @@ -91,7 +92,7 @@ source "vsphere-iso" "linux-debian" {
iso_paths = local.iso_paths
iso_checksum = local.iso_checksum
http_content = var.common_data_source == "http" ? local.data_source_content : null
floppy_content = var.common_data_source == "disk" ? local.data_source_content : null
cd_content = var.common_data_source == "disk" ? local.data_source_content : null

// Boot and Provisioning Settings
http_ip = var.common_data_source == "http" ? var.common_http_ip : null
Expand All @@ -107,7 +108,15 @@ source "vsphere-iso" "linux-debian" {
" ${local.data_source_command}",
" noprompt --<enter>",
"initrd /install.amd/initrd.gz<enter>",
"boot<enter>"
"boot<enter>",
"<wait30s>",
"<enter><wait>",
"<enter><wait>",
"<leftAltOn><f2><leftAltOff>",
"<enter><wait>",
"mount /dev/sr1 /media<enter>",
"<leftAltOn><f1><leftAltOff>",
"<down><down><down><down><enter>"
]
ip_wait_timeout = var.common_ip_wait_timeout
shutdown_command = "echo '${var.build_password}' | sudo -S -E shutdown -P now"
Expand Down