Changeset b157558
- Timestamp:
- 02/22/2004 10:32:27 PM (20 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 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, 6.0, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, v5_1, v5_1_1, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- f89de33
- Parents:
- cd0c92d6
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter01/changelog.xml
rcd0c92d6 rb157558 3 3 <?dbhtml filename="changelog.html" dir="chapter01"?> 4 4 5 <para>&version; - &releasedate;</para> 5 <para>This is version &version; of the Linux From Scratch book, dated 6 &releasedate;. If this book is more than two months old, a newer and better 7 version is probably already available. To find out, please check one of the 8 mirrors via <ulink url="&lfs-root;"/>.</para> 9 10 <para>Below is a list of changes made since the previous release of the book, 11 first a summary, then a detailed log.</para> 6 12 7 13 <itemizedlist> 14 15 <listitem><para>Upgraded to:</para> 16 <itemizedlist> 17 <listitem><para>less-382</para></listitem> 18 <listitem><para>man-pages-1.66</para></listitem> 19 <listitem><para>ncurses-5.4</para></listitem> 20 </itemizedlist></listitem> 21 22 <listitem><para>February 22nd, 2004 [alex]: Moved the stripping of the final 23 system from chapter 9 to the end of chapter 6.</para></listitem> 8 24 9 25 <listitem><para>February 22nd, 2004 [alex]: Chapter 6 - Coreutils and … … 14 30 command.</para></listitem> 15 31 16 <listitem><para>February 14th, 2004 [jeremy]: Chapter 6 - Upgraded Less17 to382.</para></listitem>32 <listitem><para>February 14th, 2004 [jeremy]: Chapter 6 - Upgraded to 33 Less-382.</para></listitem> 18 34 19 <listitem><para>February 14th, 2004 [jeremy]: Chapters 5 & 6 - Upgraded20 ncurses to version 5.4, and removed references toetip patch.</para></listitem>35 <listitem><para>February 14th, 2004 [jeremy]: Chapters 5 + 6 - Upgraded to 36 Ncurses-5.4, and removed references to the etip patch.</para></listitem> 21 37 22 38 <listitem><para>February 12th, 2004 [jeremy]: Chapter 6 - Removed explicit … … 28 44 29 45 <listitem><para>February 8th, 2004 [matt]: Chapter 6 - Updated to 30 man-pages-1.66.</para></listitem>46 Man-pages-1.66.</para></listitem> 31 47 32 48 <listitem><para>February 7th, 2004 [alex]: Chapter 1 - Moved the Conventions -
chapter05/chapter05.xml
rcd0c92d6 rb157558 574 574 <?dbhtml filename="stripping.html" dir="chapter05"?> 575 575 576 <para>The steps in this section are optional . If your LFS partition is rather577 small, you will be glad to learn that you can throw awaysome unnecessary578 things. The executables and libraries you have built so far contain about 130 MB579 of unneeded debugging symbols. Remove those symbols like this:</para>580 581 <screen><userinput>strip --strip- unneeded /tools/{,s}bin/*582 strip --strip- debug /tools/lib/*</userinput></screen>583 584 <para>The first of the above commands will skip some twenty files, reporting576 <para>The steps in this section are optional, but if your LFS partition is 577 rather small, you will be glad to learn that you can remove some unnecessary 578 things. The executables and libraries you have built so far contain about 130 579 MB of unneeded debugging symbols. Remove those symbols with:</para> 580 581 <screen><userinput>strip --strip-debug /tools/lib/* 582 strip --strip-unneeded /tools/{,s}bin/*</userinput></screen> 583 584 <para>The last of the above commands will skip some twenty files, reporting 585 585 that it doesn't recognize their file format. Most of them are scripts instead 586 586 of binaries.</para> -
chapter06/chapter06.xml
rcd0c92d6 rb157558 503 503 504 504 505 <sect1 id="ch-system-aboutdebug"> 506 <title>About debugging symbols</title> 507 <?dbhtml filename="aboutdebug.html" dir="chapter06"?> 508 509 <para>Most programs and libraries are, by default, compiled with debugging 510 symbols included (with <command>gcc</command>'s <emphasis>-g</emphasis> 511 option). This means that, when debugging a program or library that was compiled 512 with debugging information included, the debugger can give you not only memory 513 addresses but also the names of the routines and variables.</para> 514 515 <para>The inclusion of these debugging symbols, however, enlarges a program or 516 library significantly. To get an idea of the amount of space these symbols 517 occupy, have a look at the following:</para> 518 519 <itemizedlist> 520 521 <listitem><para>a bash binary 522 with debugging symbols: 1200 KB</para></listitem> 523 524 <listitem><para>a bash binary 525 without debugging symbols: 480 KB</para></listitem> 526 527 <listitem><para>Glibc and GCC files (/lib and /usr/lib) 528 with debugging symbols: 87 MB</para></listitem> 529 530 <listitem><para>Glibc and GCC files 531 without debugging symbols: 16 MB</para></listitem> 532 533 </itemizedlist> 534 535 <para>Sizes may vary somewhat, depending on which compiler was used and which C 536 library, but when comparing programs with and without debugging symbols the 537 difference will generally be a factor between 2 and 5.</para> 538 539 <para>As most people will probably never use a debugger on their system 540 software, a lot of disk space can be regained by removing these symbols. For 541 your convenience, the next section shows how to strip all debugging symbols 542 from all programs and libraries. Information on other ways of optimizing your 543 system can be found in the hint at <ulink 544 url="&hints-root;optimization.txt"/>.</para> 545 546 </sect1> 547 548 549 <sect1 id="ch-system-strippingagain"> 550 <title>Stripping again</title> 551 <?dbhtml filename="strippingagain.html" dir="chapter06"?> 552 553 <para>If you are not a programmer and don't plan to do any debugging on your 554 system software, you can shrink your system by about 200 MB by removing the 555 debugging symbols from binaries and libraries. This causes no inconvenience 556 other than not being able to debug the software fully any more.</para> 557 558 <para>Most people who use the command mentioned below don't experience any 559 problems. But it is easy to make a typo and render your new system unusable, so 560 before running the strip command it is probably a good idea to make a backup of 561 the current situation.</para> 562 563 <para>If you are going to perform the stripping, special care is needed to 564 ensure you're not running any of the binaries that are about to be stripped. 565 If you're not sure whether you entered chroot with the command given in 566 <xref linkend="ch-system-chroot"/>, then now exit from chroot and reenter it 567 with the following commands:</para> 568 569 <screen><userinput>logout; chroot $LFS /tools/bin/env -i \ 570 HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ 571 PATH=/bin:/usr/bin:/sbin:/usr/sbin \ 572 /tools/bin/bash --login</userinput></screen> 573 574 <para>Now you can safely strip the binaries and libraries:</para> 575 576 <screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ 577 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen> 578 579 <para>A large number of files will be reported as having their file format not 580 recognized. These warnings can be safely ignored, they just mean that those 581 files are scripts instead of binaries, no harm is done.</para> 582 583 <para>If you are really tight on disk space, you may want to use 584 <emphasis>--strip-all</emphasis> on the binaries in 585 <filename>/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do 586 <emphasis>not</emphasis> use this option on libraries: they would be 587 destroyed.</para> 588 589 </sect1> 590 591 505 592 <sect1 id="ch-system-revisedchroot"> 506 593 <title>Revised chroot command</title> 507 594 <?dbhtml filename="revisedchroot.html" dir="chapter06"?> 508 595 509 <para>From now on when you exit the chroot environment and wish to re -enter596 <para>From now on when you exit the chroot environment and wish to reenter 510 597 it, you should run the following modified chroot command:</para> 511 598 … … 522 609 </sect1> 523 610 524 525 &c6-aboutdebug;526 527 611 </chapter> 528 612 -
chapter08/kernel.xml
rcd0c92d6 rb157558 75 75 <screen><userinput>make CC=/opt/gcc-2.95.3/bin/gcc modules_install</userinput></screen> 76 76 77 <para>If you have a lot of modules and very little space, you may want to 78 consider stripping and compressing the modules. For most people such compression 79 isn't worth the trouble, but if you're really pressed for space, then have a look at 80 <ulink url="http://www.linux-mips.org/archives/linux-mips/2002-04/msg00031.html"/>.</para> 81 77 82 <para>As nothing is complete without documentation, build the manual pages 78 83 that come with the kernel:</para> -
chapter09/theend.xml
rcd0c92d6 rb157558 6 6 been a long process, but we hope it was worth it. We wish you a lot of fun 7 7 with your new shiny custom built Linux system.</para> 8 9 <para>Now would be a good time to strip all debug symbols from10 the binaries on your LFS system. If you are not a programmer and don't plan11 on debugging your software, then you will be happy to know that you can12 reclaim a few tens of megs by removing debug symbols. This process causes13 no inconvenience other than not being able to debug the software fully14 anymore, which is not an issue if you don't know how to debug.</para>15 16 <para>Disclaimer: 98% of the people who use the command mentioned below don't17 experience any problems. But do make a backup of your LFS system before18 you run this command. There's a slight chance it may backfire on you and19 render your system unusable (mostly by destroying your kernel modules20 and dynamic & shared libraries). This is caused more often by typos21 than by a problem with the command used.</para>22 23 <para>Having said that, the --strip-debug option we use to strip is quite24 harmless under normal circumstances. It doesn't strip anything vital from25 the files. It also is quite safe to use --strip-all on regular programs26 (don't use that on libraries - they will be destroyed), but it's not as27 safe, and the space you gain is not all that much. But if you're tight on28 disk space every little bit helps, so decide for yourself. Please refer to29 the strip man page for other strip options you can use. The general idea30 is to not run strip on libraries (other than --strip-debug), just to be31 on the safe side.</para>32 33 <para>If you are planning to go ahead and perform the strip, special care is34 needed to ensure you're not running any binaries that are about to be stripped35 -- including the active bash shell. Therefore you'll need to exit the chroot36 environment and reenter it using a modified chroot command:</para>37 38 <screen><userinput>logout39 chroot $LFS /tools/bin/env -i \40 HOME=/root TERM=$TERM PS1='\u:\w\$ ' \41 PATH=/bin:/usr/bin:/sbin:/usr/sbin \42 /tools/bin/bash --login</userinput></screen>43 44 <para>Now run the following command:</para>45 46 <screen><userinput>/tools/bin/find /{,usr/,usr/local/}{bin,sbin,lib} -type f \47 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>48 49 <para>Quite a number of files will be reported as having their file format not50 recognized. Most of these are scripts instead of binaries. These warnings can51 be safely ignored.</para>52 8 53 9 <para>It may be a good idea to create an <filename>/etc/lfs-release</filename>
Note:
See TracChangeset
for help on using the changeset viewer.