diff --git a/bin/sde-create-iso b/bin/sde-create-iso index f6316c6..ebaf3ff 100755 --- a/bin/sde-create-iso +++ b/bin/sde-create-iso @@ -107,7 +107,8 @@ for cfg in $cfgs ; do echo "Not a valid build: "$cfg"" echo "build/"$id"/TOOLCHAIN/isofs.txt might be created." else - dirs="$dirs `cat build/"$id"/TOOLCHAIN/isofs.txt`" + dirs="${dirs}"$'\n' + dirs="${dirs}"`cat build/"$id"/TOOLCHAIN/isofs.txt` fi done @@ -115,22 +116,31 @@ done # wantfiles= grafts=`mktemp` -wantfiles=$( echo "$dirs" | grep '^DISK1\|^SPLIT' | gawk '{print($2)}' ) +wantfiles=$( echo "${dirs}" | grep '^DISK1\|^SPLIT' | gawk '{print($2)}' ) -for file in $wantfiles; do - mfileline=$( echo "$file" | gawk -F/ '{print $NF}' ) - dirline=$( echo "$file" | gawk -F/ '{$NF=""; NF--; print}' | sed -e 's|\ |\/|g') - cdline=$( echo "$dirs" | grep "$dirline" | grep -v 'EVERY' | gawk '{print $3}' ) - graftline="$cdline$mfileline=$file" - echo $graftline >> $grafts +for file in ${wantfiles}; do + mfileline=$( echo "${file}" | gawk -F/ '{print $NF}' ) + dirline=$( echo "${file}" | gawk -F/ '{$NF=""; NF--; print}' | sed -e 's|\ |\/|g') + cdline=$( echo "${dirs}" | grep "${dirline}" | grep -v 'EVERY' | gawk '{print $3}' ) + graftline="${cdline}${mfileline}=${file}" + echo ${graftline} >> $grafts done -out_size=$(echo "$wantfiles" | xargs mkisofs -quiet -print-size -V 0000 -graft-points) +out_size=$(echo "${wantfiles}" | xargs mkisofs -quiet -print-size -V 0000 -graft-points) out_size=$( gawk 'BEGIN {printf("%d",'$out_size'*2048)}' ) x=$(gawk 'BEGIN {print ('$out_size' > '$size') ? "true" : "false" }') -if $x; then - exit 1 + +#mangle bootoptions +bootoptions= +bootoptions=$( echo "${dirs}" | grep '^BOOT ' | cut -f2- -d ' ') +bootoptions="${bootoptions}"`echo "${dirs}" | grep '^BOOTx ' | cut -f2- -d ' '` + +udf= +[[ "$format" = "udf" ]] && udf="-udf" + +if "$x"; then + echo_abort 1 "$out_size is bigger than $size and I am too dumb to split across multiple media :(" else - mkisofs -v -v -r -T -J -l -A "OpenSDE - Disk 1" -publisher 'OpenSDE System Develop Environment - http://www.opensde.org' \ - -path-list $grafts $bootoptions -graft-points -o iso/"$name"_"$lsize".iso + mkisofs "$udf" -r -T -J -l -A "OpenSDE - Disk 1" -publisher 'OpenSDE System Develop Environment - http://www.opensde.org' \ + -path-list "$grafts" "${bootoptions}" -graft-points -o iso/"$name"_"$lsize".iso fi