From aeeeafa08ec5ecaeeee327406b5d7757c76e0585 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 May 2011 14:48:20 +0200 Subject: Adding stuff for new Fedora ... --- .../OpenSLX/MakeInitRamFS/Distro/Fedora.pm | 58 ++++ src/initramfs/distro-specs/fedora/functions-15 | 1 + .../distro-specs/fedora/functions-default | 315 +++++++++++++++++++++ src/installer/OpenSLX/OSSetup/Engine.pm | 4 +- 4 files changed, 376 insertions(+), 2 deletions(-) create mode 100644 src/boot-env/OpenSLX/MakeInitRamFS/Distro/Fedora.pm create mode 120000 src/initramfs/distro-specs/fedora/functions-15 create mode 100644 src/initramfs/distro-specs/fedora/functions-default diff --git a/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Fedora.pm b/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Fedora.pm new file mode 100644 index 00000000..fd993960 --- /dev/null +++ b/src/boot-env/OpenSLX/MakeInitRamFS/Distro/Fedora.pm @@ -0,0 +1,58 @@ +# Copyright (c) 2009..2011 - 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::fedora.pm +# - provides Fedora Linux specific overrides of the MakeInitRamFS::Distro +# API. +# ----------------------------------------------------------------------------- +package OpenSLX::MakeInitRamFS::Distro::fedora; + +use strict; +use warnings; + +use base qw(OpenSLX::MakeInitRamFS::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'fedora', + }; + 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 = ( + '15' => '16.0', + ); + return $versionMap{$distroVersion} + || $self->SUPER::determineMatchingHwinfoVersion($distroVersion); +} + +1; diff --git a/src/initramfs/distro-specs/fedora/functions-15 b/src/initramfs/distro-specs/fedora/functions-15 new file mode 120000 index 00000000..0ced91f7 --- /dev/null +++ b/src/initramfs/distro-specs/fedora/functions-15 @@ -0,0 +1 @@ +functions-default \ No newline at end of file diff --git a/src/initramfs/distro-specs/fedora/functions-default b/src/initramfs/distro-specs/fedora/functions-default new file mode 100644 index 00000000..f9bb0f0e --- /dev/null +++ b/src/initramfs/distro-specs/fedora/functions-default @@ -0,0 +1,315 @@ +# Copyright (c) 2003..2006 - RZ Uni Freiburg +# Copyright (c) 2006..2010 - OpenSLX GmbH +# +# This program/file 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 feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# configuration script for general Scientific Linux to configure linux +# stateless clients (included by init, hwautocfg, servconfig within Initial- +# RamFS after inclusion of the main functions file). This file is the main +# base for the several RedHat based Scientific Linux versions. + +# settings of central variables +# D_DIRINBINDMNT - lists of directories to be created in bind mounted rw +# part of the client filesystem +# D_RODIRSINRW - ReadOnly Directories in RW part of filesystem to save on +# TempFS usage +# D_DIRINDXS - directories in client filesystem which should be present +# anyhow +D_BINDMPTS="tmp root media home" +D_DIRINBINDMNT="/var/run /var/log /var/tmp" +D_RODIRSINRW="/etc/bootsplash /etc/gconf /var/adm /var/lib/texmf /var/lib/rpm \ +/var/cache/fontconfig" +D_DIRINDXS="/var/lib/rpm /var/lib/nobody /var/lib/alternatives/ /var/db/nscd \ +/var/lib/bluetooth /var/lib/scrollkeeper /var/lib/nfs/sm /var/lib/nfs/sm.bak \ +/var/lib/misc /var/spool/cron" + +# empty functions are defined at the beginning of /etc/functions + +# distro specific function called from servconfig script +config_distro () { + # clean the runlevel directories which will be populated by the stage3 setup + for dir in rc0.d rc1.d rc2.d rc3.d rc4.d rc5.d rc6.d ; do + rm -rf /mnt/etc/${dir}/* + done + # set some system/environment information + echo -e "SLX VERSION = $SLXVERSION\nINITRAMFS GENERATION DATE = $date" \ + >>/mnt/etc/redhat-release + # simple bash configuration for root + echo -e "# Generated in OpenSLX stage3\n. /etc/bashrc" >/mnt/root/.profile + # enable sysrq + sed -e "1i# Configuration modified by $0 during stage3 bootup." \ + -e "s/kernel.sysrq =.*/kernel.sysrq = 1/" -i /mnt/etc/sysctl.conf + # set some networking stuff if needed + [ -e /mnt/etc/sysconfig/network ] && \ + sed -e "s/HOSTNAME=.*/HOSTNAME=$host_name/" \ + -e "s/GATEWAY=.*/GATEWAY=$gateway/" -i /mnt/etc/sysconfig/network + # check for inittab file + #test -f /mnt/etc/inittab || error "$df_erritab" +} + +# initial (boot time) runlevel scripts +initial_boot () { +# delete all classical disk base rootfs stuff from rc.sysinit +sed -e "6i# Script modified by $0 during stage3 bootup." \ + -e "/# Initialize ha/,/success/d" -e "/^ROOTFSTYPE/,/Remounting root/d" \ + -e "/# Check f/,/Mounting l/d" -e "/^# Configure mach/,/-f \/fastboot/d" \ + -e "s,/sbin/start_udev$,/etc/init.d/udevd," -i /mnt/etc/rc.d/rc.sysinit +# write a custom udev script (to be checked!!) +echo -e "#!/bin/sh\n# Simple udev starter script created as a replacement \ +during OpenSLX stage3\n# bootup." >/mnt/etc/init.d/udevd +echo -e ". /etc/init.d/functions\nSTRING=\$\"Starting udev: \" \ +\necho -n \"\$STRING \"\n/sbin/udevstart /dev/null 2>&1 \ +\n[ \$? -eq 0 ] && success \$\"\$STRING\" || failure \$\"\$STRING\" \ +\nexit 0" >>/mnt/etc/init.d/udevd +chmod u+x /mnt/etc/init.d/udevd +# delete all classical disk base rootfs stuff from halt +sed -e "7i# Modified by $0 during stage3 bootup." \ + -e "/# Save mixer/,/Saving random/d" -e "/quotaoff/,/^# Now halt/d" \ + -i /mnt/etc/init.d/halt +# boot.slx is a special runlevel script generated within initialramfs which +# should be executed before the normal runlevel scripts. +echo -e "# Run OpenSLX init runlevel script\n/etc/init.d/boot.slx" \ + >>/mnt/etc/rc.d/rc.sysinit +# switch off SElinux enforcing +sed -e "1i# Configuration modified by $0 during stage3 bootup." \ + -e "s/SELINUX=.*/SELINUX=permissive/" -i /mnt/etc/selinux/config +# link halt and reboot scripts +ln -s ../init.d/killall /mnt/etc/rc.d/rc0.d/S00killall +ln -s ../init.d/halt /mnt/etc/rc.d/rc0.d/S01halt +ln -s ../init.d/killall /mnt/etc/rc.d/rc6.d/S00killall +ln -s ../init.d/halt /mnt/etc/rc.d/rc6.d/S01reboot +} + +# linking runlevel scripts +rllinker () { +local script="$1" +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 +# empty runlevel links - decision on running certain services is passed via +# configuration +for i in rc3.d/K$stop$script rc5.d/K$stop$script \ + rc3.d/S$start$script rc5.d/S$start$script ; do + ln -sf ../init.d/$script /mnt/etc/$i +done +} + +# group of functions for the normal runlevels - first parameter is start +# second stop +# function for ntp configuration +config_ntp () { +if [ -e /mnt/etc/init.d/ntpd ] ; then + if ! strinfile "ntp:" /mnt/etc/passwd ; then + echo -e "ntp:x:38:38:NTP daemon:/var/lib/ntp:/sbin/nologin" \ + >>/mnt/etc/passwd + echo -e "ntp:!:13099:0:99999:7:::" >>/mnt/etc/shadow + fi + testmkd /mnt/var/lib/ntp ntp:ntp + if [ "x$start_ntp" = "xyes" ] ; then + rllinker "ntpd" 7 14 + fi +fi +} +# function for atd +config_atd () { +if [ "x$start_atd" = "xyes" ]; then + rllinker "atd" 14 4 +fi +} +# function for configuration of cron services +config_cron () { +if [ "x$start_cron" = "xyes" ] ; then + if [ -f /mnt/etc/init.d/cron ] ; then + rllinker "cron" 18 2 + testmkd /mnt/var/spool/anacron + echo -e "# /etc/crontab - file generated by $0:\n\ +" >/mnt/etc/crontab + else + error "$df_errcron" nonfatal + fi +fi +} +# name service caching daemon (useful in most cases) +config_nscd () { + if [ -f /mnt/etc/init.d/nscd ] ; then + testmkd /mnt/var/db/nscd + rllinker "nscd" 20 5 + fi +} +# secure shell service +config_sshd () { +if [ "x$start_sshd" = "xyes" ] ; then + if [ -f /mnt/etc/init.d/sshd ] ; then + testmkd /mnt/var/empty/sshd/dev + if ! strinfile "sshd:" /mnt/etc/passwd ; then + echo -e "sshd:x:74:74::/var/empty/sshd:/sbin/nologin" \ + >>/mnt/etc/passwd + echo -e "sshd:!:13099:0:99999:7:::" >>/mnt/etc/shadow + fi + rllinker "sshd" 25 10 + else + error "$df_errsshd" nonfatal + fi +fi +} +# snmp agent for remote monitoring +config_snmp () { +if [ "x$start_snmp" = "xyes" ] ; then + if [ -f /mnt/etc/init.d/snmpd ] ; then + rllinker "snmpd" 24 2 + testmkd /mnt/var/lib/net-snmp + fi + # fixme!! + # write service monitor depending on services started + fi +} +# configure print server (lpd or cups) +config_printer () { +if [ "x${start_printdaemon}" != "x" ] && \ + [ "x${start_printdaemon}" != "xno" ]; then + case ${start_printdaemon} in + yes|cups*|CUPS*) + rllinker "cups" 25 1 + testmkd /mnt/var/spool/cups/tmp root:sys + ;; + lp*|LP*|PLP*) + rllinker "lpd" 25 1 + testmkd /mnt/var/spool/lpd + ;; + *) + #logwrite "Do not know print-server $start_printdaemon; \ + #specify 'cups' or 'lpd'." + ;; + esac +fi +# configure cups printer client, avoid to overwrite admin provided printer +# configuration file +if [ "x$lpr_servers" != "x" ] && [ ! -e /rootfs/etc/cups/client.conf ] ; then + echo -e "# /etc/cups/client.conf - file generated by\n#\t$0:\n\ +#\t$date\n#\nServerName\t$lpr_servers" >/mnt/etc/cups/client.conf +fi +} +# configure bluetooth services +config_bt () { +if [ -e /mnt/etc/sysconfig/bluetooth ] ; then + sed -e "1i# /etc/sysconfig/bluetooth - file modified by $0" \ + -e "s,HID2HCI_ENABLE.*,HID2HCI_ENABLE=true," \ + -i /mnt/etc/sysconfig/bluetooth +else + : # no bluetooth components installed +fi +} +# set up localization like keytable and consolefont +dlocale () { +echo -e "\t# entries added by $0: $date" >> /mnt/etc/init.d/boot.slx +sed -e "s,KEYTABLE=.*,KEYTABLE=\"${KEYTABLE}\"," \ + -i /mnt/etc/sysconfig/keyboard +#echo -e "\tsetfont ${CONSOLE_FONT} >${LOGFILE} 2>&1\n" \ +# >>/mnt/etc/init.d/boot.slx +} +# acpi and powersave daemons, required e.g. to shutdown the machine via +# power button, no need for early start +config_acpi () { +rllinker acpid 01 22 +} +# configure dbus (inter application communication for kde and gnome), hal +# (hardware abstraction layer - used e.g. by powersaved) and resmgr +# (resource manager - the user gets permissions to devices when loggin on) +# runlevel script for haldaemon is now haldaemon instead of hal +config_dreshal () { +local start=4 +local stop=18 +if [ "x$start_dreshal" = "xyes" ]; then + testmkd /mnt/var/run/dbus + if [ -f /mnt/etc/init.d/messagebus ] ; then + testmkd /mnt/var/lib/dbus + strinfile "dbus:" /mnt/etc/passwd || \ + echo "dbus:x:81:81:System Message Bus:/var/run/dbus:/sbin/nologin" \ + >> /mnt/etc/passwd + strinfile "dbus:" /mnt/etc/group || echo "dbus:!:81:" >> /mnt/etc/group + rllinker "messagebus" $start $stop + fi + if [ -f /mnt/etc/init.d/haldaemon ] ; then + testmkd /mnt/var/lib/hal + strinfile "haldaemon:" /mnt/etc/passwd || \ + echo "haldaemon:x:68:68:User for haldaemon:/var/run/hal:/sbin/nologin" \ + >> /mnt/etc/passwd + strinfile "haldaemon:" /mnt/etc/group || \ + echo "haldaemon:!:103:" >> /mnt/etc/group + start=$(($start + 1)) + stop=$(($stop - 1)) + rllinker "haldaemon" $start $stop + fi +fi +} +# configure automounter (fixme: to be moved into plugin) +config_automount () { +if [ -e /mnt/etc/sysconfig/autofs ] ; then + testmkd /mnt/var/lock/subsys + sed -e "1i# /etc/sysconfig/autofs - file modified by\n#\t$0:\n#" \ + -e "s,DAEMONOPTIONS.*,DAEMONOPTIONS=\"--timeout 3\"," \ + -i /mnt/etc/sysconfig/autofs + rllinker "autofs" 18 4 +else + error "$df_erramt" nonfatal +fi +} +# start name service caching daemon +config_nscd () { +if [ -e /mnt/etc/init.d/nscd ] ; then + testmkd /mnt/var/run/nscd + rllinker "nscd" 16 16 +else + error "$df_errnsc" nonfatal +fi +} +# start portmapper (needed at least for nfs and nis services) +config_portmap () { + rllinker "portmap" 2 20 +} +# start NIS (mostly deprecated) +config_nis () { +if [ -f /mnt/etc/init.d/ypbind ] ; then + rllinker "ypbind" 6 16 + config_portmap + testmkd /mnt/var/yp/nicknames +else + error "$df_erryp" nonfatal +fi +} +# initialize runlevel skript to be executed during system startup +# (before most of the normal boot init scripts) +# this script should operate like a normal runlevel script +d_mkrlscript () { +local switch="$1" +local name="$2" +local info="$3" +case "$1" in + init) + echo -e "#!/bin/sh\n# skeleton of /etc/init.d/${name} created \ +by $0\n# after you applied changes to the creation scripts you have to \ +rerun\n# the mkdxsinitrd script to get them applied\n\ +. /etc/rc.d/init.d/functions\n#. /etc/sysconfig/logfile\ncase \ +\"\$1\" in\n start)\n\techo -n \"$info\"" >>/mnt/etc/init.d/${name} + chmod u+x /mnt/etc/init.d/${name} + ;; + entry) + echo -e "\t${info}" >>/mnt/etc/init.d/${name} + ;; + close) + echo -e "\t;;\n stop)\n\t;;\nesac" \ + >>/mnt/etc/init.d/${name} + ;; +esac +} + + diff --git a/src/installer/OpenSLX/OSSetup/Engine.pm b/src/installer/OpenSLX/OSSetup/Engine.pm index e855ef97..5e760e12 100644 --- a/src/installer/OpenSLX/OSSetup/Engine.pm +++ b/src/installer/OpenSLX/OSSetup/Engine.pm @@ -43,8 +43,8 @@ use vars qw(%supportedDistros); 'debian-4.0' => 'clone,install,update,shell', 'debian-4.0_amd64' => 'clone,install,update,shell', 'debian-5.0' => 'clone,update,shell', - 'fedora-6' => 'clone,install,update,shell', - 'fedora-6_x86_64' => 'clone,install,update,shell', + 'fedora-15' => 'clone,update,shell', + 'fedora-15_x86_64' => 'clone,update,shell', 'gentoo-2007.X' => 'clone', 'suse-10.1' => 'clone,install,update,shell', 'suse-10.1_x86_64' => 'clone,install,update,shell', -- cgit v1.2.3-55-g7522 From 3a82c9b82e6fa848ea485e19cf16114a4a4838bf Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 May 2011 14:54:05 +0200 Subject: Distro specific stuff for Fedora inclusion ... --- .../plugins/desktop/OpenSLX/Distro/Fedora.pm | 162 +++++++++++++++++---- .../plugins/kiosk/OpenSLX/Distro/Fedora.pm | 6 +- 2 files changed, 134 insertions(+), 34 deletions(-) diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm index f9428aab..c9313576 100644 --- a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm @@ -1,30 +1,132 @@ -# 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/ -# ----------------------------------------------------------------------------- -# desktop/OpenSLX/Distro/Fedora.pm -# - provides Fedora-specific overrides of the Distro API for the desktop -# plugin. -# ----------------------------------------------------------------------------- -package desktop::OpenSLX::Distro::Fedora; - -use strict; -use warnings; - -use base qw(desktop::OpenSLX::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### interface methods -################################################################################ - -# TODO: implement! - -1; \ No newline at end of file +# Copyright (c) 2006..2011 - 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/fedora.pm +# - provides fedora-specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::fedora; + +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/kiosk/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm index 2b9f8ff5..a8cd25b3 100644 --- a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2009 - OpenSLX GmbH +# Copyright (c) 2011 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -9,7 +9,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # kiosk/OpenSLX/Distro/Fedora.pm -# - provides Fedora-specific overrides of the Distro API for the kiosk +# - provides fedora-specific overrides of the Distro API for the kiosk # plugin. # ----------------------------------------------------------------------------- package kiosk::OpenSLX::Distro::Fedora; @@ -27,6 +27,4 @@ use OpenSLX::Utils; ################################################################################ - - 1; -- cgit v1.2.3-55-g7522 From 996cadf9d072aa2f545a63ac85141e60a3721f71 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 May 2011 14:54:55 +0200 Subject: More ... --- .../plugins/xserver/OpenSLX/Distro/Fedora.pm | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm new file mode 100644 index 00000000..13819059 --- /dev/null +++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm @@ -0,0 +1,89 @@ +# Copyright (c) 2008..2011 - 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/ +# ----------------------------------------------------------------------------- +# xserver/OpenSLX/Distro/Suse.pm +# - provides SUSE-specific overrides of the Distro API for the xserver +# plugin. +# ----------------------------------------------------------------------------- +package xserver::OpenSLX::Distro::Suse; + +use strict; +use warnings; + +use base qw(xserver::OpenSLX::Distro::Base); + +use File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; +use OpenSLX::DistroUtils; + +use Data::Dumper; + +################################################################################ +### interface methods +################################################################################ + +sub setupXserverScript +{ + my $self = shift; + my $repoPath = shift; + + my $script = $self->SUPER::setupXserverScript($repoPath); + + # add stuff to the script generated via Base.pm + $script .= unshiftHereDoc(<<' End-of-Here'); + # SuSE specific extension to stage3 xserver.sh + testmkd /mnt/etc/X11/xorg.conf.d + # Add InputClass to proper setup the keyboard and other input + echo 'Section "InputClass" + Identifier "evdev pointer catchall" + MatchIsPointer "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + EndSection + Section "InputClass" + Identifier "evdev keyboard catchall" + MatchIsKeyboard "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + EndSection + Section "InputClass" + Identifier "evdev touchpad catchall" + MatchIsTouchpad "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + EndSection + Section "InputClass" + Identifier "evdev tablet catchall" + MatchIsTablet "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + EndSection + Section "InputClass" + Identifier "evdev touchscreen catchall" + MatchIsTouchscreen "on" + MatchDevicePath "/dev/input/event*" + Driver "evdev" + EndSection' >/mnt/etc/X11/xorg.conf.d/10-evdev.conf + # Xorg hardware is autodetected, so no module information provided + [ -z "${xmodule}" ] && \ + sed "/Section \"Device\"/,/EndSection/d" -i ${xfc} + testmkd /mnt/var/lib/xkb/compiled + testmkd /mnt/var/lib/X11 + testmkd /mnt/var/lib/xdm/authdir/authfiles 0700 + ln -s /usr/bin/Xorg /mnt/var/lib/X11/X + rm /mnt/etc/X11/xdm/SuSEconfig.xdm + End-of-Here + + return $script; +} + +1; -- cgit v1.2.3-55-g7522 From 5f11e7e2121dfbdd0b8d49ded7beb99c0c4ffdfc Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 May 2011 15:45:29 +0200 Subject: More Fedora stuff (unchanged mostly ...) --- src/os-plugins/plugins/profile/OpenSLX/Distro/Fedora.pm | 4 ++-- src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/os-plugins/plugins/profile/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/profile/OpenSLX/Distro/Fedora.pm index 433f6f7f..fd72c015 100644 --- a/src/os-plugins/plugins/profile/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/profile/OpenSLX/Distro/Fedora.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2009 - OpenSLX GmbH +# Copyright (c) 2011 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -9,7 +9,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # profile/OpenSLX/Distro/Fedora.pm -# - provides Fedora-specific overrides of the Distro API for the profile +# - provides fedora-specific overrides of the Distro API for the profile # plugin. # ----------------------------------------------------------------------------- package profile::OpenSLX::Distro::Fedora; diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm index 13819059..6bfda47e 100644 --- a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Fedora.pm @@ -8,11 +8,11 @@ # # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- -# xserver/OpenSLX/Distro/Suse.pm -# - provides SUSE-specific overrides of the Distro API for the xserver +# xserver/OpenSLX/Distro/fedora.pm +# - provides fedora-specific overrides of the Distro API for the xserver # plugin. # ----------------------------------------------------------------------------- -package xserver::OpenSLX::Distro::Suse; +package xserver::OpenSLX::Distro::fedora; use strict; use warnings; @@ -40,7 +40,7 @@ sub setupXserverScript # add stuff to the script generated via Base.pm $script .= unshiftHereDoc(<<' End-of-Here'); - # SuSE specific extension to stage3 xserver.sh + # fedora specific extension to stage3 xserver.sh testmkd /mnt/etc/X11/xorg.conf.d # Add InputClass to proper setup the keyboard and other input echo 'Section "InputClass" @@ -80,7 +80,7 @@ sub setupXserverScript testmkd /mnt/var/lib/X11 testmkd /mnt/var/lib/xdm/authdir/authfiles 0700 ln -s /usr/bin/Xorg /mnt/var/lib/X11/X - rm /mnt/etc/X11/xdm/SuSEconfig.xdm + rm /mnt/etc/X11/xdm/fedoraconfig.xdm End-of-Here return $script; -- cgit v1.2.3-55-g7522