verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
redbear-release
OS release metadata —
/etc/os-release, hostname, motd, banner, and branding assets.
Status: PRODUCTION-READY
Category: branding
Build: ./local/scripts/build-redbear.sh redbear-mini (no Cargo workspace — pure shell/custom template)
Purpose
redbear-release is the Red Bear OS branding data package. It generates /etc/os-release (systemd-compatible OS identification), /etc/hostname, /etc/motd (message of the day), and stages branding assets (ASCII banner, application icon, loading background image) into the filesystem image at build time.
The version string (@REDBEAR_VERSION@) is substituted at build time from the current git branch name (falling back to the REDBEAR_VERSION environment variable or "0.0.0"). This ensures the OS release metadata always reflects the exact Red Bear OS version being built.
Build Integration
Included in config/redbear-mini.toml (and thus inherited by redbear-full.toml and redbear-grub.toml). Protected recipe in config/protected-recipes.toml.
Build template: custom (shell script). No Cargo, no cross-compilation — pure file staging.
Files Staged
| File | Source | Purpose |
|---|---|---|
/usr/lib/os-release |
os-release.in |
Systemd-compatible OS identification (PRETTY_NAME, NAME, VERSION_ID, ID, ID_LIKE, VERSION_CODENAME, BUILD_ID, URLs). Version substituted from git branch. |
/etc/os-release |
symlink → ../usr/lib/os-release |
Standard location for /etc/os-release |
/etc/hostname |
hostname |
Default hostname: redbear |
/etc/motd |
motd.in |
Message of the day: Red Bear OS v@REDBEAR_VERSION@ "Liliya" — Built on Redox OS |
/usr/share/redbear/banner |
banner |
ASCII art banner displayed at login |
/usr/share/icons/hicolor/128x128/apps/redbear-os.png |
images/icon.png |
Application icon (1254×1254px) |
/usr/share/redbear/images/icon.png |
images/icon.png |
Icon copy for Red Bear-specific paths |
/usr/share/redbear/images/loading-background.png |
images/loading-background.png |
Loading/boot background (1536×1024px) |
Version Substitution
The build script derives the Red Bear OS version at cook time:
# Priority: REDBEAR_VERSION env var > git branch name > "0.0.0"
if [ -n "${REDBEAR_VERSION:-}" ]; then
RB_VER="$REDBEAR_VERSION"
elif command -v git >/dev/null 2>&1; then
RB_VER=$(git -C "${COOKBOOK_ROOT:-$(pwd)}" branch --show-current \
| grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "0.0.0")
else
RB_VER="0.0.0"
fi
This ensures that os-release always reports the correct branch version (e.g., 0.3.1) regardless of how the build is invoked.
Architecture
- Template files (
*.in): contain@REDBEAR_VERSION@placeholders - Build script (
recipe.toml[build]): runssedsubstitution on templates, copies static files, symlinks/etc/os-release, and conditionally stages branding images if present - Image staging:
local/scripts/integrate-redbear.shcopies assets fromlocal/Assets/images/intosource/images/before the cookbook runs — the recipe conditionally stages them with[ -f ... ]guards
Consumers
- Init system — reads
/etc/hostnamefor hostname configuration - Login/Greeter stack — reads
/etc/motdfor login banner, uses branding images for greeter background and icon - System information tools (
redbear-info) — reads/usr/lib/os-releasefor OS identification - Package manager (
cub) — readsos-releasefor target OS metadata
References
local/Assets/images/— Source branding assets (icon, loading background)local/scripts/integrate-redbear.sh— Asset staging into recipe source treeconfig/base.toml— Comment note: "os-release is provided by the redbear-release recipe"