From 755d5888d39115c92e2305abc6c9ee2fff06ae56 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 31 Jan 2012 21:25:05 +0100 Subject: [PATCH] [molecules/arm-base] fixup remaster_post code, don't mess with /proc --- molecules/arm-base.common | 2 +- scripts/mmc_remaster_post.sh | 13 +++++++++++++ scripts/remaster_pre.sh | 5 ++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100755 scripts/mmc_remaster_post.sh diff --git a/molecules/arm-base.common b/molecules/arm-base.common index 88e7467..7cdb954 100644 --- a/molecules/arm-base.common +++ b/molecules/arm-base.common @@ -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/remaster_post.sh +outer_source_chroot_script_after: /sabayon/scripts/mmc_remaster_post.sh # Error script command, executed when something went wrong and molecule has # to terminate the execution diff --git a/scripts/mmc_remaster_post.sh b/scripts/mmc_remaster_post.sh new file mode 100755 index 0000000..37d3705 --- /dev/null +++ b/scripts/mmc_remaster_post.sh @@ -0,0 +1,13 @@ +#!/bin/sh +PKGS_DIR="/sabayon/pkgcache" +CHROOT_PKGS_DIR="${CHROOT_DIR}/var/lib/entropy/client/packages" + +# remove entropy hwash +rm -f "${CHROOT_DIR}"/etc/entropy/.hw.hash +# remove entropy pid file +rm -f "${CHROOT_DIR}"/var/run/entropy/entropy.lock + +echo "Umounting bind to ${CHROOT_PKGS_DIR}" +umount "${CHROOT_PKGS_DIR}" || exit 1 + +exit 0 diff --git a/scripts/remaster_pre.sh b/scripts/remaster_pre.sh index 15b5ceb..fea3482 100755 --- a/scripts/remaster_pre.sh +++ b/scripts/remaster_pre.sh @@ -10,6 +10,9 @@ rm -rf "${CHROOT_PKGS_DIR}"/* echo "Mounting bind to ${CHROOT_PKGS_DIR}" mount --bind "${PKGS_DIR}" "${CHROOT_PKGS_DIR}" || exit 1 -mount -t proc proc "${CHROOT_DIR}/proc" +content=$(ls -1 "${CHROOT_DIR}/proc" | wc -l) +if [ "${content}" -le 3 ]; then + mount -t proc proc "${CHROOT_DIR}/proc" +fi exit 0