Mailinglist Archive: opensuse-buildservice (348 mails)

< Previous Next >
[opensuse-buildservice] [PATCH 1/4] Cleanup VM worker disk setup options
  • From: dl9pf@xxxxxx
  • Date: Thu, 8 Apr 2010 03:19:06 +0200
  • Message-id: <1270689549-25677-1-git-send-email-dl9pf@xxxxxx>
From: Jan-Simon Möller <jsmoeller@xxxxxxxxxxxxxxxxxxx>

Signed-off-by: Jan-Simon Möller <jsmoeller@xxxxxxxxxxxxxxxxxxx>
---
dist/obsworker | 38 ++++++++++++++++++++------------------
1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/dist/obsworker b/dist/obsworker
index d7a77c2..0c2e2b0 100644
--- a/dist/obsworker
+++ b/dist/obsworker
@@ -105,27 +105,11 @@ if [ -n "$OBS_VM_KERNEL" -a "$OBS_VM_KERNEL" != "none" ]
; then
fi
fi

-if [ "$OBS_VM_DISK_AUTOSETUP" = "yes" ]; then
- # actual autosetup is in 'build' code - so 'osc build' can use it, too
- # this can later also be used for reprovisioning workers
- if [ -n "$OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE" -a -n
"$OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE" ]; then
- VMDISK_ROOT_FILESIZE="--vmdisk-rootsize
${OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE}"
- VMDISK_SWAP_FILESIZE="--vmdisk-swapsize
${OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE}"
- VMDISK_AUTOSETUP="--vmdisk-autosetup"
- if [ -n "$OBS_VM_DISK_AUTOSETUP_FILESYSTEM" ]; then
- VMDISK_FILESYSTEM="--vmdisk-filesystem
${OBS_VM_DISK_AUTOSETUP_FILESYSTEM}"
- fi
- else
- echo "Warning: OBS_VM_DISK_AUTOSETUP is set to \"yes\" but either"
- echo " OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE or "
- echo " OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE are not set."
- echo ""
- echo "Disabling automatic VM disk setup!"
- fi
-fi

[ -z "$OBS_INSTANCE_MEMORY" ] && OBS_INSTANCE_MEMORY=256

+vmopt=
+
if [ -n "$OBS_VM_TYPE" -a "$OBS_VM_TYPE" != "auto" ] ; then
if [ "$OBS_VM_TYPE" != "none" ] ; then
vmopt="--$OBS_VM_TYPE"
@@ -136,6 +120,24 @@ elif [ -e /sys/hypervisor/type ] && grep -q xen
/sys/hypervisor/type; then
vmopt=--xen
fi

+if [ -n "$vmopt" ]; then
+ # we start up in VM mode, check for the worker disk options
+ if [ -n "$OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE" -a -n
"$OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE" ]; then
+ VMDISK_ROOT_FILESIZE="--vmdisk-rootsize
${OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE}"
+ VMDISK_SWAP_FILESIZE="--vmdisk-swapsize
${OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE}"
+ if [ -n "$OBS_VM_DISK_AUTOSETUP_FILESYSTEM" ]; then
+ VMDISK_FILESYSTEM="--vmdisk-filesystem
${OBS_VM_DISK_AUTOSETUP_FILESYSTEM}"
+ fi
+ else
+ echo "Warning: VM build enabled but either"
+ echo " OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE or "
+ echo " OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE are not set."
+ echo ""
+ echo "Worker startup failed"
+ exit 1
+ fi
+fi
+
rc_reset
case "$1" in
start)
--
1.6.4.2

--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
This Thread
Follow Ups