
                            Saving Space mini-HOWTO
                                       
@: Guido Gonzato, [1]mailto:guido@ibogeo.df.unibo.it
Ķ: Jing-Jong SHYUE, [2]mailto:shyue@sonoma.com.tw

   v1.0.1, 7 April 1999
     _________________________________________________________________
   
   o mini HOWTO Ѻɥip Linux w˩һݪŶV, SOwﵧO
   qϥΪ.
     _________________________________________________________________
   
1. ²

2. nݨD

3. {

     * 3.1 ֤߭l
     * 3.2 Rε{
     * 3.3 ^Gi
     * 3.4 Q upx Y
     * 3.5 LF Gzip _
       
4. @ӹ

5. `

     * 5.1 vn(qĶ)
     * 5.2 Kdn(qĶ)
     _________________________________________________________________
   
1. ²

   ڶRF@xOq, ӰFww˦n Windows ~, ڷQ Linux ]
   ˤWh. ڧ Windows ҨϥΪΰϴp 500 MB, pڦ 240 MB 
   iH Linux ϥ. ڥϥΤ@ǧޥ, þq֪ŶݨD, ~
    RedHat 4.1 \tΦw˶ih.
   
   NAݭnhŶ, A]bo󤤧wЪŶk. 
   ڭnbeO: pGDo, Фnǧ!! ڱNϥΤ@ǥW
   MI覡, MڥΪܦn. ڤwgĵiLAF!!
   
2. nݨD

   An:
   
     * @ӧiB@ Linux t (󪩥ӳiH);
     * @몺 gzip Yu{, άO bzip2 Y{. AiHb
       [3]ftp://sunsite.unc.edu:/pub/Linux/utils/compress oǤu;
       bzip2 Yv gzip nn, t׸CBݭnhO.
     * upx Y{, Lb
       [4]http://cdata.tvnet.hu/~ml/upx.html Ϊ
       [5]http://wildsau.idv.uni-linz.ac.at/mfx/upx.html;
     * zlibc M, AiHb
       [6]ftp://sunsite.unc.edu:/pub/Linux/libs/compression . ɦWO
       zlibc-X.X.tar.gz,  X.X Ǹ.
       
   ٦@ǨLY, Ҧp gzexe (Oγo); Pb upx e̦n
    tcx; t~٦ tzx, zפW tcx n; LڪtΧ˶äF, Mڤ
   TwڬO_ǤF~. A̦n٬O upx, ]LiH, Ĳv, ӥBe
   .
   
   t~@Ӯ֤߭׸AiHϥΦp Stacker {Yw, O
   ƪgJíwʨäOܦn. Fw_, ̦nO.
   
3. {

3.1 ֤߭l

   ֤ߪlɷ|h 20 MB Ŷ, ҥHAӷ|QL. bAe,
   ĳAإߤ@ӰwAպAMΪ֤.
   
    ĳ ֤߭lɲ, DATwAwg]w. ~, A
   nsĶ{, A]ݭn֤ߪ #include .
   
   pGAMwn֤߭l, n  include/linux oӸ|, DA
   HᤣboxWsĶ{.
   
3.2 Rε{

   Mwǵ{OA u ݭn. ǫhOhl: ҦpAıoAS
    emacs ? A]iH jed.
   
   ǵ{ӭnOdOѧAMw, UO@Ǥ@ʪnI:
   
     * gcc OD`jM. oOsĶ֤߻PSε{һݭn
       . M, pGAۦ漶g C άO Fortran {, 䤤 f2c  g77
       ]O. ̾ڧApӨMwO_nL. ӨLsĶp lcc
       ]٤, uOS gcc , ڷQAi|dۥL.
     * X11 O~Hj, LO@n. pGAMwSL, ܤ֧@U
       Ʊ: udUn X A, ϥΤ@²檺޲z, udU
       xterm, nw 100 dpi r.
     * TeX PHM]۷j.  LaTeX Өϥγª TeX ٤Uܦh
       Ŷ; pGAϥ dvitty  dvivga, hAiH X11 Uw{
       , Ҧp xdvi P ghostview. ho X11 n, ] X11 һ
       Ŷ.
     * CnOݭn
       
3.3 ^Gi

   ڭ̥iH}lpGiɩҦŶ. Nɮ׷h /usr/bin, èϥγo
   O
   
machine:/usr/bin# strip *

   o|NҦOJGiɤŸ. AiHb /usr/X11R6/bin/ PL]
   tɪؿUoӫO. (OѤF TeX P gcc ) O 
   n b /sbin, /bin,  /usr/sbin/ UϥγoӫO, HKvTt.
   
