Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Init sequence
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
saint
n00b
n00b


Joined: 30 May 2003
Posts: 24

PostPosted: Fri Sep 26, 2003 11:54 am    Post subject: Init sequence Reply with quote

I've recently come to poke around in the initscripts provided with gentoo. What I've been wondering is, and unable to discern from the scripts themselves without much difficulty, what is required to actually get gentoo to a workable state, what are the... bare minimums of booting? If someone could either provide a resource where this is carefully explained, free of any distribution specific tones, or actuall able to just enumerate them here, then that'd be great! Thanks for your time, have a good day

Saint
Back to top
View user's profile Send private message
cyfred
Retired Dev
Retired Dev


Joined: 23 Aug 2002
Posts: 596

PostPosted: Fri Sep 26, 2003 1:41 pm    Post subject: Reply with quote

In theory you just need to have an init script (inittab in gentoo and most others / linuxrc occasionally / something else very rarely) which basically spawns gettys (the login terminals) and if you only wanted one VT then just one getty session need be spawned.

Of couse this does not really setup your system for niceness.
Code:
andrew@saturn /etc/runlevels $ ls boot/
bootmisc  checkroot  hostname  localmount  net.lo     serial
checkfs   clock      keymaps   modules     rmnologin  urandom


That is the contents of /etc/runlevels/boot, the init scripts that are run for every profile and basically the ones for niceness in the system. Some of these do things that are really necessary if you didnt want them. Such as the modules script, but autoloading of modules on boot is nice :D

None of the other init scripts are needed so personally I would focus on breaking those above 12 down to what you are actually looking for / or what you dont want :wink:

(Keep rmnologin, checkroot, and bootmisc at least though IMO)
Back to top
View user's profile Send private message
saint
n00b
n00b


Joined: 30 May 2003
Posts: 24

PostPosted: Fri Sep 26, 2003 2:03 pm    Post subject: Reply with quote

Ohh thank you very much. Taking a look through those, I'm just going to make a few early guesses (because I'm not knowledgable for them to be anything more ;)) in a rough order...:

->mount the root fs ro(?)
->fscking the root fs (optional, but recommended?)
->remount root fs rw(?)
->we can then "mount -a" to mount everything in fstab (excluding a few fs types)
->set the hostname
->load modules

This is just a gleening from the scripts, but I'd welcome (and hope) someone would come along and reorder it, or make additions and deletions. I think it'd be nice to have a clear overview of what gets the boot from kernel-end -> getty spawn. Anyway, thanks and have a good day.

Saint
Back to top
View user's profile Send private message
cyfred
Retired Dev
Retired Dev


Joined: 23 Aug 2002
Posts: 596

PostPosted: Fri Sep 26, 2003 2:50 pm    Post subject: Reply with quote

Essentially what happens is the kernel spawns an init session (actual binary init) which runs the commands / options set in /etc/inittab finally ending with the spawning of the getty's.

Quote:
->mount the root fs ro(?)
->fscking the root fs (optional, but recommended?)
->remount root fs rw(?)
->we can then "mount -a" to mount everything in fstab (excluding a few fs types)
->set the hostname
->load modules


Fscking is only needed if you uncleanly unmount (generally, this is not an exclusive case) but you could do it every boot if you wanted. You normally would set the hostname after you have loaded the modules aswell, as the hostname may need to bind to some device (ie networking) that the modules must initalise.

Look here http://www.au.linuxfromscratch.org/lfs/view/stable/chapter07/chapter07.html for setting up bootscripts more fully. Try reading through /etc/inittab it will probably lead you in the right direction.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum