当前位置:IT快活林→快活林学院操作系统

把rhel5 cd iso合并成dvd的脚本

作者:本站整理   发布时间:2008-4-16 22:58:01


经合并后,在vmware中以该dvd.iso启动,并正常安装了rhel5.用法: ./script.sh /TheCdIsoPath /home/username/dvd.iso#!/bin/bash# by Chris Kloiber # 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 ]; thenecho "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 $?` ]; thenecho "Found ISO CD images..."CDS=`expr 0`DISKS="1"for f in `ls $1/*.iso`; domount -o loop $f $LOOPcp -av $LOOP/* $DVDif [ -f $LOOP/.discinfo ]; thencp -av $LOOP/.discinfo $DVDCDS=`expr $CDS + 1`if [ $CDS != 1 ] ; thenDISKS=`echo ${DISKS},${CDS}`fifiumount $LOOPdoneif [ -e $DVD/.discinfo ]; thenawk '{ if ( NR == 4 ) { print disks } else { print ; } }' disks="$DISKS" $DVD/.discinfo > $DVD/.discinfo.newmv $DVD/.discinfo.new $DVD/.discinfofielseecho "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 ""[ 本帖最后由 prettywolf 于 2007-3-17 14:41 编辑 ]-----这个是我用的脚本,测试正常。合成的DVD安装正常。./mkdvd.iso /tmp/*.iso /root/rhel5dvd.iso 注 CDROM的iso文件和合并输出的DVD ISO文件不能在同一个目录。-----呵呵。两个都是一样的。-----这么复杂啊,我用UltraISO把几个文件合并,然后改.discinfo里面1为1,2,3,4,5,6怎么也能用啊 是不是有什么隐藏的问题?-----不复杂,运行这个脚本就自动合成的了。-----rhel 5 i368我合并出来的md5 = 256caf8331ce9e50f5e53a2d9e348e3d,你们是不是也是这个?-----94424433d744a26338110729aefdb531 我的是这个。启动和安装都正常,奇怪。-----是在windows下面合成的脚本?-----有windows下的版本吗?或者perl版本的?-----谢谢,试试先。
》热 点 关 注