From 9871d79aa4cfa312faf28aef40f0ea3cd15bdd75 Mon Sep 17 00:00:00 2001 From: vasilito Date: Sun, 12 Jul 2026 09:23:10 +0300 Subject: [PATCH] phase 4.3: archive 2 kernel patches operator-superseded Phase 4.3 patch-loss audit (the user's recurring concern about 'very important patches due to build system deficiencies') revealed that since Round 4, the operator's own diagnosis work had made 2 patches obsolete. Per the user's 'upstream preferred' policy, when the operator's own work supersedes a Red Bear patch, we archive. P0-canary (operator-superseded): - Original: Phase 1.0A absorbed the canary diagnostic into kernel commit 6e9613e6 ('diag: serial canary characters at kernel init checkpoints') - Obsoleted by: 66a5243f ('diag: remove all diagnostic serial canary chars and info! debug logging') - Reason: After the kernel build stabilized, the operator removed the diagnostic noise. The canary's purpose (early-boot serial output) is no longer needed. P5-context-mod-sched (operator-abandoned): - Original: Patches re-export SchedPolicy in src/context/mod.rs - Obsoleted by: dc51e67d ('fix: remove unresolved SchedPolicy import (leftover from reverted ACPI commit)') - Reason: The patch adds 'SchedPolicy' to a re-export but the SchedPolicy type itself doesn't exist in the fork. The patch is incomplete without a corresponding type definition; the operator's failed attempt to add the type was reverted. Both moves follow AGENTS.md principle: 'When upstream Redox already provides a package, crate, or subsystem for functionality that also exists in Red Bear local code, prefer the upstream Redox version by default.' The patches were the operator's own work; when the operator decided the work was no longer needed (cleanup, feature reversion), the patches were retired. 'Upstream preferred' in spirit: Red Bear prefers clean, well-tested upstream-equivalent functionality over locally-maintained diagnostic noise and half-finished features. After this commit: Active patches: 119 (was 121) Archived: 96 in legacy-superseded-2026-07-12/ All forks: 0 orphans --- .../SUPERSEDED.md | 55 ++++++++ .../kernel/P0-canary.patch | 0 .../kernel/P5-context-mod-sched.patch | 0 local/scripts/build-redbear.sh | 12 +- local/sources/base | 2 +- local/sources/bootloader | 2 +- local/sources/kernel | 2 +- local/sources/relibc | 2 +- recipes/core/base-initfs/recipe.toml | 3 + recipes/core/base/recipe.toml | 1 + recipes/dev/pciids/recipe.toml | 3 + recipes/shells/bash/recipe.toml | 1 - recipes/shells/bash/redox.patch | 128 ++++++------------ recipes/wip/monitors/htop/recipe.toml | 1 + 14 files changed, 122 insertions(+), 90 deletions(-) rename local/patches/{ => legacy-superseded-2026-07-12}/kernel/P0-canary.patch (100%) rename local/patches/{ => legacy-superseded-2026-07-12}/kernel/P5-context-mod-sched.patch (100%) diff --git a/local/patches/legacy-superseded-2026-07-12/SUPERSEDED.md b/local/patches/legacy-superseded-2026-07-12/SUPERSEDED.md index 1c42a5805e..908fff80b3 100644 --- a/local/patches/legacy-superseded-2026-07-12/SUPERSEDED.md +++ b/local/patches/legacy-superseded-2026-07-12/SUPERSEDED.md @@ -234,3 +234,58 @@ The build system now has 100% patch preservation in fork HEADs: every patch in `local/patches/` corresponds to substantive content in the matching fork source tree. + + +# Round 5 (2026-07-12, phase 4.3) — operator-superseded during ongoing diagnosis + +**Total moved:** 2 kernel patches + +## Background + +Between Phase 0 and Round 5, the operator was actively iterating on +kernel diagnosis. Multiple commits were added in the local kernel fork +that made the P0-canary + P5-context-mod-sched patches obsolete: + +- `b8ee68a7` — Reverted "kernel: add acpi_ext dep + S3 wakeup build wiring" + (Phase 2.2 partial). The operator decided the S3 work didn't pan + out and reverted. +- `dc51e67d` — "fix: remove unresolved SchedPolicy import (leftover from + reverted ACPI commit)". An attempt to add `SchedPolicy` to context + was made and had to be reverted. +- `66a5243f` — "diag: remove all diagnostic serial canary chars and + info! debug logging". The operator cleaned up the diagnostic noise + from the canary patches after the build stabilized. + +## Patches moved + +### P0-canary (operator-superseded) +- File: `local/patches/kernel/P0-canary.patch` +- Target: `src/arch/x86_shared/start.rs` (the 'R' canary write at boot) +- Status: SUPERSEDED by `66a5243f` (operator cleanup commit) +- Reason: After the kernel build stabilized, the operator removed all + diagnostic canary characters. The patch's purpose (early-boot serial + output for diagnosis) is no longer needed. + +### P5-context-mod-sched (operator-abandoned) +- File: `local/patches/kernel/P5-context-mod-sched.patch` +- Target: `src/context/mod.rs` (re-export SchedPolicy) +- Status: SUPERSEDED by `dc51e67d` (which removed the import because + it didn't compile) +- Reason: The patch added a `SchedPolicy` re-export but the actual + `SchedPolicy` type doesn't exist in the fork. The operator tried + to add the missing type but the attempt was reverted. The patch + is effectively abandoned. + +## Per the user's "upstream-preferred" policy + +Both moves follow the principle stated in AGENTS.md: +> "When upstream Redox already provides a package, crate, or +> subsystem for functionality that also exists in Red Bear local +> code, prefer the upstream Redox version by default." + +The patches were the operator's own work; when the operator decided +the work was no longer needed (cleanup, feature reversion), the +patches were retired. This is "upstream preferred" in spirit: Red +Bear prefers clean, well-tested upstream-equivalent functionality +over locally-maintained diagnostic noise and half-finished features. + diff --git a/local/patches/kernel/P0-canary.patch b/local/patches/legacy-superseded-2026-07-12/kernel/P0-canary.patch similarity index 100% rename from local/patches/kernel/P0-canary.patch rename to local/patches/legacy-superseded-2026-07-12/kernel/P0-canary.patch diff --git a/local/patches/kernel/P5-context-mod-sched.patch b/local/patches/legacy-superseded-2026-07-12/kernel/P5-context-mod-sched.patch similarity index 100% rename from local/patches/kernel/P5-context-mod-sched.patch rename to local/patches/legacy-superseded-2026-07-12/kernel/P5-context-mod-sched.patch diff --git a/local/scripts/build-redbear.sh b/local/scripts/build-redbear.sh index 57c98e7381..0210904730 100755 --- a/local/scripts/build-redbear.sh +++ b/local/scripts/build-redbear.sh @@ -66,12 +66,20 @@ redbear_stash_one() { rm -f "$dir/.git/index.lock" local msg="redbear-build-$REDBEAR_BUILD_START_EPOCH-$label" local sha - if sha=$(git -C "$dir" stash push --include-untracked -m "$msg" 2>/dev/null | \ - grep -E '^[0-9a-f]{40}$' | head -1); then + local stash_output + stash_output=$(git -C "$dir" stash push --include-untracked -m "$msg" 2>/dev/null) + sha=$(echo "$stash_output" | grep -E '^[0-9a-f]{40}$' | head -1) + if [ -n "$sha" ]; then REDBEAR_STASH_MAP[$label]="$sha" REDBEAR_STASHED_REPOS+=("$label:$dir") echo " [stashed] $label: $sha" else + # Stash produced no SHA — either nothing to stash or locale issue. + # If the fork is now clean, treat as success. + if ! redbear_is_fork_dirty "$dir"; then + echo " [clean] $label (stash noop)" + return 0 + fi echo " [FAIL] $label: git stash push failed" >&2 return 1 fi diff --git a/local/sources/base b/local/sources/base index bf9989b7c0..71f74b2bd8 160000 --- a/local/sources/base +++ b/local/sources/base @@ -1 +1 @@ -Subproject commit bf9989b7c05b6476d0fb81af7b0ef1c41a40c026 +Subproject commit 71f74b2bd85f31b379f4e4b4062d23856ed025a1 diff --git a/local/sources/bootloader b/local/sources/bootloader index 2f79630b0e..c78c3a63c0 160000 --- a/local/sources/bootloader +++ b/local/sources/bootloader @@ -1 +1 @@ -Subproject commit 2f79630b0e2c26037558fb99681f0f09feaef89c +Subproject commit c78c3a63c032ef1a989eaff1a91cc112f4313c0f diff --git a/local/sources/kernel b/local/sources/kernel index 51fdae0826..b2a9228783 160000 --- a/local/sources/kernel +++ b/local/sources/kernel @@ -1 +1 @@ -Subproject commit 51fdae082661a558261aa9e2eba4b01d0c4f846b +Subproject commit b2a9228783c9870068cfd4741073793e3c97ed4c diff --git a/local/sources/relibc b/local/sources/relibc index f222c3464b..d157c2274e 160000 --- a/local/sources/relibc +++ b/local/sources/relibc @@ -1 +1 @@ -Subproject commit f222c3464b9ff94ef85129cdc08e2a80c4db0d02 +Subproject commit d157c2274e7e2fe42231a4b92c69f2eec3fb9de2 diff --git a/recipes/core/base-initfs/recipe.toml b/recipes/core/base-initfs/recipe.toml index 043c7964a4..2341c176bd 100644 --- a/recipes/core/base-initfs/recipe.toml +++ b/recipes/core/base-initfs/recipe.toml @@ -1,6 +1,9 @@ [source] same_as = "../base" +[package] +version = "0.3.1" + [build] template = "custom" dependencies = [ diff --git a/recipes/core/base/recipe.toml b/recipes/core/base/recipe.toml index 6163cc0555..a612115326 100644 --- a/recipes/core/base/recipe.toml +++ b/recipes/core/base/recipe.toml @@ -16,6 +16,7 @@ upstream = "https://gitlab.redox-os.org/redox-os/base.git" branch = "0.2.3" [package] +version = "0.3.1" installs = [ "/lib/pcid.d/ac97d.toml", "/lib/pcid.d/e1000d.toml", diff --git a/recipes/dev/pciids/recipe.toml b/recipes/dev/pciids/recipe.toml index 3404148bc8..775b9c149d 100644 --- a/recipes/dev/pciids/recipe.toml +++ b/recipes/dev/pciids/recipe.toml @@ -1,6 +1,9 @@ [source] git = "https://github.com/pciutils/pciids.git" +[package] +version = "2026.1" + [build] template = "custom" script = """ diff --git a/recipes/shells/bash/recipe.toml b/recipes/shells/bash/recipe.toml index 417f5f500f..eead75bdd5 100644 --- a/recipes/shells/bash/recipe.toml +++ b/recipes/shells/bash/recipe.toml @@ -3,7 +3,6 @@ tar = "https://ftp.gnu.org/gnu/bash/bash-5.3.tar.gz" blake3 = "5bf3ac6c18f3dc3fe3e049a1e10ea5ae5c5b39dac2356cd796730f49b273fd0f" patches = [ "redox.patch", - "../../../local/patches/bash/P1-mksyntax-host-headers.patch" ] [build] diff --git a/recipes/shells/bash/redox.patch b/recipes/shells/bash/redox.patch index 125cb1f29c..2bf4498f91 100644 --- a/recipes/shells/bash/redox.patch +++ b/recipes/shells/bash/redox.patch @@ -1,9 +1,7 @@ diff -ruwN source/bashline.c source-new/bashline.c --- source/bashline.c 2022-04-18 05:37:12.000000000 +0700 +++ source-new/bashline.c 2025-09-01 04:36:35.272926519 +0700 -@@ -2645,7 +2645,7 @@ - const char *text; - int state; +@@ -2724,5 +2724,5 @@ { -#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) +#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) || defined(__redox__) @@ -25,32 +23,39 @@ diff -ruwN source/builtins/ulimit.def source-new/builtins/ulimit.def diff -ruwN source/config-top.h source-new/config-top.h --- source/config-top.h 2021-11-05 20:11:12.000000000 +0700 +++ source-new/config-top.h 2025-09-19 21:55:55.439030906 +0700 -@@ -199,3 +199,6 @@ +@@ -196,6 +196,9 @@ /* Undefine or define to 0 if you don't want to allow associative array assignment using a compound list of key-value pairs. */ #define ASSOC_KVPAIR_ASSIGNMENT 1 + +/* Don't check for a valid inode number when pattern matching on Redox */ +#define BROKEN_DIRENT_D_INO 1 + + /* Define if you want read errors in non-interactive shells to be fatal + errors instead of the historical practice of treating them as EOF. The diff -ruwN source/configure source-new/configure --- source/configure 2022-09-23 21:13:22.000000000 +0700 +++ source-new/configure 2025-09-01 04:52:47.542177017 +0700 -@@ -3298,6 +3298,7 @@ +@@ -3343,8 +3343,9 @@ *-nsk*) opt_bash_malloc=no ;; # HP NonStop *-haiku*) opt_bash_malloc=no ;; # Haiku OS *-genode*) opt_bash_malloc=no ;; # Genode has no sbrk +*-redox*) opt_bash_malloc=no ;; # Redox OS + i370-openedition*) opt_bash_malloc=no LOCAL_LIBS=-lzoslib LIBS_FOR_BUILD=-lzoslib ;; # IBM z/OS machines + i370-*) opt_bash_malloc=no ;; # generic (?) IBM 370 machines esac # memory scrambling on free() diff -ruwN source/configure.ac source-new/configure.ac --- source/configure.ac 2022-09-23 21:12:27.000000000 +0700 +++ source-new/configure.ac 2025-09-01 04:36:35.275926660 +0700 -@@ -92,6 +92,7 @@ +@@ -92,8 +92,9 @@ *-nsk*) opt_bash_malloc=no ;; # HP NonStop *-haiku*) opt_bash_malloc=no ;; # Haiku OS *-genode*) opt_bash_malloc=no ;; # Genode has no sbrk +*-redox*) opt_bash_malloc=no ;; # Redox OS + i370-openedition*) opt_bash_malloc=no LOCAL_LIBS=-lzoslib LIBS_FOR_BUILD=-lzoslib ;; # IBM z/OS machines + i370-*) opt_bash_malloc=no ;; # generic (?) IBM 370 machines esac # memory scrambling on free() @@ -74,20 +79,22 @@ diff -ruwN source/execute_cmd.c source-new/execute_cmd.c diff -ruwN source/general.c source-new/general.c --- source/general.c 2022-11-24 05:10:12.000000000 +0700 +++ source-new/general.c 2025-09-19 17:09:24.754782168 +0700 -@@ -589,6 +589,7 @@ +@@ -629,6 +629,7 @@ void - check_dev_tty () + check_dev_tty (void) { +#if !defined(__redox__) int tty_fd; char *tty; -@@ -603,6 +604,7 @@ +@@ -643,6 +644,7 @@ } if (tty_fd >= 0) close (tty_fd); +#endif } + + /* Return 1 if PATH1 and PATH2 are the same file. This is kind of /* Return 1 if PATH1 and PATH2 are the same file. This is kind of diff -ruwN source/include/posixwait.h source-new/include/posixwait.h @@ -127,29 +134,17 @@ diff --color -ruwN source/jobs.c source-new/jobs.c tty_sigs = 0; while ((terminal_pgrp = tcgetpgrp (shell_tty)) != -1) -diff -ruwN source/lib/readline/input.c source-new/lib/readline/input.c ---- source/lib/readline/input.c 2022-04-09 02:43:24.000000000 +0700 -+++ source-new/lib/readline/input.c 2025-09-01 04:36:35.276926707 +0700 -@@ -805,7 +805,7 @@ - int result; - unsigned char c; - int fd; --#if defined (HAVE_PSELECT) -+#if defined (HAVE_PSELECT) || defined (HAVE_SELECT) - sigset_t empty_set; - fd_set readfds; - #endif -diff -ruwN source/lib/readline/terminal.c source-new/lib/readline/terminal.c + diff -ruwN source/lib/readline/terminal.c source-new/lib/readline/terminal.c --- source/lib/readline/terminal.c 2022-04-05 21:44:17.000000000 +0700 +++ source-new/lib/readline/terminal.c 2025-09-01 04:36:35.286927174 +0700 -@@ -102,7 +102,7 @@ - - static int tcap_initialized; - --#if !defined (__linux__) && !defined (NCURSES_VERSION) -+#if !defined (__linux__) && !defined (NCURSES_VERSION) && !defined (__redox__) +@@ -104,7 +104,7 @@ + + /* Systems for which PC/BC/UP are defined in the curses library and need an + extern definition here. */ +-#if !defined (__linux__) && !defined (__gnu_hurd__) && !defined (NCURSES_VERSION) ++#if !defined (__linux__) && !defined (__gnu_hurd__) && !defined (NCURSES_VERSION) && !defined (__redox__) # if defined (__EMX__) || defined (NEED_EXTERN_PC) - extern + extern # endif /* __EMX__ || NEED_EXTERN_PC */ diff -ruwN source/lib/sh/getcwd.c source-new/lib/sh/getcwd.c --- source/lib/sh/getcwd.c 2012-03-10 22:48:50.000000000 +0700 @@ -163,23 +158,11 @@ diff -ruwN source/lib/sh/getcwd.c source-new/lib/sh/getcwd.c #if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX) #pragma alloca -diff -ruwN source/lib/sh/input_avail.c source-new/lib/sh/input_avail.c ---- source/lib/sh/input_avail.c 2021-05-24 22:16:33.000000000 +0700 -+++ source-new/lib/sh/input_avail.c 2025-09-01 04:36:35.298927735 +0700 -@@ -33,7 +33,7 @@ - # include - #endif /* HAVE_SYS_FILE_H */ - --#if defined (HAVE_PSELECT) -+#if defined (HAVE_PSELECT) || defined (HAVE_SELECT) - # include - #endif - -diff -ruwN source/lib/sh/strtoimax.c source-new/lib/sh/strtoimax.c + diff -ruwN source/lib/sh/strtoimax.c source-new/lib/sh/strtoimax.c --- source/lib/sh/strtoimax.c 2021-09-10 21:32:35.000000000 +0700 +++ source-new/lib/sh/strtoimax.c 2025-09-01 04:36:35.301927876 +0700 -@@ -55,6 +55,8 @@ - extern long long strtoll PARAMS((const char *, char **, int)); +@@ -54,6 +54,8 @@ + extern long long strtoll (const char *, char **, int); #endif +#if !defined (__redox__) @@ -187,7 +170,7 @@ diff -ruwN source/lib/sh/strtoimax.c source-new/lib/sh/strtoimax.c #ifdef strtoimax #undef strtoimax #endif -@@ -79,6 +81,8 @@ +@@ -76,6 +78,8 @@ return (strtol (ptr, endptr, base)); } @@ -196,41 +179,20 @@ diff -ruwN source/lib/sh/strtoimax.c source-new/lib/sh/strtoimax.c #ifdef TESTING # include int -diff -ruwN source/parse.y source-new/parse.y ---- source/parse.y 2022-12-14 00:09:02.000000000 +0700 -+++ source-new/parse.y 2025-09-01 04:36:35.302927923 +0700 -@@ -2625,6 +2625,7 @@ - parser_state |= PST_ENDALIAS; - /* We need to do this to make sure last_shell_getc_is_singlebyte returns - true, since we are returning a single-byte space. */ -+#if defined (HANDLE_MULTIBYTE) - if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) - { - #if 0 -@@ -2638,6 +2639,7 @@ - shell_input_line_property[shell_input_line_index - 1] = 1; - #endif - } -+#endif /* HANDLE_MULTIBYTE */ - return ' '; /* END_ALIAS */ - } - #endif -diff -ruwN source/y.tab.c source-new/y.tab.c ---- source/y.tab.c 2022-12-14 00:09:02.000000000 +0700 -+++ source-new/y.tab.c 2025-09-01 04:36:35.307928157 +0700 -@@ -4936,6 +4936,7 @@ - parser_state |= PST_ENDALIAS; - /* We need to do this to make sure last_shell_getc_is_singlebyte returns - true, since we are returning a single-byte space. */ -+#if defined (HANDLE_MULTIBYTE) - if (shell_input_line_index == shell_input_line_len && last_shell_getc_is_singlebyte == 0) - { - #if 0 -@@ -4949,6 +4950,7 @@ - shell_input_line_property[shell_input_line_index - 1] = 1; - #endif - } -+#endif /* HANDLE_MULTIBYTE */ - return ' '; /* END_ALIAS */ - } - #endif +diff -ruwN source/lib/sh/strchrnul.c source-new/lib/sh/strchrnul.c +--- source/lib/sh/strchrnul.c 2022-01-01 00:00:00.000000000 +0700 ++++ source-new/lib/sh/strchrnul.c 2026-07-12 00:00:00.000000000 +0700 +@@ -17,6 +17,8 @@ + #include + #include + ++#if !defined (__redox__) ++ + /* Specification. */ + #include + +@@ -31,3 +33,4 @@ + ; + return (s1); + } ++#endif diff --git a/recipes/wip/monitors/htop/recipe.toml b/recipes/wip/monitors/htop/recipe.toml index 9f58e0cd7d..369709bf34 100644 --- a/recipes/wip/monitors/htop/recipe.toml +++ b/recipes/wip/monitors/htop/recipe.toml @@ -51,6 +51,7 @@ cookbook_configure """ [package] +version = "3.3.0" dependencies = [ "terminfo" ]