Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanis committed May 10, 2024
1 parent 193b57f commit b716b7f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
10 changes: 9 additions & 1 deletion cableos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,19 @@ lint:
format:
packer fmt .

OVMF_VARS.fd: /usr/share/OVMF/OVMF_VARS.fd
cp -v $< $@

cableos-installer.tar.gz: check-deps clean
${PACKER} init cableos-installer.pkr.hcl && ${PACKER} build \
-var architecture=${ARCH} \
-var boot_mode=${BOOT} \
-var timeout=${TIMEOUT} cableos-installer.pkr.hcl

clean:
${RM} -rf output-cableos-installer/* cableos-installer-*.gz
${RM} -rf output-cableos-installer/* cableos-installer-*.gz \
seeds-cloudimg.iso \
OVMF_VARS.fd \
AAVMF_VARS.fd

.INTERMEDIATE: OVMF_VARS.fd seeds-cloudimg.iso
23 changes: 21 additions & 2 deletions cableos/cableos-installer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ locals {
}
// Define Packer Source for QEMU


source "null" "dependencies" {
communicator = "none"
}
source "qemu" "cableos-installer" {
boot_wait = "2s"
cpus = 2
Expand All @@ -126,7 +128,11 @@ source "qemu" "cableos-installer" {
qemuargs = [
["-machine", "${lookup(local.qemu_machine, var.architecture, "")}"],
["-cpu", "${lookup(local.qemu_cpu, var.architecture, "")}"],
["-device", "virtio-gpu-pci"]
["-device", "virtio-gpu-pci"],
["-drive", "if=pflash,format=raw,id=ovmf_code,readonly=on,file=/usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_CODE.fd"],
["-drive", "if=pflash,format=raw,id=ovmf_vars,file=${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd"],
["-drive", "file=output-cloudimg/packer-cloudimg,format=qcow2"],
["-drive", "file=seeds-cloudimg.iso,format=raw"]
]
shutdown_command = "sudo -S shutdown -P now"
ssh_handshake_attempts = 50
Expand All @@ -138,6 +144,19 @@ source "qemu" "cableos-installer" {
}

// Define Build
build {
name = "cloudimg.deps"
sources = ["source.null.dependencies"]

provisioner "shell-local" {
inline = [
"cp /usr/share/${lookup(local.uefi_imp, var.architecture, "")}/${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd ${lookup(local.uefi_imp, var.architecture, "")}_VARS.fd",
"cloud-localds seeds-cloudimg.iso user-data-cloudimg meta-data"
]
inline_shebang = "/bin/bash -e"
}
}

build {
name = "cableos-installer"
sources = [
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b716b7f

Please sign in to comment.