Browse Source

Benjamin Schieder <blindcoder@scavenger.homeip.net>:

Patch Create-ISO to pass the path-specs as a file, not as one command-line
parameter per file. This enables Create-ISO to create DVD-Images by not
exceeding the 32k command-line limit.


git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@2126 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc
rocklinux
Benjamin Schieder 21 years ago
parent
commit
dd2b2f0a7b
1 changed files with 30 additions and 17 deletions
  1. +30
    -17
      scripts/Create-ISO

+ 30
- 17
scripts/Create-ISO

@ -32,7 +32,6 @@ fi
# default disk-size is 600 MB # default disk-size is 600 MB
dsize=$(( 600 * 1024 )) dsize=$(( 600 * 1024 ))
mkdebug=0 mkdebug=0
while true ; do while true ; do
@ -54,12 +53,13 @@ echo ; date "+ [%X] Removing old files with same prefix ..."
rm -rf ${isoprefix}_* rm -rf ${isoprefix}_*
date "+ [%X] Reading configs and creating ISO index ..." date "+ [%X] Reading configs and creating ISO index ..."
index=`mktemp` ; dat=`mktemp`
index=`mktemp` ; dat=`mktemp` ; pathspec=`mktemp`
rm -f ${pathspec}*
for cfg ; do for cfg ; do
id="`grep '^export ROCKCFG_ID=' config/$cfg/config | cut -f2 -d\'`" id="`grep '^export ROCKCFG_ID=' config/$cfg/config | cut -f2 -d\'`"
if ! cat build/$id/isofs.txt >> $dat if ! cat build/$id/isofs.txt >> $dat
then rm -f $dat $index ; exit 1 ; fi
then rm -f $dat $index ${pathspec}_* ; exit 1 ; fi
done done
# function to add a given file $1 to the place $2 on the resulting ISO # function to add a given file $1 to the place $2 on the resulting ISO
@ -68,13 +68,13 @@ add() {
local from="$1" to="$2" done=0 local from="$1" to="$2" done=0
if [ ! -f "$from" -a ! -d "$from" ] ; then if [ ! -f "$from" -a ! -d "$from" ] ; then
echo "No such file or directory: $from" echo "No such file or directory: $from"
rm -f $dat $index ; exit 1
rm -f $dat $index ${pathspec}_* ; exit 1
fi fi
size="`du -sk $from | cut -f1`" size="`du -sk $from | cut -f1`"
if [ $size -gt $(( $dsize - $disk_0_size )) ] ; then if [ $size -gt $(( $dsize - $disk_0_size )) ] ; then
echo "Junk $from is too big!"
rm -f $dat $index ; exit 1
echo "Chunk $from is too big!"
rm -f $dat $index ${pathspec}_* ; exit 1
fi fi
for x in $disks ; do for x in $disks ; do
@ -82,7 +82,7 @@ add() {
if [ $(( ${!ds} + $size )) -le \ if [ $(( ${!ds} + $size )) -le \
$(( $dsize - $disk_0_size )) ] ; then $(( $dsize - $disk_0_size )) ] ; then
eval "$ds=$(( ${!ds} + $size ))" eval "$ds=$(( ${!ds} + $size ))"
eval "$dd='${!dd} $to=$from'"
echo "$to=$from" >> ${pathspec}_${disk_nr}
done=1 ; break done=1 ; break
fi fi
done done
@ -90,7 +90,14 @@ add() {
if [ $done = 0 ] ; then if [ $done = 0 ] ; then
disk_nr=$(( $disk_nr + 1 )) disk_nr=$(( $disk_nr + 1 ))
ds=disk_${disk_nr}_size ; eval "$ds=$size" ds=disk_${disk_nr}_size ; eval "$ds=$size"
dd=disk_${disk_nr}_data ; eval "$dd='$to=$from'"
# FIXME: if in a path-list files, mkisofs complains about
# missing isolinux. Should be a mkisofs bug!
if [ "$to" = "isolinux/" -o "$from" = "isolinux/" ] ; then
echo "$to=$from" >> ${pathspec}_iso
else
echo "$to=$from" >> ${pathspec}_${disk_nr}
fi
disks="$disks $disk_nr" disks="$disks $disk_nr"
fi fi
} }
@ -101,7 +108,7 @@ while read tag data ; do
if [ $tag = BOOT ] ; then if [ $tag = BOOT ] ; then
if [ "$bootoptions" ] ; then if [ "$bootoptions" ] ; then
echo "Multiple boot options found!" echo "Multiple boot options found!"
rm -f $dat $index ; exit 1
rm -f $dat $index ${pathspec}_* ; exit 1
else else
bootoptions="$data" bootoptions="$data"
fi fi
@ -122,7 +129,7 @@ while read type from to ; do
add $from $to add $from $to
if [ $disk_nr -gt 0 ] ; then if [ $disk_nr -gt 0 ] ; then
echo "Every-disk data is too big!" echo "Every-disk data is too big!"
rm -f $dat $index ; exit 1
rm -f $dat $index ${pathspec}_* ; exit 1
fi fi
fi fi
done < $dat done < $dat
@ -135,7 +142,7 @@ while read type from to ; do
add $from $to add $from $to
if [ $disk_nr -gt 1 ] ; then if [ $disk_nr -gt 1 ] ; then
echo "Disk 1 is too big!" echo "Disk 1 is too big!"
rm -f $dat $index ; exit 1
rm -f $dat $index ${pathspec}_* ; exit 1
fi fi
fi fi
done < $dat done < $dat
@ -162,7 +169,7 @@ done < $dat
echo -n > $index echo -n > $index
for x in 0 $disks ; do for x in 0 $disks ; do
dd=disk_${x}_data dd=disk_${x}_data
for y in ${!dd} ; do
for y in ${!dd} `cat ${pathspec}_${x}` ; do
to=${y%=*} ; from=${y#*=} to=${y%=*} ; from=${y#*=}
if [ -d $from ] ; then if [ -d $from ] ; then
find $from -printf "disk$x $to%P\\n" >> $index find $from -printf "disk$x $to%P\\n" >> $index
@ -179,8 +186,8 @@ fi
xxx() { xxx() {
if ! mkisofs "$@" &> $dat ; then if ! mkisofs "$@" &> $dat ; then
echo ; echo "mkisofs $*" ; echo
cat $dat ; rm -f $index $dat ; exit 1
echo ; echo "mkisofs $@" ; echo
cat $dat ; rm -f $index $dat; exit 1
fi fi
} }
@ -208,12 +215,18 @@ date "+ [%X] Creating ${isoprefix}_index.txt ..."
sort -tk -n -k2 < $index > ${isoprefix}_index.txt sort -tk -n -k2 < $index > ${isoprefix}_index.txt
for x in $disks ; do for x in $disks ; do
dd=disk_${x}_data ; ds=disk_${x}_size
ds=disk_${x}_size
date "+ [%X] Creating ${isoprefix}_cd$x.iso ..." date "+ [%X] Creating ${isoprefix}_cd$x.iso ..."
echo "This is disk #$x." > $dat echo "This is disk #$x." > $dat
# FIXME: current mkisofs does only accept one -path-list
cat ${pathspec}_${x} ${pathspec}_0 > ${pathspec}_current
xxx -q -r -T -J -l -o ${isoprefix}_cd$x.iso -A "ROCK Linux - Disk $x" \ xxx -q -r -T -J -l -o ${isoprefix}_cd$x.iso -A "ROCK Linux - Disk $x" \
-P 'The ROCK Linux Project - http://www.rocklinux.org' \ -P 'The ROCK Linux Project - http://www.rocklinux.org' \
$bootoptions -graft-points disk$x.txt=$dat $disk_0_data ${!dd}
-path-list ${pathspec}_current \
$bootoptions -graft-points disk$x.txt=$dat \
`cat ${pathspec}_iso 2>/dev/null`
rm -f ${pathspec}_iso
rm -f ${pathspec}_current
bootoptions="" bootoptions=""
@ -300,5 +313,5 @@ fi
date "+ [%X] Done. Have fun!" date "+ [%X] Done. Have fun!"
echo echo
rm -f $index $dat
rm -f $index $dat ${pathspec}_*

Loading…
Cancel
Save