The script below, a mod of
http://merlin.fit.vutbr.cz/mirrors/centos/build/mkdvdiso.sh
mentioned in
http://lists.centos.org/pipermail/centos-docs/2006-September/000039.html
works for me to create a DVD ISO from a set of C5 CD ISOs. The repo-tree part is still not working. Any advice appreciated.
Phil
--------------------------------- mkdvdiso.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.
# Modified to add sanity checks and fix CentOS4 syntax errors # by Phil Schaffner p.r.schaffner@larc.nasa.gov
# TODO: # Add checks for available disk space on devices holding output and # temp files. # Add optional 3rd parameter to specify location of temp directory
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
DVD_DIR=`dirname $2` DVD_FILE=`basename $2`
echo "DVD directory is $DVD_DIR" echo "ISO file is $DVD_FILE"
if [ "$DVD_DIR" = "." ]; then echo "Destinaton Directory $DVD_DIR does not exist" exit 1 else if [ ! -d "/$DVD_DIR" ]; then echo "Destinaton Directory $DVD_DIR must be an absolute path" exit 1 else if [ "$DVD_FILE" = "" ] || [ -d "$DVD_DIR/$DVD_FILE" ]; then echo "Null ISO file name." exit 1 fi fi fi
# exit 1
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 >&/dev/null` ] && [ $? = 0 ]; 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 if [ -f $1/isolinux/isolinux.bin ]; then echo "Found FTP-like tree..." cp -av $1/* $DVD [ -e $1/.discinfo ] && cp -av $1/.discinfo $DVD else echo "Error: No CD images nor FTP-like tree found in $1" cleanup exit 1 fi fi
rm -rf $DVD/isolinux/boot.cat find $DVD -name TRANS.TBL | xargs rm -f
cd $DVD mkisofs -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 $2
echo "Image complete, start cleanup..."
cleanup
echo "" echo "Process Complete!" echo "Wrote DVD ISO image to $DVD_DIR/$DVD_FILE" echo "" --------------------------------- mkdvdiso.sh -----------------------------------------
On Wed, 04 Apr 2007 09:19:05 -0400, Phil Schaffner wrote:
The script below, a mod of
http://merlin.fit.vutbr.cz/mirrors/centos/build/mkdvdiso.sh
mentioned in
http://lists.centos.org/pipermail/centos-docs/2006-September/000039.html
works for me to create a DVD ISO from a set of C5 CD ISOs. The repo-tree part is still not working. Any advice appreciated.
Phil
I am probably not understanding the script very well, but if you simply run createrepo right after the line 'cd $DVD' and before the mkisofs line, wouldn't it do?
Akemi
On Wed, 04 Apr 2007 15:47:49 -0700, Akemi Yagi wrote:
On Wed, 04 Apr 2007 09:19:05 -0400, Phil Schaffner wrote:
The script below, a mod of
http://merlin.fit.vutbr.cz/mirrors/centos/build/mkdvdiso.sh
mentioned in
http://lists.centos.org/pipermail/centos-docs/2006-September/000039.html
works for me to create a DVD ISO from a set of C5 CD ISOs. The repo-tree part is still not working. Any advice appreciated.
Phil
I am probably not understanding the script very well, but if you simply run createrepo right after the line 'cd $DVD' and before the mkisofs line, wouldn't it do?
Just tried it myself and it seems to be working. Thanks for posting this useful script.
Akemi
On Thu, 2007-04-05 at 08:46 -0700, Akemi Yagi wrote:
On Wed, 04 Apr 2007 15:47:49 -0700, Akemi Yagi wrote:
On Wed, 04 Apr 2007 09:19:05 -0400, Phil Schaffner wrote:
The script below, a mod of
http://merlin.fit.vutbr.cz/mirrors/centos/build/mkdvdiso.sh
mentioned in
http://lists.centos.org/pipermail/centos-docs/2006-September/000039.html
works for me to create a DVD ISO from a set of C5 CD ISOs. The repo-tree part is still not working. Any advice appreciated.
Phil
I am probably not understanding the script very well, but if you simply run createrepo right after the line 'cd $DVD' and before the mkisofs line, wouldn't it do?
Just tried it myself and it seems to be working. Thanks for posting this useful script.
Updated the script again adding the createrepo line (thanks Akemi) and additional sanity checks. See attached text file. Now works for "FTP like tree" (as well as for ISO images) with CentOS-5 final, EXCEPT for creating a suitable .discinfo file if one does not already exist. Any help in modifying the script to create a .discinfo file "on-the-fly" would be appreciated.
Phil
On 4/13/07, Phil Schaffner Philip.R.Schaffner@nasa.gov wrote:
On Thu, 2007-04-05 at 08:46 -0700, Akemi Yagi wrote:
On Wed, 04 Apr 2007 15:47:49 -0700, Akemi Yagi wrote:
Updated the script again adding the createrepo line (thanks Akemi) and additional sanity checks. See attached text file. Now works for "FTP like tree" (as well as for ISO images) with CentOS-5 final, EXCEPT for creating a suitable .discinfo file if one does not already exist. Any help in modifying the script to create a .discinfo file "on-the-fly" would be appreciated.
If the original CDs do not contain a .discinfo file, would it still be necessary to create one? If the absense of .discinfo chokes some installer, then the same installer would not work with the original CDs either. In particular, if the script is meant for CentOS5, the .discinfo file exists on CD, so there should not be a problem...
Akemi
On 4/13/07, Akemi Yagi amyagi@gmail.com wrote:
On 4/13/07, Phil Schaffner Philip.R.Schaffner@nasa.gov wrote:
On Thu, 2007-04-05 at 08:46 -0700, Akemi Yagi wrote:
Updated the script again adding the createrepo line (thanks Akemi) and additional sanity checks. See attached text file. Now works for "FTP like tree" (as well as for ISO images) with CentOS-5 final, EXCEPT for creating a suitable .discinfo file if one does not already exist. Any help in modifying the script to create a .discinfo file "on-the-fly" would be appreciated.
If the original CDs do not contain a .discinfo file, would it still be necessary to create one? If the absense of .discinfo chokes some installer, then the same installer would not work with the original CDs either. In particular, if the script is meant for CentOS5, the .discinfo file exists on CD, so there should not be a problem...
Akemi
Just saw this .discinfo on the CentOS5 DVD:
1176235114.525559 Final i386 ALL CentOS/base /home/buildcentos/CENTOS/5.0/en/i386/CentOS CentOS/pixmaps
The 4th line is usually in the form of 1,2,3,... to indicate available discs and the script will write the line that way. Now, apparently "ALL" is a legitimate option here, so this may help make the script a bit simpler.
Akemi