Init.c, making it chroot
Oliver Fromme
olli at lurza.secnetix.de
Mon Jan 8 19:48:52 UTC 2007
John Baldwin wrote:
> On Saturday 06 January 2007 14:27, Oliver Fromme wrote:
> > M. Warner Losh wrote:
> > > Also, kenv(KENV_GET, ... is used a lot. Maybe it makes sense to have
> > > a simple kenvget call. Would make a few lines a little shorter if
> > > nothing else.
> >
> > KENV_GET is used three times. Using a wrapper function
> > would save 7 characters per call. I don't think it's
> > really worth it. But if you insist, I can update the
> > patch with such a function.
>
> I think just using kenv() is fine.
OK, so how do we proceed now?
Should I submit a PR containing the patch?
I'm also willing to write a bit of documentation for the
new init_* kenv variables, but I'm not sure where to put
it. The existing init_path variable is documented in
loader(8), so maybe it should go there? Also there should
be sample entries in /boot/defaults/loader.conf, of course,
like this:
--- loader.conf.orig Mon Jan 8 20:45:23 2007
+++ loader.conf Mon Jan 8 20:47:48 2007
@@ -77,6 +77,9 @@
#boot_verbose="" # -v: Causes extra debugging information to be printed
#init_path="/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall"
# Sets the list of init candidates
+#init_shell="/bin/sh" # The shell binary used by init(8).
+#init_shript="" # Initial script to run by init(8) before chrooting.
+#init_chroot="" # Directory for init(8) to chroot into.
##############################################################
By the way, I just verified in the CVS repository that the
init.c code is identical in HEAD (1.62) and in RELENG_6
(1.60.2.2). Therefore the patch should apply cleanly to
both HEAD and RELENG_6.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'
More information about the freebsd-hackers
mailing list