debian-atomic-config/treefiles/debian-minimal-apt-ostree.yaml
2025-08-26 10:16:43 -07:00

101 lines
3.3 KiB
YAML

api_version: "1.0"
kind: "tree"
metadata:
ref_name: "debian/14/x86_64/minimal"
version: "1.0.0"
description: "Minimal Debian Trixie system with apt-ostree"
repositories:
- name: "debian"
url: "http://deb.debian.org/debian"
suite: "trixie"
components: ["main", "contrib", "non-free"]
enabled: true
- name: "debian-security"
url: "http://deb.debian.org/debian-security"
suite: "trixie-security"
components: ["main", "contrib", "non-free"]
enabled: true
packages:
base: ["systemd", "systemd-sysv", "dbus", "dbus-user-session", "sudo", "passwd", "bash", "coreutils", "util-linux", "procps", "sysvinit-utils"]
additional: ["ostree", "less", "vim-tiny", "wget", "curl", "ca-certificates", "gnupg", "iproute2", "net-tools", "openssh-client", "openssh-server", "htop", "rsync", "tar", "gzip", "unzip", "grub-pc", "grub-common", "linux-image-amd64", "linux-headers-amd64"]
excludes: []
output:
generate_container: true
container_path: "/tmp/apt-ostree-container"
export_formats:
- "docker-archive"
- "oci"
system:
# Create required bootc directories
directories:
- "/sysroot"
- "/usr/lib/bootc"
- "/usr/lib/ostree"
- "/usr/lib/systemd/system-preset"
- "/etc/apt-ostree"
- "/var/lib/apt-ostree"
- "/root/.ssh"
# Enable required systemd services
services:
- "systemd-networkd"
- "systemd-resolved"
- "ssh"
# Create composefs configuration
files:
- path: "/usr/lib/ostree/prepare-root.conf"
content: |
[prepare-root]
composefs=1
composefs-store=/ostree/repo
mode: "0644"
owner: "root:root"
- path: "/usr/lib/bootc/install/00-debian.toml"
content: |
[install]
filesystem = "ext4"
root-fs-type = "ext4"
[install.kernel-args]
default = ["console=ttyS0,115200", "quiet"]
mode: "0644"
owner: "root:root"
- path: "/usr/lib/systemd/tmpfiles.d/10-bootc.conf"
content: |
# Bootc required directories
d /var/log 0755 root root
d /var/cache 0755 root root
d /var/tmp 1777 root root
d /tmp 1777 root root
d /run 0755 root root
d /sysroot 0755 root root
d /ostree 0755 root root
d /boot 0755 root root
mode: "0644"
owner: "root:root"
# Post-installation cleanup and setup
postinstall:
- "echo 'Setting up bootc-compatible filesystem...'"
- "mkdir -p /sysroot /ostree /usr/lib/bootc /usr/lib/ostree"
- "echo 'Setting up apt-ostree directories...'"
- "mkdir -p /etc/apt-ostree /var/lib/apt-ostree /root/.ssh"
- "echo 'Setting hostname to debian-minimal'"
- "echo 'debian-minimal' > /etc/hostname"
- "echo 'Setting locale to en_US.UTF-8'"
- "echo 'en_US.UTF-8' > /etc/default/locale"
- "echo 'Setting timezone to UTC'"
- "ln -sf /usr/share/zoneinfo/UTC /etc/localtime"
- "echo 'Cleaning up log files for reproducible builds...'"
- "find /var/log -type f -name '*.log' -delete"
- "find /var/log -type f -name '*.log.*' -delete"
- "find /var/cache -type f -delete"
- "echo 'Setting up systemd tmpfiles...'"
- "systemd-tmpfiles --create --remove"
- "echo 'apt-ostree Debian minimal system created successfully'"
- "echo 'OSTree ref: debian/14/x86_64/minimal'"
- "echo 'System is ready for headless operation'"
- "echo 'Bootc setup completed successfully'"