Subject: Re: NetBSD kernel and Ultrix init never automatically reboot +FIX
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Chris G. Demetriou <cgd@alpha.bostic.com>
List: port-pmax
Date: 08/30/1994 18:05:03
> NetBSD's (kernel) init_main doesn't bother passing an explicit "-a"
> flag to init. The code assumes that init will try an automatic
> reboot (i.e., go multiuser) if invoked with no arguments.

Right.  this is the way BSD init works, at least now.  I don't have a
historical perspective on it.

> Ultrix init, conversely (perversely?) assumes the default is "-s"
> and only does an automatic reboot if the kernel explicitly passes
> a "-a" argument.

i think "perversely" is correct.  8-)  I also think that if you're
going to suggest this change (and i don't like it, even though i have
exactly the same problem on another architecture) then the fix
below is probably more correct.

> The following patch to the NetBSD kernel causes init_main() to always
> explicitly pass a "-s" or "-a" argument to init. This doesn't cost
> much in space or time and I don't see how it can possibly hurt.  While
> it's largely irrelevant to users with native NetBSD binaries it makes
> NetBSD with Ultrix binaries much more palatable. I don't know if the
> same applies to other vendor (or CSRG) versions of init.

NetBSD's init is the same as the one in 4.4-Lite (modulo one or
two things, i think).


On serious problem comes in if RB_FASTBOOT support is ever done in the
kernel. then one could pass the ULTRIX init the -f flag, and what
would it do then?  (of course, if you were running with compat
binaries, you'd probably be using ULTRIX boot blocks, etc., and so
would never see it.)

I also think it's really silly that the code to use '--' is there if no
arguments are supplied, rather than just NULL-ing arg1.  It means that
the kernel is relying on the fact that init(8) is using getopt() to
parse its arguments...




cgd
===================================================================
RCS file: /usr0/cvs/sys/kern/init_main.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 init_main.c
*** 1.1.1.4	1994/07/25 05:47:14
--- init_main.c	1994/08/30 21:57:51
***************
*** 366,372 ****
  		}
  #endif
  		if (options == 0)
! 			(void)subyte(--ucp, '-');
  		(void)subyte(--ucp, '-');		/* leading hyphen */
  		arg1 = ucp;
  
--- 366,372 ----
  		}
  #endif
  		if (options == 0)
! 			(void)subyte(--ucp, 'a');
  		(void)subyte(--ucp, '-');		/* leading hyphen */
  		arg1 = ucp;
  

------------------------------------------------------------------------------