From e61e9d93f1e87b8821aca173bac6f3abeb9678f3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Tue, 22 Nov 2011 17:25:41 +0100 Subject: Distro specific scripts ... --- src/initramfs/distro-specs/suse/functions-12.1 | 83 +++++++++++++++++++++++ src/initramfs/distro-specs/ubuntu/functions-11.10 | 28 ++++++++ src/installer/OpenSLX/OSExport/Distro/Suse.pm | 5 +- src/installer/OpenSLX/OSExport/Distro/Ubuntu.pm | 1 + 4 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 src/initramfs/distro-specs/suse/functions-12.1 create mode 100644 src/initramfs/distro-specs/ubuntu/functions-11.10 (limited to 'src') diff --git a/src/initramfs/distro-specs/suse/functions-12.1 b/src/initramfs/distro-specs/suse/functions-12.1 new file mode 100644 index 00000000..98daafa4 --- /dev/null +++ b/src/initramfs/distro-specs/suse/functions-12.1 @@ -0,0 +1,83 @@ +# Copyright (c) 2011 - 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 OpenSuSE 12.1 to configure linux stateless clients +# (included by init, hwautocfg, servconfig within InitialRamFS after +# inclusion of the main functions file). This file is the main base for the +# several SuSE distro versions + +# settings of central variables (formerly done via config-*, these variables +# are disputable ...) +# 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 + +# start portmapper (needed at least for nfs and nis services) +config_portmap () { +# portmap is provided via rpcbind in suse 11.1,2,3,4 and 12.1 +testmkd /mnt/var/lib/rpcbind +rllinker "rpcbind" 4 5 +} +# acpi and powersave daemons, required e.g. to shutdown the machine via +# power button, no need for early start +config_acpi () { +rllinker acpid 22 12 +# dbus is required to run acpid and powersaved +start_dreshal="yes" +} +# configure dbus (inter application communication for kde and gnome), hal +# (hardware abstraction layer - used e.g. by powersaved) +config_dreshal () { +if [ "x$start_dreshal" = "xyes" ]; then + # create directories and set permissions with user and group id + for dir in "/var/lib/misc" "/var/run/ConsoleKit" \ + "/var/lib/dbus" \ + "/var/lib/polkit-1/localauthority" \ + "/var/run/dbus messagebus:messagebus" \ + "/var/cache/hald haldaemon:haldaemon"; do + testmkd /mnt${dir} + done + touch /mnt/var/lib/misc/PolicyKit.reload + chown polkituser.polkituser /mnt/var/lib/misc/PolicyKit.reload + + if [ -f /mnt/etc/init.d/dbus ] ; then + strinfile "messagebus:" /mnt/etc/passwd || \ + echo "messagebus:x:102:103:User for D-BUS:/var/run/dbus:/bin/false" \ + >> /mnt/etc/passwd + strinfile "messagebus:" /mnt/etc/group || \ + echo "messagebus:!:103:" >> /mnt/etc/group + + rm -rf /mnt/etc/dbus-1/system.d/*etwork*anager.conf \ + /mnt/etc/dbus-1/system.d/nm-* + + rllinker "dbus" 1 20 + fi +fi +} +# function for ntp configuration +config_ntp () { +if [ -e /mnt/etc/init.d/ntp ] ; then + if ! strinfile "ntp:" /mnt/etc/passwd ; then + echo -e "ntp:x:74:106:NTP daemon:/var/lib/nobody:/bin/false" \ + >>/mnt/etc/passwd + echo -e "ntp:!:13099:0:99999:7:::" >>/mnt/etc/shadow + fi + testmkd /mnt/var/lib/ntp/var/run/ntp + testmkd /mnt/var/db + touch /mnt/var/db/ntp-kod + if [ "x$start_ntp" = "xyes" ] ; then + rllinker "ntp" 2 14 + fi +fi +} + diff --git a/src/initramfs/distro-specs/ubuntu/functions-11.10 b/src/initramfs/distro-specs/ubuntu/functions-11.10 new file mode 100644 index 00000000..e4c7dfd2 --- /dev/null +++ b/src/initramfs/distro-specs/ubuntu/functions-11.10 @@ -0,0 +1,28 @@ +# Copyright (c) 2011 - 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 Ubuntu 11.10 configure OpenSLX Linux stateless +# clients (merged in stage2 with ubuntu/functions-default - and loaded within +# initial ramfs - stage3) It may overwrite settings from the default config +# file (/etc/functions) + +# configure hal, dbus, policykitd and services like that +config_dreshal () { +if [ "x$start_dreshal" = "xyes" ]; then + testmkd /mnt/var/lib/dbus + testmkd /mnt/var/lib/misc + rm -rf /mnt/etc/dbus-1/system.d/*etwork*anager.conf \ + /mnt/etc/dbus-1/system.d/nm-* \ + /mnt/etc/dbus-1/event.d/*NetworkManager* + for dir in 10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d ; do + testmkd /mnt/var/lib/polkit-1/localauthority/${dir} + done +fi +} diff --git a/src/installer/OpenSLX/OSExport/Distro/Suse.pm b/src/installer/OpenSLX/OSExport/Distro/Suse.pm index 79090c04..bf09f4ff 100644 --- a/src/installer/OpenSLX/OSExport/Distro/Suse.pm +++ b/src/installer/OpenSLX/OSExport/Distro/Suse.pm @@ -135,7 +135,9 @@ sub getSquashfsVersion '11.0' => '3.2', '11.1' => '3.2', '11.2' => '3.3', - '11.3' => '4.0' + '11.3' => '4.0', + '11.4' => '4.0', + '12.1' => '4.0' ); my $distroDefault = '4.0'; @@ -143,5 +145,4 @@ sub getSquashfsVersion return $versionMap{$distroVersion} || $distroDefault; } - 1; diff --git a/src/installer/OpenSLX/OSExport/Distro/Ubuntu.pm b/src/installer/OpenSLX/OSExport/Distro/Ubuntu.pm index 300c3a76..1443251b 100644 --- a/src/installer/OpenSLX/OSExport/Distro/Ubuntu.pm +++ b/src/installer/OpenSLX/OSExport/Distro/Ubuntu.pm @@ -102,6 +102,7 @@ sub getSquashfsVersion '10.04' => '4.0', '10.10' => '4.0', '11.04' => '4.0', + '11.10' => '4.0', ); my $distroDefault = '4.0'; -- cgit v1.2.3-55-g7522