· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Linuxdoc Sgml/Saving-Space

Saving Space mini-HOWTO

Saving Space mini-HOWTO

By Guido Gonzato, guido@ibogeo.df.unibo.it

v1.0.1, 7 April 1999 ¿ªÀÚ : ÀÌÈ£¿¬ guru2k@kldp.org
ÀÌ ¹Ì´Ï ÇÏ¿ìÅõ´Â ´ç½Å¿¡°Ô ´ç½ÅÀÇ ¸®´ª½º°¡ ¼³Ä¡µÈ °÷¿¡ ÀÌ¿ëÇÒ ¼ö ÀÖ´Â °ø°£À» ½ºÄÉÁÙÇÏ´Â °ÍÀ» Áö½ÃÇÒ °ÍÀÌ´Ù. ƯÈ÷ ³ëÆ®ºÏ »ç¿ëÀÚ¸¦ ±âÁØÀ¸·Î ÀÛ¼º ÇÏ¿´´Ù.

1. ¼Ò°³

³ª´Â ¸®´ª½º¿Í À©µµ¿ì 95°¡ ¼³Ä¡µÈ ³ëÆ®ºÏ Çϳª¸¦ °¡Áö°í ÀÖ´Ù. ³ª´Â À©µµ¿ì ÆÄƼ¼Ç¿¡ 500¸Þ°¡¸¦, ¸®´ª½º¿¡ 240¸Þ°¡¸¦ ÇÒ´çÇß´Ù. ÈÄÀÚ´Â ÀÛ°Ô º¸ÀÏ °ÍÀÌ´Ù. °Å±â¿¡ ·¹µåÇÞ 4.1 ±â¹ÝÀÇ ¸®´ª½º ½Ã½ºÅÛÀ» ¿Ïº®È÷ ¾Ë¸Â°Ô ¼³Ä¡Çß°í ¸î¸î ÀÌ¿ëÇÒ ¼ö ÀÖ´Â ¸¹Àº °ø°£ÀÌ ÀÌ»óÇÏ°Ôµµ ³²¾Ò´Ù.

´ç½ÅÀÌ °ø°£ÀÌ ÇÊ¿äÇÏ´Ù¸é, ´ç½ÅÀÌ ´ÙÀ½ÀÇ ºÎºÐ¿¡¼­ ãÀ» °ÍÀº ÇÏµå µð½ºÅ©ÀÇ »ó´çÇÑ ¾çÀÇ °ø°£À» ºñ¾îÀÖ°Ô ÇÒ °ÍÀÌ´Ù. ¿ÀÁ÷ ³ª´Â ´ç½Å¿¡°Ô ÁÖÀǸ¦ ÁØ´Ù: ¸¸¾à ¾î¶² °ÍÀÌ À߸øµÇ¾ú´Ù¸é ³ª¿¡°Ô Ã¥ÀÓÀ» µ¹¸®Áö ¸¶¶ó! ¿ì¸®´Â ³ª¸¦ À§ÇØ ÁÁÀº ÀÛ¾÷À» ÇÏ´Â 2°³ÀÇ ÇÁ·Î±×·¥À» ¾µ °ÍÀÌ´Ù. ±×·¯³ª º»ÁúÀûÀ¸·Î À§ÇèÇÏ´Ù. ´ç½ÅÀº °æ°í¸¦ ¹Þ¾Ò´Ù.

2. ÇÊ¿äÇÑ ¼ÒÇÁÆ®¿þ¾î

ÇÊ¿äÇÑ °Íµé:

¿ÏÀüÇÑ ¸®´ª½º ½Ã½ºÅÛ ÀÛ¾÷Çϱâ (¾î¶² ¹öÀüÀÌ¶óµµ ÁÁ´Ù);

sunsite.unc.edu:/pub/Linux/utils/compress ¿¡¼­ ãÀ» ¼ö ÀÖ´Â º¸ÅëÀÇ gzip ¾ÐÃà À¯Æ¿¸®Æ¼ ȤÀº bzip2Áß Çϳª; ÀÌ ÅøÀº ¾ÐÃàÀ» gzipº¸´Ù Àß ÇÑ´Ù. ±×·¯³ª ¿ª½Ã Á¶±Ý ´À¸®°í ¸¹Àº ¸Þ¸ð¸®¸¦ ¼Ò¸ðÇÑ´Ù;

cdata.tvnet.hu/~ml/upx.html °ú wildsau.idv.uni-linz.ac.at/mfx/upx.html ÀÇ È¨ÆäÀÌÁö¿¡ ÀÖ´Â upx¸¦ ½ÇÇàÇÒ ¼ö ÀÖ´Â ¾ÐÃà ÇÁ·Î±×·¥;

sunsite.unc.edu:/pub/Linux/libs/compression ¿¡¼­ ÀÌ¿ëÇÒ ¼ö ÀÖ´Â zlibc ÆÐÅ°Áö. zlibc-X.X.tar.gz¶ó°í ºÒ¸®¸ç X.X´Â ÃֽŠ¹öÀüÀÌ´Ù.

´Ù¸¥ ½ÇÇà ÇÒ ¼ö ÀÖ´Â ¾ÐÃà ÇÁ·Î±×·¥ÀÌ ÀÖ´Ù. Çϳª´Â gzexe (Àؾî¹ö·È´Ù), Àá½Ã upx°¡ ÀÌ¿ëÇÒ ¼ö ÀÖ°Ô µÇ±â Àü¿¡ ¾Æ¸¶ ÃÖ°í¿´´ø tcx; ¾ÆÁ÷ ¶Ç ÇϳªÀÇ tzx, ÀÌ·Ð º¸´Ù ´õ ³ªÀº tcx. ±× °ÍÀº ³»°¡ ½ºÆÅ PC¿¡¼­ ½Ãµµ ÇßÀ»¶§ ¸ðµç °ÍÀ» °íÁ¤½ÃÄ×´Ù. ºñ·Ï ³ª´Â ¹«¾ùÀÌ À߸øµÇ¾ú´Ù°í È®½ÅÇÏÁö´Â ¾Ê´Â´Ù. ´ç½ÅÀº upx¿Í ´õ Àß °íÁ¤ÇÒ ¼ö ÀÖ´Ù; ±×°ÍÀº ¹ÏÀ» ¼ö ÀÖ°í, ¾µ¸ð ÀÖ°í ¸Å¿ì Æí¸®ÇÏ´Ù.

¸íÄèÇÑ ÆÄÀÏ ½Ã½ºÅÛ ¾ÐÃà a la StackerÀÌ Á¦°øÇÏ´Â Ä¿³Î ÆÐÄ¡°¡ ÀÖ´Ù. ±×·¯³ª ÇöÀç ÀÌ°ÍÀº ¾ÆÁ÷ ¾Æ¹«µµ ¾ÈÁ¤¼º°ú ¹ÏÀ» ¼ö ÀÖ´Â Æò°¡ µÇÁö ¾Ê¾Ò´Ù. ¾ÈÀüÀÇ ¸ñÀûÀº ´õ ³ª¾Æ°¡°Ô Çϱâ À§ÇÔÀÌ´Ù.

3. ¼ø¼­

3.1 Ä¿³Î ¼Ò½º ÁÙÀ̱â

´ç½ÅÀº Ä¿³Î ¼Ò½º¸¦ 20¸Þ°¡ º¸´Ù ´õ ÀÛ°Ô ÁÙÀ̰ųª ±×°ÍÀ» Áö¿öµµ µÈ´Ù. ¸¸¾à¿¡ ±×·¸´Ù¸é, ³ª´Â ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡¼­ Çѹø ±×¸®°í ¸ðµÎ¸¦ À§Çؼ­ ¸ÂÃçÁø »õ·Î¿î Ä¿³ÎÀ» ÄÄÆÄÀÏÇϱ⸦ Á¦¾ÈÇÑ´Ù. ±×ÈÄ ¼Ò½º¸¦ ¾ø¾Ö¶ó. Á¶½É Ç϶ó.

´ç½ÅÀÇ ÄÄÇ»ÅÍ°¡ Á¤È®È÷ ¼³Á¤µÇ¾ú´Ù°í È®½ÅÇÏÁö ¾Ê´Â´Ù¸é Ä¿³Î ¼Ò½º¸¦ Áö¿ì´Â °ÍÀ» ±ÇÇÏÁö ¾Ê´Â´Ù. ±× ¹Û¿¡, C ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ Çϱâ À§ÇØ Ä¿³Î ÀÎŬ·çµå ÆÄÀÏÀÌ ÇÊ¿äÇÏ´Ù. ´Ù½Ã »ý°¢Ç϶ó!

±×·¸°Ô ÇÏ·Á°í ÇÑ´Ù¸é, ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡¼­ ¾ÖÇø®ÄÉÀ̼ÇÀ» ÄÄÆÄÀÏÇϱ⠿øÇÑ´Ù¸é include/linux µð·ºÅ丮¸¦ Áö¿ì¸é ¾ÈµÈ´Ù.

