#!/bin/sh # # dvd2cd -- create X/OS Linux CD ISO images from a X/OS Linux DVD # # Copyright (c) 2004-2005 by X/OS Experts in Open Systems BV # # Author: Jos Vos # # This software may be freely redistributed under the terms of the # GNU General Public License, version 2 or later. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # PREFIX="xoslinux-4.0-x86_64-cd" TOTDISCS="8" if [ $# -lt 2 ]; then echo "Usage: $0 dvd-directory cd-number [ ... ]" >&2 exit 2 elif [ ! -d "$1/XOS/RPMS" -o ! -d "$1/dvdutils" ]; then echo "$0: no X/OS Linux DVD tree found in $1" >&2 exit 2 fi CURRDIR=`pwd` TEMPDIR=/tmp/dvd2cd$$ DVDROOT="$1" shift cd $DVDROOT for i in $*; do if [ ! -f "dvdutils/.pathlist-cd$i" ]; then echo "$0: unknown CD number \"$i\" given" >&2 exit 1 elif [ -f $CURRDIR/cd$i.iso ]; then echo "$0: file $CURRDIR/cd$i.iso already exists" >&2 exit 1 fi done for i in $*; do if [ $i -eq 1 ]; then options="-b isolinux/isolinux.bin -c isolinux/boot.cat "\ "-no-emul-boot -boot-load-size 4 -boot-info-table" params="isolinux/isolinux.bin=$TEMPDIR/isolinux.bin" mkdir $TEMPDIR install -m 0644 isolinux/isolinux.bin $TEMPDIR/ else options= params= fi # -volset-size $TOTDISCS -volset-seqno $i \ sed -e '/^isolinux\/isolinux\.bin$/d' -e 's/.*/&=&/' \ dvdutils/.pathlist-cd$i |\ mkisofs -r -J -T -sysid LINUX -input-charset UTF-8 $options \ -volset-size 1 -volset-seqno 1 \ -o $CURRDIR/${PREFIX}${i}.iso \ -graft-points -path-list - \ .discinfo=dvdutils/.discinfo-cd$i $params if [ $i -eq 1 ]; then rm -rf $TEMPDIR fi done exit 0