From owner-freebsd-questions@FreeBSD.ORG Wed Sep 3 10:27:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99E60106564A for ; Wed, 3 Sep 2008 10:27:44 +0000 (UTC) (envelope-from joel@levee-online.org) Received: from bounce-2.online.net (bounce-2.online.net [88.191.253.47]) by mx1.freebsd.org (Postfix) with ESMTP id 2DD468FC08 for ; Wed, 3 Sep 2008 10:27:44 +0000 (UTC) (envelope-from joel@levee-online.org) Received: from smtpout-php.online.net (unknown [88.191.253.3]) by bounce-2.online.net (Postfix) with ESMTP id C5FDF4952E for ; Wed, 3 Sep 2008 11:54:39 +0200 (CEST) Received: from localhost.localdomain (webmail-5.online.net [88.191.253.95]) by smtpout-php.online.net (Postfix) with ESMTP id 28FE213EF7A; Wed, 3 Sep 2008 11:54:37 +0200 (CEST) Received: by localhost.localdomain (Postfix, from userid 33) id AD6DE185A; Wed, 3 Sep 2008 11:54:43 +0200 (CEST) Received: from AVelizy-154-1-13-215.w82-124.abo.wanadoo.fr (AVelizy-154-1-13-215.w82-124.abo.wanadoo.fr [82.124.200.215]) by imp.online.net (IMP) with HTTP for ; Wed, 03 Sep 2008 11:54:43 +0200 Message-ID: <1220435683.48be5ee3a88bd@imp.online.net> Date: Wed, 03 Sep 2008 11:54:43 +0200 From: joel@levee-online.org To: Manolis Kiagias References: <1220348951.48bd0c17315aa@imp.online.net> <48BD1AA9.8000307@gmail.com> In-Reply-To: <48BD1AA9.8000307@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 Cc: "freebsd-questions@freebsd.org" Subject: Re: starting sysinstall at boot time X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2008 10:27:44 -0000 Quoting Manolis Kiagias : Hi Manolis Thank you very much for you quick and accurate answer. I had mounted the mfsroot but I did not notice that init was not present. So now every thins is clear and not magic at all. Best regards, Joel Levee > joel@levee-online.org wrote: > > Hi, > > > > Something seems magic in freebsd: I am looking for what does start > > sysinstall at boot time when I boot from the installation CD. > > The only thing related to systinstall is the setting of the init_path > variable > > in the loader.rc file but it is in comment thus the loader should finish > > by launchinig init as usual so what does make it launch sysinstall instead? > > > > I also examined /etc/ttys which is used by init but this file is standard > > and I do not find anything that could tell init to start sysinstall instead > > of getty! > > > > As you may guess, my goal is to create an customized installation CD in > > order to install a network appliance wich embedds freebsd. > > > > Sincerily, > > Joel Levee > > > > > > > > This is a tricky one, kind of black magic ;) > > Seriously, it is quite simple: > > You correctly located the init_path variable. This contains the > following (on a 6.3-RELEASE CD I have handy at the moment): > > #init_path="/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall" > > This is commented out, but the values shown are the built-in defaults. > > Now, if you take a look at the CD filesystem structure, *there is* an > /sbin/init and there is *no* /stand/sysinstall. So, you would assume > that init would run first. > > However, here comes the caveat: > > The root filesystem when you boot your installation media, is *not* the > CD-ROM itself. Look at /boot/loader.conf: > > mfsroot_load="YES" > mfsroot_type="mfs_root" > mfsroot_name="/boot/mfsroot" > > You will find /boot/mfsroot.gz as the file that acts as the root filesystem. > You can actually examine the contents of this if you mount it using > mdconfig (assuming you mounted your install CD on /cdrom): > > cp /cdrom/boot/mfsroot.gz /tmp > cd /tmp > unzip mfsroot.gz (Can probably be mounted compressed(?), did not check) > mdconfig -f mfsroot md0 > mount /dev/md0 /mnt > > Check the contents of /mnt: > > bin boot dev etc mnt sbin stand var > > sbin is a symbolic link to stand. There is no '/stand/init' in , but > '/stand/sysinstall' exists. Therefore, sysinstall executes ;) >