From e8195394e60b5940a3c434c3a335a463ed502ae8 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Wed, 1 Feb 2012 15:23:24 +0100 Subject: [PATCH] [scripts] fixup remaster_pre and mmc_remaster_post usage for arm specs --- molecules/arm-base.common | 4 ++-- scripts/mkloopcard.sh | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/molecules/arm-base.common b/molecules/arm-base.common index 3a74951..eba737f 100644 --- a/molecules/arm-base.common +++ b/molecules/arm-base.common @@ -12,7 +12,7 @@ execution_strategy: chroot_to_mmc # IMAGE_NAME = name of the final MMC image # DESTINATION_IMAGE_DIR = path to the destination image directory # CHROOT_DIR = path pointing to the chroot -outer_source_chroot_script: /sabayon/scripts/remaster_pre.sh +# outer_source_chroot_script: /some/path.sh # Inner source chroot script. Called from inside the source_chroot. # Can be used to spawn package updates inside the chroot. @@ -24,7 +24,7 @@ outer_source_chroot_script: /sabayon/scripts/remaster_pre.sh # IMAGE_NAME = name of the final MMC image # DESTINATION_IMAGE_DIR = path to the destination image directory # CHROOT_DIR = path pointing to the chroot -outer_source_chroot_script_after: /sabayon/scripts/mmc_remaster_post.sh +# outer_source_chroot_script_after: /some/path.sh # Error script command, executed when something went wrong and molecule has # to terminate the execution diff --git a/scripts/mkloopcard.sh b/scripts/mkloopcard.sh index c63c23e..be51bd9 100755 --- a/scripts/mkloopcard.sh +++ b/scripts/mkloopcard.sh @@ -48,6 +48,8 @@ cleanup_loopbacks() { [[ -n "${vfat_part}" ]] && losetup -d "${vfat_part}" 2> /dev/null [[ -n "${ext_part}" ]] && losetup -d "${ext_part}" 2> /dev/null [[ -n "${DRIVE}" ]] && losetup -d "${DRIVE}" 2> /dev/null + # make sure to have run this + [[ -n "${CHROOT_DIR}" ]] && /sabayon/bin/mmc_remaster_post.sh } trap "cleanup_loopbacks" 1 2 3 6 9 14 15 EXIT @@ -140,6 +142,8 @@ mount "${ext_part}" "${tmp_dir}" rsync -a -H -A -X --delete-during "${CHROOT_DIR}"/ "${tmp_dir}"/ --exclude "/proc/*" --exclude "/sys/*" \ --exclude "/dev/pts/*" --exclude "/dev/shm/*" || exit 1 +[[ -n "${CHROOT_DIR}" ]] && /sabayon/bin/remaster_pre.sh || exit 1 + # Configure 00-board-setup.start source_board_setup="/sabayon/boot/arm_startup/00-board-setup.start" dest_board_setup="${CHROOT_DIR}/etc/local.d/00-board-setup.start" @@ -172,6 +176,8 @@ chown root "${target_chroot_script}" || exit 1 chroot "${tmp_dir}" "/${chroot_script_name}" || exit 1 rm -f "${target_chroot_script}" +[[ -n "${CHROOT_DIR}" ]] && /sabayon/bin/mmc_remaster_post.sh + # execute final cleanup of entropy stuff chroot "${tmp_dir}" equo rescue vacuum