From 3e8723555bb0a1be3e27330275c4d6b2da9945df Mon Sep 17 00:00:00 2001
From: Michael Janczyk
Date: Fri, 26 Mar 2010 22:09:31 +0100
Subject: NAT TFTP boot with VBox. rwimg support added
---
.../virtualbox/OpenSLX/OSPlugin/virtualbox.pm | 52 ++++++++++--
os-plugins/plugins/virtualbox/XX_virtualbox.sh | 5 +-
os-plugins/plugins/virtualbox/files/VirtualBox.xml | 41 ---------
.../plugins/virtualbox/files/machine.include | 4 +-
.../plugins/virtualbox/files/run-virt.include | 98 +++++++++++++---------
.../plugins/virtualbox/files/virtualbox.include | 4 +-
6 files changed, 111 insertions(+), 93 deletions(-)
delete mode 100644 os-plugins/plugins/virtualbox/files/VirtualBox.xml
(limited to 'os-plugins/plugins/virtualbox')
diff --git a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
index be7f2cb5..900d08a9 100644
--- a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
+++ b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm
@@ -45,7 +45,8 @@ sub getInfo
stateless client.
End-of-Here
precedence => 70,
- required => [ qw( desktop ) ],
+ # headless mode does not require a desktop!
+ #required => [ qw( desktop ) ],
};
}
@@ -67,7 +68,7 @@ sub getAttrInfo
should the 'virtualbox'-plugin be executed during boot?
End-of-Here
content_regex => qr{^(0|1)$},
- content_descr => '1 means active - 0 means inactive',
+ content_descr => '1 for active, 0 for inactive',
default => '1',
},
# attribute 'imagesrc' defines where we can find virtualbox images
@@ -77,10 +78,9 @@ sub getAttrInfo
description => unshiftHereDoc(<<' End-of-Here'),
Where do we store our virtualbox images? NFS? Filesystem?
End-of-Here
- #TODO: check if the input is valid
- #content_regex => qr{^(0|1)$},
- content_descr => 'Allowed values: local path or URI',
- default => '',
+ content_regex => qr{^(/|nfs://)},
+ content_descr => 'local path or URI or "-" (unset)',
+ default => undef,
},
# attribute 'bridge' defines if bridged network mode should be
# switched on
@@ -92,10 +92,46 @@ sub getAttrInfo
to the ethernet the host is connected to) be enabled
End-of-Here
content_regex => qr{^(0|1)$},
- content_descr => 'Allowed values: 0 or 1',
+ content_descr => '0 or 1',
default => '1',
},
-
+ # attribute 'mem' defines if memory should be forced
+ 'virtualbox::mem' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Do you want to force a ralative amount of RAM?
+ (Not implemented right now!)
+ End-of-Here
+ content_regex => qr{^(\d\d??)$},
+ content_descr => 'Between 0 - 99',
+ default => undef,
+ },
+ # attribute 'kvm' defines if KVM modules should be forced
+ 'virtualbox::kvm' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Do you want to force the usage of KVM modules where applicable?
+ (Not implemented right now!)
+ End-of-Here
+ content_regex => qr{^(0|1)$},
+ content_descr => '0 or 1',
+ default => undef,
+ },
+ # attribute 'tftpdir' defines TFTP dir for network boots /w NAT
+ 'virtualbox::tftpdir' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Do you want to define a stage 4 TFTP dir for netwoork boots when
+ using NAT?
+ Hint: Mount your TFTP ro via NFS to a local dir
+ End-of-Here
+ content_regex => qr{^(/)},
+ content_descr => 'local path or "-" (unset)',
+ default => undef,
+ },
};
}
diff --git a/os-plugins/plugins/virtualbox/XX_virtualbox.sh b/os-plugins/plugins/virtualbox/XX_virtualbox.sh
index 4599b197..07e58428 100644
--- a/os-plugins/plugins/virtualbox/XX_virtualbox.sh
+++ b/os-plugins/plugins/virtualbox/XX_virtualbox.sh
@@ -30,8 +30,9 @@ if [ -e ${CONFFILE} ]; then
if [ $virtualbox_active -ne 0 2>/dev/null ]; then
[ $DEBUGLEVEL -gt 0 ] && echo "executing the 'virtualbox' os-plugin ...";
+
# load general configuration
- . /initramfs/machine-setup
+ . /etc/initramfs-setup
# get source of virtualbox image server (get type, server and path)
if strinstr "/" "${virtualbox_imagesrc}" ; then
@@ -55,7 +56,7 @@ if [ -e ${CONFFILE} ]; then
cp ${PLUGINDIR}/*.include ${PLUGINCONFDIR}
# copy ${CONFFILE} to ${PLUGINCONFDIR} just in case
cp ${CONFFILE} ${PLUGINCONFDIR}
-
+
# # TODO: create rawdisk if requested
# # create raw disk
# for part in $(grep -qE " 44 | 45 " /etc/disk.partition); do
diff --git a/os-plugins/plugins/virtualbox/files/VirtualBox.xml b/os-plugins/plugins/virtualbox/files/VirtualBox.xml
deleted file mode 100644
index d9a36795..00000000
--- a/os-plugins/plugins/virtualbox/files/VirtualBox.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/os-plugins/plugins/virtualbox/files/machine.include b/os-plugins/plugins/virtualbox/files/machine.include
index e11f95c5..125e45cd 100644
--- a/os-plugins/plugins/virtualbox/files/machine.include
+++ b/os-plugins/plugins/virtualbox/files/machine.include
@@ -1,5 +1,5 @@
# Include file (machine template) for run-virt.include of the virtualbox plugin
-cat < "${machconfig}"
@@ -110,7 +110,7 @@ cat <
-
+
@@ -20,7 +20,7 @@ cat <
-
+
--
cgit v1.2.3-55-g7522