From 7a363125886d06044e3b31061839fc1aa19c470f Mon Sep 17 00:00:00 2001 From: Vasilito Date: Sat, 25 Apr 2026 16:34:45 +0100 Subject: [PATCH] Add durability policy, userutils branding patch for Red Bear OS login/issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enforce that every source-tree edit must be mirrored to local/patches/ and wired into recipe.toml in the same session. Apply the policy retroactively to userutils res/issue and res/motd (Redox → Red Bear). --- AGENTS.md | 28 ++++++++++++++++++++++++++++ local/patches/userutils/redox.patch | 24 ++++++++++++++++++++++++ recipes/core/userutils/recipe.toml | 3 +++ 3 files changed, 55 insertions(+) create mode 100644 local/patches/userutils/redox.patch diff --git a/AGENTS.md b/AGENTS.md index 9972c052..b2c96baf 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -158,6 +158,34 @@ make all - **DO NOT** skip patches in WIP recipes — document what's missing with `#TODO` - **DO NOT** skip warnings — investigate, diagnose, and fix the root cause; suppressing or ignoring warnings is not acceptable when a fix is feasible +## DURABILITY POLICY + +Every change to an upstream-owned source tree (anything under `recipes/*/source/`) **must** be +mirrored into a durable location **in the same work session** it was made. A change that exists +only inside a fetched source tree is not preserved. + +**Required actions after any source-tree edit:** + +1. **Generate a patch** from the source git diff and save it under `local/patches//`. +2. **Wire the patch** into the recipe's `recipe.toml` `patches = [...]` list. +3. **Commit** the patch file and recipe change before the session ends. + +**Why:** `make distclean`, `make clean`, upstream source refreshes, and `sync-upstream.sh` all +discard or replace `recipes/*/source/` trees. Only `local/patches/`, `local/recipes/`, tracked +configs, and `local/docs/` survive. + +**Examples of changes that require immediate patching:** + +| What you edited | Durable location | +|---|---| +| `recipes/core/relibc/source/src/header/sys_select/mod.rs` | `local/patches/relibc/P3-select-not-epoll-timeout.patch` + `recipe.toml` | +| `recipes/core/relibc/source/src/header/signal/cbindgen.toml` | same patch as above | +| `recipes/core/userutils/source/res/issue` | `local/patches/userutils/redox.patch` + `recipe.toml` | +| `recipes/core/kernel/source/...` | `local/patches/kernel/redox.patch` (symlinked from recipe) | + +**What does NOT need patching:** Files that already live in `local/`, tracked `config/redbear-*.toml`, +or any path that is already git-tracked and not inside a fetched source tree. + ## PATCH MANAGEMENT All Red Bear OS modifications to upstream files are kept separately in `local/patches/`. diff --git a/local/patches/userutils/redox.patch b/local/patches/userutils/redox.patch new file mode 100644 index 00000000..dbc9a197 --- /dev/null +++ b/local/patches/userutils/redox.patch @@ -0,0 +1,24 @@ +diff --git a/res/issue b/res/issue +index 6a963d8..59ffbd4 100644 +--- a/res/issue ++++ b/res/issue +@@ -1,6 +1,6 @@ +-########## Redox OS ########## +-# Login with the following: # +-# `user` # +-# `root`:`password` # +-############################## ++########## Red Bear OS ######### ++# Login with the following: # ++# `user` # ++# `root`:`password` # ++################################ + +diff --git a/res/motd b/res/motd +index 5cd097a..dc28b04 100644 +--- a/res/motd ++++ b/res/motd +@@ -1,2 +1,2 @@ +-Welcome to Redox OS! ++Welcome to Red Bear OS! + diff --git a/recipes/core/userutils/recipe.toml b/recipes/core/userutils/recipe.toml index 666bfeb1..3bc189b7 100644 --- a/recipes/core/userutils/recipe.toml +++ b/recipes/core/userutils/recipe.toml @@ -1,5 +1,8 @@ [source] git = "https://gitlab.redox-os.org/redox-os/userutils.git" +patches = [ + "../../../local/patches/userutils/redox.patch", +] [build] template = "custom"