|
|
||
|
||
|
|
| Red Hat Documentation |
5. Making the LFS system bootable5.1 Installing SysvinitUnder normal circumstances, after the kernel is done loading and initializing
various system components, it attempts to load a program called
After applying the $(ROOT) parts to the last four lines, they should look like this:
@if [! -p $(ROOT)/dev/initctl ]; then \ echo "Creating $(ROOT)/dev/initctl"; \ rm -f $(ROOT)/dev/initctl; \ mknod -m 600 $(ROOT)/dev/initctl p; fi
make -e LDFLAGS=-static; make install 5.2 Configuring SysvinitIn order for Sysvinit to work, we need to create it's configuration file.
Create the
# Begin /etc/inittab id:2:initdefault: ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now 1:2345:respawn:/sbin/sulogin # End /etc/inittab 5.3 Creating passwd & group filesAs you can see from the inittab file, when we boot the system, init will start the sulogin program and sulogin will ask you for user root's password. This means we need to have at least a passwd file present on the LFS system.
The encoded password string above is: lfs123 When you logon to your LFS system, enter lfs123 when asked to enter user root's password. 5.4 Installing the Bash shellWhen sulogin asks you for the root password and you've entered the password, a shell needs to be started. Usually this is the bash shell. Since there are no libraries installed yet, we need to link bash statically, just like we did with Sysvinit.
./configure --enable-static-link make; make -e prefix=$LFS/usr install mv $LFS/usr/bin/bash $LFS/bin cd $LFS/bin; ln -s bash sh 5.5 Adding an entry to LILOIn order to being able to boot from this partition, we need to update our
image=<currently used image> label=<label> root=$LFS read-only Replace <currently used image> by the kernel image file that you are using to boot your normal Linux system. <label> can be anything you want it to be. I named the label "lfs" What you enter as <label> is what you enter at the LILO-prompt when you choose with system to boot. Now run the 5.6 Testing the systemAfter you've completed this section, we can test the system by rebooting into LFS and see if we can log on to it. When you reboot and are at the LILO prompt, enter the label you have entered in the lilo.conf file to start the LFS system. Then enter root's password and you should be on the bash-prompt now. You won't be able to shutdown the system with a program like shutdown. Although the program is present, it will give you the following error: "You don't exist. Go away." when you try to use the program. The meaning of this error is that the system isn't able to locate the password file. Although the shutdown program is statically linked against the libraries it needs, it still depends on the NSS Library (Name Server Switch) which is part of the GNU C Library, which will be installed in a later chapter. This NSS library passes on information where (in this case) the passwd file can be found. For now you can reboot the system using the Next Previous Contents |
|
|