chapter05.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <chapter id="chapter05">
  2. <title>Preparing the LFS system</title>
  3. <?dbhtml filename="chapter05.html" dir="chapter05"?>
  4. &c5-introduction;
  5. &c5-whystatic;
  6. &c5-creatingstage1dir;
  7. &c5-addinguser;
  8. &c5-settingenviron;
  9. &c5-binutils-pass1;
  10. &c5-gcc-pass1;
  11. &c5-kernelheaders;
  12. &c5-glibc;
  13. &c5-lockingglibc;
  14. &c5-tcl;
  15. &c5-expect;
  16. &c5-dejagnu;
  17. &c5-gcc-pass2;
  18. &c5-binutils-pass2;
  19. &c5-gawk;
  20. &c5-coreutils;
  21. &c5-bzip2;
  22. &c5-gzip;
  23. &c5-diffutils;
  24. &c5-findutils;
  25. &c5-make;
  26. &c5-grep;
  27. &c5-sed;
  28. &c5-gettext;
  29. &c5-ncurses;
  30. &c5-patch;
  31. &c5-tar;
  32. &c5-texinfo;
  33. &c5-bash;
  34. &c5-utillinux;
  35. &c5-perl;
  36. <sect1 id="ch05-stripping">
  37. <title>Stripping</title>
  38. <?dbhtml filename="stripping.html" dir="chapter05"?>
  39. <para>If your LFS partition is rather small, you will be glad to learn that you
  40. can throw away some unnecessary things. The executables and libraries you have
  41. built so far contain about 130 MB of unneeded debugging symbols. Remove those
  42. symbols like this:</para>
  43. <para><screen><userinput>strip --strip-unneeded /stage1/{,s}bin/*
  44. strip --strip-debug /stage1/lib/*</userinput></screen></para>
  45. <para>The first of the above commands will skip some twenty files, reporting
  46. that it doesn't recognize their file format. Most of them are scripts instead
  47. of binaries.</para>
  48. <para>Take care <emphasis>not</emphasis> to use
  49. <userinput>--strip-unneeded</userinput> on the libraries -- they would be
  50. destroyed and you would have to build Glibc all over again.</para>
  51. <para>To save another couple of megabytes, you can throw away the documentation
  52. and some of the bigger unneeded programs:</para>
  53. <para><screen><userinput>rm -r /stage1/share/{doc,info,man}
  54. rm /stage1/bin/{addr2line,gprof,nm,size,strings,strip}</userinput></screen></para>
  55. <para>You will now need to have at least 700 MB of free space on your LFS
  56. filesystem to be able to build and install Glibc in the next phase.</para>
  57. </sect1>
  58. </chapter>