summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-05 10:45:08 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-05 10:45:08 +0200
commit3fa43c34225e960d45f444ae4c86eace1b4259a4 (patch)
tree62e04b94eae5f277bfeba56ed0f343ff75324997 /debian
parenta99538ff9a8aff779381a71e571e971d3855a475 (diff)
forgot procfs
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/0001-Add-proc_set_init_task-make-runsystem-pid-1.patch (renamed from debian/patches/0002-Add-proc_set_init_task-make-runsystem-pid-1.patch)56
-rw-r--r--debian/patches/0002-procfs-do-not-hard-code-the-default-argument-values.patch43
-rw-r--r--debian/patches/series3
3 files changed, 98 insertions, 4 deletions
diff --git a/debian/patches/0002-Add-proc_set_init_task-make-runsystem-pid-1.patch b/debian/patches/0001-Add-proc_set_init_task-make-runsystem-pid-1.patch
index dee6932d..e9d6f9d4 100644
--- a/debian/patches/0002-Add-proc_set_init_task-make-runsystem-pid-1.patch
+++ b/debian/patches/0001-Add-proc_set_init_task-make-runsystem-pid-1.patch
@@ -1,7 +1,7 @@
-From 34625240c68a6eeddc8d175bb355adfd1e33a71c Mon Sep 17 00:00:00 2001
+From 7814f2ef1f48d90b15c12c5521c9c1193fe80a7b Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Wed, 18 Sep 2013 15:59:31 +0200
-Subject: [PATCH 2/8] Add proc_set_init_task, make runsystem pid 1
+Subject: [PATCH 1/8] Add proc_set_init_task, make runsystem pid 1
* hurd/process.defs (proc_set_init_task): New procedure.
* hurd/process_reply.defs (proc_set_init_task): Likewise.
@@ -16,6 +16,7 @@ the new root of the process tree.
(create_startup_proc): Rename to create_init_proc.
(S_proc_set_init_task): New function.
* doc/hurd.texi (Server Bootstrap): Update accordingly.
+* procfs/main.c: Do not hard-code kernel pid, use pids.h instead.
---
doc/hurd.texi | 2 +-
hurd/process.defs | 6 +++-
@@ -26,7 +27,8 @@ the new root of the process tree.
proc/main.c | 9 ++++--
proc/mgt.c | 76 ++++++++++++++++++++++++++++++++++-------------
proc/proc.h | 8 +++--
- 9 files changed, 86 insertions(+), 33 deletions(-)
+ procfs/main.c | 9 ++++--
+ 10 files changed, 93 insertions(+), 35 deletions(-)
diff --git a/doc/hurd.texi b/doc/hurd.texi
index 8fa6da7..697cce7 100644
@@ -337,6 +339,54 @@ index a2e3c53..6196697 100644
struct proc *allocate_proc (task_t);
void proc_death_notify (struct proc *);
void complete_proc (struct proc *, pid_t);
+diff --git a/procfs/main.c b/procfs/main.c
+index 54e9682..f3067d9 100644
+--- a/procfs/main.c
++++ b/procfs/main.c
+@@ -25,6 +25,7 @@
+ #include <argz.h>
+ #include <hurd/netfs.h>
+ #include <ps.h>
++#include <pids.h>
+ #include "procfs.h"
+ #include "proclist.h"
+ #include "rootdir.h"
+@@ -42,7 +43,7 @@ uid_t opt_anon_owner;
+ #define OPT_CLK_TCK sysconf(_SC_CLK_TCK)
+ #define OPT_STAT_MODE 0400
+ #define OPT_FAKE_SELF -1
+-#define OPT_KERNEL_PID 2
++#define OPT_KERNEL_PID HURD_PID_KERNEL
+ #define OPT_ANON_OWNER 0
+
+ #define NODEV_KEY -1 /* <= 0, so no short option. */
+@@ -137,6 +138,8 @@ argp_parser (int key, char *arg, struct argp_state *state)
+ }
+
+ struct argp_option common_options[] = {
++#define STR(X) XSTR (X)
++#define XSTR(X) #X
+ { "clk-tck", 'h', "HZ", 0,
+ "Unit used for the values expressed in system clock ticks "
+ "(default: sysconf(_SC_CLK_TCK))" },
+@@ -153,7 +156,7 @@ struct argp_option common_options[] = {
+ { "kernel-process", 'k', "PID", 0,
+ "Process identifier for the kernel, used to retreive its command "
+ "line, as well as the global up and idle times. "
+- "(default: 2)" },
++ "(default: " STR (OPT_KERNEL_PID) ")" },
+ { "compatible", 'c', NULL, 0,
+ "Try to be compatible with the Linux procps utilities. "
+ "Currently equivalent to -h 100 -s 0444 -S 1." },
+@@ -169,6 +172,8 @@ struct argp_option common_options[] = {
+ { "nosuid", NOSUID_KEY, NULL, 0,
+ "Ignored for compatibility with Linux' procfs." },
+ {}
++#undef XSTR
++#undef STR
+ };
+
+ struct argp argp = {
--
2.1.0
diff --git a/debian/patches/0002-procfs-do-not-hard-code-the-default-argument-values.patch b/debian/patches/0002-procfs-do-not-hard-code-the-default-argument-values.patch
new file mode 100644
index 00000000..70b41c14
--- /dev/null
+++ b/debian/patches/0002-procfs-do-not-hard-code-the-default-argument-values.patch
@@ -0,0 +1,43 @@
+From 7a0bc7740d665cf8ea3442960fde67d28dda4ecf Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Fri, 5 Sep 2014 10:34:24 +0200
+Subject: [PATCH 2/8] procfs: do not hard-code the default argument values
+
+* procfs/main.c (common_options): If possible, do not hard-code the
+default values.
+---
+ procfs/main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/procfs/main.c b/procfs/main.c
+index f3067d9..36a2d25 100644
+--- a/procfs/main.c
++++ b/procfs/main.c
+@@ -142,13 +142,13 @@ struct argp_option common_options[] = {
+ #define XSTR(X) #X
+ { "clk-tck", 'h', "HZ", 0,
+ "Unit used for the values expressed in system clock ticks "
+- "(default: sysconf(_SC_CLK_TCK))" },
++ "(default: " STR (OPT_CLK_TCK) ")" },
+ { "stat-mode", 's', "MODE", 0,
+ "The [pid]/stat file publishes information which on Hurd is only "
+ "available to the process owner. "
+ "You can use this option to override its mode to be more permissive "
+ "for compatibility purposes. "
+- "(default: 0400)" },
++ "(default: " STR (OPT_STAT_MODE) ")" },
+ { "fake-self", 'S', "PID", OPTION_ARG_OPTIONAL,
+ "Provide a fake \"self\" symlink to the given PID, for compatibility "
+ "purposes. If PID is omitted, \"self\" will point to init. "
+@@ -164,7 +164,7 @@ struct argp_option common_options[] = {
+ "Make USER the owner of files related to processes without one. "
+ "Be aware that USER will be granted access to the environment and "
+ "other sensitive information about the processes in question. "
+- "(default: use uid 0)" },
++ "(default: use uid " STR (OPT_ANON_OWNER) ")" },
+ { "nodev", NODEV_KEY, NULL, 0,
+ "Ignored for compatibility with Linux' procfs." },
+ { "noexec", NOEXEC_KEY, NULL, 0,
+--
+2.1.0
+
diff --git a/debian/patches/series b/debian/patches/series
index 82b6286e..58c6c811 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,5 @@
-0002-Add-proc_set_init_task-make-runsystem-pid-1.patch
+0001-Add-proc_set_init_task-make-runsystem-pid-1.patch
+0002-procfs-do-not-hard-code-the-default-argument-values.patch
0003-startup-rename-hurd-init-to-hurd-startup.patch
0004-init-add-a-minimalist-init-program.patch
0005-startup-do-not-pass-signals-on-to-the-child.patch