From 342b176cf9ee3261933eedc36e4d010fd62b36c9 Mon Sep 17 00:00:00 2001 From: Alex Gronenwoud Date: Mon, 9 Feb 2004 22:45:54 +0000 Subject: Merging configaration subsections into their corresponding sections. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3245 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/chapter06.xml | 57 +++++++++++++++++++++++++- chapter06/config-glibc.xml | 94 ------------------------------------------- chapter06/config-keyboard.xml | 31 -------------- chapter06/config-sysklogd.xml | 23 ----------- chapter06/config-sysvinit.xml | 38 ----------------- chapter06/config-vim.xml | 29 ------------- chapter06/glibc.xml | 94 ++++++++++++++++++++++++++++++++++++++++++- chapter06/kbd.xml | 32 ++++++++++++++- chapter06/mountproc.xml | 55 ------------------------- chapter06/sysklogd.xml | 23 ++++++++++- chapter06/sysvinit.xml | 55 ++++++++++++++++++++----- chapter06/vim.xml | 29 ++++++++++++- 12 files changed, 275 insertions(+), 285 deletions(-) delete mode 100644 chapter06/config-glibc.xml delete mode 100644 chapter06/config-keyboard.xml delete mode 100644 chapter06/config-sysklogd.xml delete mode 100644 chapter06/config-sysvinit.xml delete mode 100644 chapter06/config-vim.xml delete mode 100644 chapter06/mountproc.xml (limited to 'chapter06') diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index e008d7cd5..070284803 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -60,7 +60,62 @@ with a series of short descriptions of these. -&c6-mountproc; + + +Mounting the proc and devpts file systems + + +In order for certain programs to function properly, the +proc and devpts file systems must be +available within the chroot environment. The proc file system is the process +information pseudo file system through which the kernel provides information +about the status of the system. And the devpts file system is nowadays the most +common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a +file system can be mounted as many times and in as many places as you like, +thus it's not a problem that these file systems are already mounted on your +host system, especially so because they are virtual file systems. + +First become root, as only root +can mount file systems in unusual places. Then check again that the LFS +environment variable is set correctly by running echo +$LFS and making sure it shows the path to your LFS partition's +mount point, which is /mnt/lfs if you +followed our example. + +Now make the mount points for these filesystems: + +mkdir -p $LFS/{proc,dev/pts} + +Mount the proc file system with: + +mount proc $LFS/proc -t proc + +And mount the devpts file system with: + +mount devpts $LFS/dev/pts -t devpts + +This last command might fail with an error like: + +
filesystem devpts not supported by kernel
+ +The most likely cause for this is that your host system's kernel was +compiled without support for the devpts file system. You can check which file +systems your kernel supports by peeking into its internals with +cat /proc/filesystems. If a file system type named +devfs is listed there, then we'll be able to work around +the problem by mounting the host's devfs file system on top of the new +/dev structure which we'll create later on in the section +on . If devfs was not listed, do not worry +because there is yet a third way to get PTYs working inside the chroot +environment. We'll cover this shortly in the aforementioned + section. + +Remember that if for any reason you stop working on your LFS, and start +again later, it's important to check that these file systems are mounted again +before entering the chroot environment, otherwise problems could occur. + +
+ Entering the chroot environment diff --git a/chapter06/config-glibc.xml b/chapter06/config-glibc.xml deleted file mode 100644 index 6d74eed27..000000000 --- a/chapter06/config-glibc.xml +++ /dev/null @@ -1,94 +0,0 @@ -   - -Configuring Glibc - -We need to create the /etc/nsswitch.conf file, -because, although Glibc provides defaults when this file is missing or corrupt, -the Glibc defaults don't work well with networking. Also, our time zone needs -to be set up. - -Create a new file /etc/nsswitch.conf by running the -following: - -cat > /etc/nsswitch.conf << "EOF" -# Begin /etc/nsswitch.conf - -passwd: files -group: files -shadow: files - -publickey: files - -hosts: files dns -networks: files - -protocols: db files -services: db files -ethers: db files -rpc: db files - -netgroup: db files - -# End /etc/nsswitch.conf -EOF - -To find out what time zone you're in, run the following script: - -tzselect - -When you've answered a few questions about your location, the script will -output the name of your time zone, something like EST5EDT -or Canada/Eastern. Then create the -/etc/localtime file by running: - -cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime - -The meaning of the option: - - ---remove-destination: This is needed to -force removal of the already existing symbolic link. The reason why we copy -instead of symlink is to cover the situation where /usr is -on a separate partition. This could matter, for example, when booted into single -user mode. - - -Of course, instead of Canada/Eastern, fill in -the name of the time zone that the tzselect script -gave you. - - - -   - - -Configuring Dynamic Loader - -By default, the dynamic loader -(/lib/ld-linux.so.2) searches through /lib and /usr/lib for dynamic libraries that are needed -by programs when you run them. However, if there are libraries in -directories other than /lib and -/usr/lib, you need to add them to -the /etc/ld.so.conf file for the dynamic -loader to find them. Two directories that are commonly known to contain -additional libraries are /usr/local/lib and /opt/lib, so we add those directories to the -dynamic loader's search path. - -Create a new file /etc/ld.so.conf by running the -following: - -cat > /etc/ld.so.conf << "EOF" -# Begin /etc/ld.so.conf - -/usr/local/lib -/opt/lib - -# End /etc/ld.so.conf -EOF - - - diff --git a/chapter06/config-keyboard.xml b/chapter06/config-keyboard.xml deleted file mode 100644 index b8b85398a..000000000 --- a/chapter06/config-keyboard.xml +++ /dev/null @@ -1,31 +0,0 @@ -Configuring your keyboard - -Few things are more annoying than using Linux while a wrong keymap -for your keyboard is loaded. If you have a standard US keyboard, however, you -can skip this section, as the US keymap is the default as long as you don't -change it. - -To change the default keymap, create the -/usr/share/kbd/keymaps/defkeymap.map.gz -symlink by running the following command: - -ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz - -Of course, replace path/to/keymap with the path and -name of your keyboard's map file. For example, if you have a Dutch keyboard, -you would use i386/qwerty/nl.map.gz. - -Another way to set your keyboard's layout is to compile the keymap -into the kernel. This ensures that your keyboard will always work as expected, -even when you boot into maintenance mode (by passing `init=/bin/sh' to the -kernel), as then the bootscript that normally sets up your keymap isn't run. - -Run the following command to patch the current default keymap into the -kernel source. You will have to repeat this command whenever you unpack a -new kernel: - -loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \ -    /usr/src/linux-&kernel-version;/drivers/char/defkeymap.c - - - diff --git a/chapter06/config-sysklogd.xml b/chapter06/config-sysklogd.xml deleted file mode 100644 index 72bc83a62..000000000 --- a/chapter06/config-sysklogd.xml +++ /dev/null @@ -1,23 +0,0 @@ -   - -Configuring Sysklogd - -Create a new file /etc/syslog.conf by running the -following: - -cat > /etc/syslog.conf << "EOF" -# Begin /etc/syslog.conf - -auth,authpriv.* -/var/log/auth.log -*.*;auth,authpriv.none -/var/log/sys.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log -*.emerg * - -# End /etc/syslog.conf -EOF - - - diff --git a/chapter06/config-sysvinit.xml b/chapter06/config-sysvinit.xml deleted file mode 100644 index 8b1d9f887..000000000 --- a/chapter06/config-sysvinit.xml +++ /dev/null @@ -1,38 +0,0 @@ -   - -Configuring Sysvinit - -Create a new file /etc/inittab by running the -following: - -cat > /etc/inittab << "EOF" -# Begin /etc/inittab - -id:3:initdefault: - -si::sysinit:/etc/rc.d/init.d/rc sysinit - -l0:0:wait:/etc/rc.d/init.d/rc 0 -l1:S1:wait:/etc/rc.d/init.d/rc 1 -l2:2:wait:/etc/rc.d/init.d/rc 2 -l3:3:wait:/etc/rc.d/init.d/rc 3 -l4:4:wait:/etc/rc.d/init.d/rc 4 -l5:5:wait:/etc/rc.d/init.d/rc 5 -l6:6:wait:/etc/rc.d/init.d/rc 6 - -ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now - -su:S016:once:/sbin/sulogin - -1:2345:respawn:/sbin/agetty tty1 9600 -2:2345:respawn:/sbin/agetty tty2 9600 -3:2345:respawn:/sbin/agetty tty3 9600 -4:2345:respawn:/sbin/agetty tty4 9600 -5:2345:respawn:/sbin/agetty tty5 9600 -6:2345:respawn:/sbin/agetty tty6 9600 - -# End /etc/inittab -EOF - - - diff --git a/chapter06/config-vim.xml b/chapter06/config-vim.xml deleted file mode 100644 index 7fa0650ac..000000000 --- a/chapter06/config-vim.xml +++ /dev/null @@ -1,29 +0,0 @@ -   - -Configuring Vim - -By default, vim runs in vi-compatible mode. Some -people might like this, but we prefer to run vim in its -own mode (else we wouldn't have included it in this book, but the original -vi). Create a default vim configuration file by running -the following: - -cat > /etc/vimrc << "EOF" -" Begin /etc/vimrc - -set nocompatible -set backspace=2 -syntax on - -" End /etc/vimrc -EOF - -The set nocompatible will make -vim behave in a more useful way than the default -vi-compatible manner. The set backspace=2 allows -backspacing over line breaks, autoindent and the start of insert. And the -syntax on switches on vim's -semantic colouring. - - - diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index 5b8d60f4c..86dbcb09b 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -121,7 +121,99 @@ localedef -i ja_JP -f EUC-JP ja_JP -&c6-cf-glibc; +   + +Configuring Glibc + +We need to create the /etc/nsswitch.conf file, +because, although Glibc provides defaults when this file is missing or corrupt, +the Glibc defaults don't work well with networking. Also, our time zone needs +to be set up. + +Create a new file /etc/nsswitch.conf by running the +following: + +cat > /etc/nsswitch.conf << "EOF" +# Begin /etc/nsswitch.conf + +passwd: files +group: files +shadow: files + +publickey: files + +hosts: files dns +networks: files + +protocols: db files +services: db files +ethers: db files +rpc: db files + +netgroup: db files + +# End /etc/nsswitch.conf +EOF + +To find out what time zone you're in, run the following script: + +tzselect + +When you've answered a few questions about your location, the script will +output the name of your time zone, something like EST5EDT +or Canada/Eastern. Then create the +/etc/localtime file by running: + +cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime + +The meaning of the option: + + +--remove-destination: This is needed to +force removal of the already existing symbolic link. The reason why we copy +instead of symlink is to cover the situation where /usr is +on a separate partition. This could matter, for example, when booted into single +user mode. + + +Of course, instead of Canada/Eastern, fill in +the name of the time zone that the tzselect script +gave you. + + + +   + + +Configuring Dynamic Loader + +By default, the dynamic loader +(/lib/ld-linux.so.2) searches through /lib and /usr/lib for dynamic libraries that are needed +by programs when you run them. However, if there are libraries in +directories other than /lib and +/usr/lib, you need to add them to +the /etc/ld.so.conf file for the dynamic +loader to find them. Two directories that are commonly known to contain +additional libraries are /usr/local/lib and /opt/lib, so we add those directories to the +dynamic loader's search path. + +Create a new file /etc/ld.so.conf by running the +following: + +cat > /etc/ld.so.conf << "EOF" +# Begin /etc/ld.so.conf + +/usr/local/lib +/opt/lib + +# End /etc/ld.so.conf +EOF + + &aa-glibc-shortdesc; &aa-glibc-desc; diff --git a/chapter06/kbd.xml b/chapter06/kbd.xml index 34cea17fc..854be7e1a 100644 --- a/chapter06/kbd.xml +++ b/chapter06/kbd.xml @@ -35,7 +35,37 @@ not installed. First enable the compilation of these utilities: -&c6-cf-keyboard; +Configuring your keyboard + +Few things are more annoying than using Linux while a wrong keymap +for your keyboard is loaded. If you have a standard US keyboard, however, you +can skip this section, as the US keymap is the default as long as you don't +change it. + +To change the default keymap, create the +/usr/share/kbd/keymaps/defkeymap.map.gz +symlink by running the following command: + +ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz + +Of course, replace path/to/keymap with the path and +name of your keyboard's map file. For example, if you have a Dutch keyboard, +you would use i386/qwerty/nl.map.gz. + +Another way to set your keyboard's layout is to compile the keymap +into the kernel. This ensures that your keyboard will always work as expected, +even when you boot into maintenance mode (by passing `init=/bin/sh' to the +kernel), as then the bootscript that normally sets up your keymap isn't run. + +When in you're ready to compile the +kernel, run the following command to patch the current default keymap into the +source (you will have to repeat this command whenever you unpack a new +kernel): + +loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \ +    /usr/src/linux-&kernel-version;/drivers/char/defkeymap.c + + &aa-kbd-shortdesc; &aa-kbd-desc; diff --git a/chapter06/mountproc.xml b/chapter06/mountproc.xml deleted file mode 100644 index 876dbd5c5..000000000 --- a/chapter06/mountproc.xml +++ /dev/null @@ -1,55 +0,0 @@ - -Mounting the proc and devpts file systems - - -In order for certain programs to function properly, the -proc and devpts file systems must be -available within the chroot environment. The proc file system is the process -information pseudo file system through which the kernel provides information -about the status of the system. And the devpts file system is nowadays the most -common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a -file system can be mounted as many times and in as many places as you like, -thus it's not a problem that these file systems are already mounted on your -host system, especially so because they are virtual file systems. - -First become root, as only root -can mount file systems in unusual places. Then check again that the LFS -environment variable is set correctly by running echo -$LFS and making sure it shows the path to your LFS partition's -mount point, which is /mnt/lfs if you -followed our example. - -Now make the mount points for these filesystems: - -mkdir -p $LFS/{proc,dev/pts} - -Mount the proc file system with: - -mount proc $LFS/proc -t proc - -And mount the devpts file system with: - -mount devpts $LFS/dev/pts -t devpts - -This last command might fail with an error like: - -
filesystem devpts not supported by kernel
- -The most likely cause for this is that your host system's kernel was -compiled without support for the devpts file system. You can check which file -systems your kernel supports by peeking into its internals with -cat /proc/filesystems. If a file system type named -devfs is listed there, then we'll be able to work around -the problem by mounting the host's devfs file system on top of the new -/dev structure which we'll create later on in the section -on . If devfs was not listed, do not worry -because there is yet a third way to get PTYs working inside the chroot -environment. We'll cover this shortly in the aforementioned - section. - -Remember that if for any reason you stop working on your LFS, and start -again later, it's important to check that these file systems are mounted again -before entering the chroot environment, otherwise problems could occur. - -
- diff --git a/chapter06/sysklogd.xml b/chapter06/sysklogd.xml index f23a151b1..9043544e8 100644 --- a/chapter06/sysklogd.xml +++ b/chapter06/sysklogd.xml @@ -26,7 +26,28 @@ as those given by the kernel when unusual things happen. -&c6-cf-sysklogd; +   + +Configuring Sysklogd + +Create a new /etc/syslog.conf file by running the +following: + +cat > /etc/syslog.conf << "EOF" +# Begin /etc/syslog.conf + +auth,authpriv.* -/var/log/auth.log +*.*;auth,authpriv.none -/var/log/sys.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log +*.emerg * + +# End /etc/syslog.conf +EOF + + &aa-sysklogd-shortdesc; &aa-sysklogd-desc; diff --git a/chapter06/sysvinit.xml b/chapter06/sysvinit.xml index 9d919ffeb..37e0046b5 100644 --- a/chapter06/sysvinit.xml +++ b/chapter06/sysvinit.xml @@ -16,15 +16,14 @@ running, and shutdown of your system. Installation of Sysvinit -When run levels are changed (for example, when halting the system), -init sends the TERM and KILL signals to the processes which it started. -Init prints "Sending processes the TERM signal" to the screen. This seems -to imply that init is sending these signals to all the currently running -processes. To avoid this confusion, the init.c file can be modified, so -that the sentence reads "Sending processes started by init the TERM -signal". - -Edit the halt message: +When runlevels are changed (for example, when halting the system), +init sends termination signals to those processes that it +itself started and that shouldn't be running in the new runlevel. While doing +this, init outputs messages like "Sending processes the TERM +signal" which seem to imply that it is sending these signals to all currently +running processes. To avoid this misinterpretation, you can modify the source +so that these messages read like "Sending processes started by init the TERM +signal" instead: cp src/init.c{,.backup} sed 's/Sending processes/& started by init/g' \ @@ -40,7 +39,43 @@ sed 's/Sending processes/& started by init/g' \ -&c6-cf-sysvinit; +   + +Configuring Sysvinit + +Create a new /etc/inittab file by running the +following: + +cat > /etc/inittab << "EOF" +# Begin /etc/inittab + +id:3:initdefault: + +si::sysinit:/etc/rc.d/init.d/rc sysinit + +l0:0:wait:/etc/rc.d/init.d/rc 0 +l1:S1:wait:/etc/rc.d/init.d/rc 1 +l2:2:wait:/etc/rc.d/init.d/rc 2 +l3:3:wait:/etc/rc.d/init.d/rc 3 +l4:4:wait:/etc/rc.d/init.d/rc 4 +l5:5:wait:/etc/rc.d/init.d/rc 5 +l6:6:wait:/etc/rc.d/init.d/rc 6 + +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +su:S016:once:/sbin/sulogin + +1:2345:respawn:/sbin/agetty tty1 9600 +2:2345:respawn:/sbin/agetty tty2 9600 +3:2345:respawn:/sbin/agetty tty3 9600 +4:2345:respawn:/sbin/agetty tty4 9600 +5:2345:respawn:/sbin/agetty tty5 9600 +6:2345:respawn:/sbin/agetty tty6 9600 + +# End /etc/inittab +EOF + + &aa-sysvinit-shortdesc; &aa-sysvinit-desc; diff --git a/chapter06/vim.xml b/chapter06/vim.xml index fdb2b9d59..fd23e5ef3 100644 --- a/chapter06/vim.xml +++ b/chapter06/vim.xml @@ -61,7 +61,34 @@ installed. For more information read the Vim documentation. -&c6-cf-vim; +   + +Configuring Vim + +By default, vim runs in vi-compatible mode. Some +people might like this, but we prefer to run vim in its +own mode (else we wouldn't have included it in this book, but the original +vi). Create a default vim configuration file by running +the following: + +cat > /etc/vimrc << "EOF" +" Begin /etc/vimrc + +set nocompatible +set backspace=2 +syntax on + +" End /etc/vimrc +EOF + +The set nocompatible will make +vim behave in a more useful way than the default +vi-compatible manner. The set backspace=2 allows +backspacing over line breaks, autoindent and the start of insert. And the +syntax on switches on vim's +semantic colouring. + + &aa-vim-shortdesc; &aa-vim-desc; -- cgit v1.2.3-54-g00ecf