summaryrefslogtreecommitdiff
path: root/build-vm
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-03-28 16:59:18 +0100
committerMichael Schroeder <mls@suse.de>2014-03-28 16:59:18 +0100
commit505b1ec24240b890b99bd882e36b7e6025520b13 (patch)
tree4fe41cc1f326f1b82df6b01e1ebfac8c53a42643 /build-vm
parent9330fbeed5305ac7aaa0a33c7c469bc2e78acd58 (diff)
move vm_fixup call before writing the build.data
This is because we need to patch VM_SWAPDEV in some cases.
Diffstat (limited to 'build-vm')
-rw-r--r--build-vm10
1 files changed, 6 insertions, 4 deletions
diff --git a/build-vm b/build-vm
index baa9121..c390fc0 100644
--- a/build-vm
+++ b/build-vm
@@ -609,6 +609,10 @@ vm_first_stage() {
# umount later so step aside
cd "$SRCDIR"
fi
+
+ # do vm specific fixups
+ vm_fixup
+
# the watchdog needs a log file
test -n "$LOGFILE" || VM_WATCHDOG=
# put our config into .build/build.data
@@ -659,8 +663,6 @@ vm_first_stage() {
echo "VM_WATCHDOG='$VM_WATCHDOG'" >> $BUILD_ROOT/.build/build.data
# fallback time for broken hosts
date '+@%s' > $BUILD_ROOT/.build/.date
- # do vm specific fixups
- vm_fixup
# we're done with the root file system, unmount
umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
umount -n $BUILD_ROOT/proc 2> /dev/null || true
@@ -675,7 +677,7 @@ vm_first_stage() {
if test -n "$VM_IMAGE" ; then
# copy out kernel & initrd (if they exist) during unmounting VM image
KERNEL_TEMP_DIR=
- if test -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then
+ if test -z "$VM_KERNEL" -a -e "$BUILD_ROOT/.build.kernel.$VM_TYPE" ; then
KERNEL_TEMP_DIR=`mktemp -d`
cp "$BUILD_ROOT/.build.kernel.$VM_TYPE" "$KERNEL_TEMP_DIR/kernel"
if test -e "$BUILD_ROOT/.build.initrd.$VM_TYPE" ; then
@@ -695,7 +697,7 @@ vm_first_stage() {
vm_kernel="$BUILD_ROOT/boot/kernel"
if test -e "$KERNEL_TEMP_DIR/initrd" ; then
mv "$KERNEL_TEMP_DIR/initrd" "$BUILD_ROOT/boot/initrd"
- vm_initrd="$BUILD_ROOT/boot/initrd"
+ test -n "$VM_INITRD" && vm_initrd="$BUILD_ROOT/boot/initrd"
fi
rmdir "$KERNEL_TEMP_DIR"
fi