2011-06-22 14:43:06 +00:00
|
|
|
#!/bin/bash
|
2011-06-22 13:33:10 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2011-06-22 14:43:06 +00:00
|
|
|
if [ ! "${3}" ]; then
|
|
|
|
printf "$0 xorriso_cmd dir_in image_out [--clean]\n"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
XOR=${1}
|
|
|
|
DIR=${2}
|
|
|
|
IMG=${3}
|
|
|
|
RES="${IMG}.iso ${IMG}.new ${IMG}.md5 ${IMG}.jigdo ${IMG}.template"
|
|
|
|
|
|
|
|
# remove cruft from previous runs
|
|
|
|
# rm -f ${RES}
|
2011-06-22 13:33:10 +00:00
|
|
|
|
|
|
|
jigdo-gen-md5-list ${DIR} > ${IMG}.md5
|
|
|
|
|
2011-06-22 14:43:06 +00:00
|
|
|
${XOR} \
|
2011-06-22 13:33:10 +00:00
|
|
|
-as mkisofs \
|
|
|
|
-o ${IMG}.iso \
|
2011-06-22 14:43:06 +00:00
|
|
|
-R -V 'ISO_JIGDO' \
|
2011-06-22 13:33:10 +00:00
|
|
|
-partition_offset 16 \
|
|
|
|
-J -joliet-long \
|
|
|
|
\
|
|
|
|
-jigdo-template-compress gzip \
|
2011-06-22 14:43:06 +00:00
|
|
|
-checksum_algorithm_iso md5,sha1,sha256,sha512 \
|
|
|
|
-checksum_algorithm_template md5,sha1,sha256,sha512 \
|
2011-06-22 13:33:10 +00:00
|
|
|
-jigdo-jigdo ${IMG}.jigdo \
|
|
|
|
-jigdo-template ${IMG}.template \
|
|
|
|
-jigdo-map Debian=${DIR} \
|
|
|
|
-md5-list ${IMG}.md5 \
|
|
|
|
-jigdo-min-file-size 1024 \
|
|
|
|
\
|
|
|
|
${DIR}
|
|
|
|
|
|
|
|
jigit-mkimage \
|
|
|
|
-t ${IMG}.template \
|
|
|
|
-j ${IMG}.jigdo \
|
|
|
|
-m Debian=${DIR} \
|
2011-06-22 14:43:06 +00:00
|
|
|
-o ${IMG}.new
|
|
|
|
|
|
|
|
diff ${IMG}.iso ${IMG}.new
|
2011-06-22 13:33:10 +00:00
|
|
|
|
2011-06-22 14:43:06 +00:00
|
|
|
# sort out the cruft
|
|
|
|
if [ "${4}" == "--clean" ]; then
|
|
|
|
rm -f ${RES}
|
|
|
|
printf "removed: %s\n" ${RES}
|
|
|
|
else
|
|
|
|
printf "left: %s\n" ${RES}
|
|
|
|
fi
|