Changeset d2ecc65 for BOOK/boot/common
- Timestamp:
- Apr 19, 2014, 10:07:08 PM (11 years ago)
- Branches:
- clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 76ccba3
- Parents:
- 03679c8
- Location:
- BOOK/boot/common
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
BOOK/boot/common/changingowner.xml
r03679c8 rd2ecc65 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> 35 36 <screen os="c"><userinput>chown -Rv 0:0 ${CLFS}/tools 37 chown -Rv 0:0 ${CLFS}/cross-tools</userinput></screen> 22 38 23 39 </sect1> -
BOOK/boot/common/createfiles.xml
r03679c8 rd2ecc65 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,pwd,stty} ${CLFS}/bin18 <screen os="b"><userinput>ln -sv /tools/bin/{bash,cat,echo,grep,login,pwd,stty} ${CLFS}/bin 19 19 ln -sv /tools/bin/file ${CLFS}/usr/bin 20 20 ln -sv /tools/lib/libgcc_s.so{,.1} ${CLFS}/usr/lib 21 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++.la22 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 25 29 26 30 <para os="c">Historically, Linux maintains a list of the mounted file systems -
BOOK/boot/common/creatingdirs.xml
r03679c8 rd2ecc65 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} … … 25 33 mkdir -pv ${CLFS}/usr/{,local/}share/man/man{1,2,3,4,5,6,7,8}</userinput></screen> 26 34 27 <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, 28 36 but this is not desirable for all directories. In the commands above, 29 37 two changes are made—one to the home directory of user … … 31 39 directories for temporary files.</para> 32 40 33 <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 34 42 the <filename class="directory">/root</filename> directory—the 35 43 same as a normal user would do with his or her home directory. The … … 41 49 1777 bit mask.</para> 42 50 43 <sect2 os=" e">51 <sect2 os="f"> 44 52 <title>FHS Compliance Note</title> 45 53 -
BOOK/boot/common/devices.xml
r03679c8 rd2ecc65 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 -
BOOK/boot/common/e2fsprogs.xml
r03679c8 rd2ecc65 77 77 xpointer="xpointer(//*[@os='l'])"/> 78 78 79 <para os="ad">Create needed symlinks for a bootable system:</para>80 81 <screen os="ae"><userinput>ln -sv /tools/sbin/{fsck.ext2,fsck.ext3,fsck.ext4,e2fsck} ${CLFS}/sbin</userinput></screen>82 83 84 79 </sect2> 85 80 -
BOOK/boot/common/eudev.xml
r03679c8 rd2ecc65 46 46 loaded by <command>udev</command>:</para> 47 47 48 <screen os="k"><userinput>install -dv ${CLFS}/lib/firmware</userinput></screen>48 <screen os="k"><userinput>install -dv /tools/lib/firmware</userinput></screen> 49 49 50 50 <para os="r1">Create a dummy rule so that Eudev will name ethernet devices properly for the system.</para> … … 68 68 v4l_id, write_cd_rules, write_net_rules</seg> 69 69 <seg>libudev</seg> 70 <seg>/ etc/udev, /lib/firmware, /lib/udev, /usr/share/doc/udev</seg>70 <seg>/tools/etc/udev, /tools/lib/firmware, /tools/lib/udev</seg> 71 71 </seglistitem> 72 72 </segmentedlist> -
BOOK/boot/common/introduction.xml
r03679c8 rd2ecc65 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. They will be installed19 into <filename class="directory">/tools</filename>, but a few additional20 files and symlinks will be needed on the CLFS partition to be able to boot21 and log in. 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
r03679c8 rd2ecc65 22 22 <sect2 role="installation"> 23 23 <title>Installation of Kmod</title> 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> 24 30 25 31 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" … … 63 69 xpointer="xpointer(//*[@os='i'])"/> 64 70 65 <screen os="j"><userinput>ln -sv /tools/bin/kmod ${CLFS}/bin 66 ln -sv kmod ${CLFS}/bin/lsmod 67 ln -sv ../bin/kmod ${CLFS}/sbin/depmod 68 ln -sv ../bin/kmod ${CLFS}/sbin/insmod 69 ln -sv ../bin/kmod ${CLFS}/sbin/modprobe 70 ln -sv ../bin/kmod ${CLFS}/sbin/modinfo 71 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> 72 75 73 76 </sect2> -
BOOK/boot/common/shadow.xml
r03679c8 rd2ecc65 42 42 sed '/PASSWD_PROGRAM/s@/bin/passwd@/tools&@' config.h.orig > config.h</userinput></screen> 43 43 44 <para os="h"> Compile the package:</para>44 <para os="h">Prevent Shadow from setting installed programs suid:</para> 45 45 46 <screen os="i"><userinput>make</userinput></screen> 46 <screen os="i"><userinput>cp -v src/Makefile{,.orig} 47 sed 's/\(^suidu*bins = \).*/\1/' src/Makefile.orig > src/Makefile</userinput></screen> 47 48 48 <para os="j"> Installthe package:</para>49 <para os="j">Compile the package:</para> 49 50 50 <screen os="k"><userinput>make install</userinput></screen>51 <screen os="k"><userinput>make</userinput></screen> 51 52 52 <para os="l"> Create needed symlinks to be able to log on:</para>53 <para os="l">Install the package:</para> 53 54 54 <screen os="m"><userinput> ln -sv /tools/etc/{login.{access,defs},limits} ${CLFS}/etc</userinput></screen>55 <screen os="m"><userinput>make install</userinput></screen> 55 56 56 57 </sect2> -
BOOK/boot/common/sysvinit.xml
r03679c8 rd2ecc65 39 39 <para os="e">Install the package:</para> 40 40 41 <screen os="ad"><userinput>make -C src ROOT=/tools install 42 ln -svf /tools/sbin/init ${CLFS}/sbin</userinput></screen> 41 <screen os="ad"><userinput>make -C src ROOT=/tools install</userinput></screen> 43 42 44 43 </sect2>
Note:
See TracChangeset
for help on using the changeset viewer.