3.2 ¾ÖÇø®ÄÉÀÌ¼Ç ÁÙÀ̱â

Áö±Ý, ´ç½ÅÀÌ Á¤¸»·Î ÇÊ¿äÇÑ ¼ÒÇÁÆ®¿þ¾î¸¦ °áÁ¤Çضó. ¸î¸îÀº ÀåȲÇÏ´Ù°í ÀÔÁõ µÇ¾ú´Ù: ¿¹¸¦ µé¸é, ´ç½ÅÀÌ emacs ¾øÀÌ »ì ¼ö ¾ø´Ù°í È®½ÅÇϴ°¡? ´ç½ÅÀº ´ë½Å jed¸¦ ¾µ¼ö ÀÖ´Ù.

´ç½ÅÀÌ º¸Á¸Çϱ⠿øÇÏ´Â °ÍÀ» °áÁ¤Ç϶ó. ¸î¸î Àü¹ÝÀûÀÎ µ¿ÀÛ:

gcc´Â »ó´çÈ÷ Å« ÆÐÅ°ÁöÀÌ´Ù. Ä¿³Î°ú ¸®´ª½º ¹ÙÀ̳ʸ®°¡ »ý¼ºµÇÁö ¾ÊÀº ¸ðµç ¾ÖÇø®ÄÉÀ̼ÇÀ» ´Ù½Ã ÄÄÆÄÀÏÇϴµ¥ ÇÊ¿äÇÏ´Ù. ¹°·Ð, C³ª Æ÷Æ®¶õ (f2c ȤÀº g77) ·Î ÇÁ·Î±×·¥À» ¸¸µé¾ú´Ù¸é ±×°Í ¶ÇÇÑ ÇÊ¿äÇÏ´Ù; ´ç½ÅÀÇ Áö¿ì±â Àü¿¡ ±íÀÌ »ý°¢Ç϶ó. lcc °°Àº ´Ù¸¥ ÄÄÆÄÀÏ·¯µµ ÁÁ´Ù. ±×·¯³ª gcc ·¹º§ÀÌ ¾Æ´Ï´Ù. ³ª´Â ±×°ÍÀ» º¸Á¸Çϱ⸦ Á¦¾ÈÇÑ´Ù;

X11Àº ¾ÆÁÖ Å©´Ù. ±×·¯³ª °¡Áö°í Àֱ⿡ ÁÁ´Ù. ´ç½ÅÀÌ ±×°ÍÀ» Æ÷±âÇÏÁö ¸øÇÏ°Ú´Ù¸é, Àû¾îµµ ÀÛ°Ô ¸¸µé·Á°í ½ÃµµÇ϶ó: ¿ÀÁ÷ X ¼­¹ö¸¸ Á¤´çÇÏ°í, ÇϳªÀÇ °£´ÜÇÑ À©µµ¿ì ¸Å´ÏÀú, ¿ÀÁ÷ ÇϳªÀÇ xterm, 100 dpi ÆùÆ®´Â ¾ÈµÇ°í, ±×¿Ü;

Tex°ú ÷ºÎµÈ ÆÐÁöÅ°´Â Á¤¸» ¸Å¿ì Å©´Ù. LaTeX°ú TeX¸¦ Æ÷±âÇÏ´Â °ÍÀº ¸¹Àº °ø°£À» Àý¾àÇÑ´Ù; ´ç½ÅÀÌ dvitty¿Í dvivga¸¦ ¾´´Ù¸é, xdvi³ª ghostview°°Àº X11 ÇÁ¸®ºä¾î¸¦ Æ÷±âÇÏ´Â °ÍÀº °¡´ÉÇÏ´Ù. X11 dviware°¡ ÇÊ¿ä·ÎÇÏ´Â °ÍÀ» Á¦°ÅÇÏ´Â °ÍÀº 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 * ¸í·ÉÀ¸·Î ±× °ÍÀ» ½ÇÇà½ÃÄѶó; ¸ðµç ½ÇÇà °¡´ÉÇÑ °ÍÀ» ¾ÐÃàÇÒ °ÍÀÌ´Ù. ´Ù¸¥ µð·ºÅ丮¿¡¼­µµ ÀÌ ÀÛ¾÷À» ¹Ýº¹Ç϶ó.

»õ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÒ ¶§ ¸¶´Ù ½ÇÇà °¡´ÉÇÑ ÆÄÀÏÀ» ¾ÐÃàÇÏ´Â °ÍÀ» ±â¾ïÇ϶ó!

