Files
RedBear-OS/recipes/shells/bash/redox.patch
T
vasilito 9871d79aa4 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
2026-07-12 09:23:10 +03:00

199 lines
7.0 KiB
Diff

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
@@ -2724,5 +2724,5 @@
{
-#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H)
+#if defined (__WIN32__) || defined (__OPENNT) || !defined (HAVE_GRP_H) || defined(__redox__)
return ((char *)NULL);
#else
static char *gname = (char *)NULL;
diff -ruwN source/builtins/ulimit.def source-new/builtins/ulimit.def
--- source/builtins/ulimit.def 2021-11-05 20:19:53.000000000 +0700
+++ source-new/builtins/ulimit.def 2025-09-01 04:36:35.272926519 +0700
@@ -609,7 +609,7 @@
}
else
{
-#if defined (HAVE_RESOURCE)
+#if defined (HAVE_RESOURCE) && !defined(__redox__)
if (getrlimit (limits[ind].parameter, &limit) < 0)
return -1;
# if defined (HPUX9)
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
@@ -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
@@ -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,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()
diff -ruwN source/execute_cmd.c source-new/execute_cmd.c
--- source/execute_cmd.c 2022-12-14 00:09:02.000000000 +0700
+++ source-new/execute_cmd.c 2025-09-01 04:36:35.275926660 +0700
@@ -1379,11 +1379,11 @@
nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0);
if (posixly_correct && nullcmd)
{
-#if defined (HAVE_GETRUSAGE)
+#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY)
selfb.ru_utime.tv_sec = kidsb.ru_utime.tv_sec = selfb.ru_stime.tv_sec = kidsb.ru_stime.tv_sec = 0;
selfb.ru_utime.tv_usec = kidsb.ru_utime.tv_usec = selfb.ru_stime.tv_usec = kidsb.ru_stime.tv_usec = 0;
before = shellstart;
-#else
+#elif defined (HAVE_TIMES)
before.tms_utime = before.tms_stime = before.tms_cutime = before.tms_cstime = 0;
tbefore = shell_start_time;
#endif
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
@@ -629,6 +629,7 @@
void
check_dev_tty (void)
{
+#if !defined(__redox__)
int tty_fd;
char *tty;
@@ -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
--- source/include/posixwait.h 2019-03-30 00:25:52.000000000 +0700
+++ source-new/include/posixwait.h 2025-09-01 04:36:35.276926707 +0700
@@ -34,7 +34,7 @@
/* How to get the status of a job. For Posix, this is just an
int, but for other systems we have to crack the union wait. */
-#if !defined (_POSIX_VERSION)
+#if 0
typedef union wait WAIT;
# define WSTATUS(t) (t.w_status)
#else /* _POSIX_VERSION */
@@ -50,7 +50,7 @@
/* More Posix P1003.1 definitions. In the POSIX versions, the parameter is
passed as an `int', in the non-POSIX version, as `union wait'. */
-#if defined (_POSIX_VERSION)
+#if 1
# if !defined (WSTOPSIG)
# define WSTOPSIG(s) ((s) >> 8)
diff --color -ruwN source/jobs.c source-new/jobs.c
--- source/jobs.c 2022-12-14 00:09:02.000000000 +0700
+++ source-new/jobs.c 2026-02-09 23:29:28.811403291 +0700
@@ -4417,9 +4417,11 @@
{
shell_pgrp = getpid ();
setpgid (0, shell_pgrp);
+ }
+
+ // shell pgrep is not set automatically on Redox
if (shell_tty != -1)
tcsetpgrp (shell_tty, shell_pgrp);
- }
tty_sigs = 0;
while ((terminal_pgrp = tcgetpgrp (shell_tty)) != -1)
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
@@ -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
# 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
+++ source-new/lib/sh/getcwd.c 2025-09-01 04:36:35.286927174 +0700
@@ -20,7 +20,7 @@
#include <config.h>
-#if !defined (HAVE_GETCWD)
+#if !defined (HAVE_GETCWD) && !defined(__redox__)
#if !defined (__GNUC__) && !defined (HAVE_ALLOCA_H) && defined (_AIX)
#pragma alloca
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
@@ -54,6 +54,8 @@
extern long long strtoll (const char *, char **, int);
#endif
+#if !defined (__redox__)
+
#ifdef strtoimax
#undef strtoimax
#endif
@@ -76,6 +78,8 @@
return (strtol (ptr, endptr, base));
}
+#endif
+
#ifdef TESTING
# include <stdio.h>
int
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 <config.h>
#include <stdio.h>
+#if !defined (__redox__)
+
/* Specification. */
#include <string.h>
@@ -31,3 +33,4 @@
;
return (s1);
}
+#endif