From owner-freebsd-current Wed Feb 21 16:04:41 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA11874 for current-outgoing; Wed, 21 Feb 1996 16:04:41 -0800 (PST) Received: from tfs.com (tfs.com [140.145.250.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA11869 for ; Wed, 21 Feb 1996 16:04:40 -0800 (PST) Received: by tfs.com (smail3.1.28.1) Message-Id: From: julian@TFS.COM (Julian Elischer) Subject: Re: chrooting /sbin/init - has anybody tried it? To: jdp@polstra.com (John Polstra) Date: Wed, 21 Feb 1996 16:04:38 -0800 (PST) Cc: freebsd-current@FreeBSD.org In-Reply-To: <199602211935.LAA03576@austin.polstra.com> from "John Polstra" at Feb 21, 96 11:35:07 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-current@FreeBSD.org Precedence: bulk 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 >