3.5 GzipÀ¸·Î ¾ÐÃàÇϱâ

Çѹø ¾ÐÃàµÈ ´Ù¸¥ ÆÄÀÏÀÌ ¸¹ÀÌ ÀÖ´Ù. /usr/doc/ ¿¡¼­µµ ½ÃÀÛÇÏÀÚ; µð·ºÅ丮¸¦ ¿Å±â°í ¸í·ÉÀ» ½ÇÇàÇ϶ó

       machine:/usr/doc# find . -type f -exec gzip -9 {} \; 2> /dev/null
´ç½ÅÀÌ »õ ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÒ ¶§ ¸¶´Ù docs¸¦ ¾ÐÃàÇÏ´Â °ÍÀ» ±â¾ïÇ϶ó!

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--blocks¶ó°í º¸°íÇß´Ù:

³ª´Â Ä¿³Î ¼Ò½º¿Í Ä¿³Î ÇØ´õ¸¦ Á¦°Å ÇÏÁö ¾Ê¾Ò´Ù;

³ª´Â ¸î¸î ¾ÖÇø®ÄÉÀ̼ǰú ¸ðµç °ÔÀÓÀ» Áö¿ü´Ù. ±×·¯³ª ³ª´Â X11, X11 °³¹ßÅø, C¿Í Æ÷Æ®¶õ °³¹ßÅø, Tcl/Tk, ³×Æ®¿öÅ· Åø°ú ±×¿Ü ´Ù¸¥ Ç¥ÁØ ¾ÖÇø®ÄÉÀ̼ǵéÀ» Áö¿ü´Ù. df´Â 244,669 ºí·ÏÀ» »ç¿ëÇÑ´Ù°í º¸°íÇß´Ù;

³ª´Â /usr/bin°ú /usr/X11R6/bin°ú /usr/lib/texmf/bin/i586-linux¿Í /usr/lib/gcclib/i386-linux/2.7.2.1¿¡¼­ upx¸¦ ½ÇÇà½ÃÄ×´Ù. 226,270 ºí·ÏÀ» »ç¿ëÇÑ´Ù°í º¸°íÇß´Ù;

³ª´Â /usr/doc¿Í /usr/lib/texmf/tex/mf/dosÀÇ ¹®¼­¸¦ ¾ÐÃàÇß´Ù: 198,745 ºí·ÏÀ» »ç¿ëÇÑ´Ù°í º¸°íÇß´Ù.

Çհ踦 ±¸Çϸé, ³ª´Â 398,798 ºí·ÏÀ» 198,745 ºí·ÏÀ¸·Î ¸¸µé¾ú´Ù. Àç·á¸¦ »ý°¢Çغ¸¶ó. ´ç½ÅÀº 200,000 ºí·ÏÀ» Àý¾àÇÒ ¼ö ÀÖ´Ù! gzip ´ë½Å¿¡ bzip2¸¦ »ç¿ëÇß´Ù¸é ´õ ¸¹Àº °ø°£ÀÌ ³²¾ÒÀ» °ÍÀÌ´Ù.

Æò±ÕÀûÀ¸·Î º¼¶§, ½ÃÀÛÇÒ ¶§ Á¶½ÉÇÏ°í ÇÊ¿äÇÑ ¾ÖÇø®ÄÉÀ̼ÇÀ» ¼³Ä¡ÇÏ°í, ½ÇÇà °¡´ÉÇÑ ÆÄÀÏ°ú ¹®¼­µéÀº 20 ¸Þ°¡ Á¤µµ¸¦ Àý¾àÇØ ÁØ´Ù. ³ëÆ®ºÏ¿¡¼­´Â, ÀÌ °ÍÀº »ý¸í ±¸Á¶ÀÚ°¡ µÉ ¼ö ÀÖ´Ù.

(¿ªÀÚÁÖ : ÀÌÇÏÀÇ ºÎºÐÀº ÀúÀÛ±Ç °ü·Ã ºÎºÐÀ¸·Î ¹ø¿ªÀ» ÇÏÁö ¾Êµµ·Ï ÇÏ°Ú½À´Ï´Ù.)

5. The End

5.1 Copyright

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 Disclaimer

``Saving Space mini-HOWTO''was written by Guido Gonzato, 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-)


ID
Password
Join
By failing to prepare, you are preparing to fail.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2003-08-10 11:52:30
Processing time 0.0030 sec