check for libjte support in the tested binary and quit gracefully; drop lots of old commented cruft
This commit is contained in:
parent
bda34a1496
commit
3d68267083
@ -2,139 +2,39 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# START_DIR_DONT_CHANGE=`pwd`
|
|
||||||
# SELF=$(basename "$0")
|
|
||||||
# required config items
|
|
||||||
#CONFFILE=$HOME/.libburnia-releng/${SELF}.conf
|
|
||||||
#GEN_DATA_DIR=releng_generated_data/${SELF}
|
|
||||||
|
|
||||||
. inc/releng_getopts.inc
|
. inc/releng_getopts.inc
|
||||||
|
|
||||||
if [ ! -x $RELENG_XORRISO ]; then
|
if [ ! -x $RELENG_XORRISO ]; then
|
||||||
print_help
|
print_help
|
||||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||||
exit 31
|
exit 30
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check data dir, if any and after checking -x xorriso
|
# check data dir, if any and after checking -x xorriso
|
||||||
if [ -d "${GEN_DATA_DIR}" ]; then
|
if [ -d "${GEN_DATA_DIR}" ]; then
|
||||||
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
||||||
printf "\n${SELF}: use '${SELF} -c1' to remove.\n"
|
printf "\n${SELF}: use '${SELF} -c1' to remove.\n"
|
||||||
exit 8
|
exit 1
|
||||||
else
|
else
|
||||||
mkdir "${GEN_DATA_DIR}"
|
mkdir "${GEN_DATA_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TMP_DATA_DIR=releng_generated_data
|
TMP_DATA_DIR=releng_generated_data
|
||||||
IMG_EXTRACT_DIR=${GEN_DATA_DIR}/${SELF}_extracted_tree
|
IMG_EXTRACT_DIR=${GEN_DATA_DIR}/${SELF}_extracted_tree
|
||||||
|
|
||||||
# to be set by the config file
|
|
||||||
# RELENG_XORRISO=""
|
|
||||||
|
|
||||||
RELENG_DIR="${IMG_EXTRACT_DIR}"
|
RELENG_DIR="${IMG_EXTRACT_DIR}"
|
||||||
RELENG_ISOLINUX_BIN="isolinux/isolinux.bin"
|
RELENG_ISOLINUX_BIN="isolinux/isolinux.bin"
|
||||||
RELENG_BOOT_CAT="isolinux/boot.cat"
|
RELENG_BOOT_CAT="isolinux/boot.cat"
|
||||||
RELENG_IMG=t1
|
RELENG_IMG=t1
|
||||||
|
|
||||||
# KEEP=0
|
|
||||||
RES=""
|
RES=""
|
||||||
|
|
||||||
REMOTE_URL="http://cdimage.debian.org/cdimage/daily-builds/daily/current/i386/iso-cd"
|
REMOTE_URL="http://cdimage.debian.org/cdimage/daily-builds/daily/current/i386/iso-cd"
|
||||||
REMOTE_IMG="debian-testing-i386-businesscard.iso"
|
REMOTE_IMG="debian-testing-i386-businesscard.iso"
|
||||||
|
|
||||||
#####
|
# check for required items
|
||||||
#print_help() {
|
|
||||||
# cat << HLP
|
|
||||||
#Usage:
|
|
||||||
# ${SELF} -help
|
|
||||||
#
|
|
||||||
# using a config file ${CONFFILE}
|
|
||||||
# ${SELF} -rc [-keep]
|
|
||||||
#
|
|
||||||
# without using a config file
|
|
||||||
# ${SELF} /absolute/or/relative/path/to/xorriso [-keep]
|
|
||||||
|
|
||||||
# cleanup test generated data directory and exit
|
|
||||||
# ${SELF} -cleanup
|
|
||||||
#HLP
|
|
||||||
#}
|
|
||||||
|
|
||||||
#####
|
|
||||||
#cleanup() {
|
|
||||||
# if [ ${KEEP} -eq 0 ]; then
|
|
||||||
# # safety net, just in case -> we want to be in the starting
|
|
||||||
# # directory before removing whatever self-generated stuff
|
|
||||||
# if [ -d "${GEN_DATA_DIR}" ]; then
|
|
||||||
# cd "${START_DIR_DONT_CHANGE}" || exit 15
|
|
||||||
# chmod +w -R ${GEN_DATA_DIR}
|
|
||||||
# rm -rf ${GEN_DATA_DIR}
|
|
||||||
# printf "${SELF}: Removed (self-generated) %s\n" ${GEN_DATA_DIR}
|
|
||||||
# else
|
|
||||||
# printf "${SELF}: ${GEN_DATA_DIR} does not exist. Nothing to clean.\n"
|
|
||||||
# fi
|
|
||||||
# else
|
|
||||||
# printf "${SELF}: Leaving (self-generated) %s\n" ${GEN_DATA_DIR}
|
|
||||||
# fi
|
|
||||||
#}
|
|
||||||
|
|
||||||
# cleanup
|
|
||||||
#if [ "${1}" == "-cleanup" ]; then
|
|
||||||
# cleanup
|
|
||||||
# exit 0
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# help
|
|
||||||
#if [ ! "${1}" ]; then
|
|
||||||
# print_help && exit 3
|
|
||||||
# config file
|
|
||||||
#elif [ "${1}" == "-rc" -a "${2}" == "-keep" ]; then
|
|
||||||
# KEEP=1
|
|
||||||
# if [ -e ${CONFFILE} ]; then
|
|
||||||
# . ${CONFFILE}
|
|
||||||
# printf "${SELF}: Using config file %s\n" ${CONFFILE}
|
|
||||||
# else
|
|
||||||
# echo -e "\n${SELF}: Config file ${CONFFILE} not found.\n" && exit 4
|
|
||||||
# fi
|
|
||||||
#elif [ "${1}" == "-rc" -a ! "${2}" ]; then
|
|
||||||
# KEEP=0
|
|
||||||
# if [ -e ${CONFFILE} ]; then
|
|
||||||
# . ${CONFFILE}
|
|
||||||
# printf "${SELF}: Using config file %s\n" ${CONFFILE}
|
|
||||||
# else
|
|
||||||
# echo -e "\n${SELF}: Config file ${CONFFILE} not found.\n" && exit 4
|
|
||||||
# fi
|
|
||||||
# cmdline option
|
|
||||||
#elif [ -x "${1}" -a "${2}" == "-keep" ]; then
|
|
||||||
# RELENG_XORRISO="${1}"
|
|
||||||
# KEEP=1
|
|
||||||
#elif [ -x "${1}" ]; then
|
|
||||||
# RELENG_XORRISO="${1}"
|
|
||||||
# KEEP=0
|
|
||||||
# the rest
|
|
||||||
#else
|
|
||||||
# print_help && exit 5
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#
|
|
||||||
if [ "${RELENG_XORRISO}" == "" -o "${RELENG_DIR}" == "" -o "${RELENG_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 6
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#if [ ! -x "${RELENG_XORRISO}" ]; then
|
|
||||||
# printf "${SELF}: $RELENG_XORRISO not found or not an executable.\n"
|
|
||||||
# exit 7
|
|
||||||
#fi
|
|
||||||
|
|
||||||
# data dir
|
|
||||||
#if [ -d "${GEN_DATA_DIR}" ]; then
|
|
||||||
# printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
|
|
||||||
# printf "\n${SELF}: use '${SELF} -cleanup' to remove.\n"
|
|
||||||
# exit 8
|
|
||||||
#else
|
|
||||||
# mkdir "${GEN_DATA_DIR}"
|
|
||||||
#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=${RELENG_XORRISO}\n\tIN_dir=${RELENG_DIR}\n\tOUT_image=${RELENG_IMG}.iso"
|
printf "\n\txorriso_cmd=${RELENG_XORRISO}\n\tIN_dir=${RELENG_DIR}\n\tOUT_image=${RELENG_IMG}.iso"
|
||||||
@ -147,11 +47,23 @@ if ! "${RELENG_XORRISO}" -version | grep libjte >/dev/null 2>&1; then
|
|||||||
printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit >=1.18 and rebuild."
|
printf "\n${SELF}: JTE not supported with this xorriso build. Install jigit >=1.18 and rebuild."
|
||||||
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 9
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove cruft from previous runs
|
# check whether the binary support JTE
|
||||||
# rm -f ${RES}
|
set +e
|
||||||
|
RETSTR_VER_JTE=`"${RELENG_XORRISO}" --version 2>/dev/null | grep -P "(libjte\s+in\s+use)"`
|
||||||
|
RETCODE_VER_JTE="$?"
|
||||||
|
set -e
|
||||||
|
case ${RETCODE_VER_JTE} in
|
||||||
|
0)
|
||||||
|
printf "\n${SELF}: Found JTE support with ${RELENG_XORRISO} : ${RETSTR_VER_JTE}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printf "\n${SELF}: FAIL: Not found JTE support in ${RELENG_XORRISO}. Quit.\n"
|
||||||
|
exit 4
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# grab remote ISO image, to decompose
|
# grab remote ISO image, to decompose
|
||||||
if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||||
@ -166,7 +78,7 @@ if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
|||||||
*)
|
*)
|
||||||
echo -e "\n${SELF}: FAIL: wget returned code: $WGET_RET\n"
|
echo -e "\n${SELF}: FAIL: wget returned code: $WGET_RET\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 10
|
exit 5
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
@ -177,7 +89,7 @@ fi
|
|||||||
if [ -d "${IMG_EXTRACT_DIR}" ]; then
|
if [ -d "${IMG_EXTRACT_DIR}" ]; then
|
||||||
printf "\n${SELF}: Found ${IMG_EXTRACT_DIR}. Please cleanup.\n"
|
printf "\n${SELF}: Found ${IMG_EXTRACT_DIR}. Please cleanup.\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 11
|
exit 6
|
||||||
else
|
else
|
||||||
mkdir "${IMG_EXTRACT_DIR}"
|
mkdir "${IMG_EXTRACT_DIR}"
|
||||||
fi
|
fi
|
||||||
@ -208,7 +120,7 @@ else
|
|||||||
printf "\n${SELF}: Not found: "${MKFS_MSDOS}". Install dosfstools."
|
printf "\n${SELF}: Not found: "${MKFS_MSDOS}". Install dosfstools."
|
||||||
printf "\n${SELF}: http://www.daniel-baumann.ch/software/dosfstools/\n"
|
printf "\n${SELF}: http://www.daniel-baumann.ch/software/dosfstools/\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 12
|
exit 7
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# GENERAL section
|
# GENERAL section
|
||||||
@ -235,7 +147,7 @@ CMD+="\
|
|||||||
else
|
else
|
||||||
printf "\n${SELF}: FAIL to compose the boot section.\n"
|
printf "\n${SELF}: FAIL to compose the boot section.\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 13
|
exit 8
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# JIGDO section
|
# JIGDO section
|
||||||
@ -254,7 +166,7 @@ else
|
|||||||
printf "\n${SELF}: Not found: jigdo-gen-md5-list. Install jigit >= 1.18."
|
printf "\n${SELF}: Not found: jigdo-gen-md5-list. Install jigit >= 1.18."
|
||||||
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 14
|
exit 9
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CMD+="\
|
CMD+="\
|
||||||
@ -287,7 +199,7 @@ else
|
|||||||
printf "\n${SELF}: Not found: jigit-mkimage. Install jigit."
|
printf "\n${SELF}: Not found: jigit-mkimage. Install jigit."
|
||||||
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
printf "\n${SELF}: http://www.einval.com/~steve/software/JTE/\n"
|
||||||
cleanup
|
cleanup
|
||||||
exit 15
|
exit 10
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# trap the exit code of diff and let the Universe explode
|
# trap the exit code of diff and let the Universe explode
|
||||||
|
Loading…
Reference in New Issue
Block a user