Changeset 03e6a40 for BOOK/boot/common
- Timestamp:
- Apr 20, 2014, 8:57:39 AM (11 years ago)
- Children:
- 0be79ea
- Parents:
- 88ef769 (diff), 578ca586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- BOOK/boot/common
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/boot/common/bootscripts.xml
r88ef769 r03e6a40 6 6 ]> 7 7 8 <sect1 id="ch-scripts-boot " role="wrap">8 <sect1 id="ch-scripts-bootscripts" role="wrap"> 9 9 <?dbhtml filename="bootscripts.html"?> 10 10 11 11 <title>Bootscripts for CLFS &bootscripts-clfs-version;</title> 12 12 13 <indexterm zone="ch-scripts-boot ">13 <indexterm zone="ch-scripts-bootscripts"> 14 14 <primary sortas="a-Bootscripts">Bootscripts</primary> 15 <secondary>boot</secondary>16 15 </indexterm> 17 16 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 19 href="../../bootscripts/common/bootscripts.xml" 20 xpointer="xpointer(//*[@role='package'])"/> 17 <sect2 role="package"> 18 <title/> 19 20 <para>The Bootscripts package contains a set of scripts to 21 start/stop the CLFS system at bootup/shutdown.</para> 22 23 </sect2> 21 24 22 25 <sect2 role="installation"> 23 26 <title>Installation of Bootscripts</title> 24 27 25 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 26 href="../../bootscripts/common/bootscripts.xml" 27 xpointer="xpointer(//*[@os='a'])"/> 28 29 <screen os="b"><userinput>make DESTDIR=${CLFS} install-minimal</userinput></screen> 30 31 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 32 href="../../bootscripts/common/setclock.xml" 33 xpointer="xpointer(//*[@os='a'])"/> 34 35 <para os="c">If you do not know whether or not the hardware clock is set to UTC, 36 you can find out after you have booted the new machine by running the 37 <userinput>hwclock --localtime --show</userinput> command, and if 38 necessary editing the <filename>/etc/sysconfig/clock</filename> script. 39 The worst that will happen if you make a wrong guess here is that the 40 time displayed will be wrong.</para> 41 42 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 43 href="../../bootscripts/common/setclock.xml" 44 xpointer="xpointer(//*[@os='c'])"/> 45 46 <screen os="d"><userinput>cat > ${CLFS}/etc/sysconfig/clock << "EOF" 47 <literal># Begin /etc/sysconfig/clock 28 <para os="s1">Update the bootscripts so they can be used in /tools:</para> 29 30 <screen os="s2"><userinput>patch -Np1 -i ../bootscripts-cross-lfs-2.1-pre1-updates-1.patch</userinput></screen> 31 32 <para os="a">Install the package:</para> 33 34 <screen os="b"><userinput>make DESTDIR=/tools install-minimal</userinput></screen> 35 36 <para os="c">The <command>setclock</command> script reads the time from the 37 hardware clock, also known as the BIOS or the Complementary Metal Oxide 38 Semiconductor (CMOS) clock. If the hardware clock is set to UTC, this 39 script will convert the hardware clock's time to the local time using 40 the <filename>/etc/localtime</filename> file (which tells the 41 <command>hwclock</command> program which timezone the user is in). There 42 is no way to detect whether or not the hardware clock is set to UTC, so 43 this needs to be configured manually.</para> 44 45 46 47 <para os="d">If you do not know whether or not the hardware clock is set to UTC, 48 you can find out after you have booted the new machine by running the 49 <userinput>hwclock --localtime --show</userinput> command, and if 50 necessary editing the <filename>/etc/sysconfig/clock</filename> script. 51 The worst that will happen if you make a wrong guess here is that the 52 time displayed will be wrong.</para> 53 54 <para os="e">Change the value of the <envar>UTC</envar> variable below 55 to a value of <option>0</option> (zero) if the hardware clock 56 is <emphasis>not</emphasis> set to UTC time.</para> 57 58 <screen os="f"><userinput>cat > /tools/etc/sysconfig/clock << "EOF" 59 <literal># Begin /tools/etc/sysconfig/clock 48 60 49 61 UTC=1 50 62 51 # End / etc/sysconfig/clock</literal>63 # End /tools/etc/sysconfig/clock</literal> 52 64 EOF</userinput></screen> 53 65 54 66 </sect2> 55 67 56 <sect2 role="content"> 57 <title/> 58 59 <para>Details on this package are located in <xref 60 linkend="contents-bootscripts" role="."/></para> 68 <sect2 id="contents-bootscripts" role="content"> 69 <title>Contents of Bootscripts</title> 70 71 <segmentedlist> 72 <segtitle>Installed scripts</segtitle> 73 74 <seglistitem> 75 <seg>checkfs, cleanfs, functions, halt, localnet, mountfs, mountkernfs, 76 rc, reboot, sendsignals, setclock, swap, and udev.</seg> 77 </seglistitem> 78 </segmentedlist> 79 80 <variablelist> 81 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 82 <?dbfo list-presentation="list"?> 83 <?dbhtml list-presentation="table"?> 84 85 <varlistentry id="checkfs-bootscripts"> 86 <term><command>checkfs</command></term> 87 <listitem> 88 <para>Checks the integrity of the file systems before they are 89 mounted (with the exception of journal and network based file 90 systems)</para> 91 <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"> 92 <primary sortas="d-checkfs">checkfs</primary> 93 </indexterm> 94 </listitem> 95 </varlistentry> 96 97 <varlistentry id="cleanfs-bootscripts"> 98 <term><command>cleanfs</command></term> 99 <listitem> 100 <para>Removes files that should not be preserved between reboots, 101 such as those in <filename class="directory">/var/run/</filename> 102 and <filename class="directory">/var/lock/</filename>; it re-creates 103 <filename>/var/run/utmp</filename> and removes the possibly present 104 <filename>/etc/nologin</filename>, <filename>/fastboot</filename>, 105 and <filename>/forcefsck</filename> files</para> 106 <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"> 107 <primary sortas="d-cleanfs">cleanfs</primary> 108 </indexterm> 109 </listitem> 110 </varlistentry> 111 112 <varlistentry id="functions-bootscripts"> 113 <term><command>functions</command></term> 114 <listitem> 115 <para>Contains common functions, such as error and status checking, 116 that are used by several bootscripts</para> 117 <indexterm zone="ch-scripts-bootscripts functions-bootscripts"> 118 <primary sortas="d-functions">functions</primary> 119 </indexterm> 120 </listitem> 121 </varlistentry> 122 123 <varlistentry id="halt-bootscripts"> 124 <term><command>halt</command></term> 125 <listitem> 126 <para>Halts the system</para> 127 <indexterm zone="ch-scripts-bootscripts halt-bootscripts"> 128 <primary sortas="d-halt">halt</primary> 129 </indexterm> 130 </listitem> 131 </varlistentry> 132 133 <varlistentry id="localnet-bootscripts"> 134 <term><command>localnet</command></term> 135 <listitem> 136 <para>Sets up the system's hostname and local loopback device</para> 137 <indexterm zone="ch-scripts-bootscripts localnet-bootscripts"> 138 <primary sortas="d-localnet">localnet</primary> 139 </indexterm> 140 </listitem> 141 </varlistentry> 142 143 <varlistentry id="mountfs-bootscripts"> 144 <term><command>mountfs</command></term> 145 <listitem> 146 <para>Mounts all file systems, except ones that are marked 147 <emphasis>noauto</emphasis> or are network based</para> 148 <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"> 149 <primary sortas="d-mountfs">mountfs</primary> 150 </indexterm> 151 </listitem> 152 </varlistentry> 153 154 <varlistentry id="mountkernfs-bootscripts"> 155 <term><command>mountkernfs</command></term> 156 <listitem> 157 <para>Mounts virtual kernel file systems, such as 158 <systemitem class="filesystem">proc</systemitem></para> 159 <indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"> 160 <primary sortas="d-mountkernfs">mountkernfs</primary> 161 </indexterm> 162 </listitem> 163 </varlistentry> 164 165 <varlistentry id="rc-bootscripts"> 166 <term><command>rc</command></term> 167 <listitem> 168 <para>The master run-level control script; it is responsible for 169 running all the other bootscripts one-by-one, in a sequence 170 determined by the name of the symbolic links being processed</para> 171 <indexterm zone="ch-scripts-bootscripts rc-bootscripts"> 172 <primary sortas="d-rc">rc</primary> 173 </indexterm> 174 </listitem> 175 </varlistentry> 176 177 <varlistentry id="reboot-bootscripts"> 178 <term><command>reboot</command></term> 179 <listitem> 180 <para>Reboots the system</para> 181 <indexterm zone="ch-scripts-bootscripts reboot-bootscripts"> 182 <primary sortas="d-reboot">reboot</primary> 183 </indexterm> 184 </listitem> 185 </varlistentry> 186 187 <varlistentry id="sendsignals-bootscripts"> 188 <term><command>sendsignals</command></term> 189 <listitem> 190 <para>Makes sure every process is terminated before the system reboots 191 or halts</para> 192 <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"> 193 <primary sortas="d-sendsignals">sendsignals</primary> 194 </indexterm> 195 </listitem> 196 </varlistentry> 197 198 <varlistentry id="setclock-bootscripts"> 199 <term><command>setclock</command></term> 200 <listitem> 201 <para>Resets the kernel clock to local time in case the hardware clock 202 is not set to UTC time</para> 203 <indexterm zone="ch-scripts-bootscripts setclock-bootscripts"> 204 <primary sortas="d-setclock">setclock</primary> 205 </indexterm> 206 </listitem> 207 </varlistentry> 208 209 <varlistentry id="swap-bootscripts"> 210 <term><command>swap</command></term> 211 <listitem> 212 <para>Enables and disables swap files and partitions</para> 213 <indexterm zone="ch-scripts-bootscripts swap-bootscripts"> 214 <primary sortas="d-swap">swap</primary> 215 </indexterm> 216 </listitem> 217 </varlistentry> 218 219 <varlistentry id="eudev-bootscripts"> 220 <term><command>udev</command></term> 221 <listitem> 222 <para>Starts and stops the Eudev daemon</para> 223 <indexterm zone="ch-scripts-bootscripts eudev-bootscripts"> 224 <primary sortas="d-eudev">udev</primary> 225 </indexterm> 226 </listitem> 227 </varlistentry> 228 229 </variablelist> 61 230 62 231 </sect2> -
BOOK/boot/common/changingowner.xml
r88ef769 r03e6a40 11 11 <title>Changing Ownership</title> 12 12 13 <para os="a">Currently, the <filename class="directory">${CLFS}</filename> 14 directory and all of its subdirectories are owned by the user 15 <systemitem class="username">clfs</systemitem>, a user that exists only 16 on the host system. For security reasons, the ${CLFS} root directory and 17 all of its subdirectories should be owned by 18 <systemitem class="username">root</systemitem>. Change the ownership 19 for ${CLFS} and its subdirectories by running this command:</para> 13 <para os="a">Currently, the <filename class="directory">/tools</filename> 14 and <filename class="directory">/cross-tools</filename> directories 15 are owned by the user <emphasis>clfs</emphasis>, a user that 16 exists only on the host system. Although <filename 17 class="directory">/tools</filename> and <filename 18 class="directory">/cross-tools</filename> can be deleted once the CLFS 19 system has been finished, they can be retained to build 20 additional CLFS systems. If the <filename class="directory">/tools</filename> 21 and <filename class="directory">/cross-tools</filename> directories are 22 kept as is, the files are owned by a user ID without a corresponding 23 account. This is dangerous because a user account created later could 24 get this same user ID and would own these directories and all the files 25 therein, thus exposing those files to possible malicious manipulation.</para> 20 26 21 <screen os="b"><userinput>chown -Rv &uid-root;:&gid-root; ${CLFS}</userinput></screen> 27 <para os="b">One possible fix for this issue might be to add the 28 <systemitem class="username">clfs</systemitem> user to the new CLFS system 29 later when creating the <filename>/etc/passwd</filename> file, taking care 30 to assign it the same user and group IDs as on the host system. Alternatively, 31 assign the contents of the <filename class="directory">/tools</filename> 32 and <filename class="directory">/cross-tools</filename> directories to 33 user <systemitem class="username">root</systemitem> by running the 34 following commands:</para> 22 35 23 <para>The following files are to be owned by the group 24 <systemitem class="username">utmp</systemitem> not by 25 <systemitem class="username">root</systemitem>.</para> 26 27 <screen><userinput>chgrp -v &gid-utmp; ${CLFS}/var/run/utmp ${CLFS}/var/log/lastlog</userinput></screen> 28 36 <screen os="c"><userinput>chown -Rv 0:0 ${CLFS}/tools 37 chown -Rv 0:0 ${CLFS}/cross-tools</userinput></screen> 29 38 30 39 </sect1> -
BOOK/boot/common/createfiles.xml
r88ef769 r03e6a40 16 16 the next chapter after the software has been installed.</para> 17 17 18 <screen><userinput>ln -sv /tools/bin/{bash,cat,echo,grep,login,passwd,pwd,sleep,stty} ${CLFS}/bin 19 ln -sv /tools/sbin/{agetty,blkid} ${CLFS}/sbin 18 <screen os="b"><userinput>ln -sv /tools/bin/{bash,cat,echo,grep,login,pwd,stty} ${CLFS}/bin 20 19 ln -sv /tools/bin/file ${CLFS}/usr/bin 21 20 ln -sv /tools/lib/libgcc_s.so{,.1} ${CLFS}/usr/lib 22 ln -sv /tools/lib/libstd*so* ${CLFS}/usr/lib 21 ln -sv /tools/lib/libstdc++.so{.6,} ${CLFS}/usr/lib 22 sed -e 's/tools/usr/' /tools/lib/libstdc++.la > ${CLFS}/usr/lib/libstdc++.la 23 23 ln -sv bash ${CLFS}/bin/sh 24 ln -sv /run ${CLFS}/var/run</userinput></screen> 24 ln -sv ../run ${CLFS}/var/run 25 ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,fsck.ext4,e2fsck} ${CLFS}/sbin 26 ln -sv /tools/sbin/init ${CLFS}/sbin 27 ln -sv /tools/etc/{login.{access,defs},limits} ${CLFS}/etc</userinput></screen> 28 29 <para os="c">Historically, Linux maintains a list of the mounted file systems 30 in the file <filename>/etc/mtab</filename>. Modern kernels maintain this list 31 internally and expose it to the user via the 32 <filename class="directory">/proc</filename> filesystem. To satisfy utilities 33 that expect the presence of <filename>/etc/mtab</filename>, create the 34 following symbolic link:</para> 35 36 <screen os="d"><userinput>ln -sv /proc/self/mounts ${CLFS}/etc/mtab</userinput></screen> 25 37 26 38 </sect1> -
BOOK/boot/common/creatingdirs.xml
r88ef769 r03e6a40 11 11 <title>Creating Directories</title> 12 12 13 <para os="a">It is time to create some structure in the CLFS file system. Create a 13 <note os="a"> 14 <para>The commands in the remainder of the book should be run as 15 the <systemitem class="username">root</systemitem> user. Check 16 that ${CLFS} is set in the 17 <systemitem class="username">root</systemitem> user’s environment 18 before proceeding.</para> 19 </note> 20 21 <para os="b">It is time to create some structure in the CLFS file system. Create a 14 22 standard directory tree by issuing the following commands:</para> 15 23 16 <screen os=" b"><userinput>mkdir -pv ${CLFS}/{bin,boot,dev,{etc/,}opt,home,lib,mnt}24 <screen os="c"><userinput>mkdir -pv ${CLFS}/{bin,boot,dev,{etc/,}opt,home,lib/firmware,mnt} 17 25 mkdir -pv ${CLFS}/{proc,media/{floppy,cdrom},run/{,shm},sbin,srv,sys} 18 26 mkdir -pv ${CLFS}/var/{lock,log,mail,spool} … … 23 31 mkdir -pv ${CLFS}/usr/{,local/}share/{doc,info,locale,man} 24 32 mkdir -pv ${CLFS}/usr/{,local/}share/{misc,terminfo,zoneinfo} 25 mkdir -pv ${CLFS}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8} 26 for dir in ${CLFS}/usr{,/local}; do 27 ln -sv share/{man,doc,info} $dir 28 done</userinput></screen> 33 mkdir -pv ${CLFS}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8}</userinput></screen> 29 34 30 <para os=" c">Directories are, by default, created with permission mode 755,35 <para os="d">Directories are, by default, created with permission mode 755, 31 36 but this is not desirable for all directories. In the commands above, 32 37 two changes are made—one to the home directory of user … … 34 39 directories for temporary files.</para> 35 40 36 <para os=" d">The first mode change ensures that not just anybody can enter41 <para os="e">The first mode change ensures that not just anybody can enter 37 42 the <filename class="directory">/root</filename> directory—the 38 43 same as a normal user would do with his or her home directory. The … … 44 49 1777 bit mask.</para> 45 50 46 <sect2 os=" e">51 <sect2 os="f"> 47 52 <title>FHS Compliance Note</title> 48 53 -
BOOK/boot/common/devices.xml
r88ef769 r03e6a40 18 18 <title>Creating Initial Device Nodes</title> 19 19 20 <note os="a">21 <para>The commands in the remainder of the book should be run as22 the <systemitem class="username">root</systemitem> user. Check23 that ${CLFS} is set in the24 <systemitem class="username">root</systemitem> user’s environment25 before proceeding.</para>26 </note>27 28 20 <para os="b">When the kernel boots the system, it requires the presence 29 21 of a few device nodes, in particular the <filename … … 36 28 the following commands:</para> 37 29 38 <screen><userinput>mknod -m 600 ${CLFS}/dev/console c 5 1 39 mknod -m 666 ${CLFS}/dev/null c 1 3</userinput></screen> 40 41 <para>Before udev starts, a tmpfs filesystem is mounted over 42 <filename class="directory">/dev</filename> and the previous entries are 43 no longer available. The following command creates files that are copied 44 over by the udev bootscript:</para> 45 46 <screen><userinput>mknod -m 600 ${CLFS}/lib/udev/devices/console c 5 1 47 mknod -m 666 ${CLFS}/lib/udev/devices/null c 1 3</userinput></screen> 30 <screen><userinput>mknod -m 0600 ${CLFS}/dev/console c 5 1 31 mknod -m 0666 ${CLFS}/dev/null c 1 3</userinput></screen> 48 32 49 33 </sect2> -
BOOK/boot/common/e2fsprogs.xml
r88ef769 r03e6a40 48 48 xpointer="xpointer(//*[@os='e2'])"/> 49 49 50 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 51 href="../../final-system/common/e2fsprogs.xml" 52 xpointer="xpointer(//*[@os='e3'])"/> 53 50 54 </variablelist> 51 55 … … 73 77 xpointer="xpointer(//*[@os='l'])"/> 74 78 75 <para os="ad">Create needed symlinks for a bootable system:</para>76 77 <screen os="ae"><userinput>ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,fsck.ext4,e2fsck} ${CLFS}/sbin</userinput></screen>78 79 80 79 </sect2> 81 80 -
BOOK/boot/common/eudev.xml
r88ef769 r03e6a40 13 13 <indexterm zone="ch-boot-eudev"> 14 14 <primary sortas="a-Eudev">Eudev</primary> 15 <secondary>boot</secondary>16 15 </indexterm> 17 16 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 19 href="../../final-system/common/eudev.xml" 20 xpointer="xpointer(//*[@role='package'])"/> 17 <sect2 role="package"> 18 <title/> 19 20 <para>The Eudev package contains programs for dynamic creation of device 21 nodes.</para> 22 23 </sect2> 21 24 22 25 <sect2 role="installation"> 23 26 <title>Installation of Eudev</title> 24 27 25 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 26 href="../../final-system/common/eudev.xml" 27 xpointer="xpointer(//*[@os='a'])"/> 28 <para os="a">Prepare Eudev for compilation:</para> 28 29 29 30 <screen os="b"><userinput>BLKID_CFLAGS="-I/tools/include" BLKID_LIBS="-L/tools/lib -lblkid" \ 30 KMOD_CFLAGS="-I/tools/include/" KMOD_LIBS="-L/tools/lib -lkmod" \ 31 LDFLAGS="-Wl,-rpath,/tools/lib:/lib" ./configure --prefix=/usr \ 32 --build=${CLFS_HOST} --host=${CLFS_TARGET} \ 33 --with-rootprefix='' --enable-split-usr --sysconfdir=/etc \ 34 --libexecdir=/lib --bindir=/sbin --sbindir=/sbin --libdir=/usr/lib \ 35 --with-rootlibdir=/lib --disable-introspection --disable-gtk-doc-html \ 31 KMOD_CFLAGS="-I/tools/include/" KMOD_LIBS="-L/tools/lib -lkmod" \ 32 ./configure --prefix=/tools --build=${CLFS_HOST} --host=${CLFS_TARGET} \ 33 --disable-introspection --disable-gtk-doc-html \ 36 34 --disable-gudev --disable-keymap --with-firmware-path=/lib/firmware \ 37 35 --enable-libkmod</userinput></screen> 38 36 39 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 40 href="../../final-system/common/eudev.xml" 41 xpointer="xpointer(//*[@os='c'])"/> 42 43 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 44 href="../../final-system/common/eudev.xml" 45 xpointer="xpointer(//*[@os='d'])"/> 46 47 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 48 href="../../final-system/common/eudev.xml" 49 xpointer="xpointer(//*[@os='g'])"/> 50 51 <screen os="j"><userinput>make DESTDIR=${CLFS} install</userinput></screen> 52 53 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 54 href="../../final-system/common/eudev.xml" 55 xpointer="xpointer(//*[@os='i'])"/> 56 57 <screen os="k"><userinput>install -dv ${CLFS}/lib/firmware</userinput></screen> 58 59 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 60 href="../../final-system/common/eudev.xml" 61 xpointer="xpointer(//*[@os='r1'])"/> 37 <para os="c">Compile the package:</para> 38 39 <screen os="d"><userinput>make</userinput></screen> 40 41 <para os="g">Install the package:</para> 42 43 <screen os="j"><userinput>make install</userinput></screen> 44 45 <para os="i">Create a directory for storing firmware that can be 46 loaded by <command>udev</command>:</para> 47 48 <screen os="k"><userinput>install -dv /tools/lib/firmware</userinput></screen> 49 50 <para os="r1">Create a dummy rule so that Eudev will name ethernet devices properly for the system.</para> 62 51 63 52 <screen os="r2"><userinput>echo "# dummy, so that network is once again on eth*" \ 64 > ${CLFS}/etc/udev/rules.d/80-net-name-slot.rules</userinput></screen>53 > /tools/etc/udev/rules.d/80-net-name-slot.rules</userinput></screen> 65 54 66 55 </sect2> 67 56 68 <sect2 role="content"> 69 <title/> 70 71 <para>Details on this package are located in <xref 72 linkend="contents-eudev" role="."/></para> 57 <sect2 id="contents-eudev" role="content"> 58 <title>Contents of Eudev</title> 59 60 <segmentedlist> 61 <segtitle>Installed programs</segtitle> 62 <segtitle>Installed library</segtitle> 63 <segtitle>Installed directories</segtitle> 64 65 <seglistitem> 66 <seg>ata_id, cdrom_id, collect, create_floppy_devices, edd_id, 67 firmware.sh, fstab_import, path_id, scsi_id, udevadm, udevd, usb_id, 68 v4l_id, write_cd_rules, write_net_rules</seg> 69 <seg>libudev</seg> 70 <seg>/tools/etc/udev, /tools/lib/firmware, /tools/lib/udev</seg> 71 </seglistitem> 72 </segmentedlist> 73 74 <variablelist> 75 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 76 <?dbfo list-presentation="list"?> 77 <?dbhtml list-presentation="table"?> 78 79 <varlistentry id="udevadm"> 80 <term><command>udevadm</command></term> 81 <listitem> 82 <para>Controls the runtime behavior of Eudev, requests kernel 83 events, manages the event queue, and provides simple debugging.</para> 84 <indexterm zone="ch-boot-eudev udevadm"> 85 <primary sortas="b-udevadm">udevadm</primary> 86 </indexterm> 87 </listitem> 88 </varlistentry> 89 90 <varlistentry id="udevd"> 91 <term><command>udevd</command></term> 92 <listitem> 93 <para>A daemon that reorders hotplug events before submitting them to 94 <command>udev</command>, 95 thus avoiding various race conditions</para> 96 <indexterm zone="ch-boot-eudev udevd"> 97 <primary sortas="b-udevd">udevd</primary> 98 </indexterm> 99 </listitem> 100 </varlistentry> 101 102 <!-- Start of Helpers --> 103 <varlistentry id="ata_id"> 104 <term><command>ata_id</command></term> 105 <listitem> 106 <para>Provides Eudev with a unique string and additional 107 information (uuid, label) for an ATA drive</para> 108 <indexterm zone="ch-boot-eudev ata_id"> 109 <primary sortas="b-ata_id">ata_id</primary> 110 </indexterm> 111 </listitem> 112 </varlistentry> 113 114 <varlistentry id="cdrom_id"> 115 <term><command>cdrom_id</command></term> 116 <listitem> 117 <para>Prints the capabilities of a CDROM or DVDROM drive.</para> 118 <indexterm zone="ch-boot-eudev cdrom_id"> 119 <primary sortas="b-cdrom_id">cdrom_id</primary> 120 </indexterm> 121 </listitem> 122 </varlistentry> 123 124 <varlistentry id="collect"> 125 <term><command>collect</command></term> 126 <listitem> 127 <para>Given an ID for the current uevent and a list of IDs 128 (for all target uevents), registers the current ID and indicates whether 129 all target IDs have been registered.</para> 130 <indexterm zone="ch-boot-eudev collect"> 131 <primary sortas="b-collect">collect</primary> 132 </indexterm> 133 </listitem> 134 </varlistentry> 135 136 <varlistentry id="create_floppy_devices"> 137 <term><command>create_floppy_devices</command></term> 138 <listitem> 139 <para>Creates all possible floppy devices based on the CMOS type</para> 140 <indexterm zone="ch-boot-eudev create_floppy_devices"> 141 <primary sortas="b-create_floppy_devices">create_floppy_devices</primary> 142 </indexterm> 143 </listitem> 144 </varlistentry> 145 146 <varlistentry id="edd_id"> 147 <term><command>edd_id</command></term> 148 <listitem> 149 <para>Identifies x86 disk drives from Enhanced Disk Drive calls</para> 150 <indexterm zone="ch-boot-eudev edd_id"> 151 <primary sortas="b-edd_id">edd_id</primary> 152 </indexterm> 153 </listitem> 154 </varlistentry> 155 156 <varlistentry id="firmware.sh"> 157 <term><command>firmware.sh</command></term> 158 <listitem> 159 <para>Script to load firmware for a device</para> 160 <indexterm zone="ch-boot-eudev firmware.sh"> 161 <primary sortas="b-firmware.sh">firmware.sh</primary> 162 </indexterm> 163 </listitem> 164 </varlistentry> 165 166 <varlistentry id="fstab_import"> 167 <term><command>fstab_import</command></term> 168 <listitem> 169 <para>Finds an entry in <filename>/etc/fstab</filename> that matches 170 the current device, and provides its information to Udev.</para> 171 <indexterm zone="ch-boot-eudev fstab_import"> 172 <primary sortas="b-fstab_import">fstab_import</primary> 173 </indexterm> 174 </listitem> 175 </varlistentry> 176 177 <varlistentry id="path_id"> 178 <term><command>path_id</command></term> 179 <listitem> 180 <para>Provides the shortest possible unique hardware path to a 181 device</para> 182 <indexterm zone="ch-boot-eudev path_id"> 183 <primary sortas="b-path_id">path_id</primary> 184 </indexterm> 185 </listitem> 186 </varlistentry> 187 188 <varlistentry id="scsi_id"> 189 <term><command>scsi_id</command></term> 190 <listitem> 191 <para>Retrieves or generates a unique SCSI identifier.</para> 192 <indexterm zone="ch-boot-eudev scsi_id"> 193 <primary sortas="b-scsi_id">scsi_id</primary> 194 </indexterm> 195 </listitem> 196 </varlistentry> 197 198 <varlistentry id="usb_id"> 199 <term><command>usb_id</command></term> 200 <listitem> 201 <para>Identifies a USB block device.</para> 202 <indexterm zone="ch-boot-eudev usb_id"> 203 <primary sortas="b-usb_id">usb_id</primary> 204 </indexterm> 205 </listitem> 206 </varlistentry> 207 208 <varlistentry id="v4l_id"> 209 <term><command>v4l_id</command></term> 210 <listitem> 211 <para>Determines V4L capabilities for a given device.</para> 212 <indexterm zone="ch-boot-eudev v4l_id"> 213 <primary sortas="b-v4l_id">v4l_id</primary> 214 </indexterm> 215 </listitem> 216 </varlistentry> 217 218 <varlistentry id="write_cd_rules"> 219 <term><command>write_cd_rules</command></term> 220 <listitem> 221 <para>A script which generates Eudev rules to provide stable names 222 for network interfaces.</para> 223 <indexterm zone="ch-boot-eudev write_cd_rules"> 224 <primary sortas="b-write_cd_rules">write_cd_rules</primary> 225 </indexterm> 226 </listitem> 227 </varlistentry> 228 229 <varlistentry id="write_net_rules"> 230 <term><command>write_net_rules</command></term> 231 <listitem> 232 <para>A script which generates Eudev rules to provide stable names 233 for network interfaces.</para> 234 <indexterm zone="ch-boot-eudev write_net_rules"> 235 <primary sortas="b-write_net_rules">write_net_rules</primary> 236 </indexterm> 237 </listitem> 238 </varlistentry> 239 <!-- End of Helpers --> 240 241 <varlistentry id="libudev"> 242 <term><filename class="libraryfile">libudev</filename></term> 243 <listitem> 244 <para>A library interface to eudev device information.</para> 245 <indexterm zone="ch-boot-eudev libudev"> 246 <primary sortas="c-libudev">libudev</primary> 247 </indexterm> 248 </listitem> 249 </varlistentry> 250 251 <varlistentry id="etc-eudev"> 252 <term><filename class="directory">/etc/udev</filename></term> 253 <listitem> 254 <para>Contains <command>udev</command> configuration files, 255 device permissions, and rules for device naming</para> 256 <indexterm zone="ch-boot-eudev etc-eudev"> 257 <primary sortas="e-/etc/udev">/etc/udev</primary> 258 </indexterm> 259 </listitem> 260 </varlistentry> 261 262 <varlistentry id="lib-eudev"> 263 <term><filename class="directory">/lib/udev</filename></term> 264 <listitem> 265 <para>Contains <command>udev</command> helper programs 266 and static devices which get copied to /dev when booted.</para> 267 <indexterm zone="ch-boot-eudev lib-eudev"> 268 <primary sortas="e-/lib/udev">/lib/udev</primary> 269 </indexterm> 270 </listitem> 271 </varlistentry> 272 </variablelist> 73 273 74 274 </sect2> -
BOOK/boot/common/introduction.xml
r88ef769 r03e6a40 15 15 build the final system packages.</para> 16 16 17 <para>There are a few additional packages that will need to be18 installed to allow you to boot the minimal system. Some of these19 packages will be installed onto root or in /usr on the CLFS20 partition (${CLFS}/bin, ${CLFS}/usr/bin, etc...), rather than /tools, using the21 "DESTDIR" option with make. This will require the22 <systemitem class="username">clfs</systemitem> user to have write access to23 the rest of the CLFS partition, so you will need to temporarily change the24 ownership of ${CLFS} to the <systemitem class="username">clfs</systemitem> user.25 Run the following command as <systemitem26 class="username">root</systemitem>:</para>27 28 <screen><userinput>chown -v clfs ${CLFS}</userinput></screen>29 30 17 </sect1> -
BOOK/boot/common/kmod.xml
r88ef769 r03e6a40 23 23 <title>Installation of Kmod</title> 24 24 25 <para os="s1">Tell Kmod to use <filename class="directory">/tools/lib/modules</filename>:</para> 26 27 <screen os="s2"><userinput>cp -v libkmod/libkmod.c{,.orig} 28 sed '/dirname_default_prefix /s@/lib/modules@/tools&@' \ 29 libkmod/libkmod.c.orig > libkmod/libkmod.c</userinput></screen> 30 25 31 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 26 32 href="../../final-system/common/kmod.xml" … … 29 35 <screen os="b"><userinput>liblzma_CFLAGS="-I/tools/include" liblzma_LIBS="-L/tools/lib -llzma" \ 30 36 zlib_CFLAGS="-I/tools/include" zlib_LIBS="-L/tools/lib -lz" \ 31 ./configure --prefix=/tools --bindir=/bin \ 32 --build=${CLFS_HOST} --host=${CLFS_TARGET} --with-xz --with-zlib \ 33 --disable-manpages</userinput></screen> 37 ./configure --prefix=/tools \ 38 --build=${CLFS_HOST} --host=${CLFS_TARGET} --with-xz --with-zlib</userinput></screen> 39 40 <variablelist os="c"> 41 <title>The meaning of the new configure options:</title> 42 43 <varlistentry> 44 <term><parameter>--with-zlib --with-xz</parameter></term> 45 <listitem> 46 <para>These allow the Kmod package to handle zlib and XZ 47 compressed kernel modules.</para> 48 </listitem> 49 </varlistentry> 50 51 </variablelist> 34 52 35 53 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" … … 45 63 xpointer="xpointer(//*[@os='g'])"/> 46 64 47 <screen os=" k"><userinput>make DESTDIR=${CLFS}install</userinput></screen>65 <screen os="h"><userinput>make install</userinput></screen> 48 66 49 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"50 href="../../final-system/common/kmod.xml"51 xpointer="xpointer(//*[@os='i'])"/>67 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 68 href="../../final-system/common/kmod.xml" 69 xpointer="xpointer(//*[@os='i'])"/> 52 70 53 <screen os="j"><userinput>ln -sv kmod ${CLFS}/bin/lsmod 54 ln -sv ../bin/kmod ${CLFS}/sbin/depmod 55 ln -sv ../bin/kmod ${CLFS}/sbin/insmod 56 ln -sv ../bin/kmod ${CLFS}/sbin/modprobe 57 ln -sv ../bin/kmod ${CLFS}/sbin/modinfo 58 ln -sv ../bin/kmod ${CLFS}/sbin/rmmod</userinput></screen> 71 <screen os="j"><userinput>ln -sfv kmod /tools/bin/lsmod 72 for tool in depmod insmod modprobe modinfo rmmod; do 73 ln -sv ../bin/kmod /tools/sbin/${tool} 74 done</userinput></screen> 59 75 60 76 </sect2> -
BOOK/boot/common/pwdgroup.xml
r88ef769 r03e6a40 9 9 <?dbhtml filename="pwdgroup.html"?> 10 10 11 <title>Creating the passwd , group, and logFiles</title>11 <title>Creating the passwd and group Files</title> 12 12 13 13 <indexterm zone="ch-boot-pwdgroup"> … … 17 17 <indexterm zone="ch-boot-pwdgroup"> 18 18 <primary sortas="e-/etc/group">/etc/group</primary> 19 </indexterm>20 21 <indexterm zone="ch-boot-pwdgroup">22 <primary sortas="e-/var/run/utmp">/var/run/utmp</primary>23 </indexterm>24 25 <indexterm zone="ch-boot-pwdgroup">26 <primary sortas="e-/var/log/btmp">/var/log/btmp</primary>27 </indexterm>28 29 <indexterm zone="ch-boot-pwdgroup">30 <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary>31 </indexterm>32 33 <indexterm zone="ch-boot-pwdgroup">34 <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary>35 19 </indexterm> 36 20 … … 45 29 <screen><userinput>cat > ${CLFS}/etc/passwd << "EOF" 46 30 <literal>root::&uid-root;:&gid-root;:root:/root:/bin/bash</literal> 31 <literal>bin:x:&uid-bin;:&gid-bin;:/bin:/bin/false</literal> 32 <literal>daemon:x:&uid-daemon;:&gid-daemon;:/sbin:/bin/false</literal> 33 <literal>messagebus:x:&uid-messagebus;:&gid-messagebus;:D-Bus Message Daemon User:/dev/null:/bin/false</literal> 34 <literal>nobody:x:&uid-nobody;:&gid-nogroup;:Unprivileged User:/dev/null:/bin/false</literal> 47 35 EOF</userinput></screen> 48 36 … … 53 41 <variablelist os="c"> 54 42 55 <title>Additional users you may want to add :</title>43 <title>Additional users you may want to add if not already included:</title> 56 44 57 <varlistentry>58 <term><literal>bin:x:&uid-bin;:&gid-bin;:bin:/bin:/bin/false</literal></term>59 <listitem>60 <para>Can be useful for compatibility with legacy applications.</para>61 </listitem>62 </varlistentry>63 <varlistentry>64 <term><literal>daemon:x:&uid-daemon;:&gid-daemon;:daemon:/sbin:/bin/false</literal></term>65 <listitem>66 <para>It is often recommended to use an unprivileged User ID/Group ID67 for daemons to run as, in order to limit their access to the system.</para>68 </listitem>69 </varlistentry>70 45 <varlistentry> 71 46 <term><literal>adm:x:&uid-adm;:&gid-adm;:adm:/var/adm:/bin/false</literal></term> … … 104 79 </listitem> 105 80 </varlistentry> 106 <varlistentry>107 <term><literal>nobody:x:&uid-nobody;:&gid-nobody;:nobody:/:/bin/false</literal></term>108 <listitem>109 <para>Used by NFS</para>110 </listitem>111 </varlistentry>112 81 </variablelist> 113 82 … … 131 100 utmp:x:&gid-utmp;: 132 101 usb:x:&gid-usb;: 133 cdrom:x:&gid-cdrom;:</literal> 102 cdrom:x:&gid-cdrom;: 103 adm:x:&gid-adm;: 104 messagebus:x:&gid-messagebus;: 105 systemd-journal:x:&gid-systemd-journal;: 106 mail:x:&gid-mail;: 107 wheel:x:&gid-wheel;: 108 nogroup:x:&gid-nogroup;:</literal> 134 109 EOF</userinput></screen> 135 110 136 111 <variablelist os="d"> 137 112 138 <title>Additional groups you may want to add </title>113 <title>Additional groups you may want to add if not already included:</title> 139 114 140 <varlistentry>141 <term><literal>adm:x:&gid-adm;:root,adm,daemon</literal></term>142 <listitem>143 <para>All users in this group are allowed to do administrative tasks</para>144 </listitem>145 </varlistentry>146 115 <varlistentry> 147 116 <term><literal>console:x:&gid-console;:</literal></term> … … 154 123 <listitem> 155 124 <para>This group is allowed to use the CDRW drive</para> 156 </listitem>157 </varlistentry>158 <varlistentry>159 <term><literal>mail:x:&gid-mail;:mail</literal></term>160 <listitem>161 <para>Used by MTAs (Mail Transport Agents)</para>162 125 </listitem> 163 126 </varlistentry> … … 175 138 </varlistentry> 176 139 <varlistentry> 177 <term><literal>nogroup:x:&gid-nogroup;:</literal></term> 178 <listitem> 179 <para>This is a default group used by some programs that do not 180 require a group</para> 181 </listitem> 182 </varlistentry> 183 <varlistentry> 184 <term><literal>nobody:x:&gid-nobody;:</literal></term> 140 <term><literal>nobody:x:&gid-nogroup;:</literal></term> 185 141 <listitem> 186 142 <para>This is used by NFS</para> … … 190 146 191 147 <para os="e">The created groups are not part of any standard—they are 192 groups decided on in part by the requirements of the Eudevconfiguration148 groups decided on in part by the requirements of the Systemd configuration 193 149 in the final system, and in part by common convention employed by a 194 150 number of existing Linux distributions. The Linux Standard Base (LSB, … … 200 156 group's name.</para> 201 157 202 <para os="f">The <command>login</command>, <command>agetty</command>, and203 <command>init</command> programs (and others) use a number of log204 files to record information such as who was logged into the system and205 when. However, these programs will not write to the log files if they206 do not already exist. Initialize the log files and give them207 proper permissions:</para>208 209 <screen><userinput>touch ${CLFS}/var/run/utmp ${CLFS}/var/log/{btmp,lastlog,wtmp}210 chmod -v 664 ${CLFS}/var/run/utmp ${CLFS}/var/log/lastlog211 chmod -v 600 ${CLFS}/var/log/btmp</userinput></screen>212 213 <para>The <filename>/var/run/utmp</filename> file records the users214 that are currently logged in. The <filename>/var/log/wtmp</filename>215 file records all logins and logouts. The216 <filename>/var/log/lastlog</filename> file records when217 each user last logged in. The <filename>/var/log/btmp</filename> file218 records the bad login attempts.</para>219 220 158 </sect1> -
BOOK/boot/common/settingenviron.xml
r88ef769 r03e6a40 12 12 13 13 <para>The new instance of the shell that will start when the system is booted is a <emphasis>login</emphasis> 14 shell, which will read <filename>.bash_profile</filename> file. Create the15 <filename>.bash_profile</filename> filenow:</para>14 shell, which will read the <filename>.bash_profile</filename> file. Create 15 <filename>.bash_profile</filename> now:</para> 16 16 17 17 <screen><userinput>cat > ${CLFS}/root/.bash_profile << "EOF" -
BOOK/boot/common/shadow.xml
r88ef769 r03e6a40 23 23 <title>Installation of Shadow</title> 24 24 25 <para os="b">Disable the installation of the <command>groups</command> 26 program, as Coreutils provides a better version:</para> 25 <para os="b">Disable the installation of the <command>groups</command> and 26 <command>nologin</command> programs, as better versions 27 of these programs are provided by Coreutils and Util-linux:</para> 27 28 28 29 <screen os="c"><userinput>cp -v src/Makefile.in{,.orig} 29 sed -e 's/groups$(EXEEXT) //' src/Makefile.in.orig > src/Makefile.in</userinput></screen> 30 sed -e 's/groups$(EXEEXT) //' -e 's/= nologin$(EXEEXT)/= /' \ 31 src/Makefile.in.orig > src/Makefile.in</userinput></screen> 30 32 31 33 <para os="d">Prepare Shadow for compilation:</para> 32 34 33 35 <screen os="e"><userinput>./configure --prefix=/tools \ 34 --build=${CLFS_HOST} --host=${CLFS_TARGET} --sysconfdir=/etc</userinput></screen>36 --build=${CLFS_HOST} --host=${CLFS_TARGET}</userinput></screen> 35 37 36 <para os="f">The meaning of the configure options:</para> 38 <para os="f">Tell Shadow to use <command>passwd</command> in 39 <filename class="directory">/tools/bin</filename>:</para> 37 40 38 <variablelist os="g"> 39 <varlistentry> 40 <term><parameter>--sysconfdir=/etc</parameter></term> 41 <listitem><para>Tells Shadow to install its configuration files into 42 <filename class="directory">/etc</filename>, rather than 43 <filename class="directory">/tools/etc</filename>.</para></listitem> 44 </varlistentry> 45 46 </variablelist> 41 <screen os="g"><userinput>cp config.h{,.orig} 42 sed '/PASSWD_PROGRAM/s@/bin/passwd@/tools&@' config.h.orig > config.h</userinput></screen> 47 43 44 <para os="h">Prevent Shadow from setting installed programs suid:</para> 48 45 49 <para os="h">Compile the package:</para> 46 <screen os="i"><userinput>cp -v src/Makefile{,.orig} 47 sed 's/\(^suidu*bins = \).*/\1/' src/Makefile.orig > src/Makefile</userinput></screen> 50 48 51 <screen os="i"><userinput>make</userinput></screen>49 <para os="j">Compile the package:</para> 52 50 53 <para os="j">This package does not come with a test suite.</para>51 <screen os="k"><userinput>make</userinput></screen> 54 52 55 <para os=" k">Install the package:</para>53 <para os="l">Install the package:</para> 56 54 57 <screen os=" l"><userinput>make DESTDIR=${CLFS}install</userinput></screen>55 <screen os="m"><userinput>make install</userinput></screen> 58 56 59 57 </sect2> -
BOOK/boot/common/sysvinit.xml
r88ef769 r03e6a40 13 13 <indexterm zone="ch-boot-sysvinit"> 14 14 <primary sortas="a-Sysvinit">Sysvinit</primary> 15 <secondary>boot</secondary>16 15 </indexterm> 17 16 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 19 href="../../final-system/common/sysvinit.xml" 20 xpointer="xpointer(//*[@role='package'])"/> 17 <sect2 role="package"> 18 <title/> 19 20 <para>The Sysvinit package contains programs for controlling the startup, 21 running, and shutdown of the system.</para> 22 23 </sect2> 21 24 22 25 <sect2 role="installation"> 23 26 <title>Installation of Sysvinit</title> 24 27 25 <para os="aa">The following modifications help locate files specific to this 26 particular build:</para> 27 28 <screen os="ab"><userinput>cp -v src/Makefile{,.orig} 29 sed -e 's,/usr/lib,/tools/lib,g' \ 30 src/Makefile.orig > src/Makefile</userinput></screen> 31 32 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 33 href="../../final-system/common/sysvinit.xml" 34 xpointer="xpointer(//*[@os='c'])"/> 28 <para os="p1">Apply a patch to prevent installation of unneeded programs, 29 and allow Sysvinit to be installed in 30 <filename class="directory">/tools</filename>:</para> 31 32 <screen os="p2"><userinput>patch -Np1 -i ../sysvinit-&sysvinit-version;-tools_updates-1.patch</userinput></screen> 33 34 <para os ="c">Compile the package:</para> 35 35 36 36 <screen os="ac"><userinput>make -C src clobber 37 37 make -C src CC="${CC}"</userinput></screen> 38 38 39 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" 40 href="../../final-system/common/sysvinit.xml" 41 xpointer="xpointer(//*[@os='e'])"/> 42 43 <screen os="ad"><userinput>make -C src ROOT=${CLFS} install</userinput></screen> 39 <para os="e">Install the package:</para> 40 41 <screen os="ad"><userinput>make -C src ROOT=/tools install</userinput></screen> 44 42 45 43 </sect2> … … 57 55 </indexterm> 58 56 59 <para>Create a new file <filename> ${CLFS}/etc/inittab</filename> by running the57 <para>Create a new file <filename>/tools/etc/inittab</filename> by running the 60 58 following:</para> 61 59 62 <screen><userinput>cat > ${CLFS}/etc/inittab << "EOF"63 <literal># Begin / etc/inittab60 <screen><userinput>cat > /tools/etc/inittab << "EOF" 61 <literal># Begin /tools/etc/inittab 64 62 65 63 id:3:initdefault: 66 64 67 si::sysinit:/ etc/rc.d/init.d/rc sysinit68 69 l0:0:wait:/ etc/rc.d/init.d/rc 070 l1:S1:wait:/ etc/rc.d/init.d/rc 171 l2:2:wait:/ etc/rc.d/init.d/rc 272 l3:3:wait:/ etc/rc.d/init.d/rc 373 l4:4:wait:/ etc/rc.d/init.d/rc 474 l5:5:wait:/ etc/rc.d/init.d/rc 575 l6:6:wait:/ etc/rc.d/init.d/rc 676 77 ca:12345:ctrlaltdel:/ sbin/shutdown -t1 -a -r now78 79 su:S016:once:/ sbin/sulogin65 si::sysinit:/tools/etc/rc.d/init.d/rc sysinit 66 67 l0:0:wait:/tools/etc/rc.d/init.d/rc 0 68 l1:S1:wait:/tools/etc/rc.d/init.d/rc 1 69 l2:2:wait:/tools/etc/rc.d/init.d/rc 2 70 l3:3:wait:/tools/etc/rc.d/init.d/rc 3 71 l4:4:wait:/tools/etc/rc.d/init.d/rc 4 72 l5:5:wait:/tools/etc/rc.d/init.d/rc 5 73 l6:6:wait:/tools/etc/rc.d/init.d/rc 6 74 75 ca:12345:ctrlaltdel:/tools/sbin/shutdown -t1 -a -r now 76 77 su:S016:once:/tools/sbin/sulogin 80 78 </literal> 81 79 EOF</userinput></screen> 82 80 83 81 <para>The following command adds the standard virtual terminals to 84 <filename> ${CLFS}/etc/inittab</filename>. If your system only has a serial82 <filename>/tools/etc/inittab</filename>. If your system only has a serial 85 83 console skip the following command:</para> 86 84 87 <screen><userinput>cat >> ${CLFS}/etc/inittab << "EOF"88 <literal>1:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty1 960089 2:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty2 960090 3:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty3 960091 4:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty4 960092 5:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty5 960093 6:2345:respawn:/ sbin/agetty --noclear -I '\033(K' tty6 960085 <screen><userinput>cat >> /tools/etc/inittab << "EOF" 86 <literal>1:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty1 9600 87 2:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty2 9600 88 3:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty3 9600 89 4:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty4 9600 90 5:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty5 9600 91 6:2345:respawn:/tools/sbin/agetty --noclear -I '\033(K' tty6 9600 94 92 </literal> 95 93 EOF</userinput></screen> 96 94 97 95 <para>If your system has a serial console, run the following command to add 98 the entry to <filename> ${CLFS}/etc/inittab</filename>.</para>99 100 <screen><userinput>cat >> ${CLFS}/etc/inittab << "EOF"101 <literal>c0:12345:respawn:/ sbin/agetty --noclear 115200 ttyS0 vt10096 the entry to <filename>/tools/etc/inittab</filename>.</para> 97 98 <screen><userinput>cat >> /tools/etc/inittab << "EOF" 99 <literal>c0:12345:respawn:/tools/sbin/agetty --noclear 115200 ttyS0 vt100 102 100 </literal> 103 101 EOF</userinput></screen> 104 102 105 <para>Finally, add the end line to <filename>${CLFS}/etc/inittab</filename>.</para> 106 107 <screen><userinput>cat >> ${CLFS}/etc/inittab << "EOF" 108 <literal># End /etc/inittab</literal> 109 EOF</userinput></screen> 110 111 </sect2> 112 113 <sect2 role="content"> 114 <title/> 115 116 <para>Details on this package are located in <xref 117 linkend="contents-sysvinit" role="."/></para> 103 <para>Finally, add the end line to <filename>/tools/etc/inittab</filename>.</para> 104 105 <screen><userinput>cat >> /tools/etc/inittab << "EOF" 106 <literal># End /tools/etc/inittab</literal> 107 EOF</userinput></screen> 108 109 <para>The <parameter>-I '\033(K'</parameter> option tells 110 <command>agetty</command> to send this escape sequence to the terminal 111 before doing anything else. This escape sequence switches the console 112 character set to a user-defined one, which can be modified by running 113 the <command>setfont</command> program. The <command>console</command> 114 initscript from the CLFS-Bootscripts package calls the 115 <command>setfont</command> program during system startup. Sending this 116 escape sequence is necessary for people who use non-ISO 8859-1 screen 117 fonts, but it does not affect native English speakers.</para> 118 119 </sect2> 120 121 <sect2 id="contents-sysvinit" role="content"> 122 <title>Contents of Sysvinit</title> 123 124 <segmentedlist> 125 <segtitle>Installed programs</segtitle> 126 127 <seglistitem> 128 <seg>bootlogd, fstab-decode, halt, init, killall5, 129 poweroff (link to halt), reboot (link to halt), runlevel, 130 shutdown, and telinit (link to init)</seg> 131 </seglistitem> 132 </segmentedlist> 133 134 <variablelist> 135 <bridgehead renderas="sect3">Short Descriptions</bridgehead> 136 <?dbfo list-presentation="list"?> 137 <?dbhtml list-presentation="table"?> 138 139 <varlistentry id="bootlogd"> 140 <term><command>bootlogd</command></term> 141 <listitem> 142 <para>Logs boot messages to a log file</para> 143 <indexterm zone="ch-boot-sysvinit bootlogd"> 144 <primary sortas="b-bootlogd">bootlogd</primary> 145 </indexterm> 146 </listitem> 147 </varlistentry> 148 149 <varlistentry id="fstab-decode"> 150 <term><command>fstab-decode</command></term> 151 <listitem> 152 <para>Runs a command with fstab-encoded arguments</para> 153 <indexterm zone="ch-boot-sysvinit fstab-decode"> 154 <primary sortas="b-fstab-decode">fstab-decode</primary> 155 </indexterm> 156 </listitem> 157 </varlistentry> 158 159 <varlistentry id="halt"> 160 <term><command>halt</command></term> 161 <listitem> 162 <para>Normally invokes <command>shutdown</command> with the 163 <parameter>-h</parameter> option, except when already in run-level 0, 164 then it tells the kernel to halt the system; it notes in the 165 file <filename>/var/log/wtmp</filename> that the system is being 166 brought down</para> 167 <indexterm zone="ch-boot-sysvinit halt"> 168 <primary sortas="b-halt">halt</primary> 169 </indexterm> 170 </listitem> 171 </varlistentry> 172 173 <varlistentry id="init"> 174 <term><command>init</command></term> 175 <listitem> 176 <para>The first process to be started when the kernel has initialized 177 the hardware which takes over the boot process and starts all the 178 proceses it is instructed to</para> 179 <indexterm zone="ch-boot-sysvinit init"> 180 <primary sortas="b-init">init</primary> 181 </indexterm> 182 </listitem> 183 </varlistentry> 184 185 <varlistentry id="killall5"> 186 <term><command>killall5</command></term> 187 <listitem> 188 <para>Sends a signal to all processes, except the processes in its own 189 session so it will not kill the shell running the script that called 190 it</para> 191 <indexterm zone="ch-boot-sysvinit killall5"> 192 <primary sortas="b-killall5">killall5</primary> 193 </indexterm> 194 </listitem> 195 </varlistentry> 196 197 <varlistentry id="poweroff"> 198 <term><command>poweroff</command></term> 199 <listitem> 200 <para>Tells the kernel to halt the system and switch off the computer 201 (see <command>halt</command>)</para> 202 <indexterm zone="ch-boot-sysvinit poweroff"> 203 <primary sortas="b-poweroff">poweroff</primary> 204 </indexterm> 205 </listitem> 206 </varlistentry> 207 208 <varlistentry id="reboot"> 209 <term><command>reboot</command></term> 210 <listitem> 211 <para>Tells the kernel to reboot the system (see 212 <command>halt</command>)</para> 213 <indexterm zone="ch-boot-sysvinit reboot"> 214 <primary sortas="b-reboot">reboot</primary> 215 </indexterm> 216 </listitem> 217 </varlistentry> 218 219 <varlistentry id="runlevel"> 220 <term><command>runlevel</command></term> 221 <listitem> 222 <para>Reports the previous and the current run-level, as noted in 223 the last run-level record in <filename>/var/run/utmp</filename></para> 224 <indexterm zone="ch-boot-sysvinit runlevel"> 225 <primary sortas="b-runlevel">runlevel</primary> 226 </indexterm> 227 </listitem> 228 </varlistentry> 229 230 <varlistentry id="shutdown"> 231 <term><command>shutdown</command></term> 232 <listitem> 233 <para>Brings the system down in a secure way, signaling all processes 234 and notifying all logged-in users</para> 235 <indexterm zone="ch-boot-sysvinit shutdown"> 236 <primary sortas="b-shutdown">shutdown</primary> 237 </indexterm> 238 </listitem> 239 </varlistentry> 240 241 <varlistentry id="telinit"> 242 <term><command>telinit</command></term> 243 <listitem> 244 <para>Tells <command>init</command> which run-level to change to</para> 245 <indexterm zone="ch-boot-sysvinit telinit"> 246 <primary sortas="b-telinit">telinit</primary> 247 </indexterm> 248 </listitem> 249 </varlistentry> 250 251 </variablelist> 118 252 119 253 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.