diff options
| author | brian cully <bjc@spork.org> | 2026-06-25 11:27:24 -0400 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-07-02 19:17:19 +0200 |
| commit | 664d29820d798d9a5c5f2e18c0d53688cbf15f91 (patch) | |
| tree | e0c0986a91ac3ac5211ce4b99919572b6ae74c84 | |
| parent | 8d27b1158de3cc1823d33847cb722722c769a27e (diff) | |
gnu: hurd: Remove startup patch that is no longer needed.
runsystem and rc already create all the required servers and paths, obviating
the patch to startup.c, which also assumed / is mounted read/write before
system bootstrap.
* gnu/packages/hurd.scm (hurd): [patches]: remove ‘hurd-startup.patch’
application.
* gnu/packages/hurd-startup.patch: deleted
* gnu/local.mk: remove hurd-startup.patch
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #9527
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/hurd.scm | 3 | ||||
| -rw-r--r-- | gnu/packages/patches/hurd-startup.patch | 82 |
3 files changed, 1 insertions, 85 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 767076c95b8..5cbf117a148 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1621,7 +1621,6 @@ dist_patch_DATA = \ | |||
| 1621 | %D%/packages/patches/hurd-pfinet-recv-control-block.patch \ | 1621 | %D%/packages/patches/hurd-pfinet-recv-control-block.patch \ |
| 1622 | %D%/packages/patches/hurd-refcounts-assert.patch \ | 1622 | %D%/packages/patches/hurd-refcounts-assert.patch \ |
| 1623 | %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ | 1623 | %D%/packages/patches/hurd-rumpdisk-no-hd.patch \ |
| 1624 | %D%/packages/patches/hurd-startup.patch \ | ||
| 1625 | %D%/packages/patches/hwloc-add-with-opencl.patch \ | 1624 | %D%/packages/patches/hwloc-add-with-opencl.patch \ |
| 1626 | %D%/packages/patches/i3lock-blur-fix-build-on-gcc-10.patch \ | 1625 | %D%/packages/patches/i3lock-blur-fix-build-on-gcc-10.patch \ |
| 1627 | %D%/packages/patches/i7z-gcc-10.patch \ | 1626 | %D%/packages/patches/i7z-gcc-10.patch \ |
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 31959009c7e..7a62017d89f 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm | |||
| @@ -396,8 +396,7 @@ Hurd-minimal package which are needed for both glibc and GCC.") | |||
| 396 | (inherit (package-source hurd-headers)) | 396 | (inherit (package-source hurd-headers)) |
| 397 | (patches (search-patches "hurd-pfinet-recv-control-block.patch" | 397 | (patches (search-patches "hurd-pfinet-recv-control-block.patch" |
| 398 | "hurd-refcounts-assert.patch" | 398 | "hurd-refcounts-assert.patch" |
| 399 | "hurd-rumpdisk-no-hd.patch" | 399 | "hurd-rumpdisk-no-hd.patch")))) |
| 400 | "hurd-startup.patch")))) | ||
| 401 | (version (package-version hurd-headers)) | 400 | (version (package-version hurd-headers)) |
| 402 | (arguments | 401 | (arguments |
| 403 | `(#:tests? #f ;no "check" target | 402 | `(#:tests? #f ;no "check" target |
diff --git a/gnu/packages/patches/hurd-startup.patch b/gnu/packages/patches/hurd-startup.patch deleted file mode 100644 index 0b0dcc95374..00000000000 --- a/gnu/packages/patches/hurd-startup.patch +++ /dev/null | |||
| @@ -1,82 +0,0 @@ | |||
| 1 | This avoids hanging upon second boot and ensures a declarative /dev. | ||
| 2 | |||
| 3 | Upstream status: Not presented upstream. | ||
| 4 | |||
| 5 | From a15d281ea012ee360c45376e964d35f6292ac549 Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Janneke Nieuwenhuizen <janneke@gnu.org> | ||
| 7 | Date: Sat, 27 May 2023 17:28:22 +0200 | ||
| 8 | Subject: [PATCH] startup: Remove /hurd, /dev, create /servers. | ||
| 9 | |||
| 10 | This avoids hanging upon second boot and ensures a declarative /hurd | ||
| 11 | and /dev. | ||
| 12 | |||
| 13 | * startup/startup.c (rm_r, create_servers): New functions. | ||
| 14 | (main): Use them to remove /dev and create /servers. Remove /hurd | ||
| 15 | symlink. | ||
| 16 | --- | ||
| 17 | startup/startup.c | 42 ++++++++++++++++++++++++++++++++++++++++++ | ||
| 18 | 1 file changed, 42 insertions(+) | ||
| 19 | |||
| 20 | diff --git a/startup/startup.c b/startup/startup.c | ||
| 21 | index feb7d265..5f380194 100644 | ||
| 22 | --- a/startup/startup.c | ||
| 23 | +++ b/startup/startup.c | ||
| 24 | @@ -732,6 +732,42 @@ parse_opt (int key, char *arg, struct argp_state *state) | ||
| 25 | return 0; | ||
| 26 | } | ||
| 27 | |||
| 28 | +#include <ftw.h> | ||
| 29 | +static int | ||
| 30 | +rm_r (char const *file_name) | ||
| 31 | +{ | ||
| 32 | + int callback (char const *file_name, struct stat64 const *stat_buffer, | ||
| 33 | + int type_flag, struct FTW *ftw_buffer) | ||
| 34 | + { | ||
| 35 | + fprintf (stderr, "startup: removing: %s\n", file_name); | ||
| 36 | + return remove (file_name); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + return nftw64 (file_name, callback, 0, FTW_DEPTH | FTW_MOUNT | FTW_PHYS); | ||
| 40 | +} | ||
| 41 | + | ||
| 42 | +void | ||
| 43 | +create_servers (void) | ||
| 44 | +{ | ||
| 45 | + char const *servers[] = { | ||
| 46 | + "/servers/startup", | ||
| 47 | + "/servers/exec", | ||
| 48 | + "/servers/proc", | ||
| 49 | + "/servers/password", | ||
| 50 | + "/servers/default-pager", | ||
| 51 | + "/servers/crash-dump-core", | ||
| 52 | + "/servers/kill", | ||
| 53 | + "/servers/suspend", | ||
| 54 | + 0, | ||
| 55 | + }; | ||
| 56 | + mkdir ("/servers", 0755); | ||
| 57 | + for (char const **p = servers; *p; p++) | ||
| 58 | + open (*p, O_WRONLY | O_APPEND | O_CREAT, 0444); | ||
| 59 | + mkdir ("/servers/socket", 0755); | ||
| 60 | + mkdir ("/servers/bus", 0755); | ||
| 61 | + mkdir ("/servers/bus/pci", 0755); | ||
| 62 | +} | ||
| 63 | + | ||
| 64 | int | ||
| 65 | main (int argc, char **argv, char **envp) | ||
| 66 | { | ||
| 67 | @@ -741,6 +777,12 @@ main (int argc, char **argv, char **envp) | ||
| 68 | mach_port_t consdev; | ||
| 69 | struct argp argp = { options, parse_opt, 0, doc }; | ||
| 70 | |||
| 71 | + /* GNU Guix creates fresh ones in boot-hurd-system. */ | ||
| 72 | + unlink ("/hurd"); | ||
| 73 | + rm_r ("/dev"); | ||
| 74 | + mkdir ("/dev", 0755); | ||
| 75 | + create_servers (); | ||
| 76 | + | ||
| 77 | /* Parse the arguments. We don't want the vector reordered, we | ||
| 78 | should pass on to our child the exact arguments we got and just | ||
| 79 | ignore any arguments that aren't flags for us. ARGP_NO_ERRS | ||
| 80 | -- | ||
| 81 | 2.40.1 | ||
| 82 | |||
