Skip to content

Commit 84b2478

Browse files
example: update EFI build example with build_steps (#117)
* example: update EFI build example with build_steps Since we added the build_steps alternative for documenting and adding the boot commands, we update the example so it shows how it is used. Co-authored-by: Wilken Rivera <[email protected]>
1 parent 14e8d4e commit 84b2478

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

example/efi_build/efi-debian.pkr.hcl

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ source "qemu" "debian_efi" {
1414
vm_name = "debian_efi"
1515
# headless = "false" # uncomment to see the boot process in a qemu window
1616
machine_type = "q35" # As of now, q35 is required for secure boot to be enabled
17-
boot_command = [
18-
"<enter>FS0:<enter>EFI\\boot\\bootx64.efi<enter>",
19-
"<wait><down><down><enter>", # manual install
20-
"<wait><down><down><down><down><down><enter>", # automatic install
21-
"<wait30>", # wait 30s for preseed prompt
22-
"http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg<tab><enter>",
23-
"<wait><enter>", # select English as language/locale
24-
"<wait><enter>", # select English as language
25-
"<wait><enter>", # set English-US as keyboard layout
26-
"<wait><wait><wait>root<enter>", # set root password
27-
"<wait>root<enter>", # confirm root password
28-
"<wait>debian<enter>", # set machine name to debian
29-
"<wait><enter>", # set user to debian
30-
"<wait>debian<enter>", # set password to debian
31-
"<wait>debian<enter>", # confirm password to debian
32-
"<wait180>", # wait 3m for system to install
33-
"root<enter>root<enter>sed -Ei 's/^#.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config<enter>systemctl restart sshd<enter>exit<enter>" # configure sshd to allow root connection
17+
# Refer to the boot_steps attribute for more information on usage https://developer.hashicorp.com/packer/plugins/builders/qemu#boot_steps
18+
boot_steps = [
19+
["<enter>FS0:<enter>EFI\\boot\\bootx64.efi<enter>", "boot from EFI shell"],
20+
["<wait><down><down><enter>", "manual install"],
21+
["<wait><down><down><down><down><down><enter>", "automatic install"],
22+
["<wait30>", "wait 30s for preseed prompt"],
23+
["http://{{.HTTPIP}}:{{.HTTPPort}}/preseed.cfg<tab><enter>", "select preseed medium"],
24+
["<wait><enter>", "select English as language/locale"],
25+
["<wait><enter>", "select English as language"],
26+
["<wait><enter>", "set English-US as keyboard layout"],
27+
["<wait><wait><wait>root<enter>", "set root password"],
28+
["<wait>root<enter>", "confirm root password"],
29+
["<wait>debian<enter>", "set machine name to debian"],
30+
["<wait><enter>", "set user to debian"],
31+
["<wait>debian<enter>", "set password to debian"],
32+
["<wait>debian<enter>", "confirm password to debian"],
33+
["<wait180>", "wait 3m for system to install"],
34+
["root<enter>root<enter>sed -Ei 's/^#.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config<enter>systemctl restart sshd<enter>exit<enter>", "configure sshd to allow root connection"],
3435
]
3536
http_directory = "http"
3637
boot_wait = "3s"

0 commit comments

Comments
 (0)