From 289865536ee00866446aea79539efe484be0ea77 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 28 Nov 2012 17:11:33 +0100 Subject: fix for missing firmware modules --- src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm index 9fd2c8bc..e23dc40f 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm @@ -278,20 +278,15 @@ sub _copyKernelModules # build a list of required firmwares out of the list of modules - not # totally optimal my @firmwares; - $self->addCMD("mkdir -p $self->{'build-path'}/lib/firmware"); - $self->addCMD("ln -s . $self->{'build-path'}/lib/firmware/$self->{'kernel-version'}"); + $self->addCMD("mkdir -p $self->{'build-path'}/lib/firmware/$self->{'kernel-version'}"); foreach my $moduleToBeCopied(%modulesToBeCopied) { $moduleToBeCopied =~ /.*\/(.*?)$/; # implies usage of switch vlog(1,$1); switch ($1){ - # nic modules fw case "bnx2.ko" {push @firmwares, split ' ', "bnx2/"} case "bnx2x.ko" {push @firmwares, split ' ', "bnx2x/"} case "e100.ko" {push @firmwares, split ' ', "e100"} - case "r8169.ko" {push @firmwares, split ' ', "rtl_nic/"} - case "tg3.ko" {push @firmwares, split ' ', "tigon/"} - # wifi fw case "iwlwifi" { push @firmwares, split ' ', "iwlwifi-3945-1.ucode iwlwifi-3945-2.ucode iwlwifi-4965-1.ucode iwlwifi-4965-2.ucode iwlwifi-5000-1.ucode" @@ -300,6 +295,8 @@ sub _copyKernelModules case "radeon.ko" {push @firmwares, split ' ', "radeon/"} case "mga.ko" {push @firmwares, split ' ', "matrox/"} case "r128.ko" {push @firmwares, split ' ', "r128/"} + case "r8169.ko" {push @firmwares, split ' ', "rtl_nic/"} + case "tg3.ko" {push @firmwares, split ' ', "tigon/"} } } # copy all the firmwares that we think are required @@ -310,16 +307,18 @@ sub _copyKernelModules my $alternative_source = followLink( "$self->{'root-path'}/lib/firmware/$firmwareToBeCopied", $self->{'root-path'} ); - my $target = "$self->{'build-path'}/lib/firmware/"; if (-e $source){ + my $target = "$self->{'build-path'}/lib/firmware/$self->{'kernel-version'}/"; + $self->addCMD("cp -pr --dereference $source $target"); + } else { + vlog(3,"unable to find $source for copying purposes"); } - elsif (-e $alternative_source){ + if (-e $alternative_source){ + my $target = "$self->{'build-path'}/lib/firmware/"; + $self->addCMD("cp -pr --dereference $alternative_source $target"); } - else { - vlog(3,"unable to find $source for copying purposes"); - } } # copy all the modules that we think are required -- cgit v1.2.3-55-g7522 From d0395ef03fe5e2a5941ba8d29ad5cc5c8551305f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 28 Nov 2012 17:56:11 +0100 Subject: iPXE fixes --- src/boot-env/OpenSLX/BootEnvironment/PXE.pm | 2 +- src/boot-env/iPXE/undionly-pool.kkpxe | Bin 0 -> 83354 bytes src/boot-env/iPXE/undionly.kpxe | Bin 61973 -> 0 bytes src/boot-env/iPXE/unifr-rz.ipxe | 4 ---- src/boot-env/iPXE/unifr-rz.kpxe | Bin 61783 -> 0 bytes 5 files changed, 1 insertion(+), 5 deletions(-) create mode 100644 src/boot-env/iPXE/undionly-pool.kkpxe delete mode 100644 src/boot-env/iPXE/undionly.kpxe delete mode 100644 src/boot-env/iPXE/unifr-rz.ipxe delete mode 100644 src/boot-env/iPXE/unifr-rz.kpxe (limited to 'src') diff --git a/src/boot-env/OpenSLX/BootEnvironment/PXE.pm b/src/boot-env/OpenSLX/BootEnvironment/PXE.pm index 56549bf4..e48c7a1a 100644 --- a/src/boot-env/OpenSLX/BootEnvironment/PXE.pm +++ b/src/boot-env/OpenSLX/BootEnvironment/PXE.pm @@ -305,7 +305,7 @@ sub _prepareBootloaderConfigFolder } } #copy iPXE to tftproot - my @ipxeFiles = <$basePath/share/boot-env/iPXE/*.kpxe>; + my @ipxeFiles = <$basePath/share/boot-env/iPXE/*>; foreach my $ipxeFile (@ipxeFiles) { slxsystem( qq[cp -p "$ipxeFile" $pxePath/] diff --git a/src/boot-env/iPXE/undionly-pool.kkpxe b/src/boot-env/iPXE/undionly-pool.kkpxe new file mode 100644 index 00000000..30491744 Binary files /dev/null and b/src/boot-env/iPXE/undionly-pool.kkpxe differ diff --git a/src/boot-env/iPXE/undionly.kpxe b/src/boot-env/iPXE/undionly.kpxe deleted file mode 100644 index dec7dd1a..00000000 Binary files a/src/boot-env/iPXE/undionly.kpxe and /dev/null differ diff --git a/src/boot-env/iPXE/unifr-rz.ipxe b/src/boot-env/iPXE/unifr-rz.ipxe deleted file mode 100644 index 59a19c33..00000000 --- a/src/boot-env/iPXE/unifr-rz.ipxe +++ /dev/null @@ -1,4 +0,0 @@ -#!ipxe - -dhcp -chain http://pbs2.mp.openslx.org/ipxe/auth/serial/serialnumber/55-44-33-22-11/mac/${net0/mac} diff --git a/src/boot-env/iPXE/unifr-rz.kpxe b/src/boot-env/iPXE/unifr-rz.kpxe deleted file mode 100644 index 452189df..00000000 Binary files a/src/boot-env/iPXE/unifr-rz.kpxe and /dev/null differ -- cgit v1.2.3-55-g7522 From 77ff585ab48626ade2d312102ae98202bf8b8d98 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 4 Dec 2012 18:32:15 +0100 Subject: - respect blacklisting of modules when autoloading modules in hwautocfg '-b' (stage3). - preinit.local enabled again for config/systemName/default, until now it was only possible for the default system in config/default. It make no sense for client specific configurations though. --- src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm | 4 ++-- src/initramfs/scripts/bin/hwautocfg | 13 +++++++------ src/initramfs/scripts/init | 8 ++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm index a0c24edb..cc5cc409 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm @@ -235,9 +235,9 @@ sub _copyPreAndPostinitFiles foreach my $cfg ( 'default/initramfs/preinit.local', - "$self->{'system-name'}/initramfs/preinit.local", + "$self->{'system-name'}/default/initramfs/preinit.local", 'default/initramfs/postinit.local', - "$self->{'system-name'}/initramfs/postinit.local" + "$self->{'system-name'}/default/initramfs/postinit.local" ) { my $cfgPath = "$openslxConfig{'private-path'}/config/stage3/$cfg"; next if !-f $cfgPath; diff --git a/src/initramfs/scripts/bin/hwautocfg b/src/initramfs/scripts/bin/hwautocfg index 22323e84..482c9f9a 100755 --- a/src/initramfs/scripts/bin/hwautocfg +++ b/src/initramfs/scripts/bin/hwautocfg @@ -66,11 +66,12 @@ fi nwcardlist=$(echo ${slxconf_listnwmod}|sed "s/\ /|/g") # save results for later info and for Xen plugin when starting Xen VM hwinfo --netcard --usb-ctrl >/etc/hwinfo.netcard-usbctrl -grep modprobe /etc/hwinfo.netcard-usbctrl | grep -E "$nwcardlist|hcd" | \ - grep -v ehci | sed 's/.* Cmd: "//;s/"//' | sort -u >/etc/modprobe.base +grep modprobe /etc/hwinfo.netcard-usbctrl | grep -E "$nwcardlist|hcd" \ + | grep -v ehci | sed 's/.* Cmd: "//;s/"//;s/modprobe/modprobe -b ${MODPRV}/' \ + | sort -u >/etc/modprobe.base # virtio hack if [ $(grep -ic "virtio_pci" /etc/modprobe.base) -ge 1 ]; then - echo "modprobe virtio_net" >>/etc/modprobe.base + echo 'modprobe ${MODPRV} virtio_net' >>/etc/modprobe.base fi sh /etc/modprobe.base; mdev -s @@ -97,9 +98,9 @@ hwmain () { # check for rtc if not compiled directly into the kernel ( [ -e /proc/driver/rtc ] || modprobe ${MODPRV} rtc-cmos ) & waitfor /tmp/hwdataready 10000 -sed '/Driver Info #1/,/Config Status:/d' \ - /etc/hwinfo.data | grep modprobe | sed "s|.* Cmd: \"||;s|\"|$modloadbg|" \ - | sort -u >/etc/modprobe.pci +sed '/Driver Info #1/,/Config Status:/d' /etc/hwinfo.data | grep modprobe \ + | sed "s|.* Cmd: \"||;s|\"|$modloadbg|;s|modprobe|modprobe -b ${MODPRV}|" \ + | sort -u >/etc/modprobe.pci sh /etc/modprobe.pci mdev -s diff --git a/src/initramfs/scripts/init b/src/initramfs/scripts/init index 3f41d3c6..d1d7945b 100755 --- a/src/initramfs/scripts/init +++ b/src/initramfs/scripts/init @@ -121,8 +121,12 @@ runinithook '00-started' # run pre init script and user defined preinit.local, copied by mkdxsinitrd # from /var/lib/openslx/config/... in stage2 preinit -[ -x /bin/preinit.local ] && /bin/preinit.local - +[ -f /bin/preinit.local ] && { + [ $DEBUGLEVEL -gt 0 ] && \ + echo -n "Running script /bin/preinit.local ... " + chmod u+x /bin/preinit.local + /bin/preinit.local + [ $DEBUGLEVEL -gt 0 ] && echo "ok"; } # switch off the several configuration methods, will be switched on # according to kernel commandline settings -- cgit v1.2.3-55-g7522 From 386ac7aa6bb5f1a75c622488674ffdb42596f4dd Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Fri, 7 Dec 2012 17:11:52 +0100 Subject: Added missing plugin files for RHEL, Scientific Linux and CentOS Linux. Removed deprecated SciLin files. postinit.local from the InitRamFS will be executed, if fetching of the tgz file fails. --- .../OpenSLX/MakeInitRamFS/Distro/Scilin.pm | 61 ---------- src/initramfs/scripts/init | 17 ++- src/installer/OpenSLX/OSExport/Distro/SciLin.pm | 94 --------------- src/installer/OpenSLX/OSSetup/Distro/Scilin.pm | 48 -------- src/installer/OpenSLX/OSSetup/Engine.pm | 4 - .../plugins/desktop/OpenSLX/Distro/Centos.pm | 31 +++++ .../plugins/desktop/OpenSLX/Distro/Rhel.pm | 132 +++++++++++++++++++++ .../plugins/desktop/OpenSLX/Distro/Scientific.pm | 31 +++++ .../plugins/desktop/OpenSLX/Distro/Scilin.pm | 132 --------------------- .../plugins/infoscreen/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/infoscreen/OpenSLX/Distro/Rhel.pm | 29 +++++ .../infoscreen/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/infoscreen/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/kiosk/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/kiosk/OpenSLX/Distro/Rhel.pm | 28 +++++ .../plugins/kiosk/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/kiosk/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/profile/OpenSLX/Distro/Centos.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Rhel.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Scientific.pm | 29 +++++ .../plugins/profile/OpenSLX/Distro/Scilin.pm | 32 ----- .../plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm | 2 +- 22 files changed, 468 insertions(+), 440 deletions(-) delete mode 100644 src/boot-env/OpenSLX/MakeInitRamFS/Distro/Scilin.pm delete mode 100644 src/installer/OpenSLX/OSExport/Distro/SciLin.pm delete mode 100644 src/installer/OpenSLX/OSSetup/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm create mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm delete mode 100644 src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Scilin.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Scilin.pm deleted file mode 100644 index f2372f8f..00000000 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Scilin.pm +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) 2009..2010 - 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/ -# ----------------------------------------------------------------------------- -# MakeInitRamFS::Distro::Scilin.pm -# - provides Scientific Linux specific overrides of the -# MakeInitRamFS::Distro API. -# ----------------------------------------------------------------------------- -package OpenSLX::MakeInitRamFS::Distro::Scilin; - -use strict; -use warnings; - -use base qw(OpenSLX::MakeInitRamFS::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### implementation -################################################################################ -sub new -{ - my $class = shift; - my $self = { - 'base-name' => 'scilin', - }; - return bless $self, $class; -} - -sub applyChanges -{ - my $self = shift; - my $engine = shift; - # filter modules which are part of the main kernel already - $engine->_addFilteredKernelModules( qw( af_packet hid hid-bright usbhid unix vesafb fbcon )); - - return; -} - -sub determineMatchingHwinfoVersion -{ - my $self = shift; - my $distroVersion = shift; - - my %versionMap = ( - '4.7' => '13.11', - '5.3' => '15.3', - '5.4' => '15.21', - '5.5' => '16.0', - ); - return $versionMap{$distroVersion} - || $self->SUPER::determineMatchingHwinfoVersion($distroVersion); -} - -1; diff --git a/src/initramfs/scripts/init b/src/initramfs/scripts/init index d1d7945b..59cfea8a 100755 --- a/src/initramfs/scripts/init +++ b/src/initramfs/scripts/init @@ -1039,12 +1039,21 @@ runinithook '85-have-initial-boot' # post init for some distro specific stuff to run postinit # general postinit.local configurable by the admin via openslx/config/ -[ -f /initramfs/postinit.local ] && { - [ $DEBUGLEVEL -gt 0 ] && \ - echo -n "Running script /bin/postinit.local ... " +if [ -f /initramfs/postinit.local ] + then + [ $DEBUGLEVEL -gt 0 ] \ + && echo -n "Running script /initramfs/postinit.local ... " chmod u+x /initramfs/postinit.local /initramfs/postinit.local - [ $DEBUGLEVEL -gt 0 ] && echo "ok"; } + [ $DEBUGLEVEL -gt 0 ] && echo "ok" +elif [ -f /bin/postinit.local ] + then + [ $DEBUGLEVEL -gt 0 ] \ + && echo -n "Running script /bin/postinit.local ... " + chmod u+x /bin/postinit.local + /bin/postinit.local + [ $DEBUGLEVEL -gt 0 ] && echo "ok" +fi # start a debug shell in higher debug levels [ $DEBUGLEVEL -gt 2 -a $DEBUGLEVEL != 8 ] \ diff --git a/src/installer/OpenSLX/OSExport/Distro/SciLin.pm b/src/installer/OpenSLX/OSExport/Distro/SciLin.pm deleted file mode 100644 index 272b5cef..00000000 --- a/src/installer/OpenSLX/OSExport/Distro/SciLin.pm +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# OSExport/Distro/SciLin.pm -# - provides SciLin-specific overrides of the OSExport Distro API. -# ----------------------------------------------------------------------------- -package OpenSLX::OSExport::Distro::SciLin; - -use strict; -use warnings; - -use base qw(OpenSLX::OSExport::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### implementation -################################################################################ -sub new -{ - my $class = shift; - my $self = { - 'base-name' => 'scilin', - }; - return bless $self, $class; -} - -sub initDistroInfo -{ - my $self = shift; - - $self->{'export-filter'} = " - - /var/tmp/* - - /var/spool/* - - /var/run/* - - /var/mail - - /var/log/* - - /var/lock/* - - /var/lib/xdm - - /var/lib/vm* - - /var/lib/suspend* - - /var/lib/smart - - /var/lib/gdm/* - - /var/lib/dhcp* - - /var/lib/bluetooth/ - - /var/cache/yum - - /var/cache/man/* - - /var/cache/zypp/* - + /usr/lib/python*/*/*.o - + /usr/lib/perl5/*/*/*/*.o - + /usr/lib/gcc/*/*/*.o - + /usr/lib/*.o - + /usr/X11R6/lib/modules/drivers/*.o - + /usr/X11R6/lib/modules/drivers/linux/*.o - - /usr/bin/BackGround - - /tmp/* - - /sys/* - - /proc/* - - /opt/kde3/share/apps/kdm/read_sysconfig.sh - - /opt/kde3/share/autostart/runupdater.desktop - - /opt/kde3/share/autostart/profile_chooser-autostart.desktop - - /opt/kde3/share/autostart/kinternet.desktop - - /usr/share/gnome/autostart/gpk-update-icon*.desktop - - /mnt/* - - /media/* - + /media - + /lib/modules/*/misc/vmblock.o - + /lib/modules/*/misc/vmnet.o - + /lib/modules/*/misc/vmmon.o - - /etc/*rpmnew - - /etc/*rpmorig - - /etc/*pptp* - - /etc/*ppp* - - /etc/dhcp* - - /etc/cron.*/* - - /etc/netplug* - - /etc/sysconfig/network* - - /etc/X11/xkb - - /boot/initrd* - - /boot/grub - - *.rpmsave - - *.rpmnew - "; - return; -} - -1; diff --git a/src/installer/OpenSLX/OSSetup/Distro/Scilin.pm b/src/installer/OpenSLX/OSSetup/Distro/Scilin.pm deleted file mode 100644 index e1ce5fc3..00000000 --- a/src/installer/OpenSLX/OSSetup/Distro/Scilin.pm +++ /dev/null @@ -1,48 +0,0 @@ -# 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/ -# ----------------------------------------------------------------------------- -# OSSetup/Distro/Scilin.pm -# - provides Scientific Linux specific overrides of the OSSetup Distro API. -# ----------------------------------------------------------------------------- -package OpenSLX::OSSetup::Distro::Scilin; - -use strict; -use warnings; - -use base qw(OpenSLX::OSSetup::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### interface methods -################################################################################ -sub new -{ - my $class = shift; - my $self = {}; - return bless $self, $class; -} - -sub initialize -{ - my $self = shift; - my $engine = shift; - - $self->SUPER::initialize($engine); - $self->{'packager-type'} = 'rpm'; - $self->{'meta-packager-type'} = $ENV{SLX_META_PACKAGER} || 'yum'; - $self->{'stage1c-faked-files'} = [ - '/etc/fstab', - '/etc/mtab', - ]; - return; -} - -1; diff --git a/src/installer/OpenSLX/OSSetup/Engine.pm b/src/installer/OpenSLX/OSSetup/Engine.pm index 159a23a7..07d9c749 100644 --- a/src/installer/OpenSLX/OSSetup/Engine.pm +++ b/src/installer/OpenSLX/OSSetup/Engine.pm @@ -75,10 +75,6 @@ use vars qw(%supportedDistros); 'suse-11.4_x86_64' => 'clone,update,shell', 'suse-12.1' => 'clone,install,update,shell', 'suse-12.1_x86_64' => 'clone,update,shell', - 'scilin-4.7' => 'clone,update,shell', - 'scilin-5.3' => 'clone,update,shell', - 'scilin-5.4_x86_64' => 'clone,update,shell', - 'scilin-5.5_x86_64' => 'clone,update,shell', 'ubuntu-8.04' => 'clone,install,update,shell', 'ubuntu-8.04_amd64' => 'clone,update,shell', 'ubuntu-8.10' => 'clone,install,update,shell', diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..8f726037 --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Centos.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006..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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# desktop plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Rhel); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..9a04afc4 --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,132 @@ +# Copyright (c) 2006..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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub GDMPathInfo +{ + my $self = shift; + + my $pathInfo = $self->SUPER::GDMPathInfo(); + + # create gdm.conf-custom instead of gdm.conf + $pathInfo->{config} = '/etc/gdm/custom.conf'; + + return $pathInfo; +} + +sub setupGDMScript +{ + my $self = shift; + my $repoPath = shift; + + my $script = $self->SUPER::setupGDMScript($repoPath); + + my $configFile = $self->GDMPathInfo->{config}; + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=GNOME" \ + >/mnt/etc/sysconfig/desktop + # gdm does not like AUFS/UnionFS on its var directory + mkdir -m 1770 /mnt/var/lib/gdm + chown root:gdm /mnt/var/lib/gdm + End-of-Here + + return $script; +} + +sub GDMConfigHashForWorkstation +{ + my $self = shift; + + my $configHash = $self->SUPER::GDMConfigHashForWorkstation(); + $configHash->{'daemon'}->{SessionDesktopDir} = + '/etc/X11/session/:/usr/share/xsessions/:/usr/share/gdm/BuiltInSessions'; + $configHash->{'daemon'}->{Greeter} = + '/usr/libexec/gdmgreeter'; + + return $configHash; +} + +sub setupKDMScript +{ + my $self = shift; + my $repoPath = shift; + + # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to + # our config file + my $pathInfo = $self->KDMPathInfo(); + my $configFile = $pathInfo->{config}; + mkpath("/etc/opt/kdm"); + mkpath("/var/adm/kdm"); + # maybe backup kdmrc.sysconfig sometimes + unlink("/var/adm/kdm/kdmrc.sysconfig"); + # the config file gets overwritten if this script is present + unlink("/opt/kde3/share/apps/kdm/read_sysconfig.sh"); + symlink("/etc/opt/kdm/kdmrc", "/var/adm/kdm/kdmrc.sysconfig"); + + my $script = $self->SUPER::setupKDMScript($repoPath); + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=KDE" \ + >/mnt/etc/sysconfig/desktop + End-of-Here + + return $script; +} + +sub _setupCommonDmScript +{ + my $script = shift; + + $script .= unshiftHereDoc(<<' End-of-Here'); + # cleanup after users Xorg session + sed 's,^#!.*,,' /mnt/etc/X11/xdm/Xreset \ + > /mnt/etc/X11/xdm/Xreset.system + echo -e '#!/bin/sh\n#\n# modified by desktop plugin in Stage3\n#\n + # remove safely any remaining files of the leaving user in /tmp + ( su -c "rm -rf /tmp/*" - $USER + echo "$USER files removed by $0" >/tmp/files.removed 2>/dev/null ) & + . /etc/X11/xdm/Xreset.system' >/mnt/etc/X11/xdm/Xreset + chmod a+x /mnt/etc/X11/xdm/Xreset* + + # enable the inittab entry again (incomplete) + # sed -e "s,# line deleted.*,x:5:respawn:/etc/X11/prefdm -nodaemon," \ + # -i /mnt/etc/inittab + End-of-Here + + return $script; +} + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..9f2eedbc --- /dev/null +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006..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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# desktop plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Rhel); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index 1dc0482c..00000000 --- a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2006..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/ -# ----------------------------------------------------------------------------- -# desktop/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the desktop -# plugin. -# ----------------------------------------------------------------------------- -package desktop::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(desktop::OpenSLX::Distro::Base); - -use File::Path; - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - -sub GDMPathInfo -{ - my $self = shift; - - my $pathInfo = $self->SUPER::GDMPathInfo(); - - # create gdm.conf-custom instead of gdm.conf - $pathInfo->{config} = '/etc/gdm/custom.conf'; - - return $pathInfo; -} - -sub setupGDMScript -{ - my $self = shift; - my $repoPath = shift; - - my $script = $self->SUPER::setupGDMScript($repoPath); - - my $configFile = $self->GDMPathInfo->{config}; - - # include common stuff (independent of display manager used) - $script = _setupCommonDmScript($script); - - $script .= unshiftHereDoc(<<' End-of-Here'); - echo "DISPLAYMANAGER=GNOME" \ - >/mnt/etc/sysconfig/desktop - # gdm does not like AUFS/UnionFS on its var directory - mkdir -m 1770 /mnt/var/lib/gdm - chown root:gdm /mnt/var/lib/gdm - End-of-Here - - return $script; -} - -sub GDMConfigHashForWorkstation -{ - my $self = shift; - - my $configHash = $self->SUPER::GDMConfigHashForWorkstation(); - $configHash->{'daemon'}->{SessionDesktopDir} = - '/etc/X11/session/:/usr/share/xsessions/:/usr/share/gdm/BuiltInSessions'; - $configHash->{'daemon'}->{Greeter} = - '/usr/libexec/gdmgreeter'; - - return $configHash; -} - -sub setupKDMScript -{ - my $self = shift; - my $repoPath = shift; - - # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to - # our config file - my $pathInfo = $self->KDMPathInfo(); - my $configFile = $pathInfo->{config}; - mkpath("/etc/opt/kdm"); - mkpath("/var/adm/kdm"); - # maybe backup kdmrc.sysconfig sometimes - unlink("/var/adm/kdm/kdmrc.sysconfig"); - # the config file gets overwritten if this script is present - unlink("/opt/kde3/share/apps/kdm/read_sysconfig.sh"); - symlink("/etc/opt/kdm/kdmrc", "/var/adm/kdm/kdmrc.sysconfig"); - - my $script = $self->SUPER::setupKDMScript($repoPath); - - # include common stuff (independent of display manager used) - $script = _setupCommonDmScript($script); - - $script .= unshiftHereDoc(<<' End-of-Here'); - echo "DISPLAYMANAGER=KDE" \ - >/mnt/etc/sysconfig/desktop - End-of-Here - - return $script; -} - -sub _setupCommonDmScript -{ - my $script = shift; - - $script .= unshiftHereDoc(<<' End-of-Here'); - # cleanup after users Xorg session - sed 's,^#!.*,,' /mnt/etc/X11/xdm/Xreset \ - > /mnt/etc/X11/xdm/Xreset.system - echo -e '#!/bin/sh\n#\n# modified by desktop plugin in Stage3\n#\n - # remove safely any remaining files of the leaving user in /tmp - ( su -c "rm -rf /tmp/*" - $USER - echo "$USER files removed by $0" >/tmp/files.removed 2>/dev/null ) & - . /etc/X11/xdm/Xreset.system' >/mnt/etc/X11/xdm/Xreset - chmod a+x /mnt/etc/X11/xdm/Xreset* - - # enable the inittab entry again (incomplete) - # sed -e "s,# line deleted.*,x:5:respawn:/etc/X11/prefdm -nodaemon," \ - # -i /mnt/etc/inittab - End-of-Here - - return $script; -} - -1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..2f0ad7cd --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# infoscreen plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..a5988166 --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,29 @@ +# 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the infoscreen +# plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..5f791132 --- /dev/null +++ b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# 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/ +# ----------------------------------------------------------------------------- +# infoscreen/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# infoscreen plugin. +# ----------------------------------------------------------------------------- +package infoscreen::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(infoscreen::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index e89d6d88..00000000 --- a/src/os-plugins/plugins/infoscreen/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# 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/ -# ----------------------------------------------------------------------------- -# infoscreen/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the infoscreen -# plugin. -# ----------------------------------------------------------------------------- -package infoscreen::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(infoscreen::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..68877fd7 --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..6c0f9c9f --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,28 @@ +# 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..4e664c76 --- /dev/null +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# 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/ +# ----------------------------------------------------------------------------- +# kiosk/OpenSLX/Distro/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# kiosk plugin. +# ----------------------------------------------------------------------------- +package kiosk::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(kiosk::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index 7423a3b8..00000000 --- a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# 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/ -# ----------------------------------------------------------------------------- -# kiosk/OpenSLX/Distro/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the kiosk -# plugin. -# ----------------------------------------------------------------------------- -package kiosk::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(kiosk::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm new file mode 100644 index 00000000..99d12703 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Centos.pm @@ -0,0 +1,29 @@ +# 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/Centos.pm +# - provides Centos Linux specific overrides of the Distro API for the +# profile plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Centos; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm new file mode 100644 index 00000000..92d599d8 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Rhel.pm @@ -0,0 +1,29 @@ +# 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/Rhel.pm +# - provides RHEL specific overrides of the Distro API for the profile +# plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Rhel; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm new file mode 100644 index 00000000..e040e3f8 --- /dev/null +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scientific.pm @@ -0,0 +1,29 @@ +# 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/Scientific.pm +# - provides Scientific Linux specific overrides of the Distro API for the +# profile plugin. +# ----------------------------------------------------------------------------- +package profile::OpenSLX::Distro::Scientific; + +use strict; +use warnings; + +use base qw(profile::OpenSLX::Distro::Rhel); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +1; diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm deleted file mode 100644 index de66f02a..00000000 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Scilin.pm +++ /dev/null @@ -1,32 +0,0 @@ -# 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/Scilin.pm -# - provides Scilin-specific overrides of the Distro API for the profile -# plugin. -# ----------------------------------------------------------------------------- -package profile::OpenSLX::Distro::Scilin; - -use strict; -use warnings; - -use base qw(profile::OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - - - - -1; diff --git a/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm b/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm index 0965b482..0100d553 100644 --- a/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm +++ b/src/os-plugins/plugins/vmgrid/OpenSLX/OSPlugin/vmgrid.pm @@ -131,7 +131,7 @@ sub getAttrInfo comma separated list. first will be started first, second second, and so on, max. 4 VMs End-of-Here - content_descr => 'name of xml file e.g. scilin-5.4-wn(.xml)', + content_descr => 'name of xml file e.g. rhel-5-wn(.xml)', default => undef, }, 'vmgrid::vt' => { -- cgit v1.2.3-55-g7522 From e66413628d95f8c9d91a2080768501946c0d5514 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 11 Dec 2012 17:20:53 +0100 Subject: sysrqshutdown plugin changed. now there is a second script which does the sysrq requests which is started with nohup, so that one can logout from ssh first --- .../OpenSLX/OSPlugin/sysrqshutdown.pm | 3 +- .../plugins/sysrqshutdown/files/shutdown | 29 +++++----------- .../plugins/sysrqshutdown/files/sysrqshutdown.sh | 39 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 21 deletions(-) create mode 100644 src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh (limited to 'src') diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index bfc274d4..c30ec5dc 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -78,7 +78,8 @@ sub installationPhase if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown /opt/openslx/plugin-repo/$pluginName"); + cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ + /opt/openslx/plugin-repo/$pluginName"); chmod 0755, "/sbin/shutdown"; } # else assume reinstall diff --git a/src/os-plugins/plugins/sysrqshutdown/files/shutdown b/src/os-plugins/plugins/sysrqshutdown/files/shutdown index a27481d7..1866d516 100644 --- a/src/os-plugins/plugins/sysrqshutdown/files/shutdown +++ b/src/os-plugins/plugins/sysrqshutdown/files/shutdown @@ -1,7 +1,7 @@ #!/bin/bash # ----------------------------------------------------------------------------- # Copyright (c) 2010 - RZ Uni FR -# Copyright (c) 2010 - OpenSLX GmbH +# Copyright (c) 2010 - 2012 OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -12,7 +12,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # shutdown -# - Script for SYSRQ shutdown +# - Script which prepares for SYSRQ shutdown ################################################################################ . /etc/opt/openslx/openslx.conf @@ -22,30 +22,19 @@ ################################################################################ PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins -PLUGINCONFVMGRID=${PLUGINCONFROOT}/sysrqshutdown -# include general configuration from vmgrid -if [ -f ${PLUGINCONFVMGRID}/sysrqshutdown.conf ]; then - . ${PLUGINCONFVMGRID}/sysrqshutdown.conf +PLUGINCONFSYSRQ=${PLUGINCONFROOT}/sysrqshutdown +PLUGINDIR=${OPENSLX_DEFAULT_DIR}/plugin-repo/sysrqshutdown + +# include general configuration from sysrqshutdown +if [ -f ${PLUGINCONFSYSRQ}/sysrqshutdown.conf ]; then + . ${PLUGINCONFSYSRQ}/sysrqshutdown.conf else sysrqshutdown_active=0 fi if [ ${sysrqshutdown_active} -eq 1 ]; then - # check if reboot or halt - if echo "$@" | grep -qe '-r now'; then - for i in $(echo s u b); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - elif echo "$@" | grep -qe '-h now'; then - for i in $(echo s u o); do - echo $i > /proc/sysrq-trigger & - done - exit 0 - fi + nohup ${PLUGINDIR}/sysrqshutdown.sh $@ 2>/dev/null & fi -# else use orig shutdown -shutdown.slxorig $@ exit 0 diff --git a/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh b/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh new file mode 100644 index 00000000..7e575ed3 --- /dev/null +++ b/src/os-plugins/plugins/sysrqshutdown/files/sysrqshutdown.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# ----------------------------------------------------------------------------- +# Copyright (c) 2010 - RZ Uni FR +# Copyright (c) 2010 - 2012 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/ +# ----------------------------------------------------------------------------- +# sysrqshutdown.sh +# - Script for SYSRQ shutdown +################################################################################ + +# check if reboot or halt, else use orig shutdown +if echo "$@" | grep -qe '-r now' + then + echo "Rebooting $(hostname) (sysrq)!" + rq_opt="b" +elif echo "$@" | grep -qe '-h now' + then + echo "Shutting down $(hostname) (sysrq)!" + rq_opt="o" +else + shutdown.slxorig $@ & + exit 0 +fi + +echo s >/proc/sysrq-trigger +sleep 1 +echo u >/proc/sysrq-trigger +(sleep 3 >/dev/null; echo ${rq_opt} >/proc/sysrq-trigger) & +killall sshd >/dev/null 2>&1 + +exit 0 + -- cgit v1.2.3-55-g7522 From 54ab8ee903941dab5d360fc9340b29e7439dce20 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Tue, 11 Dec 2012 17:29:05 +0100 Subject: changed path to meet standard --- src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm | 4 ++-- src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm index 5588a177..57fc3a27 100644 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Base.pm @@ -62,7 +62,7 @@ sub getKdeHome { my $self = shift; - return ".openslx/unknown/kde"; + return ".openslx/general/kde"; } sub getGconfPathConfig @@ -77,7 +77,7 @@ sub getGconfHome { my $self = shift; - return ".openslx/unknown/gconf"; + return ".openslx/general/gconf"; } diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm index 3b288e97..0cee752d 100644 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Ubuntu_10.pm @@ -45,7 +45,7 @@ sub getKdeHome { my $self = shift; - return ".openslx/ubuntu-lucid.kde"; + return ".openslx/ubuntu-10/kde"; } sub getGconfPathConfig @@ -60,7 +60,7 @@ sub getGconfHome { my $self = shift; - return ".openslx.ubuntu-lucid.gconf"; + return ".openslx/ubuntu-10/gconf"; } 1; -- cgit v1.2.3-55-g7522 From c0feaa89cc0f28a149db7a02cd573b3815a33625 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 12 Dec 2012 18:59:34 +0100 Subject: minor sysrq changes, nohup is needed to log out from ssh session before halt or reboot --- .../sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index c30ec5dc..07630fcb 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -70,23 +70,20 @@ sub installationPhase { my $self = shift; my $info = shift; - my $openslxBasePath = $info->{'openslx-base-path'}; - my $pluginName = $self->{'name'}; + my $openslxBasePath = $info->{'openslx-base-path'}; + my $pluginName = $self->{'name'}; my $pluginBasePath = "$openslxBasePath/lib/plugins/$pluginName/files"; + my $pluginDirPath = "/opt/openslx/plugin-repo/$pluginName"; # copy files if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); - system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ - /opt/openslx/plugin-repo/$pluginName"); - chmod 0755, "/sbin/shutdown"; - } - # else assume reinstall - elsif (-e "/sbin/shutdown.slxorig") { - system("cp -p $pluginBasePath/shutdown /sbin/"); - chmod 0755, "/sbin/shutdown"; } + system("cp -p $pluginBasePath/shutdown /sbin/; + cp -p $pluginBasePath/shutdown $pluginDirPath; + cp -p $pluginBasePath/sysrqshutdown.sh $pluginDirPath"); + chmod 0755, "/sbin/shutdown", "$pluginDirPath/shutdown", + "$pluginDirPath/sysrqshutdown.sh"; return; } -- cgit v1.2.3-55-g7522 From 00aca01bbf2daf8cdd63c3846ca29e3dc50185e5 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 12 Dec 2012 19:02:04 +0100 Subject: Respect aliases and blacklist of a system. /etc/modprobe.d is now copied to InitRamFS --- src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm | 11 +++++++++++ src/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm | 2 ++ src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm | 2 ++ 3 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm index e23dc40f..bf96daf6 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm @@ -336,6 +336,17 @@ sub _copyKernelModules return; } +sub _copyModprobeD +{ + my $self = shift; + + my $source = "$self->{'root-path'}/etc/modprobe.d"; + my $target = "$self->{'build-path'}/etc"; + $self->addCMD("cp -pr --dereference $source $target"); + + return; +} + sub _platformSpecificFileFor { my $self = shift; diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm index 319ff65e..e0123aa7 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Preboot.pm @@ -43,6 +43,8 @@ sub _collectCMDs $self->_copyKernelModules(); + $self->_copyModprobeD(); + $self->_createInitRamFS(); return; diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm index cc5cc409..23448998 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/SlxBoot.pm @@ -52,6 +52,8 @@ sub _collectCMDs $self->{distro}->applyChanges($self); $self->_copyKernelModules(); + + $self->_copyModprobeD(); $self->_createInitRamFS(); -- cgit v1.2.3-55-g7522 From 85d7c713cefdc63bbe9534b1eab9bd1c6b942233 Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Wed, 12 Dec 2012 19:05:25 +0100 Subject: Remove all files from /var and leave only the dir structure --- src/installer/OpenSLX/OSExport/Distro/Rhel.pm | 37 ++++++++------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/installer/OpenSLX/OSExport/Distro/Rhel.pm b/src/installer/OpenSLX/OSExport/Distro/Rhel.pm index 330b2d14..668874cc 100644 --- a/src/installer/OpenSLX/OSExport/Distro/Rhel.pm +++ b/src/installer/OpenSLX/OSExport/Distro/Rhel.pm @@ -75,32 +75,17 @@ sub initDistroInfo - /usr/share/gnome/autostart/gpk-update-icon*.desktop + /usr/X11R6/lib/modules/drivers/linux/*.o + /usr/X11R6/lib/modules/drivers/*.o - + /var/cache/*/ - - /var/cache/* - - /var/cache/*/* - - /var/cfengine/* - + /var/lib/bluetooth/*/ - - /var/lib/bluetooth/* - - /var/lib/dhcp* - - /var/lib/gdm/* - - /var/lib/smart - - /var/lib/suspend* - - /var/lib/vm* - - /var/lib/xdm - + /var/lock/*/ - - /var/lock/* - - /var/lock/*/* - + /var/log/*/ - - /var/log/* - - /var/log/*/* - - /var/mail - + /var/run/*/ - - /var/run/* - - /var/run/*/* - + /var/spool/*/ - - /var/spool/* - - /var/spool/*/* - - /var/tmp/* + + /var/*/ + + /var/*/*/ + + /var/*/*/*/ + + /var/*/*/*/*/ + + /var/*/*/*/*/*/ + - /var/*/*/*/*/*/* + - /var/*/*/*/*/* + - /var/*/*/*/* + - /var/*/*/* + - /var/*/* + - /var/* "; return; } -- cgit v1.2.3-55-g7522 From 2c45fdd73dc9b8152119b1dd03cfbb303bb705bc Mon Sep 17 00:00:00 2001 From: Michael Janczyk Date: Fri, 14 Dec 2012 14:04:06 +0100 Subject: FW is now automatically added to the initramfs. Checks are done with modinfo. --- src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm | 78 +++++++++++++---------- 1 file changed, 46 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm index bf96daf6..1eb91e88 100644 --- a/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Engine/Base.pm @@ -278,49 +278,63 @@ sub _copyKernelModules # build a list of required firmwares out of the list of modules - not # totally optimal my @firmwares; - $self->addCMD("mkdir -p $self->{'build-path'}/lib/firmware/$self->{'kernel-version'}"); - foreach my $moduleToBeCopied(%modulesToBeCopied) { + foreach my $moduleToBeCopied(sort keys %modulesToBeCopied) { $moduleToBeCopied =~ /.*\/(.*?)$/; - # implies usage of switch - vlog(1,$1); - switch ($1){ - case "bnx2.ko" {push @firmwares, split ' ', "bnx2/"} - case "bnx2x.ko" {push @firmwares, split ' ', "bnx2x/"} - case "e100.ko" {push @firmwares, split ' ', "e100"} - case "iwlwifi" { - push @firmwares, split ' ', - "iwlwifi-3945-1.ucode iwlwifi-3945-2.ucode iwlwifi-4965-1.ucode iwlwifi-4965-2.ucode iwlwifi-5000-1.ucode" - } - # modules required for graphic adaptors (bootsplash, Xorg) - case "radeon.ko" {push @firmwares, split ' ', "radeon/"} - case "mga.ko" {push @firmwares, split ' ', "matrox/"} - case "r128.ko" {push @firmwares, split ' ', "r128/"} - case "r8169.ko" {push @firmwares, split ' ', "rtl_nic/"} - case "tg3.ko" {push @firmwares, split ' ', "tigon/"} + # use modinfo to check if module depends on firmware, and add it + my @dependsFirmware = `modinfo -F firmware $self->{'root-path'}/$moduleToBeCopied`; + foreach my $firmware(@dependsFirmware) { + push @firmwares, split ' ', "$firmware"; } + # old static copy + ## implies usage of switch + #vlog(1,$1); + #switch ($1){ + # #case "bnx2.ko" {push @firmwares, split ' ', "bnx2/"} + # #case "bnx2x.ko" {push @firmwares, split ' ', "bnx2x/"} + # case "e100.ko" {push @firmwares, split ' ', "e100"} + # case "iwlwifi" { + # push @firmwares, split ' ', + # "iwlwifi-3945-1.ucode iwlwifi-3945-2.ucode iwlwifi-4965-1.ucode iwlwifi-4965-2.ucode iwlwifi-5000-1.ucode" + # } + # # modules required for graphic adaptors (bootsplash, Xorg) + # case "radeon.ko" {push @firmwares, split ' ', "radeon/"} + # case "mga.ko" {push @firmwares, split ' ', "matrox/"} + # case "r128.ko" {push @firmwares, split ' ', "r128/"} + # case "r8169.ko" {push @firmwares, split ' ', "rtl_nic/"} + # case "tg3.ko" {push @firmwares, split ' ', "tigon/"} + #} } + # copy all the firmwares that we think are required foreach my $firmwareToBeCopied (@firmwares) { - my $source = followLink( - "$self->{'root-path'}/lib/firmware/$self->{'kernel-version'}/$firmwareToBeCopied", $self->{'root-path'} + my $firmwareSource = followLink( + "$self->{'root-path'}/lib/firmware/$firmwareToBeCopied" , + $self->{'root-path'} ); - my $alternative_source = followLink( - "$self->{'root-path'}/lib/firmware/$firmwareToBeCopied", $self->{'root-path'} + my $kernelFWSource = followLink( + "$self->{'root-path'}/lib/firmware/$self->{'kernel-version'}/" . + "$firmwareToBeCopied", $self->{'root-path'} ); - if (-e $source){ - my $target = "$self->{'build-path'}/lib/firmware/$self->{'kernel-version'}/"; - - $self->addCMD("cp -pr --dereference $source $target"); + + if (-e $firmwareSource){ + my $targetDir = dirname("$self->{'build-path'}/lib/firmware/" . + "$firmwareToBeCopied"); + $self->addCMD("mkdir -p $targetDir; \ + cp -pr --dereference $firmwareSource $targetDir"); } else { - vlog(3,"unable to find $source for copying purposes"); + vlog(3,"unable to find $firmwareSource for copying purposes"); } - if (-e $alternative_source){ - my $target = "$self->{'build-path'}/lib/firmware/"; - - $self->addCMD("cp -pr --dereference $alternative_source $target"); + + if (-e $kernelFWSource){ + my $targetDir = dirname("$self->{'build-path'}/lib/firmware/" . + "$self->{'kernel-version'}/$firmwareToBeCopied"); + $self->addCMD("mkdir -p $targetDir; \ + cp -pr --dereference $kernelFWSource $targetDir"); + } else { + vlog(3,"unable to find $kernelFWSource for copying purposes"); } } - + # copy all the modules that we think are required foreach my $moduleToBeCopied (sort keys %modulesToBeCopied) { my $source = followLink( -- cgit v1.2.3-55-g7522