diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-29 12:46:26 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-29 12:46:26 +0200 |
commit | 70222b52e3646eddd7edca31c913848b7b583145 (patch) | |
tree | b9a688225380db484117214e16263c6a3ebe9131 /debian | |
parent | a1c8cac5d43113b5c8d0d4a2396739365e818fd0 (diff) |
drop patches
Diffstat (limited to 'debian')
9 files changed, 0 insertions, 898 deletions
diff --git a/debian/patches/exec-early-diagnostics.patch b/debian/patches/exec-early-diagnostics.patch deleted file mode 100644 index ad97508b..00000000 --- a/debian/patches/exec-early-diagnostics.patch +++ /dev/null @@ -1,165 +0,0 @@ -From d4097ed3d55c2787ab2ec55270c652e94cf6e72d Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Tue, 23 Sep 2014 11:42:43 +0200 -Subject: [PATCH] exec: add proper argument parsing, add --device-master-port - -If the device master port is given, a boot-time exec server can print -diagnostic messages earlier. - -* exec/main.c (opt_device_master): New variable. -(OPT_DEVICE_MASTER_PORT): New macro. -(options): New set of options. -(parse_opt): New function. -(trivfs_append_args): Likewise. -(argp): Pull the argp definition out of main. -(trivfs_runtime_argp): Set, so that we respond properly to fsysopts. -(open_console): Pull the code out of S_exec_init and generalize it. -(main): Call open_console if a device master port is given. -(S_exec_init): Call open_console. ---- - exec/main.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- - 1 file changed, 93 insertions(+), 13 deletions(-) - -diff --git a/exec/main.c b/exec/main.c -index 78faebd..784000b 100644 ---- a/exec/main.c -+++ b/exec/main.c -@@ -45,6 +45,7 @@ int trivfs_cntl_nportclasses = 1; - struct trivfs_control *fsys; - - char **save_argv; -+mach_port_t opt_device_master; - - - #include "exec_S.h" -@@ -104,16 +105,104 @@ deadboot (void *p) - ports_enable_class (trivfs_cntl_portclasses[0]); - } - -+#define OPT_DEVICE_MASTER_PORT (-1) -+ -+static const struct argp_option options[] = -+{ -+ {"device-master-port", OPT_DEVICE_MASTER_PORT, "PORT", 0, -+ "If specified, a boot-time exec server can print " -+ "diagnostic messages earlier.", 0}, -+ {0} -+}; -+ -+static error_t -+parse_opt (int opt, char *arg, struct argp_state *state) -+{ -+ switch (opt) -+ { -+ default: -+ return ARGP_ERR_UNKNOWN; -+ case ARGP_KEY_INIT: -+ case ARGP_KEY_SUCCESS: -+ case ARGP_KEY_ERROR: -+ break; -+ -+ case OPT_DEVICE_MASTER_PORT: -+ opt_device_master = atoi (arg); -+ break; -+ } -+ return 0; -+} -+ -+/* This will be called from libtrivfs to help construct the answer -+ to an fsys_get_options RPC. */ -+error_t -+trivfs_append_args (struct trivfs_control *fsys, -+ char **argz, size_t *argz_len) -+{ -+ error_t err = 0; -+ char *opt; -+ -+ if (MACH_PORT_VALID (opt_device_master)) -+ { -+ asprintf (&opt, "--device-master-port=%d", opt_device_master); -+ -+ if (opt) -+ { -+ err = argz_add (argz, argz_len, opt); -+ free (opt); -+ } -+ } -+ -+ return err; -+} -+ -+static struct argp argp = -+{ options, parse_opt, 0, "Hurd standard exec server." }; -+ -+/* Setting this variable makes libtrivfs use our argp to -+ parse options passed in an fsys_set_options RPC. */ -+struct argp *trivfs_runtime_argp = &argp; -+ -+/* Get our stderr set up to print on the console, in case we have to -+ panic or something. */ -+error_t -+open_console (mach_port_t device_master) -+{ -+ static int got_console = 0; -+ mach_port_t cons; -+ error_t err; -+ -+ if (got_console) -+ return 0; -+ -+ err = device_open (device_master, D_READ|D_WRITE, "console", &cons); -+ if (err) -+ return err; -+ -+ stdin = mach_open_devstream (cons, "r"); -+ stdout = stderr = mach_open_devstream (cons, "w"); -+ -+ got_console = 1; -+ mach_port_deallocate (mach_task_self (), cons); -+ return 0; -+} - - int - main (int argc, char **argv) - { - error_t err; - mach_port_t bootstrap; -- struct argp argp = { 0, 0, 0, "Hurd standard exec server." }; - - argp_parse (&argp, argc, argv, 0, 0, 0); - -+ if (MACH_PORT_VALID (opt_device_master)) -+ { -+ err = open_console (opt_device_master); -+ assert_perror (err); -+ mach_port_deallocate (mach_task_self (), opt_device_master); -+ } -+ - save_argv = argv; - - task_get_bootstrap_port (mach_task_self (), &bootstrap); -@@ -236,18 +325,9 @@ S_exec_init (struct trivfs_protid *protid, - err = get_privileged_ports (&host_priv, &device_master); - assert_perror (err); - -- { -- /* Get our stderr set up to print on the console, in case we have -- to panic or something. */ -- mach_port_t cons; -- error_t err; -- err = device_open (device_master, D_READ|D_WRITE, "console", &cons); -- assert_perror (err); -- mach_port_deallocate (mach_task_self (), device_master); -- stdin = mach_open_devstream (cons, "r"); -- stdout = stderr = mach_open_devstream (cons, "w"); -- mach_port_deallocate (mach_task_self (), cons); -- } -+ err = open_console (device_master); -+ assert_perror (err); -+ mach_port_deallocate (mach_task_self (), device_master); - - proc_register_version (procserver, host_priv, "exec", "", HURD_VERSION); - --- -2.1.0 - diff --git a/debian/patches/exec-redzone0.patch b/debian/patches/exec-redzone0.patch deleted file mode 100644 index 59398093..00000000 --- a/debian/patches/exec-redzone0.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 08936efa78337cdd50676fbde2f61ae13c249a01 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Mon, 22 Sep 2014 17:59:57 +0200 -Subject: [PATCH] exec: redzone page zero before loading anything - -This prevents load_section from mapping any sections to page zero. - -* exec/exec.c (do_exec): Redzone page zero before loading anything. ---- - exec/exec.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/exec/exec.c b/exec/exec.c -index 2fc1e44..0ecf2d3 100644 ---- a/exec/exec.c -+++ b/exec/exec.c -@@ -1116,6 +1116,16 @@ do_exec (file_t file, - mach_port_destroy (oldtask, destroynames[i]); - } - -+ /* Map page zero redzoned. */ -+ { -+ vm_address_t addr = 0; -+ e.error = vm_map (newtask, -+ &addr, vm_page_size, 0, 0, MACH_PORT_NULL, 0, 1, -+ VM_PROT_NONE, VM_PROT_NONE, VM_INHERIT_COPY); -+ if (e.error) -+ goto out; -+ } -+ - /* XXX this should be below - it is here to work around a vm_map kernel bug. */ - if (interp.file != MACH_PORT_NULL) --- -2.1.0 - diff --git a/debian/patches/procfs-0001-procfs-implement-proc-N-maps.patch b/debian/patches/procfs-0001-procfs-implement-proc-N-maps.patch deleted file mode 100644 index 5ae7b696..00000000 --- a/debian/patches/procfs-0001-procfs-implement-proc-N-maps.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 42c7918ae29df491489b000b44318dcfe232a40a Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Thu, 18 Sep 2014 18:38:04 +0200 -Subject: [PATCH 1/7] procfs: implement /proc/N/maps - -Fixes https://savannah.gnu.org/bugs/?32770 . - -* procfs/process.c (process_file_gc_maps): New function. -(entries): Use the new function to implement /proc/N/maps. ---- - procfs/process.c | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 103 insertions(+), 1 deletion(-) - -diff --git a/procfs/process.c b/procfs/process.c -index 4854148..a9b1a59 100644 ---- a/procfs/process.c -+++ b/procfs/process.c -@@ -1,5 +1,5 @@ - /* Hurd /proc filesystem, implementation of process directories. -- Copyright (C) 2010 Free Software Foundation, Inc. -+ Copyright (C) 2010,14 Free Software Foundation, Inc. - - This file is part of the GNU Hurd. - -@@ -109,6 +109,100 @@ process_file_gc_environ (struct proc_stat *ps, char **contents) - } - - static ssize_t -+process_file_gc_maps (struct proc_stat *ps, char **contents) -+{ -+ error_t err; -+ FILE *s; -+ size_t contents_len; -+ vm_offset_t addr = 0; -+ vm_size_t size; -+ vm_prot_t prot, max_prot; -+ mach_port_t obj; -+ vm_offset_t offs; -+ vm_inherit_t inh; -+ int shared; -+ -+ /* Unfortunately we cannot resolve memory objects to their backing -+ file (yet), so we use the port name as identifier. To avoid the -+ same name from being used again and again, we defer the -+ deallocation until the end of the function. We use a simple -+ linked list for this purpose. */ -+ struct mem_obj -+ { -+ mach_port_t port; -+ struct mem_obj *next; -+ }; -+ struct mem_obj *objects = NULL; -+ -+ s = open_memstream (contents, &contents_len); -+ if (s == NULL) -+ { -+ *contents = NULL; -+ return 0; -+ } -+ -+ while (1) -+ { -+ err = -+ vm_region (ps->task, &addr, &size, &prot, &max_prot, &inh, -+ &shared, &obj, &offs); -+ if (err) -+ break; -+ -+ fprintf (s, "%0*x-%0*x %c%c%c%c %0*x %s %d ", -+ /* Address range. */ -+ 2*sizeof s, addr, -+ 2*sizeof s, addr + size, -+ /* Permissions. */ -+ prot & VM_PROT_READ? 'r': '-', -+ prot & VM_PROT_WRITE? 'w': '-', -+ prot & VM_PROT_EXECUTE? 'x': '-', -+ shared? 's': 'p', -+ /* Offset. */ -+ 2*sizeof s, offs, -+ /* Device. */ -+ "00:00", -+ /* Inode. */ -+ 0); -+ -+ /* Pathname. */ -+ if (MACH_PORT_VALID (obj)) -+ { -+ struct mem_obj *o = malloc (sizeof *o); -+ if (o) -+ { -+ o->port = obj; -+ o->next = objects; -+ objects = o; -+ } -+ else -+ mach_port_deallocate (mach_task_self (), obj); -+ -+ fprintf (s, "[mem_obj=%d]\n", obj); -+ } -+ else -+ fprintf (s, "\n"); -+ -+ addr += size; -+ } -+ -+ while (objects) -+ { -+ struct mem_obj *o = objects; -+ mach_port_deallocate (mach_task_self (), o->port); -+ objects = o->next; -+ free (o); -+ } -+ -+ /* This is a bit awkward, fortunately vm_region should not fail. */ -+ if (err != KERN_NO_SPACE) -+ fprintf (s, "%s\n", strerror (err)); -+ -+ fclose (s); -+ return contents_len; -+} -+ -+static ssize_t - process_file_gc_stat (struct proc_stat *ps, char **contents) - { - struct procinfo *pi = proc_stat_proc_info (ps); -@@ -348,6 +442,14 @@ static struct procfs_dir_entry entries[] = { - }, - }, - { -+ .name = "maps", -+ .hook = & (struct process_file_desc) { -+ .get_contents = process_file_gc_maps, -+ .needs = PSTAT_TASK, -+ .mode = 0400, -+ }, -+ }, -+ { - .name = "stat", - .hook = & (struct process_file_desc) { - .get_contents = process_file_gc_stat, --- -2.1.0 - diff --git a/debian/patches/procfs-0002-procfs-implement-proc-filesystems.patch b/debian/patches/procfs-0002-procfs-implement-proc-filesystems.patch deleted file mode 100644 index a344214e..00000000 --- a/debian/patches/procfs-0002-procfs-implement-proc-filesystems.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 7a3280d44f3ff7550d67fcc0689a2b2a24738aa7 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Thu, 18 Sep 2014 19:38:04 +0200 -Subject: [PATCH 2/7] procfs: implement /proc/filesystems - -* procfs/rootdir.c (rootdir_gc_filesystems): New function. -(rootdir_entries): Use the new function to implement /proc/filesystems. ---- - procfs/rootdir.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 60 insertions(+), 1 deletion(-) - -diff --git a/procfs/rootdir.c b/procfs/rootdir.c -index 9541059..f92e73d 100644 ---- a/procfs/rootdir.c -+++ b/procfs/rootdir.c -@@ -1,5 +1,5 @@ - /* Hurd /proc filesystem, permanent files of the root directory. -- Copyright (C) 2010,13 Free Software Foundation, Inc. -+ Copyright (C) 2010,13,14 Free Software Foundation, Inc. - - This file is part of the GNU Hurd. - -@@ -32,6 +32,7 @@ - #include <sys/stat.h> - #include <argz.h> - #include <ps.h> -+#include <glob.h> - #include "procfs.h" - #include "procfs_dir.h" - #include "main.h" -@@ -532,6 +533,57 @@ rootdir_gc_slabinfo (void *hook, char **contents, ssize_t *contents_len) - cache_info, cache_info_count * sizeof *cache_info); - return err; - } -+ -+static error_t -+rootdir_gc_filesystems (void *hook, char **contents, ssize_t *contents_len) -+{ -+ error_t err = 0; -+ size_t i; -+ int glob_ret; -+ glob_t matches; -+ FILE *m; -+ -+ m = open_memstream (contents, contents_len); -+ if (m == NULL) -+ return errno; -+ -+ glob_ret = glob (_HURD "*fs", 0, NULL, &matches); -+ switch (glob_ret) -+ { -+ case 0: -+ for (i = 0; i < matches.gl_pathc; i++) -+ { -+ /* Get ith entry, shave off the prefix. */ -+ char *name = &matches.gl_pathv[i][sizeof _HURD - 1]; -+ -+ /* Linux naming convention is a bit inconsistent. */ -+ if (strncmp (name, "ext", 3) == 0 -+ || strcmp (name, "procfs") == 0) -+ /* Drop the fs suffix. */ -+ name[strlen (name) - 2] = 0; -+ -+ fprintf (m, "\t%s\n", name); -+ } -+ -+ globfree (&matches); -+ break; -+ -+ case GLOB_NOMATCH: -+ /* Poor fellow. */ -+ break; -+ -+ case GLOB_NOSPACE: -+ err = ENOMEM; -+ break; -+ -+ default: -+ /* This should not happen. */ -+ err = EGRATUITOUS; -+ } -+ -+ fclose (m); -+ return err; -+} - - /* Glue logic and entries table */ - -@@ -632,6 +684,13 @@ static const struct procfs_dir_entry rootdir_entries[] = { - .cleanup_contents = procfs_cleanup_contents_with_free, - }, - }, -+ { -+ .name = "filesystems", -+ .hook = & (struct procfs_node_ops) { -+ .get_contents = rootdir_gc_filesystems, -+ .cleanup_contents = procfs_cleanup_contents_with_free, -+ }, -+ }, - #ifdef PROFILE - /* In order to get a usable gmon.out file, we must apparently use exit(). */ - { --- -2.1.0 - diff --git a/debian/patches/procfs-0003-procfs-implement-proc-N-mounts.patch b/debian/patches/procfs-0003-procfs-implement-proc-N-mounts.patch deleted file mode 100644 index 431ec01e..00000000 --- a/debian/patches/procfs-0003-procfs-implement-proc-N-mounts.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 5deac76856050d42d26f08d11a27d13d8de9ed4d Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Fri, 19 Sep 2014 07:54:04 +0200 -Subject: [PATCH 3/7] procfs: implement /proc/N/mounts - -* procfs/process.c (process_gc_mounts): New function. -(process_symlink_make_node): Likewise. -(entries): Use the new functions to provide a symlink to ../mounts. ---- - procfs/process.c | 27 +++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - -diff --git a/procfs/process.c b/procfs/process.c -index a9b1a59..f5da0d2 100644 ---- a/procfs/process.c -+++ b/procfs/process.c -@@ -202,6 +202,16 @@ process_file_gc_maps (struct proc_stat *ps, char **contents) - return contents_len; - } - -+static error_t -+process_gc_mounts (void *hook, char **contents, ssize_t *contents_len) -+{ -+#define MOUNTSLINK "../mounts" -+ *contents = MOUNTSLINK; -+ *contents_len = sizeof MOUNTSLINK - 1; -+#undef MOUNTSLINK -+ return 0; -+} -+ - static ssize_t - process_file_gc_stat (struct proc_stat *ps, char **contents) - { -@@ -420,6 +430,14 @@ process_stat_make_node (void *dir_hook, const void *entry_hook) - return np; - } - -+static struct node * -+process_symlink_make_node (void *dir_hook, const void *entry_hook) -+{ -+ struct node *np = procfs_make_node (entry_hook, dir_hook); -+ if (np) -+ procfs_node_chtype (np, S_IFLNK); -+ return np; -+} - - /* Implementation of the process directory per se. */ - -@@ -450,6 +468,15 @@ static struct procfs_dir_entry entries[] = { - }, - }, - { -+ .name = "mounts", -+ .hook = & (struct procfs_node_ops) { -+ .get_contents = process_gc_mounts, -+ }, -+ .ops = { -+ .make_node = process_symlink_make_node, -+ }, -+ }, -+ { - .name = "stat", - .hook = & (struct process_file_desc) { - .get_contents = process_file_gc_stat, --- -2.1.0 - diff --git a/debian/patches/procfs-0004-procfs-do-not-test-whether-hurd-mtab-exists.patch b/debian/patches/procfs-0004-procfs-do-not-test-whether-hurd-mtab-exists.patch deleted file mode 100644 index 9fc702b5..00000000 --- a/debian/patches/procfs-0004-procfs-do-not-test-whether-hurd-mtab-exists.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 736f7a36161800e20c30045e4eb898196e4b0027 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Fri, 19 Sep 2014 08:18:33 +0200 -Subject: [PATCH 4/7] procfs: do not test whether /hurd/mtab exists - -Now that procfs is merged into the Hurd repository we can just assume -that the mtab translator exists. - -* procfs/rootdir.c (rootdir_mounts_exists): Drop function. -(rootdir_entries): Adjust accordingly. ---- - procfs/rootdir.c | 10 ---------- - 1 file changed, 10 deletions(-) - -diff --git a/procfs/rootdir.c b/procfs/rootdir.c -index f92e73d..81e36f7 100644 ---- a/procfs/rootdir.c -+++ b/procfs/rootdir.c -@@ -463,15 +463,6 @@ rootdir_mounts_get_translator (void *hook, char **argz, size_t *argz_len) - return 0; - } - --static int --rootdir_mounts_exists (void *dir_hook, const void *entry_hook) --{ -- static int translator_exists = -1; -- if (translator_exists == -1) -- translator_exists = access (_HURD_MTAB, F_OK|X_OK) == 0; -- return translator_exists; --} -- - static error_t - rootdir_gc_slabinfo (void *hook, char **contents, ssize_t *contents_len) - { -@@ -674,7 +665,6 @@ static const struct procfs_dir_entry rootdir_entries[] = { - }, - .ops = { - .make_node = rootdir_mounts_make_node, -- .exists = rootdir_mounts_exists, - } - }, - { --- -2.1.0 - diff --git a/debian/patches/procfs-0005-procfs-generalize-the-translator-linkage-code.patch b/debian/patches/procfs-0005-procfs-generalize-the-translator-linkage-code.patch deleted file mode 100644 index ea810348..00000000 --- a/debian/patches/procfs-0005-procfs-generalize-the-translator-linkage-code.patch +++ /dev/null @@ -1,141 +0,0 @@ -From ce21071c13ce02ef168674e5ee4be1040322fc46 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Fri, 19 Sep 2014 10:01:57 +0200 -Subject: [PATCH 5/7] procfs: generalize the translator linkage code - -Generalize the translator linkage code previously introduced for the -`mounts' node. - -* procfs/rootdir.c (struct procfs_translated_node_ops): New -specialized node operations structure for translated nodes. -(rootdir_mounts_make_node): Generalize and rename to -rootdir_make_translated_node. Also, pass the entry_hook to -procfs_make_node so that... -(rootdir_mounts_get_translator): ... can be generalized to -rootdir_translated_node_get_translator and read the argz vector from -the hooked structure. -(ROOTDIR_DEFINE_TRANSLATED_NODE): New convenience macro to define -translated nodes. -(rootdir_entries): Use the new code for the `mounts' node. ---- - procfs/rootdir.c | 62 ++++++++++++++++++++++++++++++++++++++------------------ - 1 file changed, 42 insertions(+), 20 deletions(-) - -diff --git a/procfs/rootdir.c b/procfs/rootdir.c -index 81e36f7..a04fb3e 100644 ---- a/procfs/rootdir.c -+++ b/procfs/rootdir.c -@@ -409,17 +409,29 @@ rootdir_gc_fakeself (void *hook, char **contents, ssize_t *contents_len) - } - - static struct node *rootdir_mounts_node; --static pthread_spinlock_t rootdir_mounts_node_lock = -+ -+/* Translator linkage. */ -+static pthread_spinlock_t rootdir_translated_node_lock = - PTHREAD_SPINLOCK_INITIALIZER; - -+struct procfs_translated_node_ops -+{ -+ struct procfs_node_ops node_ops; -+ -+ struct node **npp; -+ char *argz; -+ size_t argz_len; -+}; -+ - static struct node * --rootdir_mounts_make_node (void *dir_hook, const void *entry_hook) -+rootdir_make_translated_node (void *dir_hook, const void *entry_hook) - { -+ const struct procfs_translated_node_ops *ops = entry_hook; - struct node *np, *prev; - -- pthread_spin_lock (&rootdir_mounts_node_lock); -- np = rootdir_mounts_node; -- pthread_spin_unlock (&rootdir_mounts_node_lock); -+ pthread_spin_lock (&rootdir_translated_node_lock); -+ np = *ops->npp; -+ pthread_spin_unlock (&rootdir_translated_node_lock); - - if (np != NULL) - { -@@ -427,18 +439,18 @@ rootdir_mounts_make_node (void *dir_hook, const void *entry_hook) - return np; - } - -- np = procfs_make_node (entry_hook, dir_hook); -+ np = procfs_make_node (entry_hook, entry_hook); - if (np == NULL) - return NULL; - - procfs_node_chtype (np, S_IFREG | S_IPTRANS); - procfs_node_chmod (np, 0444); - -- pthread_spin_lock (&rootdir_mounts_node_lock); -- prev = rootdir_mounts_node; -- if (rootdir_mounts_node == NULL) -- rootdir_mounts_node = np; -- pthread_spin_unlock (&rootdir_mounts_node_lock); -+ pthread_spin_lock (&rootdir_translated_node_lock); -+ prev = *ops->npp; -+ if (*ops->npp == NULL) -+ *ops->npp = np; -+ pthread_spin_unlock (&rootdir_translated_node_lock); - - if (prev != NULL) - { -@@ -450,19 +462,30 @@ rootdir_mounts_make_node (void *dir_hook, const void *entry_hook) - } - - static error_t --rootdir_mounts_get_translator (void *hook, char **argz, size_t *argz_len) -+rootdir_translated_node_get_translator (void *hook, char **argz, -+ size_t *argz_len) - { -- static const char const mtab_argz[] = _HURD_MTAB "\0/"; -+ const struct procfs_translated_node_ops *ops = hook; - -- *argz = malloc (sizeof mtab_argz); -+ *argz = malloc (ops->argz_len); - if (! *argz) - return ENOMEM; - -- memcpy (*argz, mtab_argz, sizeof mtab_argz); -- *argz_len = sizeof mtab_argz; -+ memcpy (*argz, ops->argz, ops->argz_len); -+ *argz_len = ops->argz_len; - return 0; - } - -+#define ROOTDIR_DEFINE_TRANSLATED_NODE(NPP, ARGZ) \ -+ &(struct procfs_translated_node_ops) { \ -+ .node_ops = { \ -+ .get_translator = rootdir_translated_node_get_translator, \ -+ }, \ -+ .npp = NPP, \ -+ .argz = (ARGZ), \ -+ .argz_len = sizeof (ARGZ), \ -+ } -+ - static error_t - rootdir_gc_slabinfo (void *hook, char **contents, ssize_t *contents_len) - { -@@ -660,11 +683,10 @@ static const struct procfs_dir_entry rootdir_entries[] = { - }, - { - .name = "mounts", -- .hook = & (struct procfs_node_ops) { -- .get_translator = rootdir_mounts_get_translator, -- }, -+ .hook = ROOTDIR_DEFINE_TRANSLATED_NODE (&rootdir_mounts_node, -+ _HURD_MTAB "\0/"), - .ops = { -- .make_node = rootdir_mounts_make_node, -+ .make_node = rootdir_make_translated_node, - } - }, - { --- -2.1.0 - diff --git a/debian/patches/procfs-0006-procfs-reorganize-rootdir.c.patch b/debian/patches/procfs-0006-procfs-reorganize-rootdir.c.patch deleted file mode 100644 index 97aaf063..00000000 --- a/debian/patches/procfs-0006-procfs-reorganize-rootdir.c.patch +++ /dev/null @@ -1,187 +0,0 @@ -From b4eb19fb7f1935b51c0335dcd1f957b38299af69 Mon Sep 17 00:00:00 2001 -From: Justus Winter <4winter@informatik.uni-hamburg.de> -Date: Fri, 19 Sep 2014 10:10:24 +0200 -Subject: [PATCH 6/7] procfs: reorganize rootdir.c - -* procfs/rootdir.c: Move the translator linkage code to the -appropriate location. ---- - procfs/rootdir.c | 153 ++++++++++++++++++++++++++++--------------------------- - 1 file changed, 77 insertions(+), 76 deletions(-) - -diff --git a/procfs/rootdir.c b/procfs/rootdir.c -index a04fb3e..d68645e 100644 ---- a/procfs/rootdir.c -+++ b/procfs/rootdir.c -@@ -409,83 +409,7 @@ rootdir_gc_fakeself (void *hook, char **contents, ssize_t *contents_len) - } - - static struct node *rootdir_mounts_node; -- --/* Translator linkage. */ --static pthread_spinlock_t rootdir_translated_node_lock = -- PTHREAD_SPINLOCK_INITIALIZER; -- --struct procfs_translated_node_ops --{ -- struct procfs_node_ops node_ops; -- -- struct node **npp; -- char *argz; -- size_t argz_len; --}; -- --static struct node * --rootdir_make_translated_node (void *dir_hook, const void *entry_hook) --{ -- const struct procfs_translated_node_ops *ops = entry_hook; -- struct node *np, *prev; - -- pthread_spin_lock (&rootdir_translated_node_lock); -- np = *ops->npp; -- pthread_spin_unlock (&rootdir_translated_node_lock); -- -- if (np != NULL) -- { -- netfs_nref (np); -- return np; -- } -- -- np = procfs_make_node (entry_hook, entry_hook); -- if (np == NULL) -- return NULL; -- -- procfs_node_chtype (np, S_IFREG | S_IPTRANS); -- procfs_node_chmod (np, 0444); -- -- pthread_spin_lock (&rootdir_translated_node_lock); -- prev = *ops->npp; -- if (*ops->npp == NULL) -- *ops->npp = np; -- pthread_spin_unlock (&rootdir_translated_node_lock); -- -- if (prev != NULL) -- { -- procfs_cleanup (np); -- np = prev; -- } -- -- return np; --} -- --static error_t --rootdir_translated_node_get_translator (void *hook, char **argz, -- size_t *argz_len) --{ -- const struct procfs_translated_node_ops *ops = hook; -- -- *argz = malloc (ops->argz_len); -- if (! *argz) -- return ENOMEM; -- -- memcpy (*argz, ops->argz, ops->argz_len); -- *argz_len = ops->argz_len; -- return 0; --} -- --#define ROOTDIR_DEFINE_TRANSLATED_NODE(NPP, ARGZ) \ -- &(struct procfs_translated_node_ops) { \ -- .node_ops = { \ -- .get_translator = rootdir_translated_node_get_translator, \ -- }, \ -- .npp = NPP, \ -- .argz = (ARGZ), \ -- .argz_len = sizeof (ARGZ), \ -- } -- - static error_t - rootdir_gc_slabinfo (void *hook, char **contents, ssize_t *contents_len) - { -@@ -619,7 +543,84 @@ rootdir_symlink_make_node (void *dir_hook, const void *entry_hook) - procfs_node_chtype (np, S_IFLNK); - return np; - } -+ -+/* Translator linkage. */ -+ -+static pthread_spinlock_t rootdir_translated_node_lock = -+ PTHREAD_SPINLOCK_INITIALIZER; -+ -+struct procfs_translated_node_ops -+{ -+ struct procfs_node_ops node_ops; -+ -+ struct node **npp; -+ char *argz; -+ size_t argz_len; -+}; -+ -+static struct node * -+rootdir_make_translated_node (void *dir_hook, const void *entry_hook) -+{ -+ const struct procfs_translated_node_ops *ops = entry_hook; -+ struct node *np, *prev; -+ -+ pthread_spin_lock (&rootdir_translated_node_lock); -+ np = *ops->npp; -+ pthread_spin_unlock (&rootdir_translated_node_lock); -+ -+ if (np != NULL) -+ { -+ netfs_nref (np); -+ return np; -+ } -+ -+ np = procfs_make_node (entry_hook, entry_hook); -+ if (np == NULL) -+ return NULL; -+ -+ procfs_node_chtype (np, S_IFREG | S_IPTRANS); -+ procfs_node_chmod (np, 0444); -+ -+ pthread_spin_lock (&rootdir_translated_node_lock); -+ prev = *ops->npp; -+ if (*ops->npp == NULL) -+ *ops->npp = np; -+ pthread_spin_unlock (&rootdir_translated_node_lock); -+ -+ if (prev != NULL) -+ { -+ procfs_cleanup (np); -+ np = prev; -+ } -+ -+ return np; -+} -+ -+static error_t -+rootdir_translated_node_get_translator (void *hook, char **argz, -+ size_t *argz_len) -+{ -+ const struct procfs_translated_node_ops *ops = hook; - -+ *argz = malloc (ops->argz_len); -+ if (! *argz) -+ return ENOMEM; -+ -+ memcpy (*argz, ops->argz, ops->argz_len); -+ *argz_len = ops->argz_len; -+ return 0; -+} -+ -+#define ROOTDIR_DEFINE_TRANSLATED_NODE(NPP, ARGZ) \ -+ &(struct procfs_translated_node_ops) { \ -+ .node_ops = { \ -+ .get_translator = rootdir_translated_node_get_translator, \ -+ }, \ -+ .npp = NPP, \ -+ .argz = (ARGZ), \ -+ .argz_len = sizeof (ARGZ), \ -+ } -+ - static const struct procfs_dir_entry rootdir_entries[] = { - { - .name = "self", --- -2.1.0 - diff --git a/debian/patches/series b/debian/patches/series index 166c8561..0060a9fd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -61,13 +61,4 @@ mach-defpager-protected-payload.patch 0001-libdiskfs-remove-code-counting-cache-misses.patch trans-crash-add-verbose.patch -procfs-0001-procfs-implement-proc-N-maps.patch -procfs-0002-procfs-implement-proc-filesystems.patch -procfs-0003-procfs-implement-proc-N-mounts.patch -procfs-0004-procfs-do-not-test-whether-hurd-mtab-exists.patch -procfs-0005-procfs-generalize-the-translator-linkage-code.patch -procfs-0006-procfs-reorganize-rootdir.c.patch procfs-0007-procfs-provide-magic-retry-response-for-proc-self.patch - -exec-redzone0.patch -exec-early-diagnostics.patch |