3.4 Q upx Y

   w upx þ\Ū. M /usr/bin, åB upx *;
   L|ҦY, ]A]w suid ɮפ]|QY (tcx |o
   ɮ). pPe@, bҦؿUoӫO.
   
   AwˤFs{M, OoL_.
   
3.5 LF Gzip _

   L٦@ɮ׵Lk@_. ڭ̥ /usr/doc/ }l. ʨoӸ
   |, ϥΤUO:
   
machine:/usr/doc# find . -type f -exec gzip -9 {} \; 2> /dev/null

   AwˤFs{M, OoL_.
   
   ۦb]t TeX 󪺥ؿUƤWYO, ڪtΦӨ, o
   Osb /usr/lib/texmf/texmf/doc/. pGAƱ檺, ]iHoǪF
   誽.
   
   ۦw zlibc, ýsĶL. pGAtΩMڬۦ, sĶ{Ƿ|]
   RAs libc ӳQ_. κޥL, A|@ӥs uncompress.o
   ɮ, oNOڭ̭nF. oɮײ /usr/local/lib/ U, åBU
   o[ /etc/profile .
   
export LD_ELF_PRELOAD=/usr/local/lib/uncompress.o

   {bFɥiH gzip Y~, Lɤ]iHQY. {
   ٬OiHsoӸ. zפWoӤkiHΦbUص{W.
   
4. @ӹ

   oOڦbڪWΤWkG, ھ df i, b}lΫe, 
   ΤF 398,798 ӥH 1024 줸լ쪺϶.
   
     * ڨS֤߭lɻP֤߼Y.
     * ڧ@ǵ{PCϦw˱, گdUF X11, X11 {oiM, C
       P Fortran oiM, Tcl/Tl, u, ML@Ǽзǵ{. df ^
       ڥΤF 244,668 Ӱ϶.
     * ڦb /usr/bin, /usr/X11R6/bin, /usr/lib/texmf/bin/i586-linux, H
       /usr/lib/gcc-lib/i386-linux/2.7.2.1 Uϥ upx, df ^ڥΤF
       226,270 Ӱ϶.
     * ڧ /usr/doc P /usr/lib/texmf/texmf/doc UY_, df ^
       ڥΤF 198,745 Ӱ϶.
       
   `Ө, ڤ@}lαF 398,798 Ӱ϶, ̫ڥuΤF 198,745 Ӱ϶.
   QQݧAb֩ 200,000 Ӱ϶ϥζqUiHh֪F! pGڥ bzip2
   ӤO gzip , ٯ٤UhŶ.
   
   Ө, pG@}lwˮɧAuw˥n{, YɻP, i
   ` 20 MB Ŷ, ﵧOqӨ, oOӱϩR.
   
5. `

5.1 vn(qĶ)

   Unless otherwise stated, Linux HOWTO documents are copyrighted by
   their respective authors. Linux HOWTO documents may be reproduced and
   distributed in whole or in part, in any medium physical or electronic,
   as long as this copyright notice is retained on all copies. Commercial
   redistribution is allowed and encouraged; however, the author would
   like to be notified of any such distributions.
   
   All translations, derivative works, or aggregate works incorporating
   any Linux HOWTO documents must be covered under this copyright notice.
   That is, you may not produce a derivative work from a HOWTO and impose
   additional restrictions on its distribution. Exceptions to these rules
   may be granted under certain conditions; please contact the Linux
   HOWTO coordinator at the address given below.
   
   In short, we wish to promote dissemination of this information through
   as many channels as possible. However, we do wish to retain copyright
   on the HOWTO documents, and would like to be notified of any plans to
   redistribute the HOWTOs.
   
   If you have questions, please contact Tim Bynum, the Linux HOWTO
   coordinator, at tjbinum@sunsite.unc.edu via email.
   
5.2 Kdn(qĶ)

   ``Saving Space mini-HOWTO''was written by Guido Gonzato,
   [7]REMOVE_MEguido@ibogeo.df.unibo.it.
   
   This document is provided ``as is''. I put great effort into writing
   it as accurately as I could, but you use the information contained in
   it at your own risk. In no event shall I be liable for any damages
   resulting from the use of this work.
   
   Feedback is welcome. For any requests, suggestions, flames, etc., feel
   free to contact me.
   
   Enjoy Linux and life,
   
   Guido =8-)

References

   1. mailto:guido@ibogeo.df.unibo.it
   2. mailto:shyue@sonoma.com.tw
   3. ftp://sunsite.unc.edu/pub/Linux/utils/compress
   4. http://cdata.tvnet.hu/~ml/upx.html
   5. http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
   6. ftp://sunsite.unc.edu/pub/Linux/libs/compression
   7. file://localhost/tmp/zh-sgmltools.3594/REMOVE_MEguido@ibogeo.df.unibo.it
