From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 27 19:27:28 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 873D016A403 for ; Wed, 27 Dec 2006 19:27:28 +0000 (UTC) (envelope-from erik.udo@gmail.com) Received: from satakieli.dnainternet.net (satakieli.dnainternet.net [212.149.75.40]) by mx1.freebsd.org (Postfix) with ESMTP id 4EA4513C474 for ; Wed, 27 Dec 2006 19:27:28 +0000 (UTC) (envelope-from erik.udo@gmail.com) Received: from [192.168.1.11] (host-212-149-186-30.kpylaajakaista.net [212.149.186.30]) by satakieli.dnainternet.net (Postfix) with ESMTP id EB1ACC8BC for ; Wed, 27 Dec 2006 21:27:25 +0200 (EET) Message-ID: <4592C91C.2040801@gmail.com> Date: Wed, 27 Dec 2006 21:27:24 +0200 From: Erik Udo User-Agent: Thunderbird 1.5.0.9 (X11/20061226) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Init.c, making it chroot X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Dec 2006 19:27:28 -0000 How can i make init chroot after executing /etc/rc, and executing /etc/rc again in the chrooted enviroment? For this to work, i'd like to know at what point do i call chroot(), becouse init.c uses fork() at the point where it runs the rc script. The thing is, i want to run a whole system in a chrooted enviroment in this livecd i'm making. But the command "chroot /mnt/root /etc/rc" returns after the /etc/rc has been run, dropping me back from the chrooted enviroment. And if it doesn't, init never starts the multiuser mode. So how can i go to the multiuser mode in a chrooted enviroment? I guess the only way to do that is to modify init.c Any help/feedback is appreciated. Cheers, Erik