Merge trunk

This commit is contained in:
Thomas Trepl (Moody) 2021-08-04 14:09:24 +02:00
commit f5b747c56f
5 changed files with 60 additions and 49 deletions

View File

@ -48,7 +48,7 @@
as well:</para> as well:</para>
<screen><userinput>cat &gt; /etc/hosts &lt;&lt; EOF <screen><userinput>cat &gt; /etc/hosts &lt;&lt; EOF
"127.0.0.1 localhost $(hostname)" 127.0.0.1 localhost $(hostname)
::1 localhost ::1 localhost
EOF</userinput></screen> EOF</userinput></screen>

View File

@ -58,28 +58,27 @@
</para> </para>
<para> <para>
Leave the chroot environment and unmount the kernel virtual file Now, if you are stripping installed files or making a backup,
systems: leave the chroot environment:
</para> </para>
<note> <screen role="nodump"><userinput>exit</userinput></screen>
<important>
<para>All of the following instructions are executed by <para>All of the following instructions are executed by
<systemitem class="username">root</systemitem>. Take extra <systemitem class="username">root</systemitem>. Take extra
care about the commands you're going to run as mistakes care about the commands you're going to run as mistakes
here can modify your host system. Be aware that the here can modify your host system. Be aware that the
environment variable <envar>LFS</envar> is set for user environment variables <envar>LFS</envar> and <envar>LFS_TGT</envar>
<systemitem class="username">lfs</systemitem> by default are set for user <systemitem class="username">lfs</systemitem> by default
but it might <emphasis>not</emphasis> be set for but may <emphasis>not</emphasis> be set for
<systemitem class="username">root</systemitem>. Whenever <systemitem class="username">root</systemitem>. Whenever
commands are to be executed by <systemitem class="username">root</systemitem>, commands are to be executed by <systemitem class="username">root</systemitem>,
make sure you have set <envar>LFS</envar> accordingly. make sure you have set <envar>LFS</envar> and <envar>LFS_TGT</envar> accordingly.
This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>. This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>.
</para> </para>
</note> </important>
<screen role="nodump"><userinput>exit
umount $LFS/dev{/pts,}
umount $LFS/{sys,proc,run}</userinput></screen>
<sect2> <sect2>
<title>Stripping</title> <title>Stripping</title>
@ -90,24 +89,22 @@ umount $LFS/{sys,proc,run}</userinput></screen>
symbols.</para> symbols.</para>
<para>Strip off debugging symbols from binaries:</para> <para>Strip off debugging symbols from binaries:</para>
<screen arch="default" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib/* <!-- arch="default" ml_32 ml_x32 ml_all -->
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/*
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> <screen role="nodump"><userinput>cd $LFS/tools/$LFS_TGT
<screen arch="ml_32" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib{,32}/* bin/strip --strip-unneeded $LFS/usr/lib/*</userinput><userinput arch="ml_32">
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/* bin/strip --strip-unneeded $LFS/usr/lib32/*</userinput><userinput arch="ml_x32">
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> bin/strip --strip-unneeded $LFS/usr/libx32/*</userinput><userinput arch="ml_all">
<screen arch="ml_x32" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib{,x32}/* bin/strip --strip-unneeded $LFS/usr/lib{,x}32/*</userinput><userinput>
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/* bin/strip --strip-unneeded $LFS/usr/{,s}bin/*
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> bin/strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<screen arch="ml_all" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib{,{,x}32}/*
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/* <screen arch="ml_32" role="nodump"><userinput></userinput></screen>
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<para>These commands will skip a number of files reporting that it does not <para>These commands will skip a number of files reporting that it does not
recognize their file format. Most of these are scripts instead of binaries. recognize their file format. Most of these are scripts instead of binaries.
<!--Note that we use the <command>strip</command> program built in </para>
<quote>Binutils pass 2</quote>, since it is the one that knows how to strip
our cross-compiled programs.--></para>
<para>At this point, you should have at least 5 GB of free space on the <para>At this point, you should have at least 5 GB of free space on the
chroot partition that can be used to build and install Glibc and GCC in chroot partition that can be used to build and install Glibc and GCC in
@ -137,14 +134,19 @@ $LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<systemitem class="username">root</systemitem>. <systemitem class="username">root</systemitem>.
</para> </para>
<para>Before we make a backup, unmount the virtual file systems:</para>
<screen role="nodump"><userinput>umount $LFS/dev{/pts,}
umount $LFS/{sys,proc,run}</userinput></screen>
<para> <para>
Create the backup archive by running the following command: Create the backup archive by running the following command:
</para> </para>
<screen role="nodump" revision="sysv"><userinput>cd $LFS &amp;&amp; <screen role="nodump" revision="sysv"><userinput>cd $LFS
tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen> tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen>
<screen role="nodump" revision="systemd"><userinput>cd $LFS &amp;&amp; <screen role="nodump" revision="systemd"><userinput>cd $LFS
tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen> tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen>
<para> <para>
@ -170,12 +172,18 @@ tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen>
<!-- Make the following look different so users don't blindly run the <!-- Make the following look different so users don't blindly run the
restore when they don't need to. --> restore when they don't need to. -->
<screen role="nodump" revision="sysv"><computeroutput>cd $LFS &amp;&amp; <warning><para>The following commands are extremly dangerous. If
rm -rf ./* &amp;&amp; you run <command>rm -rf ./*</command> as the root user and you
do not change to the $LFS directory or the <envar>LFS</envar>
environment variable is not set for the root user, it will destroy
your entire host system. YOU ARE WARNED.</para></warning>
<screen role="nodump" revision="sysv"><computeroutput>cd $LFS
rm -rf ./*
tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen> tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen>
<screen role="nodump" revision="systemd"><computeroutput>cd $LFS &amp;&amp; <screen role="nodump" revision="systemd"><computeroutput>cd $LFS
rm -rf ./* &amp;&amp; rm -rf ./*
tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen> tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
<para> <para>
@ -185,8 +193,8 @@ tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
<important> <important>
<para> <para>
If you left the chroot environment either to strip off debug If you left the chroot environment
symbols, create a backup, or restart building using a restore, to create a backup or restart building using a restore,
remember to check that the virtual filesystems are still remember to check that the virtual filesystems are still
mounted (<command>findmnt | grep $LFS</command>). mounted (<command>findmnt | grep $LFS</command>).
If they are not mounted, remount them now as If they are not mounted, remount them now as

View File

@ -1096,7 +1096,7 @@ readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
<varlistentry id="libutil"> <varlistentry id="libutil">
<term><filename class="libraryfile">libutil</filename></term> <term><filename class="libraryfile">libutil</filename></term>
<listitem> <listitem>
<para>>Dummy library containing no functions. Previously contained <para>Dummy library containing no functions. Previously contained
code for <quote>standard</quote> functions used in code for <quote>standard</quote> functions used in
many different Unix utilities. These functions are now in many different Unix utilities. These functions are now in
<filename class="libraryfile">libc</filename></para> <filename class="libraryfile">libc</filename></para>

View File

@ -40,15 +40,19 @@
Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> for the Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> for the
rationale to use the <command>install</command> command here.</para> rationale to use the <command>install</command> command here.</para>
<note><para>The linux loader's name is ld-linux-x86-64.so.2 on 64-bit systems
and ld-linux.so.2 on 32-bit systems. The contruct below selects the
correct name for the current architecture.</para></note>
<!-- also of interest are libgfortan, libgo, libgomp, and libobjc from GCC --> <!-- also of interest are libgfortan, libgo, libgomp, and libobjc from GCC -->
<!--<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"--> <!--<screen><userinput>save_lib="ld-2.25.so libc-2.25.so libpthread-2.25.so libthread_db-1.0.so"-->
<screen><userinput>save_usrlib="ld-linux-x86-64.so.2 <screen><userinput>save_usrlib="$(cd /usr/lib; ls ld_linux*)
libc.so.6 libc.so.6
libpthread.so.6 libthread_db.so.1
libthread_db.so
libquadmath.so.&libquadmath-version; libquadmath.so.&libquadmath-version;
libstdc++.so.6 libstdc++.so.&libstdcpp-version;
libitm.so.&libitm-version; libitm.so.&libitm-version;
libatomic.so.&libatomic-version;" libatomic.so.&libatomic-version;"
@ -83,13 +87,12 @@ for LIB in $save_usrlib; do
done</userinput><userinput> done</userinput><userinput>
online_usrbin="bash find strip" online_usrbin="bash find strip"
online_usrlib="libbfd.so online_usrlib="libbfd-&binutils-version;.so
libdl.so.2 libhistory.so.&readline-version;
libhistory.so libncursesw.so.&ncurses-version;
libncursesw.so
libm.so.6 libm.so.6
libreadline.so libreadline.so.&readline-version;
libz.so libz.so.&zlib-version;
$(cd /usr/lib; find libnss*.so* -type f)" $(cd /usr/lib; find libnss*.so* -type f)"
for BIN in $online_usrbin; do for BIN in $online_usrbin; do