bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting ext2fs a console


From: Neal H Walfield
Subject: Getting ext2fs a console
Date: Sat, 10 Nov 2001 01:01:39 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1

If ext2fs crashes during the system boot, it can be difficult to
determine what the problem is, in fact, for an inexperienced user, it
can be almost impossible to tell that the error came from ext2fs.

The problem is that ext2fs does not have a stdout until after it has
both the device master port and finished parsing the arguments.  One
way to solve this is to attempt to open a console as soon the
--device-master-port flag is seen processed.  This, however, has two
unfortunate side effects: the translator using libdiskfs may not be
interested in calling diskfs_console_stdio () (diskfs_console_stdio is
normally called in diskfs_init_main (), which is not a required
function) and trying to get the device master port via
get_privileged_ports when there is no host privilege port fails (Cf.
libc/hurd/privports.c).

Anyway, on with the show, I propose the following two patches:


2001-11-10  Neal H Walfield  <neal@cs.uml.edu>

        * hurd/privports.c (__get_privileged_ports): Only contact the
        proc server if it is absolutely necessary.


Index: privports.c
===================================================================
RCS file: /cvs/libc/hurd/privports.c,v
retrieving revision 1.5
diff -u -r1.5 privports.c
--- privports.c 2001/07/06 04:54:47     1.5
+++ privports.c 2001/11/09 23:37:55
@@ -28,7 +28,8 @@
 __get_privileged_ports (host_priv_t *host_priv_ptr,
                        device_t *device_master_ptr)
 {
-  if (! _hurd_host_priv)
+  if ((host_priv_ptr && ! _hurd_host_priv)
+      || (device_master_ptr && ! _hurd_device_master))
     {
       error_t err;


And in hurd/libdiskfs:

2001-11-10  Neal H Walfield  <neal@cs.uml.edu>

        * opts-std-startup.c (parse_startup_opt): When processing
        OPT_DEVICE_MASTER_PORT, also attempt to open a console.


Index: opts-std-startup.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/opts-std-startup.c,v
retrieving revision 1.19
diff -u -r1.19 opts-std-startup.c
--- opts-std-startup.c  2001/08/24 02:23:57     1.19
+++ opts-std-startup.c  2001/11/09 23:40:11
@@ -97,7 +97,9 @@
 
       /* Boot options */
     case OPT_DEVICE_MASTER_PORT:
-      _hurd_device_master = atoi (arg); break;
+      _hurd_device_master = atoi (arg);
+      diskfs_console_stdio ();
+      break;
     case OPT_HOST_PRIV_PORT:
       _hurd_host_priv = atoi (arg); break;
     case OPT_EXEC_SERVER_TASK:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]