把RedHat Linux 5.0 的CD ISO合并成DVD的脚本

最近找RedHat Linux5.0 x86_64的DVD ISO文件,结果一直找不到,却找到了6个cd的ISO,因为最后一个为源码盘,暂时不管,把其他5个CD合并成一个DVD,,脚步如下:vim dvd.sh#!/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 “”

把5个iso放到/u01下执行一下命令./dvd.sh /u01 /u01/redhat5.0_x86_64_dvd.iso【LINUX公社  】结果如下:Total translation table size: 710166Total rockridge attributes bytes: 306908Total directory bytes: 466944Path table size(bytes): 188Done with: The File(s) Block(s) 1583819Writing: Ending Padblock Start Block 1584239Done with: Ending Padblock Block(s) 150Max brk space used 2550001584389 extents written (3094 MB)./script.sh: line 55: /usr/lib/anaconda-runtime/implantisomd5: No such file or directoryProcess Complete!在linux下进行挂载ISOmount -o loop -t iso9660 redhat5.0_x86_64_dvd.iso /media

或许是某座闻名遐迩的文化古城。我们可以沿途用镜头记录彼此的笑脸,

把RedHat Linux 5.0 的CD ISO合并成DVD的脚本

相关文章:

你感兴趣的文章:

标签云: