
                            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
     _________________________________________________________________
   
    mini HOWTO ṩܼС Linux װռķ, رԱʼ
   Եʹ.
     _________________________________________________________________
   
1. 

2. 

3. 

     * 3.1 Ƴԭʼ
     * 3.2 ɾӦóʽ
     * 3.3 ѹեλ
     * 3.4  upx ѹִе
     * 3.5  Gzip ѹ
       
4. һʵ

5. ܽ

     * 5.1 Ȩ(˶β)
     * 5.2 (˶β)
     _________________________________________________________________
   
1. 

   һ̨ʼ͵, ԤȰװõ Windows ֮,  Linux Ҳ
   װȥ. Ұ Windows ʹõķָС 500 MB,  240 MB Ŀ
   Ը Linux ʹ. ұʹһЩ, ٿռ, ܰѻ
    RedHat 4.1 ϵͳװȥ.
   
   㲻ҪĿռ, ҲļҵͷӲռķ. 
   Ҫ˵ǰ: κⷢ, 벻Ҫ!! ҽʹһЩ
   Σյķʽ, Ȼõĺܺ. Ѿ!!
   
2. 

   Ҫ:
   
     * һ Linux ϵͳ (κΰ汾Ӧö);
     * һ gzip ѹ߳ʽ,  bzip2 ѹʽ. 
       [3]ftp://sunsite.unc.edu:/pub/Linux/utils/compress ҵЩ;
       bzip2 ѹʱ gzip Ҫ, ٶȽҪ϶ļ.
     * upx ִеѹʽ, ҳ
       [4]http://cdata.tvnet.hu/~ml/upx.html 
       [5]http://wildsau.idv.uni-linz.ac.at/mfx/upx.html;
     * zlibc ׼, 
       [6]ftp://sunsite.unc.edu:/pub/Linux/libs/compression ҵ. 
       zlibc-X.X.tar.gz,  X.X 汾.
       
   һЩִеѹ,  gzexe ();  upx ֮ǰ
    tcx; ⻹ tzx, ϱ tcx ; ҵϵͳŪ, ȻҲ
   ȷǷ˴. û upx, Ϊ, Ч, ʹ
   .
   
   һ޲ʹ Stacker ȳʽѹӲ, Ƕ
   ϵдȶԲǺܺ. Ϊ˰ȫ, ñ.
   
3. 

3.1 Ƴԭʼ

   ĵԭʼռȥԼ 20 MB Ŀռ, ӦûƳ. Ƴ֮ǰ,
   Ƚһ̬רõĺĵ.
   
     ѺԭʼƳ, ȷĻѾ趨. , 
   Ҫʽʱ, ҲҪĵ #include .
   
   ҪƳԭʼ, Ҫ Ƴ include/linux ·, 
   ᲻̨ϱʽ.
   
3.2 ɾӦóʽ

   ȾЩʽ  Ҫ. ЩǶŵ: 㲻û
    emacs ? ҲԸ jed.
   
   ЩʽӦҪ, һЩһԵҪ:
   
     * gcc Ƿǳ׼. ȴǱκԭûеӦóʽҪ
       . Ȼ, ׫д C  Fortran ʽʱ, е f2c  g77
       ҲǱ. ״ǷҪƳ. ı lcc
       Ҳ, ֻû gcc ߽, ܻ.
     * X11 ˵Ĵ, һ. û, 
       : ֻ±Ҫ X ŷ, ʹһ򵥵Ӵ, ֻ
       xterm, Ҫװ 100 dpi ͵ȵ.
     * TeX ׼Ҳ൱Ĵ.  LaTeX ʹõ TeX ʡºܶ
       Ŀռ; ʹ dvitty  dvivga, Է X11 µԤ
       ʽ,  xdvi  ghostview. ȥЩ X11 , Ҳܼ X11 
       Ŀռ.
     * ϷǲҪ
       
3.3 ѹեλ

   ǿԿʼСλռĿռ. Ƚᵽ /usr/bin, ʹ
   ָ
   
machine:/usr/bin# strip *

   ὫǶ춶λеķƳ.  /usr/X11R6/bin/ 
   ִеĿ¼ִָ. ( TeX  gcc ִе)  
   Ҫ  /sbin, /bin,  /usr/sbin/ ʹָ, Ӱϵͳ.
   
3.4  upx ѹִе

   Ȱװ upx Ķ˵ļ. Ȼл /usr/bin, ִ upx *;
   еִеѹ, 趨 suid ĵҲᱻѹ (tcx ѹ
   ֵ). ͬǰһ, Ŀ¼ִָ.
   
   㰲װµĳʽ׼, ǵðѹ.
   
3.5  Gzip ѹ

   һѵ޷һѹ.  /usr/doc/ ʼ. ƶ·
   , ʹָ:
   
machine:/usr/doc# find . -type f -exec gzip -9 {} \; 2> /dev/null

   㰲װµĳʽ׼, ǵð˵ѹ.
   
   ڰ TeX ˵ļĿ¼ظѹָ, ҵϵͳ, Щ
   ļǴ /usr/lib/texmf/texmf/doc/. ϣĻ, Ҳ԰Щ
   ֱɱ.
   
   װ zlibc, . ϵͳƵĻ, ĳΪ
   ̬ libc ж. ù, ҵһ uncompress.o
   ĵ, Ҫ. Ƶ /usr/local/lib/ , Ұ
   мӵ /etc/profile .
   
export LD_ELF_PRELOAD=/usr/local/lib/uncompress.o

   ڳļ gzip ѹ, ϵҲԱѹ. صĳʽ
   ӦûǿԴȡϵ. ڸֳʽ.
   
4. һʵ

   ҵĻķĽ,  df ı, ڿʼǰ, 
    398,798  1024 λԪΪλ.
   
     * ûƳԭʼıͷ.
     * ҰһЩʽϷװ,  X11, X11 ʽչ׼, C
        Fortran չ׼, Tcl/Tl, ·, һЩ׼ʽ. df ر
        244,668 .
     *  /usr/bin, /usr/X11R6/bin, /usr/lib/texmf/bin/i586-linux, Լ
       /usr/lib/gcc-lib/i386-linux/2.7.2.1 ʹ upx, df ر
       226,270 .
     * Ұ /usr/doc  /usr/lib/texmf/texmf/doc ļѹ, df 
        198,745 .
       
   ܽ, һʼõ 398,798 , ֻ 198,745 .
   뿴 200,000 ʹ¿жٶ!  bzip2
    gzip Ļ, һʡ¸Ŀռ.
   
   ƽ, һʼװʱֻװҪĳʽ, ѹִе˵, 
   ʡ 20 MB Ŀռ, ԱʼǵԶ, Ǹ.
   
5. ܽ

5.1 Ȩ(˶β)

   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 (˶β)

   ``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.4483/REMOVE_MEguido@ibogeo.df.unibo.it
