Allow to build variant ISO image as done for memstick

This commit is contained in:
Renato Botelho 2017-02-02 18:27:17 -02:00
parent 186c7a6ca4
commit b17d47b67f
2 changed files with 20 additions and 5 deletions

View File

@ -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

View File

@ -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}