¾÷µ¥ÀÌÆ®¸¦ ¹Ý¿µÇÏ·Á¸é Á¦´ë·Î ÀÛµ¿ÇÏ´Â rpm ÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÏ°í ¸®´ª½º ¸Ó½Å¿¡¼ ¹èÆ÷ÆÇ µð·ºÅ丮¿¡ ¾²±â ±ÇÇÑÀÌ ÀÖ¾î¾ß ÇÑ´Ù. ¾Æ·¡¿Í °°Àº ¼¼ ´Ü°è¸¦ °ÅÃÄ¾ß ÇÑ´Ù.
¸¸¾à updates
µð·ºÅ丮ÀÇ ¹Ì·¯¸µÀ» À¯ÁöÇÏ°í ÀÖ´Ù¸é ÀÌ·¯ÇÑ ´Ü°è¸¦
¹Ýº¹ÇÔÀ¸·Î½á ¾ðÁ¦µçÁö ÇöÀçÀÇ ¾÷µ¥ÀÌÆ®¸¦ Æ÷ÇÔÇÏ´Â CD¸¦ ¸¸µé ¼ö ÀÖ´Ù.
¼³Ä¡ÇÏ´Â µµÁß¿¡ ¾î¶² ÇÁ·Î±×·¥µéÀº CD·ÎºÎÅÍ Á÷Á¢ ½ÇÇàµÈ´Ù. ºÒÇàÇÏ°Ôµµ FTP
ÇÁ·Î±×·¥Àº º¹»çµÇ´Â ÆÄÀÏ°ú µð·ºÅ丮ÀÇ º¸È£ ¸ðµå¸¦ ¾ðÁ¦³ª º¸Á¸ÇÏÁö´Â ¾Ê´Â´Ù.
µû¶ó¼ µð·ºÅ丮¸¦ CD¿¡ ±Á±â Àü¿¡ ÇÁ·Î±×·¥, ½© ½ºÅ©¸³Æ®, °øÀ¯ ¶óÀ̺귯¸®¿¡
½ÇÇà Æ۹̼ÇÀÌ ÁÖ¾îÁ® ÀÖ´ÂÁö¸¦ È®ÀÎÇÏ´Â °ÍÀÌ ÇÊ¿äÇÏ´Ù. ±×·¸°Ô ÇÏ·Á¸é
¾Æ·¡ÀÇ updatePerm
½ºÅ©¸³Æ®¸¦ ¹èÆ÷ÆÇÀÇ ·ÎÄà º¹»çº»¿¡ ½ÇÇà½ÃÅ°¸é µÈ´Ù.
#!/bin/bash RHVERSION=6.0 LIST=/tmp/er3hd3w25 CDDIR=/jaz/redhat-${RHVERSION} # Find all directories, and make sure they have +x permission find $CDDIR -type d -exec chmod -c 755 {} \; # Find all files that are executables, shell or perl scripts find $CDDIR -type f | file -f - | grep -v RPM \ | egrep -i 'executable|perl|bourne|shell' | cut -f1 -d: > $LIST # Find shared libraries find $CDDIR -name \*.so >> $LIST # Make them executable while read file do if [ ! -x $file ] ; then chmod -c 755 $file fi done < $LIST /bin/rm $LIST exit 0
updateCD
¶ó°í ºÒ¸®´Â ¾Æ·¡ÀÇ ½ºÅ©¸³Æ®´Â updates µð·ºÅ丮·ÎºÎÅÍ ¸ðµç ÆÄÀÏÀ»
RPMS µð·ºÅ丮·Î ¿Å±ä´Ù. ÀÌ ½ºÅ©¸³Æ®´Â updates µð·ºÅ丮¿¡¼ ¾î¶² ÆÄÀÏÀÌ ´õ
ÃÖ±ÙÀÇ °ÍÀÎÁö¸¦ ÆǺ°Çϱâ À§ÇØ ¸î °³ÀÇ ÀçÄ¡ÀÖ´Â rpm Æ®¸¯À» »ç¿ëÇÑ´Ù. ¿À·¡ µÈ
ÆÐÅ°ÁöµéÀº ${OLD}
µð·ºÅ丮·Î ¿Å°ÜÁø´Ù.
#! /bin/bash # This script updates rpms in a RedHat distribution found in $RPMDIR. # The old rpms will be placed in $OLDDIR. # The new rpms should be located in $UPDDIR. # The new images are in $IMGDIR # The images to be updated are in $OMGDIR # The architechture is $ARCH. RHVERSION=6.0 ARCH=i386 CDDIR=/jaz/redhat-${RHVERSION} RPMDIR=${CDDIR}/${ARCH}/RedHat/RPMS UPDDIR=${CDDIR}/updates/${ARCH} IMGDIR=${CDDIR}/updates/images/${ARCH} OMGDIR=${CDDIR}/${ARCH}/images OLDDIR=${CDDIR}/old if [ ! -d $OLDDIR ] ; then echo making directory $OLDDIR mkdir $OLDDIR fi allow_null_glob_expansion=1 for rpm in ${UPDDIR}/*.rpm ; do NAME=`rpm --queryformat "%{NAME}" -qp $rpm` unset OLDNAME for oldrpm in ${RPMDIR}/${NAME}*.rpm ; do if [ `rpm --queryformat "%{NAME}" -qp $oldrpm` = "$NAME" ]; then OLDNAME=$oldrpm; break fi done if [ -z "$OLDNAME" ]; then echo $NAME is new cp -pv $rpm $RPMDIR else if [ `basename $rpm` != `basename $OLDNAME` ]; then mv $OLDNAME $OLDDIR cp -pv $rpm $RPMDIR fi fi done # Copy new boot image files to the right place... for newfile in ${IMGDIR}/* ; do file=${OMGDIR}/$(basename ${newfile}) if [ $newfile -nt $file ] ; then cp -pv $newfile $file fi done exit 0
ƯÈ÷ kernel°ú kernel-smp ÆÐÅ°Áö °°Àº ƯÁ¤ RPMµéÀº ÆÄÀÏ À̸§¿¡´Â Ç÷§ÆûÀÌ Æ÷ÇԵǾî ÀÖÁö¸¸ ÆÐÅ°Áö À̸§¿¡´Â Æ÷ÇԵǾî ÀÖÁö ¾Ê´Ù. ¿¹¸¦ µé¸é "kernel" ÆÐÅ°Áö´Â ¾Æ·¡¿Í °°ÀÌ ¸î Á¾·ù·Î °ø±ÞµÈ´Ù.
kernel-2.2.5-22.i386.rpm
kernel-2.2.5-22.i586.rpm
kernel-2.2.5-22.i686.rpm
ÇÏÁö¸¸ ¼¼ °³ ¸ðµÎ¿¡¼ -qp ·Î °Ë»çÇØ º¸¸é ÆÐÅ°Áö À̸§À¸·Î ±×³É "kernel"À̶ó°í ³ª¿Â´Ù.
º¸¸é ¾Ë°ÚÁö¸¸ ÀÌ·¸°Ô µÇ¸é updateCD ½ºÅ©¸³Æ®°¡ ¿Àµ¿ÀÛÀ» ÇÏ°Ô µÈ´Ù. ±× °á°ú·Î ¸¶Áö¸· ÆÄÀϸ¸ Á¦´ë·Î º¹»çµÈ´Ù. ¾ÕÀÇ µÎ °³µµ º¹»ç°¡ µÇ±ä ÇÏÁö¸¸ ¹Ù·Î $OLD µð·ºÅ丮·Î ¿Å°ÜÁ® ¹ö¸°´Ù. ·¹µåÇÞ¿¡¼ À̵éÀÇ À̸§À» ´Ù¸£°Ô ºÙÀ̸é ÁÁ°ÚÁö¸¸, Áö±Ý ÇöÀç·Î½á´Â °¡Àå °£´ÜÇÑ ÇØ°áÃ¥Àº updateCD ¸¦ ½ÇÇà½ÃŲ ÈÄ¿¡ ¼öÀÛ¾÷À¸·Î ¿Å±â´Â °ÍÀÌ´Ù. ( Kyle B. Ferrio¿¡°Ô °¨»çµå¸³´Ï´Ù.)
ÀÌ·¯ÇÑ ¹®Á¦¸¦ ÇØ°áÇÒ ¼ö ÀÖ´Â ÆÞ ½ºÅ©¸³Æ®¸¦ Joshua Sarro°¡ ¸¸µé¾ú´Ù. http://imsb.au.dk/~mok/linux/doc/updateMirror.pl¿¡¼ ±¸ÇÒ ¼ö ÀÖ´Ù.
CD·ÎºÎÅÍ ¼³Ä¡ÇÒ ¶§ CD¿¡ ÀÖ´Â ¼³Ä¡ ÇÁ·Î±×·¥Àº ¾î¶² RPM ÆÐÅ°ÁöµéÀÌ
»ç¿ë°¡´ÉÇÑÁö¸¦ ±â¼úÇÏ´Â RedHat/base/hdlist
ÆÄÀÏ¿¡
ÀÇÁ¸ÇÑ´Ù. hdlist
ÆÄÀÏÀº misc/src/install/genhdlist
·Î »ý¼ºÇÒ ¼ö ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥À» ½ÇÇà½Ãų ¶§¿¡´Â ´Ü ÇϳªÀÇ Àμö¸¦
ÁÖ¾î¾ß Çϴµ¥ ±×°ÍÀº ¹èÆ÷ÆÇÀÇ ·çÆ® µð·ºÅ丮ÀÇ Àý´ë°æ·ÎÀÌ´Ù.
±× ÇÁ·Î±×·¥À» È£ÃâÇÏ´Â updateHdlist
½ºÅ©¸³Æ®´Â ¾Æ·¡¿Í °°´Ù:
#!/bin/bash RHVERSION=6.0 ARCH=i386 echo generating hdlist... CDDIR=/jaz/redhat-${RHVERSION} GENHDDIR=${CDDIR}/${ARCH}/misc/src/install chmod u+x ${GENHDDIR}/genhdlist chmod 644 ${CDDIR}/${ARCH}/RedHat/base/hdlist ${GENHDDIR}/genhdlist ${CDDIR}/${ARCH} || echo "*** GENHDLIST FAILED ***" exit 0
NOTE: RedHat/RPMS
µð·ºÅ丮¿¡ ¾÷µ¥ÀÌÆ®¸¦ ¹Ý¿µÇÑ ÈÄ¿¡´Â ´ç½ÅÀÇ
¹èÆ÷ÆÇ º¹»çº»Àº ´õ ÀÌ»ó ·¹µåÇÞ ¹èÆ÷ÆÇ »çÀÌÆ®ÀÇ ¹Ì·¯°¡ ¾Æ´Ï´Ù. »ç½Ç, ±×°ÍÀº
´õ¿í ÃÖ½ÅÀÇ °ÍÀÌ´Ù! µû¶ó¼ ¹èÆ÷ÆÇÀ» ¹Ì·¯ÇÏ·Á°í ½ÃµµÇÑ´Ù¸é ¾÷µ¥ÀÌÆ®µÈ RPMµéÀÇ
ÀÌÀü ¹öÀüµéÀÌ ´Ù½Ã ´Ù¿î·Îµå µÉ °ÍÀ̸ç, ¾÷µ¥ÀÌÆ®µéÀº Áö¿öÁú °ÍÀÌ´Ù.
·¹µåÇÞ 5.2 ÀÌÀüºÎÅÍ ¹èÆ÷µÈ genhdlist
´Â RedHat/RPMS
µð·ºÅ丮¿¡ RPM ÆÄÀÏÀÌ ¾Æ´Ñ ÆÄÀÏÀÌ ÀÖÀ¸¸é Ãæµ¹À» ÀÏÀ¸Å²´Ù. 5.2 ¹èÆ÷ÆÇ¿¡´Â
ls-lR
°ú ls-lR.gz
¶ó´Â RPM ÀÌ ¾Æ´Ñ ÆÄÀÏÀÌ Àֱ⠶§¹®¿¡ ¹®Á¦¸¦
ÀÏÀ¸Å°°Ô µÈ´Ù. µû¶ó¼ RPM ÀÌ ¾Æ´Ñ ÆÄÀÏÀ» ¸ðµÎ ±× µð·ºÅ丮·ÎºÎÅÍ Á¦°ÅÇؾß
ÇÑ´Ù. ±× ´ë½Å¿¡ ´ÙÀ½ÀÇ ÆÐÄ¡¸¦ misc/src/install/genhdlist.c
¿¡ Àû¿ëÇÏ°í »õ·Î ÄÄÆÄÀÏÇصµ µÈ´Ù. ¾Æ·¡ÀÇ ÆÐÄ¡´Â genhdlist
°¡ RPMÀÌ
¾Æ´Ñ ÆÄÀÏÀ» ¹«½ÃÇϵµ·Ï ¸¸µç´Ù.
*** genhdlist.c.orig Fri Nov 27 12:08:13 1998 --- genhdlist.c Fri Nov 27 12:08:20 1998 *************** *** 12,23 **** --- 12,26 ---- #define FILENAME_TAG 1000000 + /* Not used apparently... + int tags[] = { RPMTAG_NAME, RPMTAG_VERSION, RPMTAG_RELEASE, RPMTAG_SERIAL, RPMTAG_FILENAMES, RPMTAG_FILESIZES, RPMTAG_GROUP, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_DESCRIPTION, RPMTAG_SUMMARY, RPMTAG_PROVIDES, RPMTAG_SIZE, RPMTAG_OBSOLETES }; int numTags = sizeof(tags) / sizeof(int); + */ int main(int argc, char ** argv) { char buf[300]; *************** *** 26,34 **** --- 29,39 ---- struct dirent * ent; int fd, rc, isSource; Header h; + /* not used int count, type; int i; void * ptr; + */ if (argc != 2) { fprintf(stderr, "usage: genhdlist <dir>\n"); *************** *** 74,79 **** --- 79,85 ---- rc = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL); + if (!rc) { headerRemoveEntry(h, RPMTAG_POSTIN); headerRemoveEntry(h, RPMTAG_POSTUN); headerRemoveEntry(h, RPMTAG_PREIN); *************** *** 110,115 **** --- 116,122 ---- headerWrite(outfd, h, HEADER_MAGIC_YES); headerFree(h); close(fd); + } } errno = 0;
comps ÆÄÀÏÀº ¼³Ä¡ °úÁ¤¿¡¼ ÆÐÅ°ÁöµéÀÌ ¾î¶»°Ô ²Ù·ÁÁö´ÂÁö¸¦ Á¤ÀÇÇÑ´Ù. ·¹µåÇÞ º¸ÆÄÆÇ¿¡¼ ÀÌ °úÁ¤Àº ÆÐÅ°ÁöµéÀÇ ±â´É¿¡ µû¶ó ºÐ¸®µÈ´Ù. ¾Æ·¡ÀÇ ¿¹¸¦ º¸¶ó:
¼³Ä¡ÇÏ´Â µµÁß¿¡ »ç¿ëÀÚ´Â "Components to install"À̶ó´Â ´ëÈ»óÀÚ¸¦ º¸°Ô µÈ´Ù. ¾î¶°ÇÑ ÄÄÆ÷³ÍÆ®µéÀº ¹Ì¸® ¼±ÅõǾî ÀÖ°í ¾î¶² °ÍµéÀº ±×·¸Áö ¾Ê´Ù. ÄÄÆ÷³ÍÆ®µéÀÇ ¸®½ºÆ®¿¡´Â ¸¶Áö¸·¿¡ "Everything"ÀÌ ÀÖ´Ù. ·¹µåÇÞ ¹®¼¿¡ µû¸£¸é ¸ðµç ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÏ·Á¸é °ÅÀÇ 1 Gb¿¡ ´ÞÇÏ´Â µð½ºÅ©ÀÇ ¿©À¯°ø°£ÀÌ ÇÊ¿äÇÏ´Ù°í ÇÑ´Ù.
´ëÈ»óÀÚ¿¡´Â »ç¿ëÀÚ°¡ ¼³Ä¡ÇÒ ÆÐÅ°Áö¸¦ ÀÏÀÏÀÌ ¼³Ä¡ÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁÖ´Â
¿É¼Çµµ ÀÖ´Ù. RedHat/base/comps
ÆÄÀÏÀ» º¯°æÇÏÁö ¾Ê´Â´Ù¸é
ÀÏÀÏÀÌ ÆÐÅ°Áö¸¦ °ñ¶ó¼ ¼³Ä¡ÇÏ´øÁö ¾Æ´Ï¸é ¸ðµç ÆÐÅ°Áö¸¦ ¼³Ä¡ÇÏ´Â ¼ö¹Û¿¡ ¾ø´Ù.
comps
ÆÄÀÏÀº ÇöÀç comps ¾ç½ÄÀÇ ¹öÀüÀ» ±â¼úÇÏ´Â °ÍÀ¸·Î
½ÃÀÛÇϸç, ¹Ù·Î ¾Æ·¡¿¡´Â ºó ÁÙÀÌ ¿Í¾ß ÇÑ´Ù.
0.1
<ºó ÁÙ>
±× µÚ¿¡´Â ÄÄÆ÷³ÍÆ®µéÀÌ ³ª¿µÇ¸ç, ºó ÁÙ·Î ±¸ºÐÇÑ´Ù.
<ù¹ø° ÄÄÆ÷³ÍÆ®>
<ºó ÁÙ>
<µÎ¹ø° ÄÄÆ÷³ÍÆ®>
<ºó ÁÙ>
.
.
<n¹ø° ÄÄÆ÷³ÍÆ®>
<ºó ÁÙ>
EOF
°¢°¢ÀÇ ÄÄÆ÷³ÍÆ®´Â ¾Æ·¡¿Í °°ÀÌ Á¤ÀǵȴÙ:
(0|1) (--hide)? <name>
<RPM 1>
<RPM 2>
...
<RPM n>
end
°¢ ÄÄÆ÷³ÍÆ®ÀÇ À̸§ ¾Õ¿¡ 0À̳ª 1ÀÌ ÁÖ¾îÁø´Ù. ¿©±â¼ 1Àº ±× ÄÄÆ÷³ÍÆ®°¡ ±âº»ÀûÀ¸·Î ¼±Åõȴٴ °ÍÀ», 0Àº ±×·¸Áö ¾ÊÀ½À» ÀǹÌÇÑ´Ù. "--hide" ¿É¼ÇÀº "expert" ¼³Ä¡°úÁ¤À» ¼±ÅÃÇÏÁö ¾Ê´Â´Ù¸é ¸ñ·ÏÀ» º¼ ¼ö ¾øÀ½À» ÀǹÌÇÑ´Ù. ù¹ø° ÄÄÆ÷³ÍÆ®´Â "Base"ÀÌ°í, ¹Ýµå½Ã Á¸ÀçÇØ¾ß ÇÏ¸ç ´ëÈ»óÀÚ¿¡ ³ªÅ¸³ªÁö ¾Ê´Â´Ù´Â Á¡¿¡¼ Ưº°ÇÏ´Ù.(´ç¿¬È÷ ±âº» ¼³Ä¡´Â ¼±ÅÃÇÏÁö ¾ÊÀ» ¼ö ¾ø´Ù...)
´ÙÀ½¿¡´Â ±× ÄÄÆ÷³ÍÆ®¿¡ ÇØ´çÇÏ´Â rpm ÆÐÅ°ÁöµéÀÇ ¸ñ·ÏÀÌ ³ª¿Â´Ù. À̸§µéÀÌ ÆÐÅ°ÁöÀÇ ÆÄÀÏ À̸§ÀÇ ÀϺκÐÀÌ ¾Æ´Ï°í rpm ÆÄÀÏ ¾È¿¡ ÀúÀåµÇ¾î ÀÖ´Â À̸§ÀÌ ¶ó´Â Á¡¿¡ À¯ÀÇÇÏ¿©¾ß ÇÑ´Ù. (´ë°³ °°±â´Â ÇÏÁö¸¸...)
comps
ÆÄÀÏ¿¡ ´ç½ÅÀÇ ÆÐÅ°Áö¸¦ Ãß°¡ÇÔÀ¸·Î½á ´ç½Å¸¸ÀÇ
¹èÆ÷ÆÇÀ» ±¸¼ºÇÒ ¼ö ÀÖ°í È®½ÇÇÏ°Ô ´ç½ÅÀÇ ÆÐÅ°Áö°¡ ±âº»À¸·Î ¼³Ä¡µÇµµ·Ï
ÇÒ ¼ö ÀÖ´Ù. ÇÑ °¡Áö ÁÖÀÇÇØ¾ß ÇÒ Á¡Àº ´ç½ÅÀÇ ÆÐÅ°Áö ¾È¿¡¼ÀÇ »óÈ£ÀÇÁ¸¼ºÀÌ´Ù.
ÀÚ±â ÀڽŸ¸ÀÇ °ÍÀ» ¸¸µé°í ÀÖ±ä ÇÏÁö¸¸... :-) Ãæ°í ÇÑ ¸¶µð: ÆÄÀÏ ¾È¿¡
¿©ºÐÀÇ °ø¹éÀ» Ãß°¡Çϰųª Á¦°ÅÇÏÁö ¾Êµµ·Ï ÁÖÀÇÇ϶ó. ÇöÀç ÀÖ´Â comps
ÆÄÀÏ(¿øº»À» º¹»çÇØ µÎ¾î¶ó)À» »ìÆ캸¸é ¾î¶»°Ô µÇ¾î ÀÖ´ÂÁö¸¦
¾Ë ¼ö ÀÖ´Ù. (¶Ç´Â ±× ÆÄÀÏÀÌ ¾î¶»°Ô parseµÇ´ÂÁö ¾Ë°í ½Í´Ù¸é
i386/misc/src/install/pkgs.c
¸¦ È®ÀÎÇØ º¸¾Æµµ µÈ´Ù.)