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>
<screen><userinput>cat &gt; /etc/hosts &lt;&lt; EOF
"127.0.0.1 localhost $(hostname)"
127.0.0.1 localhost $(hostname)
::1 localhost
EOF</userinput></screen>

View File

@ -58,28 +58,27 @@
</para>
<para>
Leave the chroot environment and unmount the kernel virtual file
systems:
Now, if you are stripping installed files or making a backup,
leave the chroot environment:
</para>
<note>
<screen role="nodump"><userinput>exit</userinput></screen>
<important>
<para>All of the following instructions are executed by
<systemitem class="username">root</systemitem>. Take extra
care about the commands you're going to run as mistakes
here can modify your host system. Be aware that the
environment variable <envar>LFS</envar> is set for user
<systemitem class="username">lfs</systemitem> by default
but it might <emphasis>not</emphasis> be set for
environment variables <envar>LFS</envar> and <envar>LFS_TGT</envar>
are set for user <systemitem class="username">lfs</systemitem> by default
but may <emphasis>not</emphasis> be set for
<systemitem class="username">root</systemitem>. Whenever
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'/>.
</para>
</note>
</important>
<screen role="nodump"><userinput>exit
umount $LFS/dev{/pts,}
umount $LFS/{sys,proc,run}</userinput></screen>
<sect2>
<title>Stripping</title>
@ -90,24 +89,22 @@ umount $LFS/{sys,proc,run}</userinput></screen>
symbols.</para>
<para>Strip off debugging symbols from binaries:</para>
<screen arch="default" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib/*
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/*
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<screen arch="ml_32" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib{,32}/*
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/*
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<screen arch="ml_x32" role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib{,x32}/*
$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/*
$LFS_TGT-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/*
$LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<!-- arch="default" ml_32 ml_x32 ml_all -->
<screen role="nodump"><userinput>cd $LFS/tools/$LFS_TGT
bin/strip --strip-unneeded $LFS/usr/lib/*</userinput><userinput arch="ml_32">
bin/strip --strip-unneeded $LFS/usr/lib32/*</userinput><userinput arch="ml_x32">
bin/strip --strip-unneeded $LFS/usr/libx32/*</userinput><userinput arch="ml_all">
bin/strip --strip-unneeded $LFS/usr/lib{,x}32/*</userinput><userinput>
bin/strip --strip-unneeded $LFS/usr/{,s}bin/*
bin/strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<screen arch="ml_32" role="nodump"><userinput></userinput></screen>
<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.
<!--Note that we use the <command>strip</command> program built in
<quote>Binutils pass 2</quote>, since it is the one that knows how to strip
our cross-compiled programs.--></para>
</para>
<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
@ -137,14 +134,19 @@ $LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen>
<systemitem class="username">root</systemitem>.
</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>
Create the backup archive by running the following command:
</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>
<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>
<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
restore when they don't need to. -->
<screen role="nodump" revision="sysv"><computeroutput>cd $LFS &amp;&amp;
rm -rf ./* &amp;&amp;
<warning><para>The following commands are extremly dangerous. If
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>
<screen role="nodump" revision="systemd"><computeroutput>cd $LFS &amp;&amp;
rm -rf ./* &amp;&amp;
<screen role="nodump" revision="systemd"><computeroutput>cd $LFS
rm -rf ./*
tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
<para>
@ -185,8 +193,8 @@ tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen>
<important>
<para>
If you left the chroot environment either to strip off debug
symbols, create a backup, or restart building using a restore,
If you left the chroot environment
to create a backup or restart building using a restore,
remember to check that the virtual filesystems are still
mounted (<command>findmnt | grep $LFS</command>).
If they are not mounted, remount them now as

View File

@ -42,9 +42,9 @@
<para>Prepare Bash for compilation:</para>
<screen><userinput remap="configure">./configure --prefix=/usr \
<screen><userinput remap="configure">./configure --prefix=/usr \
--docdir=/usr/share/doc/bash-&bash-version; \
--without-bash-malloc \
--without-bash-malloc \
--with-installed-readline</userinput></screen>
<variablelist>

View File

@ -1096,7 +1096,7 @@ readelf -l a.out | grep '/ld-linux-x32'</userinput></screen>
<varlistentry id="libutil">
<term><filename class="libraryfile">libutil</filename></term>
<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
many different Unix utilities. These functions are now in
<filename class="libraryfile">libc</filename></para>

View File

@ -40,15 +40,19 @@
Read the related entry in <xref linkend="pkgmgmt-upgrade-issues"/> for the
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 -->
<!--<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
libpthread.so.6
libthread_db.so
libthread_db.so.1
libquadmath.so.&libquadmath-version;
libstdc++.so.6
libstdc++.so.&libstdcpp-version;
libitm.so.&libitm-version;
libatomic.so.&libatomic-version;"
@ -83,13 +87,12 @@ for LIB in $save_usrlib; do
done</userinput><userinput>
online_usrbin="bash find strip"
online_usrlib="libbfd.so
libdl.so.2
libhistory.so
libncursesw.so
libm.so.6
libreadline.so
libz.so
online_usrlib="libbfd-&binutils-version;.so
libhistory.so.&readline-version;
libncursesw.so.&ncurses-version;
libm.so.6
libreadline.so.&readline-version;
libz.so.&zlib-version;
$(cd /usr/lib; find libnss*.so* -type f)"
for BIN in $online_usrbin; do