Changeset c649743
- Timestamp:
- 08/04/2021 02:35:39 AM (3 years ago)
- Branches:
- 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, 12.2, 12.2-rc1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- d04ce15
- Parents:
- adcaf07e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/stripping.xml
radcaf07e rc649743 56 56 57 57 <para> 58 Leave the chroot environment and unmount the kernel virtual file59 systems:58 Now, if you are stripping installed files or making a backup, 59 leave the chroot environment: 60 60 </para> 61 61 62 <note> 62 <screen role="nodump"><userinput>exit</userinput></screen> 63 64 <important> 63 65 <para>All of the following instructions are executed by 64 66 <systemitem class="username">root</systemitem>. Take extra 65 67 care about the commands you're going to run as mistakes 66 68 here can modify your host system. Be aware that the 67 environment variable <envar>LFS</envar> is set for user68 <systemitem class="username">lfs</systemitem> by default69 but it might<emphasis>not</emphasis> be set for69 environment variables <envar>LFS</envar> and <envar>LFS_TGT</envar> 70 are set for user <systemitem class="username">lfs</systemitem> by default 71 but may <emphasis>not</emphasis> be set for 70 72 <systemitem class="username">root</systemitem>. Whenever 71 73 commands are to be executed by <systemitem class="username">root</systemitem>, 72 make sure you have set <envar>LFS</envar> a ccordingly.74 make sure you have set <envar>LFS</envar> and <envar>LFS_TGT</envar> accordingly. 73 75 This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>. 74 76 </para> 75 </ note>77 </important> 76 78 77 <screen role="nodump"><userinput>exit78 umount $LFS/dev{/pts,}79 umount $LFS/{sys,proc,run}</userinput></screen>80 79 81 80 <sect2> … … 88 87 89 88 <para>Strip off debugging symbols from binaries:</para> 90 <screen role="nodump"><userinput>$LFS_TGT-strip --strip-unneeded $LFS/usr/lib/* 91 $LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/* 92 $LFS_TGT-strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> 89 90 <screen role="nodump"><userinput>cd $LFS/tools/$LFS_TGT 91 bin/strip --strip-unneeded $LFS/usr/lib/* 92 bin/strip --strip-unneeded $LFS/usr/{,s}bin/* 93 bin/strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> 93 94 94 95 <para>These commands will skip a number of files reporting that it does not 95 96 recognize their file format. Most of these are scripts instead of binaries. 96 <!--Note that we use the <command>strip</command> program built in 97 <quote>Binutils pass 2</quote>, since it is the one that knows how to strip 98 our cross-compiled programs.--></para> 97 </para> 99 98 100 99 <para>At this point, you should have at least 5 GB of free space on the … … 126 125 </para> 127 126 127 <para>Before we make a backup, unmount the virtual file systems:</para> 128 129 <screen role="nodump"><userinput>umount $LFS/dev{/pts,} 130 umount $LFS/{sys,proc,run}</userinput></screen> 131 128 132 <para> 129 133 Create the backup archive by running the following command: 130 134 </para> 131 135 132 <screen role="nodump" revision="sysv"><userinput>cd $LFS &&136 <screen role="nodump" revision="sysv"><userinput>cd $LFS 133 137 tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen> 134 138 135 <screen role="nodump" revision="systemd"><userinput>cd $LFS &&139 <screen role="nodump" revision="systemd"><userinput>cd $LFS 136 140 tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen> 137 141 … … 159 163 restore when they don't need to. --> 160 164 161 <screen role="nodump" revision="sysv"><computeroutput>cd $LFS &&162 rm -rf ./* &&165 <screen role="nodump" revision="sysv"><computeroutput>cd $LFS 166 rm -rf ./* 163 167 tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen> 164 168 165 <screen role="nodump" revision="systemd"><computeroutput>cd $LFS &&166 rm -rf ./* &&169 <screen role="nodump" revision="systemd"><computeroutput>cd $LFS 170 rm -rf ./* 167 171 tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen> 168 172 … … 174 178 <important> 175 179 <para> 176 If you left the chroot environment either to strip off debug177 symbols, create a backup,or restart building using a restore,180 If you left the chroot environment 181 to create a backup or restart building using a restore, 178 182 remember to check that the virtual filesystems are still 179 183 mounted (<command>findmnt | grep $LFS</command>).
Note:
See TracChangeset
for help on using the changeset viewer.