rss· 投稿· 设为首页· 加入收藏· 繁體版
当前位置: 火魔网 » 操作系统 » Redhat

RedHat linux CD光盘集成为DVD光盘制作方法

【注释】文中的脚本是Redhat的一个工程师写的CD转DVD的script, 使用起来非常方便。RHEL每发布一个

Update,我都制作一个同样的DVD. 为了避免这个脚本丢失,特纪录如下:

1、建立转换脚本convert2dvd.sh
# vi /usr/convert2dvd.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 1
fi
cleanup() {
[ ${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 
}
cleanup
mkdir -p $LOOP
mkdir -p $DVD
if [ !`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
fi
else
echo "Found FTP-like tree..."
rsync -avP --exclude SRPMS $1/* $DVD
# cp -av $1/* $DVD
[ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD
fi
rm -rf $DVD/isolinux/boot.cat
find $DVD -name TRANS.TBL | xargs rm -f
# My thanks to Mubashir Cheema for suggesting this fix.
# cd $DVD
mkisofs -J -R -v -T -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot

-load-size 8 -boot-info-table $DVD
# /usr/lib/anaconda-runtime/implantisomd5 --force $2
# Don't like forced mediacheck? Try this instead.
# /usr/lib/anaconda-runtime/implantisomd5 --supported-iso --force $2
cleanup
echo ""
echo "Process Complete!"
echo ""

重要提示:

1、如果系统没有安装implantisomd5请注释掉这一行(以上文档已注解该行):
/usr/lib/anaconda-runtime/implantisomd5 --force $2
否则会出现
/usr/convert2dvd.sh: line 58: /usr/lib/anaconda-runtime/implantisomd5: No such file or

directory的错误提示

2、建立光盘的镜像文件成ISO格式并拷贝到一个目录:
(如果你是通过网络下载的ISO文件可以略过此步骤)
#mkdir  Cpv /usr/iso
#dd  if=/dev/hdc  of=/usr/iso/disk1.iso   (注释:if C input file     of-- outputfile)
同样建立其他各个光盘的镜像
#dd  if=/dev/hdc  of=/usr/iso/disk2.iso
#dd  if=/dev/hdc  of=/usr/iso/disk3.iso
#dd  if=/dev/hdc  of=/usr/iso/disk4.iso

3、赋予转换脚本的可执行权限
# chmod 775 /usr/convert2dvd.sh

4、DVD光盘的集成:
convert2dvd脚本使用方法

convert2dvd.sh sourcedir  targetdir/dvdfilename.iso
①sourdedir       存放源ISO文件的目录
②targetdir       存放转换文件所在目录
③dvdfilename     转换后的ISO格式的DVD文件名

# /usr/convert2dvd.sh /usr/iso /usr/MyDVD.iso
集成后的光盘就是MyDVD.iso

剩下的步骤就是将集成的DVD刻录保存了

http://forum.conan.com.ru/topic/1582-redhat-linux-cd%E5%85%89%E7%9B%98%E9%9B%86%E6%88%90%

E4%B8%BAdvd%E5%85%89%E7%9B%98%E5%88%B6%E4%BD%9C%E6%96%B9%E6%B3%95/

顶一下
(0)
踩一下
(0)