From b7077b4c2275ad23e5eedecbd7249913061bac95 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 13 Apr 2010 15:48:45 +0200 Subject: fix pbs stuff --- boot-env/OpenSLX/BootEnvironment/PBS.pm | 8 ++++---- boot-env/OpenSLX/BootEnvironment/PXE.pm | 10 ++++++---- boot-env/pbs/uclib-rootfs/init | 1 - 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/boot-env/OpenSLX/BootEnvironment/PBS.pm b/boot-env/OpenSLX/BootEnvironment/PBS.pm index 2e7ef706..2072884b 100644 --- a/boot-env/OpenSLX/BootEnvironment/PBS.pm +++ b/boot-env/OpenSLX/BootEnvironment/PBS.pm @@ -92,12 +92,12 @@ sub writeBootloaderMenuFor 'systems' => $systemInfos }); my $ua = LWP::UserAgent->new; - my $res = $ua->request(POST 'http://pbs.lan/backend/system/sync', [data => $data_json]); + my $res = $ua->request(POST 'http://pbs.experimental.openslx.org/backend/system/sync', [data => $data_json]); if ($res->is_success) { my $resData = from_json($res->content); if ($resData->{'getKernel'} eq 'fresh') { - $res = $ua->request(POST 'http://pbs.lan/backend/system/addkernel', + $res = $ua->request(POST 'http://pbs.experimental.openslx.org/backend/system/addkernel', ['kernel' => basename($prebootSystemInfo->{'kernel-file'}), 'kernelFile' => ["$self->{'target-path'}/imagebase/vmlinuz"], 'initramfsFile' => ["$self->{'target-path'}/imagebase/initramfs"], @@ -109,7 +109,7 @@ sub writeBootloaderMenuFor } else { if ($resData->{'getKernel'} eq 'update') { - $res = $ua->request(POST 'http://pbs.lan/backend/system/updatekernel', + $res = $ua->request(POST 'http://pbs.experimental.openslx.org/backend/system/updatekernel', ['kernel' => basename($prebootSystemInfo->{'kernel-file'}), 'kernelFile' => ["$self->{'target-path'}/imagebase/vmlinuz"], ], @@ -121,7 +121,7 @@ sub writeBootloaderMenuFor # do nothing } if ($resData->{'getInitramfs'} eq 'update') { - $res = $ua->request(POST 'http://pbs.lan/backend/system/updateinitramfs', + $res = $ua->request(POST 'http://pbs.experimental.openslx.org/backend/system/updateinitramfs', ['kernel' => basename($prebootSystemInfo->{'kernel-file'}), 'initramfsFile' => ["$self->{'target-path'}/imagebase/initramfs"], ], diff --git a/boot-env/OpenSLX/BootEnvironment/PXE.pm b/boot-env/OpenSLX/BootEnvironment/PXE.pm index 8387219d..06df1361 100644 --- a/boot-env/OpenSLX/BootEnvironment/PXE.pm +++ b/boot-env/OpenSLX/BootEnvironment/PXE.pm @@ -99,11 +99,13 @@ sub writeBootloaderMenuFor # set default menu entry my $pxeDefault = ""; - if ($openslxConfig{'pxe-default-menu-entry'} eq $info->{'external-id'}) - { - $pxeDefault = "\tMENU DEFAULT\n"; + if (defined $openslxConfig{'pxe-default-menu-entry'}) { + if ($openslxConfig{'pxe-default-menu-entry'} eq + $info->{'external-id'}) + { + $pxeDefault = "\tMENU DEFAULT\n"; + } } - $append .= " initrd=$pxePrefix$vendorOSName/$info->{'initramfs-name'}"; $append .= " file=$bootURI" if length($bootURI); $append .= " file=$tftpPrefix" if length($tftpPrefix); diff --git a/boot-env/pbs/uclib-rootfs/init b/boot-env/pbs/uclib-rootfs/init index 67427127..3c992070 100755 --- a/boot-env/pbs/uclib-rootfs/init +++ b/boot-env/pbs/uclib-rootfs/init @@ -177,7 +177,6 @@ echo "macaddr=$macaddr" >>/etc/initramfs-setup # user choose what kind of SLX client he wants to get dialog --infobox "Fetching preboot interactive part and configuration from \ the net ($boot_uri) ..." 4 65 -echo -e "192.168.2.100\t pbs.lan" > /etc/hosts mkdir -p /preboot wget -q -O /preboot/preboot.init ${boot_uri}bootloader/env/getinit/formedia/$PBS_ID chmod u+x /preboot/preboot.init -- cgit v1.2.3-55-g7522 From 6ee8363caa02411cbc6851e5f8ecfa407643e8f0 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 28 Apr 2010 15:33:15 +0200 Subject: clean exit added + port redirects now via xml file --- .../init-hooks/80-after-plugins/virtualization.sh | 2 +- .../plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm | 4 +- os-plugins/plugins/vmgrid/files/run-vmgrid.sh | 46 ++++++++++++++++------ .../init-hooks/80-after-plugins/virtualization.sh | 2 +- 4 files changed, 38 insertions(+), 16 deletions(-) diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh index 400075cd..a1da2e63 100644 --- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then diff --git a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm index 401a2151..c3542274 100644 --- a/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm +++ b/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm @@ -72,9 +72,9 @@ sub getAttrInfo description => unshiftHereDoc(<<' End-of-Here'), which virtualization technique schould be used? End-of-Here - content_regex => qr{^(vmware|virtualbox|qemukvm|xen)$}, + content_regex => qr{^(virtualbox|qemukvm|xen)$}, #openvz|vserver - content_descr => 'vmware, virtualbox, qemukvm, xen', + content_descr => 'virtualbox, qemukvm, xen', #openvz, vserver default => undef, }, diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh index a684310b..9b9adb44 100644 --- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh +++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh @@ -49,6 +49,17 @@ writelog () { echo -e "$1" >> ${vmgrid_rwmnt}/logs/run-vmgrid.${USER}.$$.log } +# remove config dirs when exit +cleanexit () { + if echo "${RMDIRS}" 2>/dev/null | grep -q ${vmgrid_virt}; then + writelog "${vmgrid_virt} exited. Cleanning up... \c" + rm -rf ${RMDIRS} >/dev/null 2>&1 + writelog "done" + fi + + exit "$1" +} + ################################################################################ ### Get XML file and dir ################################################################################ @@ -289,11 +300,28 @@ vmostype=$(grep -io '/dev/null @@ -377,7 +406,7 @@ elif [ -n "${VIRTCMDHL}" ]; then ${VIRTCMDHL} ${VIRTCMDOPTSHL} 2>/dev/null else writelog "${vmgrid_virt}: No headless mode defined, exiting!" - exit 1 + cleanexit 1 fi # postrun for scripts after virtualization finishes @@ -385,12 +414,5 @@ if [ -n "${POSTRUN}" ]; then eval ${POSTRUN} >/dev/null 2>&1 fi -# remove config dirs when finished -if echo "${RMDIRS}" 2>/dev/null | grep -q ${vmgrid_virt}; then - writelog "${vmgrid_virt} exited. Cleanning up... \c" - rm -rf ${RMDIRS} >/dev/null 2>&1 - writelog "done" -fi - -echo -e "Bye." +cleanexit 0 exit 0 diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh index 400075cd..a1da2e63 100644 --- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh @@ -30,7 +30,7 @@ active=0 [ ${vmgrid_active} -ne 0 ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ - && echo -e "Executing the virtual 'virtualization' plugin ... \c" + && echo -e "Executing the 'virtualization' plugin ... \c" if [ ${active} -ne 0 ] ; then -- cgit v1.2.3-55-g7522 From 536f8326396ee2ab11577b15069100cf73124e7f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Apr 2010 20:53:45 +0200 Subject: minor fixes --- initramfs/distro-specs/ubuntu/functions-default | 2 +- .../plugins/profile/OpenSLX/Distro/Ubuntu_10.pm | 66 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index bfd01524..41af807e 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -97,7 +97,7 @@ elif [ -e /mnt/etc/init.d/${script} -a -n "$1" -a -n "$2" ] ; then [ "$DEBUGLEVEL" == 5 ] && echo "Linked $script" done else - error echo "Target $(pwd)../${script} does not exist. Skipping links." + error "Target $(pwd)../${script} does not exist. Skipping links." nonfatal fi } diff --git a/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm b/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm new file mode 100644 index 00000000..3b288e97 --- /dev/null +++ b/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm @@ -0,0 +1,66 @@ +# Copyright (c) 2009 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +# ----------------------------------------------------------------------------- +# profile/OpenSLX/Distro/Ubuntu.pm +# - provides Debian-specific overrides of the Distro API for the profile +# plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Ubuntu_10; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub _getKdeHomeMap +{ + my $self = shift; + + return; +} + +sub getProfileDPAth +{ + my $self = shift; + + + return "/etc/profile.d/slx-kdehome.sh"; +} + +sub getKdeHome +{ + my $self = shift; + + return ".openslx/ubuntu-lucid.kde"; +} + +sub getGconfPathConfig +{ + my $self = shift; + + return "/etc/gconf/2/path"; +} + + +sub getGconfHome +{ + my $self = shift; + + return ".openslx.ubuntu-lucid.gconf"; +} + +1; -- cgit v1.2.3-55-g7522 From 6556aa6df7a0c26685a2e65732ac291d97a9ad92 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Thu, 29 Apr 2010 16:24:07 +0200 Subject: fix rllinker script for ubuntu 10.04 --- initramfs/distro-specs/ubuntu/functions-default | 38 +++++++++++++++---------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/initramfs/distro-specs/ubuntu/functions-default b/initramfs/distro-specs/ubuntu/functions-default index 41af807e..475290bb 100644 --- a/initramfs/distro-specs/ubuntu/functions-default +++ b/initramfs/distro-specs/ubuntu/functions-default @@ -82,23 +82,31 @@ rllinker () { local script="$1" # activating the new way, check if a appropriate script is available, else # try the traditional approach -if [ -e /mnt/etc/init.inactive/${script}.conf ] ; then - mv /mnt/etc/init.inactive/${script}.conf /mnt/etc/init -elif [ -e /mnt/etc/init.d/${script} -a -n "$1" -a -n "$2" ] ; then - if [ $2 -lt 10 ] ; then - local start="0$2"; else local start="$2" - fi - if [ $3 -lt 10 ] ; then - local stop="0$3"; else local stop="$3" - fi - for i in rc2.d/K$stop$script rc3.d/K$stop$script \ - rc2.d/S$start$script rc3.d/S$start$script ; do - ln -sf ../init.d/$script /mnt/etc/$i - [ "$DEBUGLEVEL" == 5 ] && echo "Linked $script" - done + +if [ -e /mnt/etc/init.inactive/${script}.conf -o -e /mnt/etc/init/${script}.conf ]; then + # we have upstart scripts + if [ -e /mnt/etc/init.inactive/${script}.conf ] ; then + mv /mnt/etc/init.inactive/${script}.conf /mnt/etc/init + fi +elif [ -e /mnt/etc/init.d/${script} ]; then + # we old rc scripts + if [ -e /mnt/etc/init.d/${script} -a -n "$1" -a -n "$2" ] ; then + if [ $2 -lt 10 ] ; then + local start="0$2"; else local start="$2" + fi + if [ $3 -lt 10 ] ; then + local stop="0$3"; else local stop="$3" + fi + for i in rc2.d/K$stop$script rc3.d/K$stop$script \ + rc2.d/S$start$script rc3.d/S$start$script ; do + ln -sf ../init.d/$script /mnt/etc/$i + [ "$DEBUGLEVEL" == 5 ] && echo "Linked $script" + done + fi else - error "Target $(pwd)../${script} does not exist. Skipping links." nonfatal + error "Script: ${script} does not exist. Skipping setup of startscipts/events.." nonfatal fi + } # set up localization like keytable, console -- cgit v1.2.3-55-g7522 From 36b3473d1854d9bc4d9ed5d0bec578ca076f556e Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Thu, 29 Apr 2010 18:34:29 +0200 Subject: bug if statement changed, so it works if only one plugin installed --- .../vmchooser/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- .../plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmchooser/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then diff --git a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh index a1da2e63..37576331 100644 --- a/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh +++ b/os-plugins/plugins/vmgrid/init-hooks/80-after-plugins/virtualization.sh @@ -25,9 +25,9 @@ PLUGINCONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}/plugins/virtualization # check if plugins available active=0 [ -f ${CONFFILEVMCHOOSER} ] && . ${CONFFILEVMCHOOSER} -[ ${vmchooser_active} -ne 0 ] && active=1 +[ "x${vmchooser_active}" = "x1" ] && active=1 [ -f ${CONFFILEVMGRID} ] && . ${CONFFILEVMGRID} -[ ${vmgrid_active} -ne 0 ] && active=1 +[ "x${vmgrid_active}" = "x1" ] && active=1 [ $DEBUGLEVEL -gt 0 ] \ && echo -e "Executing the 'virtualization' plugin ... \c" @@ -46,7 +46,7 @@ if [ ${active} -ne 0 ] ; then | awk '{print $2}') / 1024) echo "totalmem=${totalmem}" >> ${PLUGINCONFDIR}/virtualization.conf - if [ ${vmgrid_active} -ne 0 ]; then + if [ "x${vmgrid_active}" = "x1" ]; then totalmemtest=$(expr $(echo ${vmgrid_memratio} \ | awk -F ',' '{print $1" + "$2" + "$3" + "$4" + "$5" + "$6}')) @@ -63,7 +63,7 @@ if [ ${active} -ne 0 ] ; then fi # main vm mem (vmchooser) - if [ ${vmchooser_active} -ne 0 ]; then + if [ "x${vmchooser_active}" = "x1" ]; then mainvirtratio=$(echo ${vmgrid_memratio} | awk -F ',' '{print $5}') mainvirtmem=$(expr ${totalmem} \* ${mainvirtratio} / 100 2>/dev/null) if [ ${mainvirtmem} -lt 512 2>/dev/null ]; then -- cgit v1.2.3-55-g7522