From 41e5269ae7943d5ef0254dd1a5b17dc1bb460b2c Mon Sep 17 00:00:00 2001 From: Ana Custura Date: Fri, 23 Jan 2026 15:14:05 +0000 Subject: [PATCH] Add basic recipe for an amd64 machine --- vmdb2-recipes/amd64_trixie.yaml | 179 ++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 vmdb2-recipes/amd64_trixie.yaml diff --git a/vmdb2-recipes/amd64_trixie.yaml b/vmdb2-recipes/amd64_trixie.yaml new file mode 100644 index 0000000..d5e15ac --- /dev/null +++ b/vmdb2-recipes/amd64_trixie.yaml @@ -0,0 +1,179 @@ +--- +# See https://wiki.debian.org/RaspberryPi3 for known issues and more details. +# image.yml based on revision: ff7fdbf (Switch from qemu-debootstrap to debootstrap., 2024-01-01) + +steps: + - mkimg: "{{ output }}" + size: 3100M + + - mklabel: gpt + device: "{{ output }}" + +############ efi + - mkpart: primary + fs-type: 'fat32' + device: "{{ output }}" + start: 1MiB + end: 132MiB + tag: efi + + - set_part_flag: "{{ output }}" + tag: efi + flag: boot + state: enabled + + - set_part_flag: "{{ output }}" + tag: efi + flag: esp + state: enabled + +############ bios grub + - mkpart: primary + device: "{{ output }}" + start: 132MiB + end: 133MiB + tag: bios_grub + + - set_part_flag: "{{ output }}" + tag: bios_grub + flag: bios_grub + state: enabled +############ live + - mkpart: primary + device: "{{ output }}" + start: 133MiB + end: 100% + tag: tag-root + + - set_part_flag: "{{ output }}" + tag: tag-root + flag: legacy_boot + state: enabled + + - kpartx: "{{ output }}" + + - mkfs: vfat + partition: efi + label: EFI + options: -F32 + + - mkfs: ext4 + partition: tag-root + label: boot + + - mount: tag-root + + - shell: | + dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/mbr/gptmbr.bin of="{{ output }}" + root-fs: tag-root + + - unpack-rootfs: tag-root + + - debootstrap: trixie + require_empty_target: false + mirror: http://deb.debian.org/debian + target: tag-root + components: + - main + - non-free-firmware + - non-free + unless: rootfs_unpacked + + - create-file: /etc/apt/sources.list + contents: |+ + deb http://deb.debian.org/debian trixie main non-free-firmware non-free + deb http://deb.debian.org/debian trixie-updates main non-free-firmware non-free + deb http://security.debian.org/debian-security trixie-security main non-free-firmware non-free + + unless: rootfs_unpacked + + - apt: install + packages: + - avahi-daemon + - curl + - udisks2 + - wget + - dhcpcd + - python3 + - lighttpd + - unzip + - sudo + - systemd-timesyncd + - ca-certificates + - dosfstools + - iw + - parted + - ssh + - wpasupplicant + - systemd + - systemd-sysv + - init-system-helpers + - syslinux + - linux-image-amd64 + tag: tag-root + unless: rootfs_unpacked + + - cache-rootfs: tag-root + unless: rootfs_unpacked + + - shell: | + echo "butterbox" > "${ROOT?}/etc/hostname" + + # Allow root logins locally with no password + sed -i 's,root:[^:]*:,root::,' "${ROOT?}/etc/shadow" + + install -m 644 -o root -g root image-specs/rootfs/etc/fstab "${ROOT?}/etc/fstab" + + install -m 644 -o root -g root image-specs/rootfs/etc/network/interfaces.d/eth0 "${ROOT?}/etc/network/interfaces.d/eth0" + install -m 600 -o root -g root image-specs/rootfs/etc/network/interfaces.d/wlan0 "${ROOT?}/etc/network/interfaces.d/wlan0" + root-fs: tag-root + + # Clean up archive cache (likely not useful) and lists (likely outdated) to + # reduce image size by several hundred megabytes. + - chroot: tag-root + shell: | + apt-get clean + rm -rf /var/lib/apt/lists + + - grub: bios + tag: tag-root + console: serial +# + - grub: uefi + tag: tag-root + efi: efi + console: serial + + - shell: | + rm "${ROOT?}/etc/resolv.conf" + root-fs: tag-root + + # Clear /etc/machine-id and /var/lib/dbus/machine-id, as both should + # be auto-generated upon first boot. From the manpage + # (machine-id(5)): + # + # For normal operating system installations, where a custom image is + # created for a specific machine, /etc/machine-id should be + # populated during installation. + # + # Note this will also trigger ConditionFirstBoot=yes for systemd. + # On Buster, /etc/machine-id should be an emtpy file, not an absent file + # On Bullseye, /etc/machine-id should not exist in an image + - chroot: tag-root + shell: | + rm -f /etc/machine-id /var/lib/dbus/machine-id + echo "uninitialized" > /etc/machine-id + echo "LABEL=BOOT / ext4 rw 0 1" > /etc/fstab + + + - virtual-filesystems: tag-root + + - ansible: tag-root + playbook: ../ansible/main.yml + config_file: ../ansible/ansible.cfg + extra_vars: + butter_language: en + butter_name: butterbox + tags: base,usb,matrix,keanu,website + butter_user: "amd" + ap_mode_supported: "false"