summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/series5
-rw-r--r--debian/patches/startup0001-Unify-and-document-the-way-fsids-are-handled-in-triv.patch88
-rw-r--r--debian/patches/startup0002-startup-implement-bits-of-the-fs-and-io-protocols.patch182
-rw-r--r--debian/patches/startup0003-startup-add-verbose-parameter.patch237
-rw-r--r--debian/patches/startup0004-startup-use-the-generated-default-server-implementat.patch153
-rw-r--r--debian/patches/startup0005-startup-write-all-messages-to-stderr.patch182
6 files changed, 847 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index 0d3908fd..b9da5a46 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -45,3 +45,8 @@ crash0001-xxx-crash-logging-works.patch
fixes0001-utils-settrans-implement-active-translator-stacking.patch
fixes0002-Avoid-superfluous-locking-of-node.patch
fixes0003-fstests-new-micro-benchmark.patch
+startup0001-Unify-and-document-the-way-fsids-are-handled-in-triv.patch
+startup0002-startup-implement-bits-of-the-fs-and-io-protocols.patch
+startup0003-startup-add-verbose-parameter.patch
+startup0004-startup-use-the-generated-default-server-implementat.patch
+startup0005-startup-write-all-messages-to-stderr.patch
diff --git a/debian/patches/startup0001-Unify-and-document-the-way-fsids-are-handled-in-triv.patch b/debian/patches/startup0001-Unify-and-document-the-way-fsids-are-handled-in-triv.patch
new file mode 100644
index 00000000..9ad99a78
--- /dev/null
+++ b/debian/patches/startup0001-Unify-and-document-the-way-fsids-are-handled-in-triv.patch
@@ -0,0 +1,88 @@
+From f250b6d8626c9d3ecf0d356dfd786a23ebbf6ca1 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Tue, 26 Apr 2016 15:43:26 +0200
+Subject: [PATCH hurd 1/5] Unify and document the way fsids are handled in
+ trivfs translators
+
+* doc/hurd.texi: Clarify what happens if 'trivfs_fsid' is zero.
+* login/utmp.c: Leave 'trivfs_fsid' at zero.
+* pfinet/main.c: Likewise.
+* trans/ifsock.c: Likewise.
+* trans/proxy-defpager.c: Likewise.
+---
+ doc/hurd.texi | 4 +++-
+ login/utmp.c | 2 +-
+ pfinet/main.c | 1 -
+ trans/ifsock.c | 2 +-
+ trans/proxy-defpager.c | 2 --
+ 5 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/doc/hurd.texi b/doc/hurd.texi
+index 525bfa7..2bcf561 100644
+--- a/doc/hurd.texi
++++ b/doc/hurd.texi
+@@ -2284,7 +2284,9 @@ and functions:
+ @deftypevarx {extern int} trivfs_fsid
+ These variables are returned in the @var{st_fstype} and @var{st_fsid}
+ fields of @code{struct stat}. @var{trivfs_fstype} should be chosen
+-from the @code{FSTYPE_*} constants found in @code{<hurd/hurd_types.h>}.
++from the @code{FSTYPE_*} constants found in
++@code{<hurd/hurd_types.h>}. If @code{trivfs_fsid} is zero, trivfs
++will use the pid of the translator instead.
+ @end deftypevar
+
+ @deftypevar {extern int} trivfs_allow_open
+diff --git a/login/utmp.c b/login/utmp.c
+index c7c1ac0..f366d44 100644
+--- a/login/utmp.c
++++ b/login/utmp.c
+@@ -364,7 +364,7 @@ S_login_get_login_collection(file_t utmp, int *pid)
+ #define PT_PROC 2 /* Our process handle. */
+
+ int trivfs_fstype = FSTYPE_MISC;
+-int trivfs_fsid = 0; /* ??? */
++int trivfs_fsid = 0;
+
+ int trivfs_support_read = 0;
+ int trivfs_support_write = 0;
+diff --git a/pfinet/main.c b/pfinet/main.c
+index 4bfa318..5e4b749 100644
+--- a/pfinet/main.c
++++ b/pfinet/main.c
+@@ -283,7 +283,6 @@ main (int argc,
+ pfinet_bucket = ports_create_bucket ();
+ addrport_class = ports_create_class (clean_addrport, 0);
+ socketport_class = ports_create_class (clean_socketport, 0);
+- trivfs_fsid = getpid ();
+ mach_port_allocate (mach_task_self (), MACH_PORT_RIGHT_RECEIVE,
+ &fsys_identity);
+
+diff --git a/trans/ifsock.c b/trans/ifsock.c
+index 13a2133..908fe13 100644
+--- a/trans/ifsock.c
++++ b/trans/ifsock.c
+@@ -51,7 +51,7 @@ struct port_class *node_class;
+ struct port_bucket *port_bucket;
+
+ int trivfs_fstype = FSTYPE_IFSOCK;
+-int trivfs_fsid = 0; /* ??? */
++int trivfs_fsid = 0;
+
+ int trivfs_support_read = 0;
+ int trivfs_support_write = 0;
+diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c
+index 9a8436a..e2b15ea 100644
+--- a/trans/proxy-defpager.c
++++ b/trans/proxy-defpager.c
+@@ -286,8 +286,6 @@ main (int argc, char **argv)
+ if (bootstrap == MACH_PORT_NULL)
+ error (1, 0, "Must be started as a translator");
+
+- trivfs_fsid = getpid ();
+-
+ err = trivfs_add_protid_port_class (&trivfs_protid_class);
+ if (err)
+ error (1, 0, "error creating protid port class");
+--
+2.1.4
+
diff --git a/debian/patches/startup0002-startup-implement-bits-of-the-fs-and-io-protocols.patch b/debian/patches/startup0002-startup-implement-bits-of-the-fs-and-io-protocols.patch
new file mode 100644
index 00000000..8c081e89
--- /dev/null
+++ b/debian/patches/startup0002-startup-implement-bits-of-the-fs-and-io-protocols.patch
@@ -0,0 +1,182 @@
+From 10218526abf4c7537642cf5c3d8955578d599402 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Sat, 23 Apr 2016 17:52:33 +0200
+Subject: [PATCH hurd 2/5] startup: implement bits of the fs and io protocols
+
+* startup/Makefile: Build fs and io server with default
+implementations.
+(mung_msg_S.h): Tune regexp only to match the include guard.
+* startup/startup.c (mig_reply_setup): New function.
+(demuxer): Add new protocols. Nicer implementation.
+(S_file_check_access): New function.
+(S_io_restrict_auth): Likewise.
+---
+ startup/Makefile | 6 ++--
+ startup/startup.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 101 insertions(+), 11 deletions(-)
+
+diff --git a/startup/Makefile b/startup/Makefile
+index ee2ecdd5..db062ad 100644
+--- a/startup/Makefile
++++ b/startup/Makefile
+@@ -21,15 +21,17 @@ makemode := server
+ SRCS = startup.c
+ OBJS = $(SRCS:.c=.o) \
+ startupServer.o notifyServer.o startup_replyUser.o msgServer.o \
+- startup_notifyUser.o fsysServer.o
++ startup_notifyUser.o fsysServer.o fsServer.o ioServer.o
+ target = startup
+ HURDLIBS = shouldbeinlibc
+
+ # startup does not use libports. Disable the default payload to port
+ # conversion.
+ MIGSFLAGS="-DHURD_DEFAULT_PAYLOAD_TO_PORT=1"
++fsServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
++ioServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
+
+ include ../Makeconf
+
+ mung_msg_S.h: msg_S.h
+- sed 's/msg_server/mung_msg_server/' < $< > $@
++ sed 's/_msg_server/_mung_msg_server/' < $< > $@
+diff --git a/startup/startup.c b/startup/startup.c
+index 9c45f4b..97a1bab 100644
+--- a/startup/startup.c
++++ b/startup/startup.c
+@@ -51,12 +51,16 @@
+ #include <version.h>
+ #include <argp.h>
+ #include <pids.h>
++#include <idvec.h>
+
+ #include "startup_notify_U.h"
+ #include "startup_reply_U.h"
+ #include "startup_S.h"
+ #include "notify_S.h"
+ #include "mung_msg_S.h"
++#include "fsys_S.h"
++#include "fs_S.h"
++#include "io_S.h"
+
+ /* host_reboot flags for when we crash. */
+ static int crash_flags = RB_AUTOBOOT;
+@@ -498,19 +502,57 @@ run_for_real (char *filename, char *args, int arglen, mach_port_t ctty,
+
+ /** Main program and setup **/
+
++/* XXX: The libc should provide this function. */
++static void
++mig_reply_setup (
++ const mach_msg_header_t *in,
++ mach_msg_header_t *out)
++{
++ static const mach_msg_type_t RetCodeType = {
++ /* msgt_name = */ MACH_MSG_TYPE_INTEGER_32,
++ /* msgt_size = */ 32,
++ /* msgt_number = */ 1,
++ /* msgt_inline = */ TRUE,
++ /* msgt_longform = */ FALSE,
++ /* msgt_deallocate = */ FALSE,
++ /* msgt_unused = */ 0
++ };
++
++#define InP (in)
++#define OutP ((mig_reply_header_t *) out)
++ OutP->Head.msgh_bits =
++ MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(InP->msgh_bits), 0);
++ OutP->Head.msgh_size = sizeof *OutP;
++ OutP->Head.msgh_remote_port = InP->msgh_remote_port;
++ OutP->Head.msgh_local_port = MACH_PORT_NULL;
++ OutP->Head.msgh_seqno = 0;
++ OutP->Head.msgh_id = InP->msgh_id + 100;
++ OutP->RetCodeType = RetCodeType;
++ OutP->RetCode = MIG_BAD_ID;
++#undef InP
++#undef OutP
++}
++
+ static int
+ demuxer (mach_msg_header_t *inp,
+ mach_msg_header_t *outp)
+ {
+- extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
+- extern int startup_server (mach_msg_header_t *, mach_msg_header_t *);
+- extern int msg_server (mach_msg_header_t *, mach_msg_header_t *);
+- extern int fsys_server (mach_msg_header_t *, mach_msg_header_t *);
+-
+- return (notify_server (inp, outp) ||
+- msg_server (inp, outp) ||
+- fsys_server (inp, outp) ||
+- startup_server (inp, outp));
++ mig_routine_t routine;
++
++ mig_reply_setup (inp, outp);
++
++ if ((routine = notify_server_routine (inp)) ||
++ (routine = msg_server_routine (inp)) ||
++ (routine = fsys_server_routine (inp)) ||
++ (routine = fs_server_routine (inp)) ||
++ (routine = io_server_routine (inp)) ||
++ (routine = startup_server_routine (inp)))
++ {
++ (*routine) (inp, outp);
++ return TRUE;
++ }
++ else
++ return FALSE;
+ }
+
+ error_t
+@@ -1703,3 +1745,49 @@ S_fsys_forward (mach_port_t server, mach_port_t requestor,
+ {
+ return EOPNOTSUPP;
+ }
++
++error_t
++S_file_check_access (mach_port_t server,
++ int *allowed)
++{
++ if (server != startup)
++ return EOPNOTSUPP;
++ *allowed = 0;
++ return 0;
++}
++
++error_t
++S_io_stat (mach_port_t server,
++ struct stat *st)
++{
++ if (server != startup)
++ return EOPNOTSUPP;
++
++ memset (st, 0, sizeof *st);
++
++ st->st_fstype = FSTYPE_MISC;
++ st->st_fsid = getpid ();
++ st->st_mode = S_IFCHR | S_IROOT;
++
++ return 0;
++}
++
++error_t
++S_io_restrict_auth (mach_port_t server,
++ mach_port_t *newport,
++ mach_msg_type_name_t *newporttype,
++ uid_t *uids, size_t nuids,
++ uid_t *gids, size_t ngids)
++{
++ struct idvec user = { uids, (unsigned) nuids, (unsigned) nuids };
++
++ if (server != startup)
++ return EOPNOTSUPP;
++
++ if (! idvec_contains (&user, 0))
++ return EPERM;
++
++ *newport = server;
++ *newporttype = MACH_MSG_TYPE_COPY_SEND;
++ return 0;
++}
+--
+2.1.4
+
diff --git a/debian/patches/startup0003-startup-add-verbose-parameter.patch b/debian/patches/startup0003-startup-add-verbose-parameter.patch
new file mode 100644
index 00000000..96e1f975
--- /dev/null
+++ b/debian/patches/startup0003-startup-add-verbose-parameter.patch
@@ -0,0 +1,237 @@
+From 1c0dc88f5411451ba1acd7e41a5d362fdd947586 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Tue, 26 Apr 2016 18:01:41 +0200
+Subject: [PATCH hurd 3/5] startup: add verbose parameter
+
+* startup/startup.c: Add verbose parameter and inform about progress
+through the bootstrap procedure if it is given.
+---
+ startup/startup.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 65 insertions(+), 8 deletions(-)
+
+diff --git a/startup/startup.c b/startup/startup.c
+index 97a1bab..f3e3534 100644
+--- a/startup/startup.c
++++ b/startup/startup.c
+@@ -65,6 +65,8 @@
+ /* host_reboot flags for when we crash. */
+ static int crash_flags = RB_AUTOBOOT;
+
++static int verbose = 0;
++
+ #define BOOT(flags) ((flags & RB_HALT) ? "halt" : "reboot")
+
+
+@@ -79,6 +81,7 @@ options[] =
+ {"crash-debug", 'H', 0, 0, "On system crash, go to kernel debugger"},
+ {"debug", 'd', 0, 0 },
+ {"fake-boot", 'f', 0, 0, "This hurd hasn't been booted on the raw machine"},
++ {"verbose", 'v', 0, 0, "be verbose"},
+ {0, 'x', 0, OPTION_HIDDEN},
+ {0}
+ };
+@@ -401,10 +404,8 @@ run (const char *server, mach_port_t *ports, task_t *task)
+ crash_system ();
+ }
+
+-#if 0
+- printf ("started %s\n", prog);
+- fflush (stdout);
+-#endif
++ if (verbose)
++ fprintf (stderr, "started %s\n", prog);
+
+ /* Dead-name notification on the task port will tell us when it dies,
+ so we can crash if we don't make it to a fully bootstrapped Hurd. */
+@@ -539,6 +540,9 @@ demuxer (mach_msg_header_t *inp,
+ {
+ mig_routine_t routine;
+
++ if (verbose > 1)
++ error (0, 0, "%d", inp->msgh_id);
++
+ mig_reply_setup (inp, outp);
+
+ if ((routine = notify_server_routine (inp)) ||
+@@ -549,6 +553,9 @@ demuxer (mach_msg_header_t *inp,
+ (routine = startup_server_routine (inp)))
+ {
+ (*routine) (inp, outp);
++
++ if (verbose > 1)
++ error (0, ((mig_reply_header_t *) outp)->RetCode, "%d", inp->msgh_id);
+ return TRUE;
+ }
+ else
+@@ -592,6 +599,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
+ case 'n': bootstrap_args |= RB_INITNAME; break;
+ case 'f': fakeboot = 1; break;
+ case 'H': crash_flags = RB_DEBUGGER; break;
++ case 'v': verbose++; break;
+ case 'x': /* NOP */ break;
+ default: return ARGP_ERR_UNKNOWN;
+ }
+@@ -705,6 +713,9 @@ launch_core_servers (void)
+ mach_port_t authproc, fsproc, procproc;
+ error_t err;
+
++ if (verbose)
++ fprintf (stderr, "Launching core servers\n");
++
+ /* Reply to the proc and auth servers. */
+ err = startup_procinit_reply (procreply, procreplytype, 0,
+ mach_task_self (), authserver,
+@@ -717,6 +728,9 @@ launch_core_servers (void)
+ device_master = 0;
+ }
+
++ if (verbose)
++ fprintf (stderr, "proc launched\n");
++
+ /* Mark us as important. */
+ err = proc_mark_important (procserver);
+ assert_perror (err);
+@@ -741,12 +755,18 @@ launch_core_servers (void)
+ /* Good luck. Who knows, maybe it's an old installation. */
+ error (0, err, "Failed to bind to " _SERVERS_STARTUP);
+
++ if (verbose)
++ fprintf (stderr, "Installed on /servers/startup\n");
++
+ err = startup_authinit_reply (authreply, authreplytype, 0, authproc,
+ MACH_MSG_TYPE_COPY_SEND);
+ assert_perror (err);
+ err = mach_port_deallocate (mach_task_self (), authproc);
+ assert_perror (err);
+
++ if (verbose)
++ fprintf (stderr, "auth launched\n");
++
+ /* Give the library our auth and proc server ports. */
+ _hurd_port_set (&_hurd_ports[INIT_PORT_AUTH], authserver);
+ _hurd_port_set (&_hurd_ports[INIT_PORT_PROC], procserver);
+@@ -785,10 +805,6 @@ launch_core_servers (void)
+ err = proc_mark_exec (fsproc);
+ assert_perror (err);
+
+-#if 0
+- printf ("Init has completed.\n");
+- fflush (stdout);
+-#endif
+ printf (".\n");
+ fflush (stdout);
+
+@@ -803,11 +819,17 @@ launch_core_servers (void)
+ if (old != MACH_PORT_NULL)
+ mach_port_deallocate (mach_task_self (), old);
+
++ if (verbose)
++ fprintf (stderr, "Message port registered\n");
++
+ /* Give the bootstrap FS its proc and auth ports. */
+ err = fsys_init (bootport, fsproc, MACH_MSG_TYPE_COPY_SEND, authserver);
+ mach_port_deallocate (mach_task_self (), fsproc);
+ if (err)
+ error (0, err, "fsys_init"); /* Not necessarily fatal. */
++
++ if (verbose)
++ fprintf (stderr, "Fixed up bootstrap filesystem\n");
+ }
+
+ /* Set up the initial value of the standard exec data. */
+@@ -874,6 +896,9 @@ frob_kernel_process (void)
+ task_t task;
+ process_t proc, kbs;
+
++ if (verbose)
++ fprintf (stderr, "Frobbing kernel process\n");
++
+ err = proc_pid2task (procserver, HURD_PID_KERNEL, &task);
+ if (err)
+ {
+@@ -1094,6 +1119,9 @@ start_child (const char *prog, char **progargs)
+ }
+ assert_perror (err);
+
++ if (verbose)
++ fprintf (stderr, "Going to execute '%s'\n", args);
++
+ file = file_name_lookup (args, O_EXEC, 0);
+ if (file == MACH_PORT_NULL)
+ {
+@@ -1180,6 +1208,9 @@ void
+ launch_system (void)
+ {
+ launch_something (0);
++
++ if (verbose)
++ fprintf (stderr, "Init has completed\n");
+ }
+
+ /** RPC servers **/
+@@ -1200,6 +1231,9 @@ S_startup_procinit (startup_t server,
+ /* Only one proc server. */
+ return EPERM;
+
++ if (verbose)
++ fprintf (stderr, "Received startup message from proc\n");
++
+ procserver = proc;
+
+ procreply = reply;
+@@ -1226,6 +1260,9 @@ S_startup_authinit (startup_t server,
+ /* Only one auth server. */
+ return EPERM;
+
++ if (verbose)
++ fprintf (stderr, "Received startup message from auth\n");
++
+ authserver = auth;
+
+ /* Save the reply port until we get startup_procinit. */
+@@ -1258,6 +1295,10 @@ S_startup_essential_task (mach_port_t server,
+ if (credential != host_priv)
+ return EPERM;
+
++ if (verbose)
++ fprintf (stderr, "Received startup essential message from '%s'\n",
++ name);
++
+ fail = record_essential_task (name, task);
+ if (fail)
+ return fail;
+@@ -1276,8 +1317,13 @@ S_startup_essential_task (mach_port_t server,
+ else if (!strcmp (name, "proc"))
+ procinit = 1;
+
++ if (verbose)
++ fprintf (stderr, " still waiting for:");
++
+ if (authinit && execinit && procinit)
+ {
++ if (verbose)
++ fprintf (stderr, " none!\n");
+ /* Reply to this RPC, after that everything
+ is ready for real startup to begin. */
+ startup_essential_task_reply (reply, replytype, 0);
+@@ -1291,6 +1337,17 @@ S_startup_essential_task (mach_port_t server,
+
+ return MIG_NO_REPLY;
+ }
++
++ if (verbose)
++ {
++ if (! authinit)
++ fprintf (stderr, " auth");
++ if (! execinit)
++ fprintf (stderr, " exec");
++ if (! procinit)
++ fprintf (stderr, " proc");
++ fprintf (stderr, "\n");
++ }
+ }
+
+ return 0;
+--
+2.1.4
+
diff --git a/debian/patches/startup0004-startup-use-the-generated-default-server-implementat.patch b/debian/patches/startup0004-startup-use-the-generated-default-server-implementat.patch
new file mode 100644
index 00000000..9fc08790
--- /dev/null
+++ b/debian/patches/startup0004-startup-use-the-generated-default-server-implementat.patch
@@ -0,0 +1,153 @@
+From 6620d8b801c4683bf81fc419484d64530ba126ba Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Tue, 26 Apr 2016 19:12:17 +0200
+Subject: [PATCH hurd 4/5] startup: use the generated default server
+ implementations
+
+* startup/Makefile: Set appropriate flags.
+* startup/startup.c: Drop most stub functions.
+---
+ startup/Makefile | 3 ++
+ startup/startup.c | 102 +-----------------------------------------------------
+ 2 files changed, 4 insertions(+), 101 deletions(-)
+
+diff --git a/startup/Makefile b/startup/Makefile
+index db062ad..bda3ffb 100644
+--- a/startup/Makefile
++++ b/startup/Makefile
+@@ -28,6 +28,9 @@ HURDLIBS = shouldbeinlibc
+ # startup does not use libports. Disable the default payload to port
+ # conversion.
+ MIGSFLAGS="-DHURD_DEFAULT_PAYLOAD_TO_PORT=1"
++notify-MIGSFLAGS="-DNOTIFY_IMPORTS=import <hurd.h>;"
++notifyServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
++fsysServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
+ fsServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
+ ioServer-CFLAGS="-DMIG_EOPNOTSUPP=EOPNOTSUPP"
+
+diff --git a/startup/startup.c b/startup/startup.c
+index f3e3534..66f960c 100644
+--- a/startup/startup.c
++++ b/startup/startup.c
+@@ -1448,41 +1448,6 @@ S_startup_reboot (mach_port_t server,
+ for (;;);
+ }
+
+-/* Stubs for unused notification RPCs. */
+-
+-kern_return_t
+-do_mach_notify_port_destroyed (mach_port_t notify,
+- mach_port_t rights)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-kern_return_t
+-do_mach_notify_send_once (mach_port_t notify)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-kern_return_t
+-do_mach_notify_no_senders (mach_port_t port, mach_port_mscount_t mscount)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-kern_return_t
+-do_mach_notify_port_deleted (mach_port_t notify,
+- mach_port_t name)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-kern_return_t
+-do_mach_notify_msg_accepted (mach_port_t notify,
+- mach_port_t name)
+-{
+- return EOPNOTSUPP;
+-}
+-
+ /* msg server */
+
+ kern_return_t
+@@ -1731,75 +1696,10 @@ S_fsys_getroot (mach_port_t fsys_t,
+ }
+
+ error_t
+-S_fsys_goaway (mach_port_t control, int flags)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_startup (mach_port_t bootstrap, int flags, mach_port_t control,
+- mach_port_t *real, mach_msg_type_name_t *realtype)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_syncfs (mach_port_t control,
+- int wait,
+- int recurse)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_set_options (mach_port_t control,
+- char *data, mach_msg_type_number_t len,
+- int do_children)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+ S_fsys_get_options (mach_port_t control,
+ char **data, mach_msg_type_number_t *len)
+ {
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_getfile (mach_port_t control,
+- uid_t *uids, size_t nuids,
+- uid_t *gids, size_t ngids,
+- char *handle, size_t handllen,
+- mach_port_t *pt,
+- mach_msg_type_name_t *pttype)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_getpriv (mach_port_t control,
+- mach_port_t *host_priv, mach_msg_type_name_t *host_priv_type,
+- mach_port_t *dev_master, mach_msg_type_name_t *dev_master_type,
+- task_t *fs_task, mach_msg_type_name_t *fs_task_type)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_init (mach_port_t control,
+- mach_port_t reply,
+- mach_msg_type_name_t replytype,
+- mach_port_t proc,
+- auth_t auth)
+-{
+- return EOPNOTSUPP;
+-}
+-
+-error_t
+-S_fsys_forward (mach_port_t server, mach_port_t requestor,
+- char *argz, size_t argz_len)
+-{
++ /* XXX Implement me. */
+ return EOPNOTSUPP;
+ }
+
+--
+2.1.4
+
diff --git a/debian/patches/startup0005-startup-write-all-messages-to-stderr.patch b/debian/patches/startup0005-startup-write-all-messages-to-stderr.patch
new file mode 100644
index 00000000..ee6244c3
--- /dev/null
+++ b/debian/patches/startup0005-startup-write-all-messages-to-stderr.patch
@@ -0,0 +1,182 @@
+From b04364bcdcd1a209cb3e2762e09a42247bcde5f0 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Thu, 28 Apr 2016 18:57:54 +0200
+Subject: [PATCH hurd 5/5] startup: write all messages to stderr
+
+This avoids the need to flush the buffer and works around a weird
+problem with 'puts' not printing a newline.
+
+* startup/startup.c: Write all messages to stderr.
+---
+ startup/startup.c | 61 +++++++++++++++++++++++++------------------------------
+ 1 file changed, 28 insertions(+), 33 deletions(-)
+
+diff --git a/startup/startup.c b/startup/startup.c
+index 66f960c..f90b524 100644
+--- a/startup/startup.c
++++ b/startup/startup.c
+@@ -173,17 +173,15 @@ reboot_mach (int flags)
+ {
+ if (fakeboot)
+ {
+- printf ("%s: Would %s Mach with flags %#x\n",
+- program_invocation_short_name, BOOT (flags), flags);
+- fflush (stdout);
++ fprintf (stderr, "%s: Would %s Mach with flags %#x\n",
++ program_invocation_short_name, BOOT (flags), flags);
+ exit (1);
+ }
+ else
+ {
+ error_t err;
+- printf ("%s: %sing Mach (flags %#x)...\n",
+- program_invocation_short_name, BOOT (flags), flags);
+- fflush (stdout);
++ fprintf (stderr, "%s: %sing Mach (flags %#x)...\n",
++ program_invocation_short_name, BOOT (flags), flags);
+ sleep (5);
+ while ((err = host_reboot (host_priv, flags)))
+ error (0, err, "reboot");
+@@ -207,17 +205,16 @@ notify_shutdown (const char *msg)
+ for (n = ntfy_tasks; n != NULL; n = n->next)
+ {
+ error_t err;
+- printf ("%s: notifying %s of %s...",
+- program_invocation_short_name, n->name, msg);
+- fflush (stdout);
++ fprintf (stderr, "%s: notifying %s of %s...",
++ program_invocation_short_name, n->name, msg);
++
+ err = startup_dosync (n->notify_port, 60000); /* 1 minute to reply */
+ if (err == MACH_SEND_INVALID_DEST)
+- puts ("(no longer present)");
++ fprintf (stderr, "(no longer present)\n");
+ else if (err)
+- puts (strerror (err));
++ fprintf (stderr, "%s\n", strerror (err));
+ else
+- puts ("done");
+- fflush (stdout);
++ fprintf (stderr, "done\n");
+ }
+ }
+
+@@ -276,20 +273,18 @@ reboot_system (int flags)
+ }
+ if (!(pi->state & PI_NOPARENT))
+ {
+- printf ("%s: Killing pid %d\n",
+- program_invocation_short_name, pp[ind]);
+- fflush (stdout);
++ fprintf (stderr, "%s: Killing pid %d\n",
++ program_invocation_short_name, pp[ind]);
+ task_terminate (task);
+ }
+ if (noise_len > 0)
+ munmap (noise, noise_len);
+ }
+ }
+- printf ("%s: Killing proc server\n", program_invocation_short_name);
+- fflush (stdout);
++ fprintf (stderr, "%s: Killing proc server\n",
++ program_invocation_short_name);
+ task_terminate (proctask);
+- printf ("%s: Exiting", program_invocation_short_name);
+- fflush (stdout);
++ fprintf (stderr, "%s: Exiting", program_invocation_short_name);
+ }
+ reboot_mach (flags);
+ }
+@@ -359,7 +354,7 @@ run (const char *server, mach_port_t *ports, task_t *task)
+
+ if (bootstrap_args & RB_INITNAME)
+ {
+- printf ("Server file name (default %s): ", server);
++ fprintf (stderr, "Server file name (default %s): ", server);
+ if (getstring (buf, sizeof (buf)))
+ prog = buf;
+ }
+@@ -381,7 +376,7 @@ run (const char *server, mach_port_t *ports, task_t *task)
+ 0, task);
+ if (bootstrap_args & RB_KDB)
+ {
+- printf ("Pausing for %s\n", prog);
++ fprintf (stderr, "Pausing for %s\n", prog);
+ getchar ();
+ }
+ err = file_exec (file, *task, 0,
+@@ -397,7 +392,8 @@ run (const char *server, mach_port_t *ports, task_t *task)
+ error (0, err, "%s", prog);
+ }
+
+- printf ("File name for server %s (or nothing to reboot): ", server);
++ fprintf (stderr, "File name for server %s (or nothing to reboot): ",
++ server);
+ if (getstring (buf, sizeof (buf)))
+ prog = buf;
+ else
+@@ -405,7 +401,7 @@ run (const char *server, mach_port_t *ports, task_t *task)
+ }
+
+ if (verbose)
+- fprintf (stderr, "started %s\n", prog);
++ fprintf (stderr, stderr, "started %s\n", prog);
+
+ /* Dead-name notification on the task port will tell us when it dies,
+ so we can crash if we don't make it to a fully bootstrapped Hurd. */
+@@ -431,7 +427,7 @@ run_for_real (char *filename, char *args, int arglen, mach_port_t ctty,
+ char buf[512];
+ do
+ {
+- printf ("File name [%s]: ", filename);
++ fprintf (stderr, "File name [%s]: ", filename);
+ if (getstring (buf, sizeof (buf)) && *buf)
+ filename = buf;
+ file = file_name_lookup (filename, O_EXEC, 0);
+@@ -467,7 +463,7 @@ run_for_real (char *filename, char *args, int arglen, mach_port_t ctty,
+ }
+ if (bootstrap_args & RB_KDB)
+ {
+- printf ("Pausing for %s\n", filename);
++ fprintf (stderr, "Pausing for %s\n", filename);
+ getchar ();
+ }
+ progname = strrchr (filename, '/');
+@@ -690,11 +686,11 @@ main (int argc, char **argv, char **envp)
+
+ default_ports[INIT_PORT_BOOTSTRAP] = startup;
+ run ("/hurd/proc", default_ports, &proctask);
+- printf (" proc");
+- fflush (stdout);
++ if (! verbose)
++ fprintf (stderr, " proc");
+ run ("/hurd/auth", default_ports, &authtask);
+- printf (" auth");
+- fflush (stdout);
++ if (! verbose)
++ fprintf (stderr, " auth");
+ default_ports[INIT_PORT_BOOTSTRAP] = MACH_PORT_NULL;
+
+ /* Wait for messages. When both auth and proc have started, we
+@@ -805,8 +801,7 @@ launch_core_servers (void)
+ err = proc_mark_exec (fsproc);
+ assert_perror (err);
+
+- printf (".\n");
+- fflush (stdout);
++ fprintf (stderr, ".\n");
+
+ /* Tell the proc server our msgport. Be sure to do this after we are all
+ done making requests of proc. Once we have done this RPC, proc
+@@ -1141,7 +1136,7 @@ start_child (const char *prog, char **progargs)
+
+ if (bootstrap_args & RB_KDB)
+ {
+- printf ("Pausing for %s\n", args);
++ fprintf (stderr, "Pausing for %s\n", args);
+ getchar ();
+ }
+
+--
+2.1.4
+