prefix config variables with RELENG_

This commit is contained in:
George Danchev 2011-06-28 16:20:31 +00:00
parent a4f1f704e4
commit 9a726fb231
2 changed files with 43 additions and 43 deletions

View File

@ -5,12 +5,12 @@ set -e
START_DIR_DONT_CHANGE=`pwd` START_DIR_DONT_CHANGE=`pwd`
SELF=$(basename "$0") SELF=$(basename "$0")
# required config items # required config items
XOR="" RELENG_XORRISO=""
DIR="" RELENG_DIR=""
IMG="" RELENG_IMG=""
# optional config items # optional config items
ISOLINUX_BIN="" RELENG_ISOLINUX_BIN=""
BOOT_CAT="" RELENG_BOOT_CAT=""
CONFFILE=$HOME/.libburnia-releng/releng_build_isojigdo.conf CONFFILE=$HOME/.libburnia-releng/releng_build_isojigdo.conf
KEEP=0 KEEP=0
GEN_DATA_DIR=releng_generated_data/${SELF} GEN_DATA_DIR=releng_generated_data/${SELF}
@ -58,12 +58,12 @@ if [ "${1}" == "-rc" ]; then
if [ "${2}" == "-keep" ]; then KEEP=1; fi if [ "${2}" == "-keep" ]; then KEEP=1; fi
# command line args # command line args
elif [ "${3}" ]; then elif [ "${3}" ]; then
XOR="${1}" RELENG_XORRISO="${1}"
DIR="${2}" RELENG_DIR="${2}"
IMG="${3}" RELENG_IMG="${3}"
if [ "${4}" ]; then if [ "${4}" ]; then
ISOLINUX_BIN="${4}" RELENG_ISOLINUX_BIN="${4}"
if [ "${5}" ]; then BOOT_CAT="${5}"; fi if [ "${5}" ]; then RELENG_BOOT_CAT="${5}"; fi
if [ "${4}" == "-keep" -o "${5}" == "-keep" -o "${6}" == "-keep" ]; then KEEP=1; fi if [ "${4}" == "-keep" -o "${5}" == "-keep" -o "${6}" == "-keep" ]; then KEEP=1; fi
fi fi
# the rest # the rest
@ -80,25 +80,25 @@ else
mkdir "${GEN_DATA_DIR}" mkdir "${GEN_DATA_DIR}"
fi fi
if [ "${XOR}" == "" -o "${DIR}" == "" -o "${IMG}" == "" ]; then if [ "${RELENG_XORRISO}" == "" -o "${RELENG_DIR}" == "" -o "${RELENG_IMG}" == "" ]; then
echo -e "\n${SELF}: xorriso_cmd IN_dir and OUT_image are required\n" echo -e "\n${SELF}: xorriso_cmd IN_dir and OUT_image are required\n"
exit 40 exit 40
fi fi
if [ ! -x "${XOR}" ]; then if [ ! -x "${RELENG_XORRISO}" ]; then
printf "${SELF}: Not found or not an executable: $XOR\n" printf "${SELF}: Not found or not an executable: $RELENG_XORRISO\n"
exit 50 exit 50
fi fi
# all must be set at this point # all must be set at this point
printf "${SELF}: Config items:" printf "${SELF}: Config items:"
printf "\n\txorriso_cmd=${XOR}\n\tIN_dir=${DIR}\n\tOUT_image=${IMG}.iso" printf "\n\txorriso_cmd=${RELENG_XORRISO}\n\tIN_dir=${RELENG_DIR}\n\tOUT_image=${RELENG_IMG}.iso"
printf "\n\tIN_isolinux=${ISOLINUX_BIN}\n\tOUT_bootcat=${BOOT_CAT}\n" printf "\n\tIN_isolinux=${RELENG_ISOLINUX_BIN}\n\tOUT_bootcat=${RELENG_BOOT_CAT}\n"
RES="${IMG}.iso ${IMG}.new ${IMG}.md5 ${IMG}.jigdo ${IMG}.template" RES="${RELENG_IMG}.iso ${RELENG_IMG}.new ${RELENG_IMG}.md5 ${RELENG_IMG}.jigdo ${RELENG_IMG}.template"
# xorriso version details, incl. underlying libraries # xorriso version details, incl. underlying libraries
"${XOR}" -version "${RELENG_XORRISO}" -version
if ! "${XOR}" -version | grep libjte >/dev/null 2>&1; then if ! "${RELENG_XORRISO}" -version | grep libjte >/dev/null 2>&1; then
printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit and rebuild." printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit and rebuild."
printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n" printf "\n${SELF}: See http://www.einval.com/~steve/software/JTE/\n"
exit 51 exit 51
@ -116,7 +116,7 @@ fi
# create MD5 list in base64 format # create MD5 list in base64 format
if which jigdo-gen-md5-list >/dev/null 2>&1; then if which jigdo-gen-md5-list >/dev/null 2>&1; then
printf "${SELF}: Creating MD5 list in hex format..." printf "${SELF}: Creating MD5 list in hex format..."
jigdo-gen-md5-list ${DIR} > ${GEN_DATA_DIR}/${IMG}.md5 jigdo-gen-md5-list ${RELENG_DIR} > ${GEN_DATA_DIR}/${RELENG_IMG}.md5
printf "Done.\n" printf "Done.\n"
else else
printf "\n${SELF}: Not found: jigdo-gen-md5-list. Install jigit." printf "\n${SELF}: Not found: jigdo-gen-md5-list. Install jigit."
@ -125,10 +125,10 @@ else
fi fi
# build the command - general section # build the command - general section
CMD="${XOR} \ CMD="${RELENG_XORRISO} \
-as mkisofs \ -as mkisofs \
-quiet \ -quiet \
-o ${GEN_DATA_DIR}/${IMG}.iso \ -o ${GEN_DATA_DIR}/${RELENG_IMG}.iso \
-R \ -R \
-V ISOJIGDO \ -V ISOJIGDO \
-partition_offset 16 \ -partition_offset 16 \
@ -136,10 +136,10 @@ CMD="${XOR} \
" "
# boot section TODO # boot section TODO
#if [ "${ISOLINUX_BIN}" -a "${BOOT_CAT}" ]; then #if [ "${RELENG_ISOLINUX_BIN}" -a "${RELENG_BOOT_CAT}" ]; then
#CMD+=\ #CMD+=\
# -b ${ISOLINUX_BIN} \ # NOTE: boot/isolinux/isolinux.bin # -b ${RELENG_ISOLINUX_BIN} \ # NOTE: boot/isolinux/isolinux.bin
# -c ${BOOT_CAT} \ # NOTE: boot/boot.cat # -c ${RELENG_BOOT_CAT} \ # NOTE: boot/boot.cat
# -no-emul-boot -boot-load-size 4 -boot-info-table \ # -no-emul-boot -boot-load-size 4 -boot-info-table \
# -isohybrid-mbr somembr.sysarea \ # TODO: figure out where to grab one # -isohybrid-mbr somembr.sysarea \ # TODO: figure out where to grab one
# -partition_offset 16 \ # -partition_offset 16 \
@ -151,14 +151,14 @@ CMD+="\
-jigdo-template-compress gzip \ -jigdo-template-compress gzip \
-checksum_algorithm_iso md5,sha1,sha256,sha512 \ -checksum_algorithm_iso md5,sha1,sha256,sha512 \
-checksum_algorithm_template md5,sha1,sha256,sha512 \ -checksum_algorithm_template md5,sha1,sha256,sha512 \
-jigdo-jigdo ${GEN_DATA_DIR}/${IMG}.jigdo \ -jigdo-jigdo ${GEN_DATA_DIR}/${RELENG_IMG}.jigdo \
-jigdo-template ${GEN_DATA_DIR}/${IMG}.template \ -jigdo-template ${GEN_DATA_DIR}/${RELENG_IMG}.template \
-jigdo-map Debian=${DIR} \ -jigdo-map Debian=${RELENG_DIR} \
-md5-list ${GEN_DATA_DIR}/${IMG}.md5 \ -md5-list ${GEN_DATA_DIR}/${RELENG_IMG}.md5 \
-jigdo-min-file-size 1024 \ -jigdo-min-file-size 1024 \
" "
CMD+="${DIR}" CMD+="${RELENG_DIR}"
# run it # run it
echo -e "${SELF}: Creating ISO and jigdo representations:\n$CMD\n" echo -e "${SELF}: Creating ISO and jigdo representations:\n$CMD\n"
@ -168,10 +168,10 @@ ${CMD}
if which jigit-mkimage >/dev/null 2>&1; then if which jigit-mkimage >/dev/null 2>&1; then
printf "${SELF}: Creating new ISO from jigdo files..." printf "${SELF}: Creating new ISO from jigdo files..."
jigit-mkimage \ jigit-mkimage \
-t ${GEN_DATA_DIR}/${IMG}.template \ -t ${GEN_DATA_DIR}/${RELENG_IMG}.template \
-j ${GEN_DATA_DIR}/${IMG}.jigdo \ -j ${GEN_DATA_DIR}/${RELENG_IMG}.jigdo \
-m Debian=${DIR} \ -m Debian=${RELENG_DIR} \
-o ${GEN_DATA_DIR}/${IMG}.new -o ${GEN_DATA_DIR}/${RELENG_IMG}.new
printf "Done.\n" printf "Done.\n"
else else
printf "\n${SELF}: Not found: jigit-mkimage. Install jigit." printf "\n${SELF}: Not found: jigit-mkimage. Install jigit."
@ -180,11 +180,11 @@ else
fi fi
# trap the exit code of diff and let the Universe explode # trap the exit code of diff and let the Universe explode
diff ${GEN_DATA_DIR}/${IMG}.iso ${GEN_DATA_DIR}/${IMG}.new diff ${GEN_DATA_DIR}/${RELENG_IMG}.iso ${GEN_DATA_DIR}/${RELENG_IMG}.new
DIFF_RET="$?" DIFF_RET="$?"
case ${DIFF_RET} in case ${DIFF_RET} in
0) 0)
echo -e "${SELF}: diff ${GEN_DATA_DIR}/${IMG}.iso ${GEN_DATA_DIR}/${IMG}.new matched.\n" echo -e "${SELF}: diff ${GEN_DATA_DIR}/${RELENG_IMG}.iso ${GEN_DATA_DIR}/${RELENG_IMG}.new matched.\n"
;; ;;
*) *)
echo -e "${SELF}: FAIL: diff returned code: $DIFF_RET\n" echo -e "${SELF}: FAIL: diff returned code: $DIFF_RET\n"
@ -204,9 +204,9 @@ fi
# last hints # last hints
printf "\n${SELF}: HINT: manual checks remained to be done:\n" printf "\n${SELF}: HINT: manual checks remained to be done:\n"
printf " * ${IMG}.img boots from USB stick and/or optical media.\n" printf " * ${RELENG_IMG}.img boots from USB stick and/or optical media.\n"
printf " * appended FAT partition is mountable.\n" printf " * appended FAT partition is mountable.\n"
printf " * xorriso -indev ${IMG}.iso -pvd_info\n" printf " * xorriso -indev ${RELENG_IMG}.iso -pvd_info\n"
printf " * fdisk -lu ${IMG}.iso\n" printf " * fdisk -lu ${RELENG_IMG}.iso\n"
exit 0 exit 0

View File

@ -3,16 +3,16 @@
# *** Then a run of 'releng_build_isojigdo -rc' will pick it up # *** Then a run of 'releng_build_isojigdo -rc' will pick it up
# xorriso executable to be tested # xorriso executable to be tested
XOR=/path/to/xorriso RELENG_XORRISO=/path/to/xorriso
# Should contain an ISOLINUX setup and some payload files # Should contain an ISOLINUX setup and some payload files
DIR=/path/to/input_dir RELENG_DIR=/path/to/input_dir
# Gets created resp. overwritten by this test # Gets created resp. overwritten by this test
IMG=/path/to/out_image RELENG_IMG=/path/to/out_image
# It is part of the ISOLINUX setup in $DIR # It is part of the ISOLINUX setup in $DIR
ISOLINUX_BIN=/path/to/input_dir/isolinux.bin RELENG_ISOLINUX_BIN=/path/to/input_dir/isolinux.bin
# Will be created in the ISO image. Should not exist in $DIR # Will be created in the ISO image. Should not exist in $DIR
BOOT_CAT=/path/to/boot.cat RELENG_BOOT_CAT=/path/to/boot.cat