Skip to content

Commit 4f3ca0c

Browse files
committed
refactor(packages): mios.toml is the only runtime SSOT; PACKAGES.md is documentation
Removes the legacy PACKAGES.md fenced-block fallback from the runtime path. mios.toml [packages.<section>].pkgs is now the single source consulted by automation/lib/packages.sh, resolved through the documented overlay chain (MIOS_TOML override -> ~/.config -> /etc/mios -> /ctx/mios-bootstrap -> /usr/share/mios -> /ctx/usr/share/mios). Touched files: - automation/lib/packages.sh: drop Tier-2 sed/awk PACKAGES.md scrape; get_packages / get_packages_strict / install_packages_optional now take only a section name. - automation/build.sh: export MIOS_TOML instead of PACKAGES_MD; FATAL when the TOML is missing. - automation/install-bootstrap.sh: source packages.sh and aggregate every [packages.*] section discovered via awk so the ignition path matches what the OCI build chain installs. - Containerfile + Containerfile.minimal: drop the COPY of PACKAGES.md and the export PACKAGES_MD; pass MIOS_TOML pointing at the already-shipped /tmp/build/usr/share/mios/mios.toml. - build-mios.ps1: required-file check verifies usr/share/mios/mios.toml, not usr/share/mios/PACKAGES.md. - usr/share/mios/env.defaults: replace MIOS_PACKAGES_MD with MIOS_TOML. - usr/libexec/mios-verify: probe the new doc-tree PACKAGES.md location + keep mios.toml as a hard-required vendor file. - 11 automation/*.sh comment-only fixups: each "from PACKAGES.md packages-X" header now reads "from mios.toml [packages.X]". - usr/share/mios/PACKAGES.md -> usr/share/doc/mios/reference/PACKAGES.md (legacy reference moved to the docs tree, header rewritten to state the fallback is fully removed in v0.2.4). - llms.txt + usr/share/doc/mios/reference/credits.md: citation pointers updated to the new docs-tree path and to mios.toml as the SSOT. Why: completes the user's "deprecate -> consolidate -> remove" arc for PACKAGES.md. The TOML manifest is what the configurator HTML edits and what every operator override layer expects; keeping the fenced-block fallback in code drifted away from that. The 44 [packages.<section>] tables in mios.toml were already authoritative for every section the build chain touches. Verified: bash -n on all 14 modified scripts; get_packages_from_toml smoke-tested for base/ai/glibc-hwcaps-v3 + nonexistent section against the live usr/share/mios/mios.toml.
1 parent 5e731d3 commit 4f3ca0c

22 files changed

Lines changed: 168 additions & 136 deletions

Containerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ COPY usr/ /ctx/usr/
77
COPY etc/ /ctx/etc/
88
# /home/ is bootstrap territory (mios-bootstrap.git stages user homes via
99
# profile/ in Phase-3); the build no longer pulls it.
10-
COPY usr/share/mios/PACKAGES.md /ctx/PACKAGES.md
10+
# SSOT: mios.toml [packages.<section>].pkgs lives at
11+
# usr/share/mios/mios.toml and is already shipped via the COPY usr/ above.
12+
# build.sh exports $MIOS_TOML to /ctx/usr/share/mios/mios.toml so
13+
# automation/lib/packages.sh resolves the canonical TOML manifest.
1114
COPY VERSION /ctx/VERSION
1215
COPY config/artifacts/ /ctx/bib-configs/
1316
COPY tools/ /ctx/tools/
@@ -50,7 +53,7 @@ RUN --mount=type=bind,from=ctx,source=/ctx,target=/ctx,ro \
5053
--mount=type=cache,dst=/var/cache/dnf,sharing=locked \
5154
set -ex; \
5255
install -d -m 0755 /tmp/build; \
53-
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/PACKAGES.md /ctx/VERSION /ctx/bib-configs /ctx/tools /tmp/build/; \
56+
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/VERSION /ctx/bib-configs /ctx/tools /tmp/build/; \
5457
# Defensive CRLF -> LF normalization. .gitattributes already pins
5558
# *.sh / *.toml / *.conf / *.yaml / *.json / *.md to LF, but Windows
5659
# build hosts (OneDrive sync in particular) bypass git's filter and
@@ -69,7 +72,7 @@ RUN --mount=type=bind,from=ctx,source=/ctx,target=/ctx,ro \
6972
-o -name "*.volume" -o -name "*.repo" -o -name "*.policy" \
7073
-o -name "*.rules" \) \
7174
-exec sed -i 's/\r$//' {} +; \
72-
export PACKAGES_MD=/tmp/build/PACKAGES.md; \
75+
export MIOS_TOML=/tmp/build/usr/share/mios/mios.toml; \
7376
bash /tmp/build/automation/lib/packages.sh >/dev/null 2>&1 || true; \
7477
source /tmp/build/automation/lib/packages.sh; \
7578
# Purge any stale/corrupt repo metadata left in the buildkit cache mount

Containerfile.minimal

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ FROM scratch AS ctx
5151
COPY automation/ /ctx/automation/
5252
COPY usr/ /ctx/usr/
5353
COPY etc/ /ctx/etc/
54-
COPY usr/share/mios/PACKAGES.md /ctx/PACKAGES.md
54+
# SSOT: mios.toml [packages.<section>].pkgs (resolved by lib/packages.sh).
55+
# usr/ already carries usr/share/mios/mios.toml -- the COPY above lands it
56+
# at /ctx/usr/share/mios/mios.toml, which is the lowest-precedence default
57+
# the resolver picks up via $MIOS_TOML below.
5558
COPY VERSION /ctx/VERSION
5659
COPY tools/ /ctx/tools/
5760

@@ -88,7 +91,7 @@ RUN --mount=type=bind,from=ctx,source=/ctx,target=/ctx,ro \
8891
--mount=type=cache,dst=/var/cache/dnf,sharing=locked \
8992
set -ex; \
9093
install -d -m 0755 /tmp/build; \
91-
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/PACKAGES.md /ctx/VERSION /ctx/tools /tmp/build/; \
94+
cp -a /ctx/automation /ctx/usr /ctx/etc /ctx/VERSION /ctx/tools /tmp/build/; \
9295
# Same defensive CRLF normalization as the canonical Containerfile.
9396
find /tmp/build -type f \
9497
\( -name "*.sh" -o -name "*.toml" -o -name "*.conf" \
@@ -99,7 +102,7 @@ RUN --mount=type=bind,from=ctx,source=/ctx,target=/ctx,ro \
99102
-o -name "*.volume" -o -name "*.repo" -o -name "*.policy" \
100103
-o -name "*.rules" \) \
101104
-exec sed -i 's/\r$//' {} +; \
102-
export PACKAGES_MD=/tmp/build/PACKAGES.md; \
105+
export MIOS_TOML=/tmp/build/usr/share/mios/mios.toml; \
103106
export MIOS_VARIANT=minimal; \
104107
source /tmp/build/automation/lib/packages.sh; \
105108
${DNF_BIN:-dnf5} clean metadata 2>/dev/null || true; \

automation/10-gnome.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
2424
source "${SCRIPT_DIR}/lib/packages.sh"
2525

2626
# ═════════════════════════════════════════════════════════════════════════════
27-
# GNOME 50 -- Install from PACKAGES.md (build-up, NOT strip-down)
27+
# GNOME 50 -- Install from mios.toml [packages.gnome] (build-up, NOT strip-down)
2828
# ═════════════════════════════════════════════════════════════════════════════
2929
echo "[10-gnome] Installing GNOME 50 desktop (pure build-up)..."
3030
install_packages "gnome"
3131

32-
# Optional GNOME Core Apps (all commented out by default in PACKAGES.md)
32+
# Optional GNOME Core Apps (empty pkgs[] in [packages.gnome-core-apps] by default)
3333
install_packages_optional "gnome-core-apps"
3434

3535
# ═════════════════════════════════════════════════════════════════════════════

automation/11-hardware.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
# NVIDIA acceleration - image still works for everything else.
1010
#
1111
# Mesa (AMD/Intel/software fallback) and ROCm + intel-compute-runtime are
12-
# installed from PACKAGES.md. They have no kernel-version coupling.
12+
# installed from mios.toml [packages.gpu-amd] / [packages.gpu-intel]. They
13+
# have no kernel-version coupling.
1314
#
1415
# CHANGELOG:
1516
# v0.2.0: Dropped COPY-layer fallback. ucore-hci IS already built from

automation/21-moby-engine.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ source "$(dirname "$0")/lib/packages.sh"
99
source "$(dirname "$0")/lib/common.sh"
1010

1111
# moby-engine conflicts with podman-docker over /usr/bin/docker. install_packages
12-
# routes through dnf which resolves the conflict at install time; PACKAGES.md is
13-
# the SSOT for every RPM (see CLAUDE.md / CONTRIBUTING.md).
12+
# routes through dnf which resolves the conflict at install time; mios.toml
13+
# [packages.moby] is the SSOT for every RPM (see CLAUDE.md / CONTRIBUTING.md).
1414
install_packages "moby"
1515

1616
# Enable the Docker socket to ensure it's available on boot

automation/23-uki-render.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ echo "==> Preparing Unified Kernel Image (UKI) configuration..."
77
source "$(dirname "$0")/lib/packages.sh"
88
source "$(dirname "$0")/lib/common.sh"
99

10-
# packages-boot already pulls systemd-ukify; reinstall via the SSOT block as a
11-
# safety net in case --skip-unavailable dropped it on a constrained mirror.
10+
# [packages.boot] already pulls systemd-ukify; reinstall via the SSOT
11+
# [packages.uki] section as a safety net in case --skip-unavailable dropped
12+
# it on a constrained mirror.
1213
if ! rpm -q systemd-ukify >/dev/null 2>&1; then
13-
echo "==> systemd-ukify not found via boot-section install; reinstalling via PACKAGES.md..."
14+
echo "==> systemd-ukify not found via boot-section install; reinstalling via mios.toml [packages.uki]..."
1415
install_packages_strict "uki"
1516
fi
1617

automation/43-uupd-installer.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
2-
# 43-uupd-installer.sh - install uupd + greenboot (from PACKAGES.md
3-
# packages-updater section) and disable the updaters it supersedes.
2+
# 43-uupd-installer.sh - install uupd + greenboot (from mios.toml
3+
# [packages.updater]) and disable the updaters it supersedes.
44
set -euo pipefail
55

66
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

automation/44-podman-machine-compat.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# 44-podman-machine-compat.sh - Podman-machine backend compatibility.
3-
# Package installs moved to PACKAGES.md (packages-containers, packages-utils).
3+
# Package installs moved to mios.toml [packages.containers] / [packages.utils].
44
# This script only does the runtime config that cannot be expressed as packages:
55
# - create the 'core' user (Podman machine convention)
66
# - enable services needed for machine backend operation

automation/45-nvidia-cdi-refresh.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22
# 45-nvidia-cdi-refresh.sh - wire up NVIDIA CDI auto-refresh services.
3-
# Package installs live in PACKAGES.md (packages-gpu-nvidia section).
3+
# Package installs live in mios.toml [packages.gpu-nvidia].
44
#
55
# Key invariants:
66
# - nvidia-container-toolkit ≥ 1.18 for nvidia-cdi-refresh.service/path.

automation/46-greenboot.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
2-
# 46-greenboot.sh - wire greenboot services; package installs via PACKAGES.md
3-
# (packages-updater section: greenboot, greenboot-default-health-checks).
2+
# 46-greenboot.sh - wire greenboot services; package installs via mios.toml
3+
# [packages.updater] (greenboot, greenboot-default-health-checks).
44
set -euo pipefail
55
source "$(dirname "${BASH_SOURCE[0]}")/lib/common.sh"
66

0 commit comments

Comments
 (0)