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

Modernize configuration #16

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 additions & 0 deletions .github/workflows/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
env:
PACKER_GITHUB_API_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Where is OVMF_CODE.fd?
run: |
cd /usr/local
find . -name OVMF_CODE.fd

- name: Build the Box
run: packer build -only=qemu.freebsd .
env:
Expand Down
2 changes: 2 additions & 0 deletions http/installerconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ fi
if [ "$FILESYSTEM" = 'ufs' ]; then
PARTITIONS="$GEOM"
else
export ZFSBOOT_BOOT_TYPE="UEFI"
export ZFSBOOT_DISKS="$GEOM"
export ZFSBOOT_PARTITION_SCHEME="GPT"
if [ "$ZFS_COMPRESSION" = 'zstd' ]; then
export ZFSBOOT_POOL_CREATE_OPTIONS="-O compress=zstd -O atime=off"
fi
Expand Down
15 changes: 12 additions & 3 deletions packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ source "qemu" "freebsd" {
boot_wait = "5s"
cpus = "${var.cpus}"
disk_size = "${var.disk_size}"
efi_boot = true
efi_firmware_code = "/usr/share/OVMF/OVMF_CODE.fd"
efi_firmware_vars = "/usr/share/OVMF/OVMF_VARS.fd"
headless = true
http_directory = "http"
iso_checksum = "file:${var.mirror}/${var.directory}/ISO-IMAGES/${var.revision}/CHECKSUM.SHA256-FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}"
Expand All @@ -20,23 +23,29 @@ source "virtualbox-iso" "freebsd" {
boot_command = ["<esc><wait>", "boot -s<enter>", "<wait15s>", "/bin/sh<enter><wait>", "mdmfs -s 100m md /tmp<enter><wait>", "dhclient -l /tmp/dhclient.lease.vtnet0 vtnet0<enter><wait5>", "fetch -o /tmp/installerconfig http://{{ .HTTPIP }}:{{ .HTTPPort }}/installerconfig<enter><wait5>", "FILESYSTEM=${var.filesystem}<enter>", "export FILESYSTEM<enter>", "ZFS_COMPRESSION=${var.zfs_compression}<enter>", "export ZFS_COMPRESSION<enter>", "RC_CONF_FILE=${var.rc_conf_file}<enter>", "export RC_CONF_FILE<enter>", "bsdinstall script /tmp/installerconfig<enter>"]
boot_wait = "10s"
cpus = "${var.cpus}"
chipset = "ich9"
disk_size = "${var.disk_size}"
export_opts = ["--manifest", "--vsys", "0", "--product", "FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}", "--producturl", "https://www.freebsd.org", "--description", "FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.", "--version", "${var.revision}-${var.branch}"]
firmware = "efi"
gfx_controller = "vmsvga"
gfx_vram_size = 5
guest_additions_mode = "disable"
guest_os_type = "${var.guest_os_type}"
hard_drive_interface = "sata"
hard_drive_interface = "virtio"
headless = true
http_directory = "http"
iso_checksum = "file:${var.mirror}/${var.directory}/ISO-IMAGES/${var.revision}/CHECKSUM.SHA256-FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}"
iso_interface = "sata"
iso_interface = "virtio"
iso_urls = ["iso/FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}-disc1.iso", "${var.mirror}/${var.directory}/ISO-IMAGES/${var.revision}/FreeBSD-${var.revision}-${var.branch}-${var.arch}${var.build_date}${var.git_commit}-disc1.iso"]
memory = "${var.memory}"
nested_virt = true
nic_type = "virtio"
shutdown_command = "poweroff"
ssh_password = "vagrant"
ssh_port = 22
ssh_timeout = "1000s"
ssh_username = "root"
vboxmanage = [["modifyvm", "{{ .Name }}", "--graphicscontroller", "vmsvga", "--nictype1", "virtio"], ["storagectl", "{{ .Name }}", "--name", "IDE Controller", "--remove"]]
vboxmanage = [["modifyvm", "{{ .Name }}", "--mouse", "usbmultitouch", "--pae", "off"], ["storagectl", "{{ .Name }}", "--name", "IDE Controller", "--remove"]]
virtualbox_version_file = ".vbox_version"
vm_name = "box"
}
Expand Down
Loading