diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-09-19 09:15:02 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-11-21 05:49:03 +0100 |
commit | 5ee314b6c1ffd8b090ca6771f0896e080f7000ef (patch) | |
tree | f6d20c43e718f887060f9c2c4e6e78fffed26407 /libdiskfs/boot-start.c | |
parent | dcafd2d6cc7a98744b08875b35caf218a4a5c14a (diff) | |
download | hurd-5ee314b6c1ffd8b090ca6771f0896e080f7000ef.tar.gz hurd-5ee314b6c1ffd8b090ca6771f0896e080f7000ef.tar.bz2 hurd-5ee314b6c1ffd8b090ca6771f0896e080f7000ef.zip |
startup: bind the startup server to /servers/startup
Previously, the Hurd (ab)used the fact that the startup server speaks
all protocols on its message port. Any server that wished to register
for shutdown notifications would use proc_getmsgport to get a port to
the startup server.
This hardcodes the PID of /hurd/startup, and does not allow one to
point a server to ones own startup server (e.g. using remap).
Bind the startup server to /servers/startup instead. Use this to
contact the startup server.
* exec/main.c (S_exec_init): Use /servers/startup. Fall back to the
old method so that the system still boots when the node
/servers/startup is missing.
* hurd/paths.h (_SERVERS_STARTUP): New macro.
* libdiskfs/boot-start.c (diskfs_S_fsys_init): Use /servers/startup.
* libdiskfs/init-startup.c (_diskfs_init_completed): Likewise.
* pfinet/main.c (arrange_shutdown_notification): Likewise.
* startup/Makefile (OBJS): Add fsysServer.o.
* startup/startup.c (demuxer): Handle the fsys protocol.
(main): Bind to /servers/startup.
(S_fsys_getroot): Implement fsys_getroot. Stub out the rest.
Diffstat (limited to 'libdiskfs/boot-start.c')
-rw-r--r-- | libdiskfs/boot-start.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c index 42e991e6..cfe23034 100644 --- a/libdiskfs/boot-start.c +++ b/libdiskfs/boot-start.c @@ -33,7 +33,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <string.h> #include <argz.h> #include <error.h> -#include <pids.h> #include "exec_S.h" #include "exec_startup_S.h" #include "fsys_S.h" @@ -602,9 +601,12 @@ diskfs_S_fsys_init (struct diskfs_control *pt, proc_register_version (procserver, host, diskfs_server_name, "", diskfs_server_version); + mach_port_deallocate (mach_task_self (), procserver); - err = proc_getmsgport (procserver, HURD_PID_STARTUP, &startup); - if (!err) + startup = file_name_lookup (_SERVERS_STARTUP, 0, 0); + if (startup == MACH_PORT_NULL) + error (0, errno, "%s", _SERVERS_STARTUP); + else { startup_essential_task (startup, mach_task_self (), MACH_PORT_NULL, diskfs_server_name, host); @@ -612,7 +614,6 @@ diskfs_S_fsys_init (struct diskfs_control *pt, } mach_port_deallocate (mach_task_self (), host); - mach_port_deallocate (mach_task_self (), procserver); _diskfs_init_completed (); |