summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2014-09-29 09:53:35 +0200
committerMichael Schroeder <mls@suse.de>2014-09-29 09:53:35 +0200
commit1788e1ad068e42fd6906e88fa18f14baef98cea7 (patch)
tree0155336d7ae7e4abda0ae43691b243f9f665a50e
parent53ec11670b4264387ee59fe233e8122a39aa9174 (diff)
parentd84bb645378b5a005be2ccc22f8998abbd3f95db (diff)
Merge pull request #132 from andreas-schwab/master
allow using swap in the emulator
-rwxr-xr-xbuild1
-rw-r--r--build-vm-emulator10
2 files changed, 8 insertions, 3 deletions
diff --git a/build b/build
index 9f9fb72..647a840 100755
--- a/build
+++ b/build
@@ -259,7 +259,6 @@ Known Parameters:
--emulator
Use any generic emulator to isolate the build process. You need to write
an emulator/emulator.sh script and put it next to the build script sources.
- You must NOT use any vm swap file for this.
--emulator-script SCRIPT
specify another emulator instead of emulator.sh
diff --git a/build-vm-emulator b/build-vm-emulator
index 472385c..f3169ff 100644
--- a/build-vm-emulator
+++ b/build-vm-emulator
@@ -5,7 +5,11 @@
#
vm_verify_options_emulator() {
- VM_SWAP=
+ if test -f "$BUILD_DIR/emulator/verify-options.sh"; then
+ . "$BUILD_DIR/emulator/verify-options.sh"
+ else
+ VM_SWAP=
+ fi
}
vm_startup_emulator() {
@@ -15,7 +19,7 @@ vm_startup_emulator() {
elif test "${EMULATOR_SCRIPT:0:1}" != / ; then
EMULATOR_SCRIPT="./$EMULATOR_SCRIPT"
fi
- set -- "$EMULATOR_SCRIPT" "$VM_IMAGE"
+ set -- "$EMULATOR_SCRIPT" "$VM_IMAGE" "$VM_SWAP"
echo "$@"
if ! "$@"; then
popd
@@ -24,6 +28,8 @@ vm_startup_emulator() {
fi
popd
+ test -n "$VM_SWAP" && return
+
# Emulators may not offer to use a second swap space.
# So we just mount the filesystem.
# WARNING: This is not safe against attacks.