上古大秦

金戈铁马只为一天地男儿 弯弓射雕成就一代豪情霸业!

用户操作
[即时聊天] [发私信] [加为好友]
郭靖ID:yzguoz
13477次访问,排名8594(1)好友7人,关注者12
yzguoz的文章
原创 10 篇
翻译 0 篇
转载 22 篇
评论 24 篇
最近评论
文章分类
    收藏
      相册
      存档
      软件项目交易
      订阅我的博客
      XML聚合  FeedSky
      订阅到鲜果
      订阅到Google
      订阅到抓虾
      订阅到BlogLines
      订阅到Yahoo
      订阅到GouGou
      订阅到飞鸽
      订阅到Rojo
      订阅到newsgator
      订阅到netvibes

      原创 rhel 5添加光盘镜像为本地源(5张以CD合成一张DVD)收藏

      新一篇:  将5张以CD合成一长DVD | 旧一篇:  达内 软件工程师

      1 将5张以CD合成一长DVDtouch /root/make_dvd.sh内容如下#!/bin/bash# by Chris Kloiber <ckloiber@redhat.com># A quick hack that will create a bootable DVD iso of a Red Hat Linux# Distribution. Feed it either a directory containing the downloaded# iso files of a distribution, or point it at a directory containing# the "RedHat", "isolinux", and "images" directories.# This version only works with "isolinux" based Red Hat Linux versions.# Lots of disk space required to work, 3X the distribution size at least.# GPL version 2 applies. No warranties, yadda, yadda. Have fun.if [ $# -lt 2 ]; then        echo "Usage: `basename $0` source /destination/DVD.iso"        echo ""        echo "        The 'source' can be either a directory containing a single"        echo "        set of isos, or an exploded tree like an ftp site."        exit 1ficleanup() {[ ${LOOP:=/tmp/loop} = "/" ] && echo "LOOP mount point = \/, dying!" && exit[ -d $LOOP ] && rm -rf $LOOP[ ${DVD:=~/mkrhdvd} = "/" ] && echo "DVD data location is \/, dying!" && exit[ -d $DVD ] && rm -rf $DVD}cleanupmkdir -p $LOOPmkdir -p $DVDif [ !`ls $1/*.iso 2>&1>/dev/null ; echo $?` ]; then        echo "Found ISO CD images..."        CDS=`expr 0`        DISKS="1"        for f in `ls $1/*.iso`; do                mount -o loop $f $LOOP                cp -av $LOOP/* $DVD                if [ -f $LOOP/.discinfo ]; then                        cp -av $LOOP/.discinfo $DVD                        CDS=`expr $CDS + 1`                        if [ $CDS != 1 ] ; then                                DISKS=`echo ${DISKS},${CDS}`                        fi                fi                umount $LOOP        done        if [ -e $DVD/.discinfo ]; then                awk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo > $DVD/.discinfo.new                mv $DVD/.discinfo.new $DVD/.discinfo        fielse        echo "Found FTP-like tree..."        cp -av $1/* $DVD        [ -e $1/.discinfo ] && cp -av $1/.discinfo $DVDfirm -rf $DVD/isolinux/boot.catfind $DVD -name TRANS.TBL | xargs rm -fcd $DVDmkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table ./usr/lib/anaconda-runtime/implantisomd5 --force $2cleanupecho ""echo "Process Complete!"echo ""3 cd /rootchmod a+x make_dvd.sh假设我的5张cd在/wind/redhat/rhel-5-server-i386-disc1.iso/wind/redhat/rhel-5-server-i386-disc2.iso/wind/redhat/rhel-5-server-i386-disc3.iso/wind/redhat/rhel-5-server-i386-disc4.iso/wind/redhat/rhel-5-server-i386-disc5.iso./make_dvd.sh /wind/redhat /mydoc/rhel-5-server-i386-DVD.iso然后在/mydoc目录下产生rhel-5-server-i386-DVD.iso5 mkdir /rhel_dvdmount -o loop /mydoc/rhel-5-server-i386-DVD.iso /rhel_dvd6gedit /etc/yum.repos.d/rhel_local.repo内容如下:[Cluster]name=Red Hat Enterprise Linux $releasever-$basearch-Clusterbaseurl=file:///rhel_dvd/Clusterenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release[ClusterStorage]name=Red Hat Enterprise Linux $releasever-$basearch-ClusterStoragebaseurl=file:///rhel_dvd/ClusterStorageenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release[Server]name=Red Hat Enterprise Linux $releasever-$basearch-Serverbaseurl=file:///rhel_dvd/Serverenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release[VT]name=Red Hat Enterprise Linux $releasever-$basearch-VTbaseurl=file:///rhel_dvd/VTenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release7执行createrepo命令,如果找不到命令,则要先安装createrepo的rpm包,自己google吧为了方便,创建一个sh文件touch /root/yum.sh内容如下:mkdir -p /var/rhel/{Server,Cluster,ClusterStorage,VT}createrepo -o /var/rhel/Cluster -g /rhel_dvd/Cluster/repodata/comps-rhel5-cluster.xml /rhel_dvd/Clustercreaterepo -o /var/rhel/ClusterStorage -g /rhel_dvd/ClusterStorage/repodata/comps-rhel5-cluster-st.xml /rhel_dvd/ClusterStoragecreaterepo -o /var/rhel/Server -g /rhel_dvd/Server/repodata/comps-rhel5-server-core.xml /rhel_dvd/Servercreaterepo -o /var/rhel/VT -g /rhel_dvd/VT/repodata/comps-rhel5-vt.xml /rhel_dvd/VTmount --bind /var/rhel/Cluster/repodata /rhel_dvd/Cluster/repodatamount --bind /var/rhel/ClusterStorage/repodata /rhel_dvd/ClusterStorage/repodatamount --bind /var/rhel/Server/repodata /rhel_dvd/Server/repodatamount --bind /var/rhel/VT/repodata /rhel_dvd/VT/repodatayum clean allchmod a+x yum.sh./yum.sh

      发表于 @ 2008年06月10日 17:14:00|评论(loading...)|

      新一篇:  将5张以CD合成一长DVD | 旧一篇:  达内 软件工程师

      评论:没有评论。

      发表评论  


      当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
      Csdn Blog version 3.1a
      Copyright © 猪头秦王