debian-atomic-config/treefiles/debian-minimal-apt-ostree.yaml
2025-09-04 20:44:11 -07:00

119 lines
4 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
# Note: apt-ostree and bootc packages will be installed manually after tree creation
packages:
base: ["systemd", "systemd-sysv", "dbus", "dbus-user-session", "sudo", "passwd", "bash", "coreutils", "util-linux", "procps", "sysvinit-utils"]
additional: [
# Core OSTree packages (available in Debian)
"ostree", "ostree-boot",
# Initramfs and boot
"dracut-core", "grub-pc", "grub-common", "linux-image-amd64", "linux-headers-amd64",
# Container and storage
"podman", "skopeo", "cloud-guest-utils", "systemd-container",
# Storage and encryption
"cryptsetup", "cryptsetup-bin", "lvm2", "gdisk", "kpartx", "mdadm",
# System utilities
"less", "vim-tiny", "wget", "curl", "ca-certificates", "gnupg",
"iproute2", "net-tools", "openssh-client", "openssh-server",
"htop", "rsync", "tar", "gzip", "unzip", "zstd"
]
excludes: ["initramfs-tools"]
output:
generate_container: true
container_path: "/home/joe/Projects/overseer/apt-ostree-container"
export_formats:
- "docker-archive"
- "oci"
build_dir: "/home/joe/Projects/overseer/apt-ostree-build"
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 'Configuring kernel install for OSTree...'"
- "echo 'layout=ostree' > /usr/lib/kernel/install.conf"
- "echo 'apt-ostree and bootc packages installed from Particle OS repository'"
- "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'"