From b17d47b67f73ed0cccc0edbdd9c9548522ba2e40 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 2 Feb 2017 18:27:17 -0200 Subject: [PATCH] Allow to build variant ISO image as done for memstick --- build.sh | 8 +++++++- tools/builder_common.sh | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index fecc39f294e..8fb23277f37 100755 --- a/build.sh +++ b/build.sh @@ -362,7 +362,13 @@ for _IMGTOBUILD in $_IMAGESTOBUILD; do case "${_IMGTOBUILD}" in iso) - create_iso_image + if [ -n "${ISO_VARIANTS}" ]; then + for _variant in ${ISO_VARIANTS}; do + create_iso_image ${_variant} + done + else + create_iso_image + fi ;; memstick) if [ -n "${MEMSTICK_VARIANTS}" ]; then diff --git a/tools/builder_common.sh b/tools/builder_common.sh index d76107ea147..f7abe1d312c 100644 --- a/tools/builder_common.sh +++ b/tools/builder_common.sh @@ -721,6 +721,8 @@ create_distribution_tarball() { } create_iso_image() { + local _variant="$1" + LOGFILE=${BUILDER_LOGS}/isoimage.${TARGET} if [ -z "${ISOPATH}" ]; then @@ -732,7 +734,14 @@ create_iso_image() { mkdir -p $(dirname ${ISOPATH}) - customize_stagearea_for_image "iso" + local _image_path=${ISOPATH} + if [ -n "${_variant}" ]; then + _image_path=$(echo "$_image_path" | \ + sed "s/${PRODUCT_NAME_SUFFIX}-/&${_variant}-/") + VARIANTIMAGES="${VARIANTIMAGES}${VARIANTIMAGES:+ }${_image_path}" + fi + + customize_stagearea_for_image "iso" "" $_variant install_default_kernel ${DEFAULT_KERNEL} BOOTCONF=${INSTALLER_CHROOT_DIR}/boot.config @@ -748,15 +757,15 @@ create_iso_image() { sh ${FREEBSD_SRC_DIR}/release/${TARGET}/mkisoimages.sh -b \ ${FSLABEL} \ - ${ISOPATH} \ + ${_image_path} \ ${INSTALLER_CHROOT_DIR} - if [ ! -f "${ISOPATH}" ]; then + if [ ! -f "${_image_path}" ]; then echo "ERROR! ISO image was not built" print_error_pfS fi - gzip -qf $ISOPATH & + gzip -qf $_image_path & _bg_pids="${_bg_pids}${_bg_pids:+ }$!" echo ">>> ISO created: $(LC_ALL=C date)" | tee -a ${LOGFILE}