- Timestamp:
- 02/09/2004 10:45:54 PM (20 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 418e6cc
- Parents:
- c76accc
- Location:
- chapter06
- Files:
-
- 6 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/chapter06.xml
rc76accc r342b176 61 61 </sect1> 62 62 63 &c6-mountproc; 63 64 <sect1 id="ch-system-proc"> 65 <title>Mounting the proc and devpts file systems</title> 66 <?dbhtml filename="proc.html" dir="chapter06"?> 67 68 <para>In order for certain programs to function properly, the 69 <emphasis>proc</emphasis> and <emphasis>devpts</emphasis> file systems must be 70 available within the chroot environment. The proc file system is the process 71 information pseudo file system through which the kernel provides information 72 about the status of the system. And the devpts file system is nowadays the most 73 common way pseudo terminals (PTYs) are implemented. Since kernel version 2.4, a 74 file system can be mounted as many times and in as many places as you like, 75 thus it's not a problem that these file systems are already mounted on your 76 host system, especially so because they are virtual file systems.</para> 77 78 <para>First become <emphasis>root</emphasis>, as only <emphasis>root</emphasis> 79 can mount file systems in unusual places. Then check again that the LFS 80 environment variable is set correctly by running <userinput>echo 81 $LFS</userinput> and making sure it shows the path to your LFS partition's 82 mount point, which is <filename class="directory">/mnt/lfs</filename> if you 83 followed our example.</para> 84 85 <para>Now make the mount points for these filesystems:</para> 86 87 <screen><userinput>mkdir -p $LFS/{proc,dev/pts}</userinput></screen> 88 89 <para>Mount the <emphasis>proc</emphasis> file system with:</para> 90 91 <screen><userinput>mount proc $LFS/proc -t proc</userinput></screen> 92 93 <para>And mount the <emphasis>devpts</emphasis> file system with:</para> 94 95 <screen><userinput>mount devpts $LFS/dev/pts -t devpts</userinput></screen> 96 97 <para>This last command might fail with an error like:</para> 98 99 <blockquote><screen>filesystem devpts not supported by kernel</screen></blockquote> 100 101 <para>The most likely cause for this is that your host system's kernel was 102 compiled without support for the devpts file system. You can check which file 103 systems your kernel supports by peeking into its internals with 104 <command>cat /proc/filesystems</command>. If a file system type named 105 <emphasis>devfs</emphasis> is listed there, then we'll be able to work around 106 the problem by mounting the host's devfs file system on top of the new 107 <filename>/dev</filename> structure which we'll create later on in the section 108 on <xref linkend="ch-system-MAKEDEV"/>. If devfs was not listed, do not worry 109 because there is yet a third way to get PTYs working inside the chroot 110 environment. We'll cover this shortly in the aforementioned 111 <xref linkend="ch-system-MAKEDEV"/> section.</para> 112 113 <para>Remember that if for any reason you stop working on your LFS, and start 114 again later, it's important to check that these file systems are mounted again 115 before entering the chroot environment, otherwise problems could occur.</para> 116 117 </sect1> 118 64 119 65 120 <sect1 id="ch-system-chroot"> -
chapter06/glibc.xml
rc76accc r342b176 122 122 </sect2> 123 123 124 &c6-cf-glibc; 124 <sect2><title> </title><para> </para></sect2> 125 126 <sect2><title>Configuring Glibc</title> 127 128 <para>We need to create the <filename>/etc/nsswitch.conf</filename> file, 129 because, although Glibc provides defaults when this file is missing or corrupt, 130 the Glibc defaults don't work well with networking. Also, our time zone needs 131 to be set up.</para> 132 133 <para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the 134 following:</para> 135 136 <screen><userinput>cat > /etc/nsswitch.conf << "EOF"</userinput> 137 # Begin /etc/nsswitch.conf 138 139 passwd: files 140 group: files 141 shadow: files 142 143 publickey: files 144 145 hosts: files dns 146 networks: files 147 148 protocols: db files 149 services: db files 150 ethers: db files 151 rpc: db files 152 153 netgroup: db files 154 155 # End /etc/nsswitch.conf 156 <userinput>EOF</userinput></screen> 157 158 <para>To find out what time zone you're in, run the following script:</para> 159 160 <screen><userinput>tzselect</userinput></screen> 161 162 <para>When you've answered a few questions about your location, the script will 163 output the name of your time zone, something like <emphasis>EST5EDT</emphasis> 164 or <emphasis>Canada/Eastern</emphasis>. Then create the 165 <filename>/etc/localtime</filename> file by running:</para> 166 167 <screen><userinput>cp --remove-destination /usr/share/zoneinfo/Canada/Eastern /etc/localtime</userinput></screen> 168 169 <para>The meaning of the option:</para> 170 171 <itemizedlist> 172 <listitem><para><userinput>--remove-destination</userinput>: This is needed to 173 force removal of the already existing symbolic link. The reason why we copy 174 instead of symlink is to cover the situation where <filename>/usr</filename> is 175 on a separate partition. This could matter, for example, when booted into single 176 user mode.</para></listitem> 177 </itemizedlist> 178 179 <para>Of course, instead of <emphasis>Canada/Eastern</emphasis>, fill in 180 the name of the time zone that the <command>tzselect</command> script 181 gave you.</para> 182 183 </sect2> 184 185 <sect2><title> </title><para> </para></sect2> 186 187 <sect2> 188 <title>Configuring Dynamic Loader</title> 189 190 <para>By default, the dynamic loader 191 (<filename>/lib/ld-linux.so.2</filename>) searches through <filename 192 class="directory">/lib</filename> and <filename 193 class="directory">/usr/lib</filename> for dynamic libraries that are needed 194 by programs when you run them. However, if there are libraries in 195 directories other than <filename class="directory">/lib</filename> and 196 <filename class="directory">/usr/lib</filename>, you need to add them to 197 the <filename>/etc/ld.so.conf</filename> file for the dynamic 198 loader to find them. Two directories that are commonly known to contain 199 additional libraries are <filename 200 class="directory">/usr/local/lib</filename> and <filename 201 class="directory">/opt/lib</filename>, so we add those directories to the 202 dynamic loader's search path.</para> 203 204 <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the 205 following:</para> 206 207 <screen><userinput>cat > /etc/ld.so.conf << "EOF"</userinput> 208 # Begin /etc/ld.so.conf 209 210 /usr/local/lib 211 /opt/lib 212 213 # End /etc/ld.so.conf 214 <userinput>EOF</userinput></screen> 215 216 </sect2> 125 217 126 218 &aa-glibc-shortdesc; -
chapter06/kbd.xml
rc76accc r342b176 36 36 </sect2> 37 37 38 &c6-cf-keyboard; 38 <sect2><title>Configuring your keyboard</title> 39 40 <para>Few things are more annoying than using Linux while a wrong keymap 41 for your keyboard is loaded. If you have a standard US keyboard, however, you 42 can skip this section, as the US keymap is the default as long as you don't 43 change it.</para> 44 45 <para>To change the default keymap, create the 46 <filename class="symlink">/usr/share/kbd/keymaps/defkeymap.map.gz</filename> 47 symlink by running the following command:</para> 48 49 <screen><userinput>ln -s path/to/keymap /usr/share/kbd/keymaps/defkeymap.map.gz</userinput></screen> 50 51 <para>Of course, replace <filename>path/to/keymap</filename> with the path and 52 name of your keyboard's map file. For example, if you have a Dutch keyboard, 53 you would use <filename>i386/qwerty/nl.map.gz</filename>.</para> 54 55 <para>Another way to set your keyboard's layout is to compile the keymap 56 into the kernel. This ensures that your keyboard will always work as expected, 57 even when you boot into maintenance mode (by passing `init=/bin/sh' to the 58 kernel), as then the bootscript that normally sets up your keymap isn't run.</para> 59 60 <para>When in <xref linkend="chapter-mixture"/> you're ready to compile the 61 kernel, run the following command to patch the current default keymap into the 62 source (you will have to repeat this command whenever you unpack a new 63 kernel):</para> 64 65 <screen><userinput>loadkeys -m /usr/share/kbd/keymaps/defkeymap.map.gz > \ 66 /usr/src/linux-&kernel-version;/drivers/char/defkeymap.c</userinput></screen> 67 68 </sect2> 39 69 40 70 &aa-kbd-shortdesc; -
chapter06/sysklogd.xml
rc76accc r342b176 27 27 </sect2> 28 28 29 &c6-cf-sysklogd; 29 <sect2><title> </title><para> </para></sect2> 30 31 <sect2><title>Configuring Sysklogd</title> 32 33 <para>Create a new <filename>/etc/syslog.conf</filename> file by running the 34 following:</para> 35 36 <screen><userinput>cat > /etc/syslog.conf << "EOF"</userinput> 37 # Begin /etc/syslog.conf 38 39 auth,authpriv.* -/var/log/auth.log 40 *.*;auth,authpriv.none -/var/log/sys.log 41 daemon.* -/var/log/daemon.log 42 kern.* -/var/log/kern.log 43 mail.* -/var/log/mail.log 44 user.* -/var/log/user.log 45 *.emerg * 46 47 # End /etc/syslog.conf 48 <userinput>EOF</userinput></screen> 49 50 </sect2> 30 51 31 52 &aa-sysklogd-shortdesc; -
chapter06/sysvinit.xml
rc76accc r342b176 17 17 <title>Installation of Sysvinit</title> 18 18 19 <para>When run levels are changed (for example, when halting the system), 20 init sends the TERM and KILL signals to the processes which it started. 21 Init prints "Sending processes the TERM signal" to the screen. This seems 22 to imply that init is sending these signals to all the currently running 23 processes. To avoid this confusion, the init.c file can be modified, so 24 that the sentence reads "Sending processes started by init the TERM 25 signal".</para> 26 27 <para>Edit the halt message:</para> 19 <para>When runlevels are changed (for example, when halting the system), 20 <command>init</command> sends termination signals to those processes that it 21 itself started and that shouldn't be running in the new runlevel. While doing 22 this, <command>init</command> outputs messages like "Sending processes the TERM 23 signal" which seem to imply that it is sending these signals to all currently 24 running processes. To avoid this misinterpretation, you can modify the source 25 so that these messages read like "Sending processes started by init the TERM 26 signal" instead:</para> 28 27 29 28 <screen><userinput>cp src/init.c{,.backup} … … 41 40 </sect2> 42 41 43 &c6-cf-sysvinit; 42 <sect2><title> </title><para> </para></sect2> 43 44 <sect2><title>Configuring Sysvinit</title> 45 46 <para>Create a new <filename>/etc/inittab</filename> file by running the 47 following:</para> 48 49 <screen><userinput>cat > /etc/inittab << "EOF"</userinput> 50 # Begin /etc/inittab 51 52 id:3:initdefault: 53 54 si::sysinit:/etc/rc.d/init.d/rc sysinit 55 56 l0:0:wait:/etc/rc.d/init.d/rc 0 57 l1:S1:wait:/etc/rc.d/init.d/rc 1 58 l2:2:wait:/etc/rc.d/init.d/rc 2 59 l3:3:wait:/etc/rc.d/init.d/rc 3 60 l4:4:wait:/etc/rc.d/init.d/rc 4 61 l5:5:wait:/etc/rc.d/init.d/rc 5 62 l6:6:wait:/etc/rc.d/init.d/rc 6 63 64 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now 65 66 su:S016:once:/sbin/sulogin 67 68 1:2345:respawn:/sbin/agetty tty1 9600 69 2:2345:respawn:/sbin/agetty tty2 9600 70 3:2345:respawn:/sbin/agetty tty3 9600 71 4:2345:respawn:/sbin/agetty tty4 9600 72 5:2345:respawn:/sbin/agetty tty5 9600 73 6:2345:respawn:/sbin/agetty tty6 9600 74 75 # End /etc/inittab 76 <userinput>EOF</userinput></screen> 77 78 </sect2> 44 79 45 80 &aa-sysvinit-shortdesc; -
chapter06/vim.xml
rc76accc r342b176 62 62 </sect2> 63 63 64 &c6-cf-vim; 64 <sect2><title> </title><para> </para></sect2> 65 66 <sect2><title>Configuring Vim</title> 67 68 <para>By default, <command>vim</command> runs in vi-compatible mode. Some 69 people might like this, but we prefer to run <command>vim</command> in its 70 own mode (else we wouldn't have included it in this book, but the original 71 <command>vi</command>). Create a default vim configuration file by running 72 the following:</para> 73 74 <screen><userinput>cat > /etc/vimrc << "EOF"</userinput> 75 " Begin /etc/vimrc 76 77 set nocompatible 78 set backspace=2 79 syntax on 80 81 " End /etc/vimrc 82 <userinput>EOF</userinput></screen> 83 84 <para>The <emphasis>set nocompatible</emphasis> will make 85 <command>vim</command> behave in a more useful way than the default 86 vi-compatible manner. The <emphasis>set backspace=2</emphasis> allows 87 backspacing over line breaks, autoindent and the start of insert. And the 88 <emphasis>syntax on</emphasis> switches on <command>vim</command>'s 89 semantic colouring.</para> 90 91 </sect2> 65 92 66 93 &aa-vim-shortdesc;
Note:
See TracChangeset
for help on using the changeset viewer.