Date: Wed, 03 Sep 2008 11:54:43 +0200 From: joel@levee-online.org To: Manolis Kiagias <sonic2000gr@gmail.com> Cc: "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org> Subject: Re: starting sysinstall at boot time Message-ID: <1220435683.48be5ee3a88bd@imp.online.net> In-Reply-To: <48BD1AA9.8000307@gmail.com> References: <1220348951.48bd0c17315aa@imp.online.net> <48BD1AA9.8000307@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Manolis Kiagias <sonic2000gr@gmail.com>: 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 ;) >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1220435683.48be5ee3a88bd>