Browse Source
- coreos: everything specific to Fedora CoreOS (virtiofs discovery and mount, qemu-guest-agent, SSH host key persistence, DNS configuration). - base: everything else (install-tools, fastfetch, resolv.conf resync, base images, users and groups). common.mk now injects both as implicit dependencies: coreos has none, base depends on coreos and every other project depends on coreos and base. default-butane-spec.sh skips ignition files whose content duplicates a previous one: butane rejects duplicate merge entries, which happens with empty "-examples" ignition files (e.g. coreos-examples and nftables-examples). The virtiofs tags are now discovered in /run/quadlets/coreos/virtiofs (seedbox mounts updated accordingly) and the tmpfiles.d file is named coreos.conf so that make install/uninstall picks it up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>main
14 changed files with 146 additions and 58 deletions
@ -0,0 +1,15 @@ |
|||
|
|||
SYSTEMD_MAIN_UNIT_NAMES := var-lib-virtiofs-data.mount |
|||
SYSTEMD_MAIN_UNIT_NAMES += rpm-ostree-install-qemu-guest-agent.service |
|||
|
|||
# Include common Makefile
|
|||
include ../../scripts/common.mk |
|||
|
|||
pre-requisites:: |
|||
@set -Eeuo pipefail; \
|
|||
for tool in rpm-ostree; do \
|
|||
if ! which $$tool &>/dev/null ; then \
|
|||
echo "$$tool is not installed. Please install it first." >&2; \
|
|||
exit 1; \
|
|||
fi ; \
|
|||
done |
|||
@ -0,0 +1,46 @@ |
|||
# Podman Quadlet: CoreOS |
|||
|
|||
## Overview |
|||
|
|||
The coreos cookbook provides the configuration specific to Fedora CoreOS systems. It includes: |
|||
|
|||
- **virtiofs data mount**: the **discover-virtiofs-tags.service** lists the virtiofs tags exposed by the hypervisor. |
|||
When a `data` tag is present, **var-lib-virtiofs-data.mount** mounts it on `/var/lib/virtiofs/data` with the `container_file_t` SELinux context, so containers can use it. |
|||
- **tmpfiles configuration**: creates the `/var/lib/virtiofs` directory. |
|||
- **QEMU guest agent**: when running on KVM, **rpm-ostree-install-qemu-guest-agent.service** layers `qemu-guest-agent` with `rpm-ostree`, applies it live and starts it. |
|||
- **SSH key persistence** (Butane spec only): backs up the SSH host keys in `/var/lib/private/sshd` and restores them on reinstall, so the host keeps its identity. |
|||
- **DNS configuration** (Butane spec only): masks `systemd-resolved` and lets NetworkManager write `/etc/resolv.conf` directly (`rc-manager=file`). |
|||
|
|||
This cookbook is an implicit dependency of every other cookbook, including [base](../base/). |
|||
It has no dependencies itself. |
|||
|
|||
## Usage |
|||
|
|||
This cookbook requires `rpm-ostree`, so it can only be installed on Fedora CoreOS. |
|||
|
|||
In a separate terminal, follow the logs. |
|||
|
|||
```sh |
|||
sudo make tail-logs |
|||
``` |
|||
|
|||
Install the CoreOS configuration. |
|||
|
|||
```sh |
|||
sudo make clean install |
|||
``` |
|||
|
|||
On a KVM virtual machine, you should see the **rpm-ostree-install-qemu-guest-agent.service** installing the QEMU guest agent. |
|||
|
|||
To verify the installation: |
|||
|
|||
```sh |
|||
systemctl status qemu-guest-agent.service |
|||
findmnt /var/lib/virtiofs/data |
|||
``` |
|||
|
|||
Finally, remove the configuration and its data. |
|||
|
|||
```sh |
|||
sudo make uninstall clean |
|||
``` |
|||
@ -0,0 +1,28 @@ |
|||
variant: fcos |
|||
version: 1.4.0 |
|||
storage: |
|||
directories: |
|||
- path: /var/lib/private/sshd |
|||
mode: 0700 |
|||
files: |
|||
- path: /etc/resolv.conf |
|||
overwrite: true |
|||
contents: |
|||
inline: "" # will be updated by NetworkManager |
|||
- path: /etc/NetworkManager/conf.d/itix.conf |
|||
contents: |
|||
inline: | |
|||
[main] |
|||
# test |
|||
rc-manager=file |
|||
systemd: |
|||
units: |
|||
- name: systemd-resolved.service |
|||
enabled: false |
|||
mask: true |
|||
- name: sshd-keygen@.service |
|||
dropins: |
|||
- name: backup-restore.conf |
|||
contents: | |
|||
[Service] |
|||
ExecStartPost=/bin/bash -c 'if [ -f /var/lib/private/sshd/ssh_host_%i_key ]; then cp -Z /var/lib/private/sshd/ssh_host_%i_key{,.pub} /etc/ssh/; elif [ -f /etc/ssh/ssh_host_%i_key ]; then cp -a /etc/ssh/ssh_host_%i_key{,.pub} /var/lib/private/sshd/; fi' |
|||
Loading…
Reference in new issue