Bug 104984

Summary: /sbin/init takes no command line parameters
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Andreas Gruenbacher <agruen>
Component: BasesystemAssignee: Hannes Reinecke <hare>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: coolo
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: mkinitrd

Description Andreas Gruenbacher 2005-08-16 17:00:10 UTC
This line in mkinitrd:  
  
  |exec /bin/run-init -c ./dev/console /root $init "$@"   
  
passes the $kernel_cmdline parameters to the init process. IMO this is wrong;   
the init process does not take parameters. This doesn't matter for the "real"   
init, but an option like "init=/bin/sh" causes the shell to try executing a   
script which then fails, for example.
Comment 1 Hannes Reinecke 2005-08-17 06:37:37 UTC
Well, not quite. init does take a parameter (the selected runlevel).

But for others it seems you are correct.
Comment 2 Hannes Reinecke 2005-08-17 06:38:17 UTC
Created attachment 46229 [details]
mkinitrd

Fixed /sbin/mkinitrd
Comment 3 Hannes Reinecke 2005-08-17 06:39:03 UTC
This is the version I've checked in into CVS. Please test with it; if I don't
hear anything by the end of the week I'll submit it to autobuild.
Comment 4 Ruediger Oertel 2005-08-18 16:44:08 UTC
wait a second: will this break the possibility to set 
variable names on the boot-prompt that affect hooks in the boot-process ? 
 
Comment 5 Andreas Gruenbacher 2005-08-18 16:47:29 UTC
No, all parameters are all still available in /proc/cmdline. This was only 
about how the init process itself is invoked. 
Comment 6 Olaf Hering 2005-08-18 18:56:10 UTC
I'm almost sure this breaks init=/bin/bash --login 
Comment 7 Hannes Reinecke 2005-08-19 06:17:06 UTC
Ad comment #4: Yes.
Ad comment #6: Probably.

Andreas, I'm beginning to wonder whether we should revert that change.
Comment 8 Stephan Kulow 2005-08-19 07:17:12 UTC
then indeed everything comes down to the bug in gfxboot to not allow 
parameters anymore - which forces you into the text grub, that doesn't remove 
the showopts we have in our default menu.lst. Because init=/bin/bash showopts 
_is_ a problem. 
Comment 9 Hannes Reinecke 2005-09-07 11:05:55 UTC
So, we fixed mkinitrd to only pass the runlevel to run_init.
Everything else is pointless anyway.

And no, init=/bin/bash --login is not broken.