Merge "Remove img-functions from ramdisk-image-create."

This commit is contained in:
Jenkins 2013-05-08 19:51:32 +00:00 committed by Gerrit Code Review
commit c26bd8d655
3 changed files with 20 additions and 20 deletions

View File

@ -56,7 +56,6 @@ for arg do RAMDISK_ELEMENT="$RAMDISK_ELEMENT $arg" ; done
source $_LIB/ramdisk-defaults source $_LIB/ramdisk-defaults
source $_LIB/common-functions source $_LIB/common-functions
source $_LIB/img-functions
source $_LIB/ramdisk-functions source $_LIB/ramdisk-functions
RAMDISK_ELEMENT=$($SCRIPT_HOME/element-info --expand-dependencies $RAMDISK_ELEMENT) RAMDISK_ELEMENT=$($SCRIPT_HOME/element-info --expand-dependencies $RAMDISK_ELEMENT)

View File

@ -141,3 +141,21 @@ function mount_qcow_image() {
sudo mount ${NBD_DEV} $WORK_DIR sudo mount ${NBD_DEV} $WORK_DIR
fi fi
} }
function cleanup_dirs () {
sudo rm -rf $TMP_BUILD_DIR/built
sudo rm -rf $TMP_BUILD_DIR/mnt
sudo umount $TMP_BUILD_DIR
rm -rf $TMP_BUILD_DIR
}
# Run a directory of hooks outside the target.
function run_d() {
check_element
check_break before-$1 bash
if [ -d ${TMP_HOOKS_PATH}/$1.d ] ; then
run-parts ${TMP_HOOKS_PATH}/$1.d
fi
check_break after-$1 bash
}

View File

@ -38,13 +38,6 @@ function cleanup () {
cleanup_dirs cleanup_dirs
} }
function cleanup_dirs () {
sudo rm -rf $TMP_BUILD_DIR/built
sudo rm -rf $TMP_BUILD_DIR/mnt
sudo umount -f $TMP_BUILD_DIR || true
rm -rf $TMP_BUILD_DIR
}
function ensure_nbd () { function ensure_nbd () {
NBD=`which qemu-nbd` || true NBD=`which qemu-nbd` || true
if [ -z "$NBD" ]; then if [ -z "$NBD" ]; then
@ -127,16 +120,6 @@ function run_d_in_target() {
fi fi
} }
# Run a directory of hooks outside the target.
function run_d() {
check_element
check_break before-$1 bash
if [ -d ${TMP_HOOKS_PATH}/$1.d ] ; then
run-parts ${TMP_HOOKS_PATH}/$1.d
fi
check_break after-$1 bash
}
function prepare_first_boot () { function prepare_first_boot () {
check_break before-first-boot run_in_target bash check_break before-first-boot run_in_target bash
if [ -d ${TMP_HOOKS_PATH}/first-boot.d ] ; then if [ -d ${TMP_HOOKS_PATH}/first-boot.d ] ; then