I quite agree with dietmar, concerning uglyness... And concerning the replacement of init with a script, well, hum... :D Is it even possible ? Won't it suffer from the lack of proc / sys and dev ? Environment variables setup by init ? What's more, there is a risk to spawn multiple processes (eval ?) before init is launched and the previous questions do apply.
In the meantime, I find it rather strange that busybox wipes it's arguments, knowing that passing arguments to init is a feature supported, at least, by linux and that only argv[1] is parsed, so extra arguments would do no harm. The ps argument is quite strange, why does it matter ? "Cluttered" command-lines are quite well accepted for other processes, why would init be any different ? For now, I will stick with using argv[1] and retrieving it's content with the RUNLEVEL environment variable, until I'm able to propose a decent patch, with an option to disable this behavior. Anyway, thank you for all your answers. 2016-01-29 17:32 GMT+01:00 Isaac Dunham <[email protected]>: > On Fri, Jan 29, 2016 at 08:27:19AM +0100, Nicolas CARRIER wrote: > > Thank you for your answer. > > > > Even if I'm using linux, I want the solution to work in the context of > init > > being launched as a pid 1 of a pid namespace, which is my main use case. > > In this situation, the kernel's command line can't be changed as it's the > > one of the host PC. > > > > Luckily enough, I have several ways to achieve what I want, but in my > > opinion, using init's arguments would have been the most elegant option. > > > > I'm really interested in knowing which is the real reason behind this > > feature and if there is any chance that a patch would be accepted, to > > either remove, or allow to disable this part of the code. > > A patch to optionally disable a feature is usually acceptable, it seems. > I can't speak for the maintainer, though. > > However, I seem to recall that commonly, options like 'foo=bar' get into > the environment. > This would be doable by means of a script that execs busybox init, > something like this (untested, doesn't handle -...): > > for opt in $#; do > case "$opt" in > (*=*) eval "$opt" > ;; > esac > done > > exec busybox init $@ > > > HTH, > Isaac Dunham >
_______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
