From owner-freebsd-questions@FreeBSD.ORG Tue Sep 2 10:51:26 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 C151D106564A for ; Tue, 2 Sep 2008 10:51:26 +0000 (UTC) (envelope-from sonic2000gr@gmail.com) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.191]) by mx1.freebsd.org (Postfix) with ESMTP id 471F28FC1E for ; Tue, 2 Sep 2008 10:51:26 +0000 (UTC) (envelope-from sonic2000gr@gmail.com) Received: by fk-out-0910.google.com with SMTP id k31so1947261fkk.11 for ; Tue, 02 Sep 2008 03:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=6/XFEp4zH19M0YW+Z2XTWc0wMV492axn1xiaTGtXkkc=; b=gQ2O74Qf625ElmXYvBjbbGySPy7xJ4bPijjv1nlMV3vcT1FBnC1WytTqVBV1vC4zkr kfCbgXlwluMXL3jo8qWlTurF7tuX8Jr3MspQFA8R+EGwJEX5PTWACW/aOVWMYrqAVfuj 352JCeaW7x8S40YkdWlCf27PGsP3Y/tV7nXto= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=ip+dlmjsD6CU7Ezoos1Rd/ulecBgXaH6hEsBUWYc15gx87J4rLqbj9tAVwZ/T8c0UU 5SAREtHlbnemFoRz8UnncoDclziTcnKDnPUHGQDX/MSD8G/sYvLhtPJ55lDTC9o5MzKs TRK/yufsyslpYhNWoPOiSlbVJ60OMkPBSQQx0= Received: by 10.181.32.15 with SMTP id k15mr5588948bkj.84.1220352684534; Tue, 02 Sep 2008 03:51:24 -0700 (PDT) Received: from atlantis.dyndns.org ( [85.72.97.62]) by mx.google.com with ESMTPS id g28sm7405135fkg.8.2008.09.02.03.51.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 02 Sep 2008 03:51:23 -0700 (PDT) Message-ID: <48BD1AA9.8000307@gmail.com> Date: Tue, 02 Sep 2008 13:51:21 +0300 From: Manolis Kiagias User-Agent: Thunderbird 2.0.0.16 (X11/20080829) MIME-Version: 1.0 To: joel@levee-online.org References: <1220348951.48bd0c17315aa@imp.online.net> In-Reply-To: <1220348951.48bd0c17315aa@imp.online.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Tue, 02 Sep 2008 10:51:27 -0000 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 ;)