#!/bin/sh # mmdebstrap customize-hook: stamp narOS identity into the rootfs (NAROS.md §2.3). # $1 = rootfs dir; NAROS_* env exported by build-rootfs.sh. Debian's own # /usr/lib/os-release stays intact (ID_LIKE tooling keeps working); we replace only the # /etc/os-release symlink with the narOS file. set -eu R="$1" rm -f "$R/etc/os-release" cat > "$R/etc/os-release" < "$R/etc/naros/channel" echo "$NAROS_SNAPSHOT" > "$R/etc/naros/snapshot-date" echo "container" > "$R/etc/naros/role" # Capability manifest (NAROS.md §6.3). Base fields here; toolchain entries are appended # by the tiers that install them (agent-tier hook, N2). Versions of Nucleic packages are # queryable via dpkg, listed here for one-stop reads. nash_ver="$(chroot "$R" dpkg-query -W -f '${Version}' nash 2>/dev/null || echo null)" [ "$nash_ver" = null ] || nash_ver="\"$nash_ver\"" cat > "$R/etc/naros/manifest.json" <