Made releng/manual_isojigdo ready for FreeBSD ("bash" linked to /bin/sh)

This commit is contained in:
Thomas Schmitt 2011-08-10 09:16:03 +00:00
parent 15c3c70212
commit 26e98f5fa8

View File

@ -54,7 +54,7 @@ REMOTE_URL="http://cdimage.debian.org/cdimage/daily-builds/daily/current/i386/is
REMOTE_IMG="debian-testing-i386-businesscard.iso" REMOTE_IMG="debian-testing-i386-businesscard.iso"
# check for required items # check for required items
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 2 exit 2
fi fi
@ -70,7 +70,7 @@ RES="${RELENG_IMG}.iso ${RELENG_IMG}.new ${RELENG_IMG}.md5 ${RELENG_IMG}.jigdo $
# check whether the binary support JTE # check whether the binary support JTE
set +e set +e
RETSTR_VER_JTE=`"${RELENG_XORRISO}" --version 2>/dev/null | grep -P "(libjte\s+in\s+use)"` RETSTR_VER_JTE=`"${RELENG_XORRISO}" --version 2>/dev/null | grep "libjte * in use"`
RETCODE_VER_JTE="$?" RETCODE_VER_JTE="$?"
set -e set -e
case ${RETCODE_VER_JTE} in case ${RETCODE_VER_JTE} in
@ -89,9 +89,21 @@ 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
printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n" printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n"
wget --no-check-certificate -T20 -t3 -O \ if wget -V >/dev/null 2>&1
"${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}" then
WGET_RET="$?" wget --no-check-certificate -T20 -t3 \
-O "${TMP_DATA_DIR}"/"${REMOTE_IMG}" "${REMOTE_URL}"/"${REMOTE_IMG}"
WGET_RET="$?"
elif fetch -T 20 -o "${TMP_DATA_DIR}"/"${REMOTE_IMG}" \
"${REMOTE_URL}"/"${REMOTE_IMG}"
then
WGET_RET=0
else
echo
echo "FAIL: ${SELF} : Neither wget nor fetch are present and willing to work"
cleanup
exit 10
fi
case ${WGET_RET} in case ${WGET_RET} in
0) 0)
echo -e "\n${SELF}: Downloading successfully completed.\n" echo -e "\n${SELF}: Downloading successfully completed.\n"
@ -137,11 +149,15 @@ APPEND_PART="${GEN_DATA_DIR}/fatpart.fat"
MKFS_MSDOS="/sbin/mkfs.msdos" MKFS_MSDOS="/sbin/mkfs.msdos"
if [ -x "${MKFS_MSDOS}" ]; then if [ -x "${MKFS_MSDOS}" ]; then
"${MKFS_MSDOS}" -n Bla -C "${APPEND_PART}" 8192 "${MKFS_MSDOS}" -n Bla -C "${APPEND_PART}" 8192
APPEND_PART_CMD="-append_partition 2 0x01 ${APPEND_PART}"
else else
printf "\n${SELF}: Not found: "${MKFS_MSDOS}". Install dosfstools." APPEND_PART_CMD=
printf "\n${SELF}: http://www.daniel-baumann.ch/software/dosfstools/\n"
cleanup # printf "\nFAIL : ${SELF} : Not found: ${MKFS_MSDOS}"
exit 7 # printf "\n${SELF}: Not found: "${MKFS_MSDOS}". Install dosfstools."
# printf "\n${SELF}: http://www.daniel-baumann.ch/software/dosfstools/\n"
# cleanup
# exit 7
fi fi
# GENERAL section # GENERAL section
@ -156,25 +172,32 @@ CMD="${RELENG_XORRISO} \
" "
# BOOT section # BOOT section
if [ -f "${IMG_EXTRACT_DIR}"/"${RELENG_ISOLINUX_BIN}" -a -f "${ISOHYBRID_MBR}" -a -f "${APPEND_PART}" ]; then if [ -f "${IMG_EXTRACT_DIR}"/"${RELENG_ISOLINUX_BIN}" -a -f "${ISOHYBRID_MBR}" ]
CMD+="\ then
CMD="$CMD \
-b ${RELENG_ISOLINUX_BIN} \ -b ${RELENG_ISOLINUX_BIN} \
-c ${RELENG_BOOT_CAT} \ -c ${RELENG_BOOT_CAT} \
-no-emul-boot -boot-load-size 4 -boot-info-table \ -no-emul-boot -boot-load-size 4 -boot-info-table \
-isohybrid-mbr ${ISOHYBRID_MBR} \ -isohybrid-mbr ${ISOHYBRID_MBR} \
-partition_offset 16 \ -partition_offset 16 \
-append_partition 2 0x01 ${APPEND_PART} \
" "
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 8 exit 8
fi fi
if [ -n "${APPEND_PART_CMD}" -a -f "${APPEND_PART}" ]; then
CMD="$CMD \
${APPEND_PART_CMD}
"
fi
# JIGDO section # JIGDO section
JIGDO_JIGDO=${GEN_DATA_DIR}/${RELENG_IMG}.jigdo JIGDO_JIGDO=${GEN_DATA_DIR}/${RELENG_IMG}.jigdo
JIGDO_TEMPLATE=${GEN_DATA_DIR}/${RELENG_IMG}.template JIGDO_TEMPLATE=${GEN_DATA_DIR}/${RELENG_IMG}.template
JIGDO_MAP_RHV=`readlink -e ${RELENG_DIR}`
JIGDO_MAP_RHV=$(cd ${RELENG_DIR} 2>/dev/null && pwd)
JIGDO_MAP="Debian=${JIGDO_MAP_RHV}/" JIGDO_MAP="Debian=${JIGDO_MAP_RHV}/"
# create jigdo MD5 list in base64 format # create jigdo MD5 list in base64 format
@ -190,7 +213,7 @@ else
exit 9 exit 9
fi fi
CMD+="\ CMD="$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 \
@ -201,7 +224,7 @@ CMD+="\
-jigdo-min-file-size 1024 \ -jigdo-min-file-size 1024 \
" "
CMD+="${RELENG_DIR}" CMD="$CMD ${RELENG_DIR}"
# Run the whole compound command # Run the whole compound command
echo -e "${SELF}: Creating ISO and jigdo representations:\n$CMD\n" echo -e "${SELF}: Creating ISO and jigdo representations:\n$CMD\n"