build: ensure the justfile could fully replace the makefile.

This commit is contained in:
Alexandre Pujol 2025-03-28 20:13:00 +01:00
parent fbb71fb47b
commit 8e2a7e8068
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 163 additions and 29 deletions

View file

@ -24,7 +24,7 @@ source "qemu" "default" {
disk_compression = true
disk_detect_zeroes = "unmap"
disk_discard = "unmap"
output_directory = pathexpand(var.output)
output_directory = pathexpand(var.output_dir)
vm_name = "${local.name}.qcow2"
boot_wait = "10s"
firmware = pathexpand(var.firmware)
@ -85,7 +85,7 @@ build {
post-processor "shell-local" {
inline = [
"mv ${var.output}/${local.name}.qcow2 ${var.base_dir}/${local.name}.qcow2",
"mv ${var.output_dir}/${local.name}.qcow2 ${var.base_dir}/${local.name}.qcow2",
]
}

View file

@ -52,18 +52,18 @@ variable "base_dir" {
default = "~/.libvirt/base"
}
variable "output_dir" {
description = "Output build directory"
type = string
default = "~/.libvirt/base/packer"
}
variable "firmware" {
description = "Path to the UEFI firmware"
type = string
default = "/usr/share/edk2/x64/OVMF.4m.fd"
}
variable "output" {
description = "Output build directory"
type = string
default = "/tmp/packer"
}
variable "prefix" {
description = "Image name prefix"
type = string