您的位置:首页 > 其它

RHEL 4/5 DVD光盘的制作及其注意事项

2007-12-10 23:05 597 查看
Chris Kloiber 发布的一个 shell script 可以将下载的 iso 制作成 DVD,其注意事项如下:

1.通常安装时系统不安装 anaconda-runtime,因此/usr/lib/anaconda-runtime/implantisomd5
  无法执行,所以制作的DVD不能安装前检测。如果你想制作一个能安装前检测的DVD,制作前清检查
你的系统。
2. 不同版本的anaconda-runtime所在的光盘不同,下面是 RHEL 4/5的,手动安装:
RHEL AS 4u4 i386 disc4 anaconda-runtime-10.1.1.46-1.i386.rpm
RHEL AS 4u4 x86_64 disc4 anaconda-runtime-10.1.1.46-1.x86_64.rpm
RHEL Server 5 i386 disc5 anaconda-runtime-11.1.2.36-1.i386.rpm
RHEL Server 5 x86_64 disc6 anaconda-runtime-11.1.2.36-1.x86_64.rpm
3. Chris Kloiber 的 shell script 没有添加 label,我把它加上了,用法如下
mkdvd /path/to/iso /home/prometheus/rhel-as-4-i386-dvd.iso "RHEL AS 4 DVD"
mkdvd /path/to/src /home/prometheus/rhel-as-4-i386-dvd.iso RHEL-AS-4-DVD
label 中间带空格时要加引号,如 "rhel as 4u4 i386 dvd ",但需要修改环境变量,
建议不带空格。不超过32字符,Windows 显示16个字符。
4. 我用 RHEL AS 4 i386/x64 和 RHEL 5 i386/x86 做了测试,都没有问题。
5. 如果直接拷贝下面的 shell script,请存成 ASCII 码,以免不能执行。你也可以直接下在附件。

#!/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 you want implant iso md5 into DVD, Be sure /usr/lib/anaconda-runtime/implantisomd5
# is installated correctlly. anaconda-runtime rpm in the following disc.
# RHEL AS 4 i386 disc4 anaconda-runtime-10.1.1.46-1.i386.rpm
# RHEL AS 4 x86_64 disc4 anaconda-runtime-10.1.1.46-1.x86_64.rpm
# RHEL Server 5 i386 disc5 anaconda-runtime-11.1.2.36-1.i386.rpm
# RHEL Server 5 x86_64 disc6 anaconda-runtime-11.1.2.36-1.x86_64.rpm
# Usage:
# mkdvd /path/to/iso /home/prometheus/rhel-as-4-i386-dvd.iso "RHEL AS 4 DVD"
# mkdvd /path/to/src /home/prometheus/rhel-as-4-i386-dvd.iso RHEL-AS-4-DVD

if [ $# -lt 3 ]; then
echo "Usage: `basename $0` source iso_file iso_label"
echo ""
echo " 'source' can be either a directory containing a single"
echo " set of isos, or an exploded tree like an ftp site."
echo " 'iso_file' is the iso file to be created."
echo " 'iso_label' is the DVD disk label."
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..."
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
cd $DVD
mkisofs -J -R -v -V $3 -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 $2
cleanup
echo ""
echo "Process Complete!"
echo ""

--------------------

原文地址:http://www.aoxue.org/cgi-bin/bbs/topic_show.cgi?id=109820&bpg=1&age=0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: