Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 1996 16:04:38 -0800 (PST)
From:      julian@TFS.COM (Julian Elischer)
To:        jdp@polstra.com (John Polstra)
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: chrooting /sbin/init - has anybody tried it?
Message-ID:  <m0tpOWV-0003vqC@TFS.COM>
In-Reply-To: <199602211935.LAA03576@austin.polstra.com> from "John Polstra" at Feb 21, 96 11:35:07 am

next in thread | previous in thread | raw e-mail | index | archive | help
I do something similar.
I have a chroot environment that takes up a partition, and boot
sd(0,f)/kernel to test it..

MACH does something similar to what you suggest (in 2.5 at least)
as / is actually  /RFS/.LOCALROOT

The kernlal is already capable of looking for many different inits
so just place the new one earlier in the list in you -current kernel
that way when you want the special init, you move it to where it will be found
and when you don't you remove it,
the second in the list is the standard init.
> 
> I have a chroot environment set up on my production system, so that
> I can do make worlds of -current, without touching my installed
> system.  (Thanks, Nate!)  I've been toying with the idea of taking
> this one step further.  I'd like to use chroot to enable me to boot
> up and run the -current kernel at times, for testing, without
> creating a separate slice for its root filesystem.
> 
> My chroot tree is in "/home/current".  What I have in mind is the
> following:
> 
>     * Modify the -current kernel slighly, so that it looks for the
>       "init" program in "/home/current/sbin/init".
> 
>     * Build the modified kernel, and put a copy of it in "/kernel.current".
> 
>     * Modify the -current "init" program so that, at startup, it does a
>       chroot to "/home/current".
> 
> If I did that, I think I could then boot up "/kernel.current", and
> everything after that would run chrooted, in my "/home/current" tree.
> It should behave almost like an actual installed -current system.
> 
> Have any of you tried this before?  Does it work?  Are there any
> pitfalls I should look out for?
> 
> Thanks.
> --
>    John Polstra                                       jdp@polstra.com
>    John D. Polstra & Co., Inc.                Seattle, Washington USA
>    "Self-knowledge is always bad news."                 -- John Barth
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0tpOWV-0003vqC>