LFS Init scripts?

Bruce Dubbs bruce.dubbs at gmail.com
Thu Sep 30 13:22:26 PDT 2010


Mark Knecht wrote:
> Hi,
>    I've recently found LFS. Thanks to those that feed and care for it.
> Nice project.
> 
>    I've read through the book once and started my first build. It's
> proceeding fine. I'm typically a Gentoo user so most of what's going
> on in terms of building software is relatively familiar and I'm not
> having any trouble. (Yet!)
> 
>    That said my reason for searching out and trying LFS is to learn
> more about init scripts. It seems that the LFS init scripts - if I
> understand them and likely I don't - sort of leave the init scripts
> alone and as a result they remain sort of generic. They handle lots of
> different file system types and many conditions I don't think will be
> important to me.
> 
>    My personal goal is to understand, for a _very_ minimal system with
> just a couple of partitions and most all of the drivers built into the
> kernel, how to boot the kernel and then load everything by hand, one
> command at a time. I.e. = I'd like to mount /proc, mount /dev, mount
> /sys all by hand and then work through understanding what the scripts
> do step by step. I don't care about X for now. I do need networking.
> 
>    I'm wondering if there might be a good doc around, either LFS
> specific or even a for-sale Linux book I could buy, that covers what
> has to happen to get from that last stage of the kernel booting to a
> bash prompt that allows a user to login?

The first program to run in linux is init.  We use sysvinit.  That reads 
/etc/inittab.

 From there thee are really three lines that are significant:

id:3:initdefault:
si::sysinit:/etc/rc.d/init.d/rc sysinit
l3:3:wait:/etc/rc.d/init.d/rc 3

The second and third line run the /etc/rc.d/init.d/rc scripts.  The 
third line is run because of the first.

Read the rc script to trace what is happening.  The scripts are written 
for LFS, but the functionality is close to RedHat's scripts.  Generally 
the scripts have been pretty stable.  We have not made significant 
changes in years.

   -- Bruce



More information about the lfs-support mailing list