diff options
| author | Michael Neves | 2013-05-23 17:01:04 +0200 |
|---|---|---|
| committer | Michael Neves | 2013-05-23 17:01:04 +0200 |
| commit | 655b2494fc7d8fec3a5f6212bbb7a88cbe5c13f7 (patch) | |
| tree | 26e62638af3ae641fe0e561ba3ee19bdbb71e484 | |
| parent | [SUSE] vmchooser xml now found in correct dir (diff) | |
| parent | fix PATH for debug shell (diff) | |
| download | tm-scripts-655b2494fc7d8fec3a5f6212bbb7a88cbe5c13f7.tar.gz tm-scripts-655b2494fc7d8fec3a5f6212bbb7a88cbe5c13f7.tar.xz tm-scripts-655b2494fc7d8fec3a5f6212bbb7a88cbe5c13f7.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
43 files changed, 421 insertions, 143 deletions
diff --git a/data/openslx-ng-install b/data/openslx-ng-install new file mode 100755 index 00000000..0e71684e --- /dev/null +++ b/data/openslx-ng-install @@ -0,0 +1,207 @@ +#!/bin/bash + +function print () +{ + echo -e "\033[01;29m$@\033[00m" +} + +function error () +{ + echo -e "\033[00;31m$@\033[00m" + exit 1 +} + +function getinput () +{ + [ $# -ne 2 ] && error "getinput called with wrong parameter count ($@)" + CURRENT_VAR="$2" + echo -n -e "\033[01;29m$1 [${!CURRENT_VAR}]:\033[00m " + read RETVAL + [ -z "$RETVAL" ] && RETVAL="${!CURRENT_VAR}" +} + +function accept () +{ + [ -z "$CURRENT_VAR" ] && error "accept called when CURRENT_VAR is empty" + eval "$CURRENT_VAR='$RETVAL'" + CURRENT_VAR="" + break +} + +function deny () +{ + print "Ungültige Eingabe: '$RETVAL'" +} + +function yesno () +{ + while true; do + echo -n -e "\033[01;29m$@ [J/n] " + read KEYPRESS + [ -z "$KEYPRESS" ] && return 0 + [[ "$KEYPRESS" == J* || "$KEYPRESS" == j* ]] && return 0 + [[ "$KEYPRESS" == N* || "$KEYPRESS" == n* ]] && return 1 + print "Bitte mit J oder N antworten" + done +} + +function save_defaults () +{ + echo -e "# OpenSLX-NG defaults for this server - saved from a previous run of openslx-install\n# Delete this file if you want to start from scratch" > "$DEFAULTS_FILE" + for VARNAME in ${!SLX_*}; do + echo "$VARNAME='${!VARNAME}'" >> "$DEFAULTS_FILE" + done +} + +function check_password () +{ + [ $# -lt 1 ] && error "No user given to check_password" + [ $# -lt 2 ] && error "No password given to check_password" + [ ! -r /etc/shadow ] && return 1 + local correct=$(< /etc/shadow awk -v "user=$1" -F : 'user == $1 {print $2}') + local prefix=${correct%"${correct#\$*\$*\$}"} + local supplied="$(perl -e "print crypt('$2', '$prefix')")" # el cheapo: do not pass a password containing a single quote ( ' ) + [ "x$supplied" = "x$correct" ] && return 0 + return 1 +} + +# Load "Factory defaults" first +FACTORY_DEFAULTS_FILE="/opt/openslx/server-factory-defaults" +if [ -s "$FACTORY_DEFAULTS_FILE" ]; then + . "$FACTORY_DEFAULTS_FILE" || error "Factory defaults konnten nicht geladen werden. ($FACTORY_DEFAULTS_FILE)" +fi +# Load presets/previously given replies +DEFAULTS_FILE="/opt/openslx/server-defaults" +if [ -s "$DEFAULTS_FILE" ]; then + . "$DEFAULTS_FILE" || error "Voreinstellungen von vorherigem Scriptdurchlauf konnten nicht geladen werden. Bitte die Datei $DEFAULTS_FILE überprüfen und reparieren oder ggf. löschen." + print " *** Voreinstellungen von vorherigem Scriptaufruf ($SLX_LAST_INVOCATION) gefunden" + print " *** Diese Einstellungen werden als Standard-Antwort auf alle Fragen" + print " angenommen. Um dieses Setup mit den ursprünglichen Standardantworten" + print " auszuführen, die Datei $DEFAULTS_FILE löschen." + print " *** Das Setup kann mit Strg+C abgebrochen werden." + print "" +fi + +print "OpenSLX-NG Server Preview: Setup" +print "" +print "Zum erfolgreichen Aufsetzen eines OpenSLX-NG Servers müssen" +print "einige Fragen beantwortet werden." +print "" + +# +# ---- Ask if the private key of Uni Freiburg should be accepted for root logins +# +if [ ! -s "/root/.ssh/authorized_keys" ] || ! grep "openslx-admin@uni-freiburg.de" "/root/.ssh/authorized_keys" > /dev/null; then + print "" + print "Soll der Private Key der bwLehrpool-Abteilung in Freiburg für root-Logins auf" + print "diesem Server zugelassen werden? Dadurch ist es für die Entwickler aus Freiburg" + print "möglich, sich ohne Kenntnis des Passworts als root auf diesem Server einzuloggen." + if yesno "Dies vereinfacht die Fernwartung, Fehlerdiagnose und -behebung."; then + if mkdir -p "/root/.ssh" \ + && chmod 0700 "/root/.ssh" \ + && echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC667v6bIksFcwE6DMFs65ySfjySSn9V44GoN7qzIOUok/fgOsiotq2HJby/cgQxGVKogVmGUDRUqK3lKSqYnDmEigP3aQdleP1NFx6ex/zhEUoHp4VfqfQncSZT1zYE5IGQ9YNERrsDEI0YOZ5Cr+/I3p0bJAbXZM9dk/1Y6VOyMt1ZHXam5VvC6EJnJQzW9uAS69JSezprRsDYH+3NGd/XV/INkOsPIvkLc8rp5rtcdHrq/7NPNqtTCUdChv5F5lNMMHyXlhaM9FjG/DOZ0teKzh8MMe3oUXg/VibqEPZK4zVBKypATlWdv6zODiMrbi4n/Vm9IMA5i/71NW2GOdH openslx-admin@uni-freiburg.de" >> "/root/.ssh/authorized_keys" \ + && chmod 0600 "/root/.ssh/authorized_keys"; then + print "Key erfolgreich hinzugefügt" + else + error "Fehler beim Hinzufügen des Keys!" + fi + fi +fi + +# +# ---- Haupt-Adresse (zwecks iPXE) ---- +# +print "" +print "Zum Einrichten der iPXE-Funktionalität muss die IP-Adresse des Servers" +print "festgelegt werden. Alle Clients werden über diese Adresse bedient." +print "WICHTIG: Sollte sich die Adresse des Servers ändern, muss dieses Setup" +print "erneut ausgeführt werden." +print "Erkannte lokale Adressen:" + +LOCAL_ADDRS="$(ip a | grep -E -o '^\s*inet\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+')" +echo "$LOCAL_ADDRS" + +if [ -z "$SLX_LOCAL_ADDR" ] || [[ $LOCAL_ADDRS != *$SLX_LOCAL_ADDR* ]]; then + SLX_LOCAL_ADDR="" + for ADDR in $LOCAL_ADDRS; do + [[ "$ADDR" == 127.* ]] && continue + LAN_IP=$ADDR + [[ "$ADDR" == 192.168.* ]] && continue + [[ "$ADDR" == 10.* ]] && continue + [[ "$ADDR" == 172.* ]] && continue + SLX_LOCAL_ADDR=$ADDR + done + [ -z "$SLX_LOCAL_ADDR" ] && SLX_LOCAL_ADDR=$LAN_IP +fi + +while true; do + getinput "Primäre IP-Adresse des Servers" SLX_LOCAL_ADDR + # syntax check + echo "$RETVAL" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' > /dev/null || continue + if ! ip a | grep -E "^\s*inet\s+$RETVAL/" > /dev/null; then + print "Dieser Server scheint kein Interface zu besitzen, welches auf" + print "die Adresse $RETVAL konfiguriert ist." + yesno "Trotzdem diese Adresse verwenden?" || continue + fi + accept +done + +# +# ---- NFS Share +# +# Is it a local one? +print "" +print "Bereitstellung der VMWare-Images" +print "Die Clients booten die VMWare-Images von einem NFS-Share. Dieser kann" +print "entweder auf diesem Server liegen, oder auf einem externen Server mit NFS-Zugang." +print "Sofern die Images von diesem Server ausgeliefert werden sollen, wird ein" +print "zusätzlicher SMB-Server installiert, um das Aufspielen neuer Images" +print "von einem Windows-PC aus zu erleichtern." + +while true; do + getinput "Welches Setup ist erwünscht? L = Lokal, E = Extern" SLX_VM_NFS_TYPE + # Local Server + if [[ "$RETVAL" == L* || "$RETVAL" == l* ]]; then + while true; do + getinput "Lokaler Speicherort für VM-Images" SLX_VM_PATH + if [[ "$RETVAL" != /* ]]; then + print "FEHLER: Der Pfad muss absolut sein (mit einem / beginnen)" + continue + fi + mkdir -p "$RETVAL" + [ -w "$RETVAL" ] && accept + print "FEHLER: Verzeichnis '$RETVAL' nicht beschreibbar." + done + SLX_VM_NFS="$SLX_LOCAL_ADDR:$SLX_VM_PATH" + print "Lokaler VM-NFS-Share erreichbar unter $SLX_VM_NFS" + SLX_VM_NFS_TYPE=L + break # No accept here as it cannot be nested + fi + # External Server + if [[ "$RETVAL" == E* || "$RETVAL" == e* ]]; then + while true; do + getinput "Adresse und Pfad des externen NFS-Shares für VM-Images im Format Adresse:Pfad" SLX_VM_NFS + echo "$RETVAL" | grep -E '\S+:/\S+' && accept + print "FEHLER: Ungültiges NFS-Share-Format: $RETVAL" + done + print "Externer VM-NFS-Share erreichbar unter $SLX_VM_NFS" + SLX_VM_NFS_TYPE=E + break # No accept + fi + print "Ungültige Auswahl '$RETVAL'" +done # Done setting up VM NFS Server type + +# +# ---- Safety first: make user change root password if it is still the default ---- +# +if [ "x$1" != "x--test" ] && check_password "root" "openslx-ng"; then + print "" + print "Aus Sicherheitsgründen sollte das root-Passwort dieses Servers geändert werden." + while check_password "root" "openslx-ng" && yesno "Passwort jetzt ändern?"; do + passwd + done +fi + +SLX_LAST_INVOCATION="$(date)" +save_defaults + diff --git a/helper/fileutil.inc b/helper/fileutil.inc index 24b50a5f..fcb551eb 100644 --- a/helper/fileutil.inc +++ b/helper/fileutil.inc @@ -1,9 +1,9 @@ # one time jobs # determine packet manager: -if [ ! -z "$(which apt-get)" ]; then +if [ ! -z "$(which apt-get 2>/dev/null)" ]; then PACKET_MANAGER="apt" -elif [ ! -z "$(which zypper)" ]; then +elif [ ! -z "$(which zypper 2>/dev/null)" ]; then PACKET_MANAGER="zypper" else perror "Could not determine this platform's packet manager" @@ -45,9 +45,9 @@ tarcopy () { # get all files of required packages by a module list_packet_files() { - [ -z "$REQUIRED_PACKAGES" ] && pinfo "No required packages for $TOOL" && return 1 + [ -z "$REQUIRED_CONTENT_PACKAGES" ] && pinfo "No required packages for $TOOL" && return 1 local PACKAGE="" - for PACKAGE in $REQUIRED_PACKAGES; do + for PACKAGE in $REQUIRED_CONTENT_PACKAGES; do local OPTIONAL="$(echo "$PACKAGE" | cut -c 1)" [ "x$OPTIONAL" = "x@" ] && PACKAGE="$(echo "$PACKAGE" | cut -c 2-)" local FILES="" @@ -72,15 +72,15 @@ list_packet_files() { } # # install all dependencies of a module -# goes through all package as given in the variable REQUIRED_DEPENDENCIES +# goes through all package as given in the variable REQUIRED_INSTALLED_PACKAGES install_dependencies() { - [ -z "$REQUIRED_DEPENDENCIES" ] && return + [ -z "$REQUIRED_INSTALLED_PACKAGES" ] && return if [ "$PACKET_MANAGER" = "apt" ]; then # install package, only if not already installed, TODO fix me - #dpkg -l $(echo $(echo "$REQUIRED_DEPENDENCIES")) &> /dev/null && return - apt-get install -y $REQUIRED_DEPENDENCIES || perror "Could not apt-get install $REQUIRED_DEPENDENCIES" + #dpkg -l $(echo $(echo "$REQUIRED_INSTALLED_PACKAGES")) &> /dev/null && return + apt-get install -y $REQUIRED_INSTALLED_PACKAGES || perror "Could not apt-get install $REQUIRED_INSTALLED_PACKAGES" elif [ "$PACKET_MANAGER" = "zypper" ]; then - zypper --no-refresh install -y -n $REQUIRED_DEPENDENCIES || perror "Could not zypper install $REQUIRED_DEPENDENCIES" + zypper --no-refresh install -y -n $REQUIRED_INSTALLED_PACKAGES || perror "Could not zypper install $REQUIRED_INSTALLED_PACKAGES" fi } # diff --git a/helper/system.inc b/helper/system.inc index 2e619a3c..0cfcfbc6 100644 --- a/helper/system.inc +++ b/helper/system.inc @@ -5,7 +5,8 @@ # please try not to use this to find/fetch libs in /lib or /usr/lib. # Use ARCH_LIB_DIR, like "$ARCH_LIB_DIR/somefile.so" or "/usr$ARCH_LIB_DIR/somefile.so" ARCH_TRIPLET=$(ldd $SHELL|grep "libc.so" | awk -F "/" '{print $3}') -[ -z "$ARCH_TRIPLET" ] && pwarning "Could not determine arch triplet." +#[ -z "$ARCH_TRIPLET" ] && pwarning "Could not determine arch triplet." +[[ $ARCH_TRIPLET == *\(*\) ]] && ARCH_TRIPLET="" ARCH_LIB_DIR=$(ldd $SHELL | grep "libc.so" | sed -r 's#^.*(/lib.*)/libc.so.*$#\1#g') [ -z "$ARCH_LIB_DIR" -o ! -d "$ARCH_LIB_DIR" ] && perror "Could not determine arch dependent lib dir (where libc.so resides)" diff --git a/remote/modules/consolekit/consolekit.conf b/remote/modules/consolekit/consolekit.conf index 38f1718f..afb573ce 100644 --- a/remote/modules/consolekit/consolekit.conf +++ b/remote/modules/consolekit/consolekit.conf @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES="consolekit" +REQUIRED_CONTENT_PACKAGES="consolekit" REQUIRED_BINARIES=" ck-history ck-launch-session ck-list-sessions diff --git a/remote/modules/consolekit/consolekit.conf.zypper b/remote/modules/consolekit/consolekit.conf.zypper index c528ddc0..394ee0da 100644 --- a/remote/modules/consolekit/consolekit.conf.zypper +++ b/remote/modules/consolekit/consolekit.conf.zypper @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES="ConsoleKit" +REQUIRED_CONTENT_PACKAGES="ConsoleKit" REQUIRED_BINARIES=" ck-history ck-launch-session ck-list-sessions diff --git a/remote/modules/dbus/dbus.build b/remote/modules/dbus/dbus.build index 7f6d663f..bcab63b0 100644 --- a/remote/modules/dbus/dbus.build +++ b/remote/modules/dbus/dbus.build @@ -13,11 +13,5 @@ build() { } post_copy() { - - # quick fix to get the unit files from the package - # moved them from lib/systemd to usr/lib/systemd - #cd "${BUILDDIR}" - #tarcopy lib/systemd "${TARGET_BUILD_DIR}"/usr - #cd - &> /dev/null : } diff --git a/remote/modules/dbus/dbus.conf b/remote/modules/dbus/dbus.conf index 4a1bc6a5..c8fa050d 100644 --- a/remote/modules/dbus/dbus.conf +++ b/remote/modules/dbus/dbus.conf @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES="dbus" +REQUIRED_CONTENT_PACKAGES="dbus" REQUIRED_BINARIES=" dbus-cleanup-sockets dbus-daemon dbus-uuidgen diff --git a/remote/modules/dbus/dbus.conf.zypper b/remote/modules/dbus/dbus.conf.zypper index e34e47d8..ce3d5d08 100644 --- a/remote/modules/dbus/dbus.conf.zypper +++ b/remote/modules/dbus/dbus.conf.zypper @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES="dbus-1" +REQUIRED_CONTENT_PACKAGES="dbus-1" REQUIRED_BINARIES=" dbus-cleanup-sockets dbus-daemon dbus-uuidgen @@ -8,3 +8,4 @@ REQUIRED_BINARIES=" dbus-cleanup-sockets REQUIRED_DIRECTORIES=" /etc/dbus-1 /usr/lib/systemd" REQUIRED_FILES="" + diff --git a/remote/modules/hwinfo/hwinfo.conf b/remote/modules/hwinfo/hwinfo.conf index 2d3db99d..c254fc71 100644 --- a/remote/modules/hwinfo/hwinfo.conf +++ b/remote/modules/hwinfo/hwinfo.conf @@ -1,3 +1,3 @@ REQUIRED_BINARIES=" hwinfo" -REQUIRED_DEPENDENCIES=" flex +REQUIRED_INSTALLED_PACKAGES=" flex hwinfo" diff --git a/remote/modules/kdm/kdm.conf b/remote/modules/kdm/kdm.conf index a6f0161e..d59f0009 100644 --- a/remote/modules/kdm/kdm.conf +++ b/remote/modules/kdm/kdm.conf @@ -1,6 +1,6 @@ -REQUIRED_DEPENDENCIES=" kdm +REQUIRED_INSTALLED_PACKAGES=" kdm kde-workspace-kgreet-plugins" -REQUIRED_PACKAGES=" kdm +REQUIRED_CONTENT_PACKAGES=" kdm kde-workspace-kgreet-plugins libicu48 libxcursor1 diff --git a/remote/modules/kdm/kdm.conf.zypper b/remote/modules/kdm/kdm.conf.zypper index 23034356..a2266c52 100644 --- a/remote/modules/kdm/kdm.conf.zypper +++ b/remote/modules/kdm/kdm.conf.zypper @@ -1,5 +1,5 @@ -REQUIRED_DEPENDENCIES="kdm" -REQUIRED_PACKAGES="kdm kde4-kgreeter-plugins" +REQUIRED_INSTALLED_PACKAGES="kdm" +REQUIRED_CONTENT_PACKAGES="kdm kde4-kgreeter-plugins" REQUIRED_BINARIES="" REQUIRED_DIRECTORIES=" /etc/dbus-1 /usr/lib/kde4 diff --git a/remote/modules/ldm-gtk-greeter/ldm-gtk-greeter.conf b/remote/modules/ldm-gtk-greeter/ldm-gtk-greeter.conf index 58d189b7..e9349002 100644 --- a/remote/modules/ldm-gtk-greeter/ldm-gtk-greeter.conf +++ b/remote/modules/ldm-gtk-greeter/ldm-gtk-greeter.conf @@ -1,7 +1,7 @@ VERSION=lightdm-gtk-greeter-1.3.1 URL=https://launchpad.net/lightdm-gtk-greeter/1.4/1.3.1/+download/lightdm-gtk-greeter-1.3.1.tar.gz -REQUIRED_DEPENDENCIES="gtk+-3.0 liblightdm-gobject-1-dev libgdk-pixbuf2.0-0 libpango1.0-0 librsvg2-common shared-mime-info gnome-themes-standard" -REQUIRED_PACKAGES="libgdk-pixbuf2.0-0 libpango1.0-0 librsvg2-common shared-mime-info gnome-themes-standard" +REQUIRED_INSTALLED_PACKAGES="gtk+-3.0 liblightdm-gobject-1-dev libgdk-pixbuf2.0-0 libpango1.0-0 librsvg2-common shared-mime-info gnome-themes-standard" +REQUIRED_CONTENT_PACKAGES="libgdk-pixbuf2.0-0 libpango1.0-0 librsvg2-common shared-mime-info gnome-themes-standard" REQUIRED_BINARIES="lightdm-gtk-greeter" REQUIRED_DIRECTORIES="/usr/lib /usr/share/lightdm-gtk-greeter /usr/share/mime /usr/share/xgreeters /usr/share/icons /usr/share/themes /etc /usr/bin" REQUIRED_FILES="/etc/lightdm/lightdm-gtk-greeter.conf" diff --git a/remote/modules/ldm/ldm.conf b/remote/modules/ldm/ldm.conf index d40aab7f..74ab9450 100644 --- a/remote/modules/ldm/ldm.conf +++ b/remote/modules/ldm/ldm.conf @@ -1,7 +1,7 @@ VERSION=lightdm-1.4.0 URL=https://launchpad.net/lightdm/1.4/1.4.0/+download/lightdm-1.4.0.tar.gz -REQUIRED_DEPENDENCIES="libpam-dev itstool liblightdm-gobject-1-dev" -REQUIRED_PACKAGES="" +REQUIRED_INSTALLED_PACKAGES="libpam-dev itstool liblightdm-gobject-1-dev" +REQUIRED_CONTENT_PACKAGES="" REQUIRED_BINARIES="dm-tool lightdm lightdm-set-defaults gdmflexiserver lightdm-guest-session-wrapper lightdm-set-defaults" REQUIRED_DIRECTORIES="/etc /lib" REQUIRED_FILES="" diff --git a/remote/modules/openbox/openbox.build b/remote/modules/openbox/openbox.build index 3e56fbfb..51c6beec 100644 --- a/remote/modules/openbox/openbox.build +++ b/remote/modules/openbox/openbox.build @@ -7,7 +7,9 @@ build() { [ -e "$COPYLIST" ] && rm "$COPYLIST" list_packet_files >> "$COPYLIST" - tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" + # FIXME: Hack: openSUSE's rpm -ql lilsts non-existant pango.modules, which makes + # tarcopy fail. We probably can't fix that, so remove it using grep.... + tarcopy "$(cat "$COPYLIST" | grep -v 'pango\.modules$' | sort -u)" "${MODULE_BUILD_DIR}" return 0 } diff --git a/remote/modules/openbox/openbox.conf b/remote/modules/openbox/openbox.conf index 67c63c4c..2dc5da54 100644 --- a/remote/modules/openbox/openbox.conf +++ b/remote/modules/openbox/openbox.conf @@ -1,12 +1,11 @@ -REQUIRED_DEPENDENCIES=" openbox +REQUIRED_INSTALLED_PACKAGES=" openbox libpango1.0-0" -REQUIRED_PACKAGES=" openbox +REQUIRED_CONTENT_PACKAGES=" openbox libpango1.0-0" REQUIRED_BINARIES=" openbox openbox-session" REQUIRED_FILES=" /usr/share/xsessions/openbox.desktop" REQUIRED_DIRECTORIES=" /etc - /usr/lib/openbox - /usr/share/themes/Clearlooks - /usr/lib/$ARCH_TRIPLET/pango/" - + /usr/lib + /usr/share/themes/Clearlooks" + diff --git a/remote/modules/openbox/openbox.conf.zypper b/remote/modules/openbox/openbox.conf.zypper new file mode 100644 index 00000000..63e5e25d --- /dev/null +++ b/remote/modules/openbox/openbox.conf.zypper @@ -0,0 +1,5 @@ +REQUIRED_INSTALLED_PACKAGES=" openbox + libpango-1_0-0" +REQUIRED_CONTENT_PACKAGES=" openbox + libpango-1_0-0" + diff --git a/remote/modules/pam/pam.conf b/remote/modules/pam/pam.conf index 0afd3ec3..2d334b52 100644 --- a/remote/modules/pam/pam.conf +++ b/remote/modules/pam/pam.conf @@ -1,7 +1,7 @@ -REQUIRED_DEPENDENCIES=" libpam-ldap +REQUIRED_INSTALLED_PACKAGES=" libpam-ldap libnss-ldap libpam-script" -REQUIRED_PACKAGES=" libpam0g +REQUIRED_CONTENT_PACKAGES=" libpam0g libpam-modules libpam-ck-connector libpam-cap diff --git a/remote/modules/pam/pam.conf.zypper b/remote/modules/pam/pam.conf.zypper index ab0039ff..191850db 100644 --- a/remote/modules/pam/pam.conf.zypper +++ b/remote/modules/pam/pam.conf.zypper @@ -1,5 +1,5 @@ -REQUIRED_DEPENDENCIES=" pam_ldap pam pam-devel nss_ldap pam-modules" -REQUIRED_PACKAGES=" pam_ldap pam pam-devel nss_ldap pam-modules" +REQUIRED_INSTALLED_PACKAGES=" pam_ldap pam pam-devel nss_ldap pam-modules" +REQUIRED_CONTENT_PACKAGES=" pam_ldap pam pam-devel nss_ldap pam-modules nss-mdns" REQUIRED_DIRECTORIES=" /lib /usr/lib /etc/security" diff --git a/remote/modules/plymouth/plymouth.conf b/remote/modules/plymouth/plymouth.conf index 026aff9c..0e3e6eda 100644 --- a/remote/modules/plymouth/plymouth.conf +++ b/remote/modules/plymouth/plymouth.conf @@ -1,6 +1,6 @@ VERSION=plymouth-0.8.6.1 URL=http://www.freedesktop.org/software/plymouth/releases/${VERSION}.tar.bz2 -REQUIRED_DEPENDENCIES=" libpng-dev +REQUIRED_INSTALLED_PACKAGES=" libpng-dev libpango1.0-dev libcairo-dev libgtk2.0-dev diff --git a/remote/modules/plymouth/plymouth.conf.zypper b/remote/modules/plymouth/plymouth.conf.zypper index 9166c137..ad9052e5 100644 --- a/remote/modules/plymouth/plymouth.conf.zypper +++ b/remote/modules/plymouth/plymouth.conf.zypper @@ -1,6 +1,6 @@ VERSION=plymouth-0.8.6.1 URL=http://www.freedesktop.org/software/plymouth/releases/${VERSION}.tar.bz2 -REQUIRED_DEPENDENCIES=" libpng12-devel +REQUIRED_INSTALLED_PACKAGES=" libpng12-devel pango-devel cairo-devel gtk2-devel diff --git a/remote/modules/policykit-src/policykit.conf b/remote/modules/policykit-src/policykit.conf index 73b04015..3e74c383 100644 --- a/remote/modules/policykit-src/policykit.conf +++ b/remote/modules/policykit-src/policykit.conf @@ -1,7 +1,7 @@ VERSION=polkit-0.110 URL=http://www.freedesktop.org/software/polkit/releases/polkit-0.110.tar.gz -REQUIRED_DEPENDENCIES="libmozjs185-1.0" -REQUIRED_PACKAGES="libmozjs185-1.0" +REQUIRED_INSTALLED_PACKAGES="libmozjs185-1.0" +REQUIRED_CONTENT_PACKAGES="libmozjs185-1.0" REQUIRED_BINARIES="" REQUIRED_DIRECTORIES="/bin /etc /lib /usr/share/dbus-1 /usr/share/polkit-1" REQUIRED_FILES="" diff --git a/remote/modules/policykit/policykit.conf b/remote/modules/policykit/policykit.conf index cf04281d..f13fe2c0 100644 --- a/remote/modules/policykit/policykit.conf +++ b/remote/modules/policykit/policykit.conf @@ -1,5 +1,5 @@ -REQUIRED_DEPENDENCIES="libmozjs185-1.0" -REQUIRED_PACKAGES="libmozjs185-1.0 policykit-1" +REQUIRED_INSTALLED_PACKAGES="libmozjs185-1.0" +REQUIRED_CONTENT_PACKAGES="libmozjs185-1.0 policykit-1" REQUIRED_BINARIES="" REQUIRED_DIRECTORIES=" /etc/pam.d /etc/dbus-1 /etc/polkit-1 /usr/bin diff --git a/remote/modules/policykit/policykit.conf.zypper b/remote/modules/policykit/policykit.conf.zypper index 5d334b1e..87c0014e 100644 --- a/remote/modules/policykit/policykit.conf.zypper +++ b/remote/modules/policykit/policykit.conf.zypper @@ -1,5 +1,5 @@ -REQUIRED_DEPENDENCIES="libmozjs185-1_0" -REQUIRED_PACKAGES="libmozjs185-1_0 polkit" +REQUIRED_INSTALLED_PACKAGES="libmozjs185-1_0" +REQUIRED_CONTENT_PACKAGES="libmozjs185-1_0 polkit" REQUIRED_BINARIES="" REQUIRED_DIRECTORIES=" /etc/pam.d /etc/dbus-1 /etc/polkit-1 /usr/bin diff --git a/remote/modules/rsyslogd/rsyslogd.conf b/remote/modules/rsyslogd/rsyslogd.conf index 602a6050..d0d46e77 100644 --- a/remote/modules/rsyslogd/rsyslogd.conf +++ b/remote/modules/rsyslogd/rsyslogd.conf @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES=" rsyslog" +REQUIRED_CONTENT_PACKAGES=" rsyslog" REQUIRED_BINARIES=" rsyslogd" REQUIRED_FILES=" /etc/rsyslog.conf" REQUIRED_DIRECTORIES=" /usr/lib/rsyslog" diff --git a/remote/modules/rsyslogd/rsyslogd.conf.zypper b/remote/modules/rsyslogd/rsyslogd.conf.zypper index 782503e2..0a61d61b 100644 --- a/remote/modules/rsyslogd/rsyslogd.conf.zypper +++ b/remote/modules/rsyslogd/rsyslogd.conf.zypper @@ -1,3 +1,3 @@ REQUIRED_BINARIES=" rsyslogd rsyslog-service-prepare" -REQUIRED_PACKAGES=" rsyslog" +REQUIRED_CONTENT_PACKAGES=" rsyslog" diff --git a/remote/modules/systemd/data/etc/systemd/system/debug-shell.service b/remote/modules/systemd/data/etc/systemd/system/debug-shell.service index f702064d..fedd138d 100644 --- a/remote/modules/systemd/data/etc/systemd/system/debug-shell.service +++ b/remote/modules/systemd/data/etc/systemd/system/debug-shell.service @@ -12,8 +12,7 @@ DefaultDependencies=no IgnoreOnIsolate=yes [Service] -Environment=TERM=linux -EnvironmentPath=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin +Environment=TERM=linux PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin ExecStart=/bin/sh Restart=always RestartSec=0 diff --git a/remote/modules/systemd/systemd.conf b/remote/modules/systemd/systemd.conf index 2b116784..b5e8370d 100644 --- a/remote/modules/systemd/systemd.conf +++ b/remote/modules/systemd/systemd.conf @@ -2,7 +2,7 @@ VERSION=systemd-197 URL=http://www.freedesktop.org/software/systemd/${VERSION}.tar.xz LIBKMOD_VERSION="kmod-12" LIBKMOD_URL="http://www.kernel.org/pub/linux/utils/kernel/kmod/${LIBKMOD_VERSION}.tar.gz" -REQUIRED_DEPENDENCIES=" intltool +REQUIRED_INSTALLED_PACKAGES=" intltool gperf dbus pkg-config diff --git a/remote/modules/systemd/systemd.conf.zypper b/remote/modules/systemd/systemd.conf.zypper index 8fd38a30..de89399e 100644 --- a/remote/modules/systemd/systemd.conf.zypper +++ b/remote/modules/systemd/systemd.conf.zypper @@ -1,82 +1,9 @@ VERSION=systemd-201 URL=http://www.freedesktop.org/software/systemd/${VERSION}.tar.xz -REQUIRED_DEPENDENCIES=" intltool +REQUIRED_INSTALLED_PACKAGES=" intltool gperf pkg-config libcap-devel libudev-devel dbus-1-devel libxslt-tools" -REQUIRED_BINARIES=" hostnamectl - journalctl - localectl - loginctl - systemctl - systemd-analyze - systemd-ask-password - systemd-cat - systemd-cgls - systemd-cgtop - systemd-coredumpctl - systemd-delta - systemd-detect-virt - systemd-inhibit - systemd-machine-id-setup - systemd-notify - systemd-nspawn - systemd-stdio-bridge - systemd-tmpfiles - systemd-tty-ask-password-agent - timedatectl - udevadm - systemd - systemd-ac-power - systemd-binfmt - systemd-bootchart - systemd-cgroups-agent - systemd-coredump - systemd-fsck - systemd-hostnamed - systemd-initctl - systemd-journald - systemd-localed - systemd-logind - systemd-modules-load - systemd-multi-seat-x - systemd-quotacheck - systemd-random-seed - systemd-readahead - systemd-remount-fs - systemd-reply-password - systemd-shutdown - systemd-shutdownd - systemd-sleep - systemd-sysctl - systemd-timedated - systemd-timestamp - systemd-udevd - systemd-update-utmp - systemd-user-sessions - systemd-vconsole-setup - systemd-fstab-generator - systemd-getty-generator - systemd-rc-local-generator - systemd-system-update-generator - accelerometer - ata_id - cdrom_id - collect - keymap - mtd_probe - scsi_id - v4l_id" -REQUIRED_DIRECTORIES=" /etc - /usr/lib - /usr/include - /usr/share/dbus-1 - /usr/share/polkit-1 - /usr/lib/udev/rules.d" -REQUIRED_FILES=" /usr/bin/systemd-analyze - /usr/share/systemd/kbd-model-map - /usr/lib/udev/findkeyboards - /usr/lib/udev/keyboard-force-release.sh" diff --git a/remote/modules/vmchooser/vmchooser.conf b/remote/modules/vmchooser/vmchooser.conf index 976384aa..7f03ea83 100644 --- a/remote/modules/vmchooser/vmchooser.conf +++ b/remote/modules/vmchooser/vmchooser.conf @@ -1,5 +1,5 @@ GIT=git://git.openslx.org/openslx/tools/vmchooser.git -REQUIRED_DEPENDENCIES=" cmake +REQUIRED_INSTALLED_PACKAGES=" cmake libqt4-dev" PREFIX="/opt/openslx/bin" REQUIRED_BINARIES="vmchooser" diff --git a/remote/modules/vmchooser/vmchooser.conf.zypper b/remote/modules/vmchooser/vmchooser.conf.zypper new file mode 100644 index 00000000..ca9944af --- /dev/null +++ b/remote/modules/vmchooser/vmchooser.conf.zypper @@ -0,0 +1,5 @@ +GIT=git://git.openslx.org/openslx/tools/vmchooser.git +REQUIRED_INSTALLED_PACKAGES=" cmake + libqt4-devel" +PREFIX="/opt/openslx/bin" +REQUIRED_BINARIES="vmchooser" diff --git a/remote/modules/vmplayer/vmplayer.conf b/remote/modules/vmplayer/vmplayer.conf index df88968e..2797303e 100644 --- a/remote/modules/vmplayer/vmplayer.conf +++ b/remote/modules/vmplayer/vmplayer.conf @@ -1,5 +1,5 @@ -#REQUIRED_DEPENDENCIES="libgconf-2-4 fontconfig-config" -#REQUIRED_PACKAGES="libgconf-2-4 fontconfig-config" +#REQUIRED_INSTALLED_PACKAGES="libgconf-2-4 fontconfig-config" +#REQUIRED_CONTENT_PACKAGES="libgconf-2-4 fontconfig-config" REQUIRED_BINARIES="" REQUIRED_SYSTEM_FILES="" REQUIRED_DIRECTORIES="/etc /usr" diff --git a/remote/modules/xorg/xorg.conf b/remote/modules/xorg/xorg.conf index a63ef508..81b5530b 100644 --- a/remote/modules/xorg/xorg.conf +++ b/remote/modules/xorg/xorg.conf @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES=" xserver-xorg +REQUIRED_CONTENT_PACKAGES=" xserver-xorg xserver-xorg-core libgl1-mesa-dri xkb-data diff --git a/remote/modules/xorg/xorg.conf.zypper b/remote/modules/xorg/xorg.conf.zypper index 22a6bdd8..e0636dd7 100644 --- a/remote/modules/xorg/xorg.conf.zypper +++ b/remote/modules/xorg/xorg.conf.zypper @@ -1,4 +1,4 @@ -REQUIRED_PACKAGES=" xorg-x11 +REQUIRED_CONTENT_PACKAGES=" xorg-x11 xorg-x11-server xorg-x11-driver-input xorg-x11-driver-video diff --git a/remote/rootfs/rootfs-stage32/data/etc/issue b/remote/rootfs/rootfs-stage32/data/etc/issue index de0a2265..11c0452c 100644 --- a/remote/rootfs/rootfs-stage32/data/etc/issue +++ b/remote/rootfs/rootfs-stage32/data/etc/issue @@ -1,11 +1,11 @@ WELCOME TO \n (\l) - _____ ______ ______ __ __ _______ __ __ __ - / _ | _ | ___| | | | | ____| | | | | | - | | | | |_| | |_ | | | | |___ | | / / - | | | | ___/| _| | | ____ | | | | - | |_| | | | |___| | | | ____| | |___ / / - _____/|__| |______|__| |__| |_______|______|__| |__| + _____ ______ ______ __ __ ______ __ __ __ __ __ ______ + / _ | _ | ___| | | || ___| | | | | | | | | | ____ +| | | | |_| | |_ | | || |__ | | / / __ | | | | +| | | | ___/| _| | | ___ | | | | |__| | | | ___ +| |_| | | | |___| | | | ___| | |___ / / | | | | |__ | + _____/|__| |______|__| |__||______|______|__| |__| |__| |__| _____/ (c) <OpenSLX.ORG> diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-tmp.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-tmp.service new file mode 100644 index 00000000..75e285e2 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-tmp.service @@ -0,0 +1,7 @@ +[Unit] +Description=Mount hard drive as tmp + +[Service] +Type=oneshot +ExecStart=/opt/openslx/bin/analyse-disk +ExecStart=/opt/openslx/bin/disk-tmp diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/analyse-disk b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/analyse-disk new file mode 100755 index 00000000..27c3f306 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/analyse-disk @@ -0,0 +1,105 @@ +#!/bin/bash +# Copyright (c) 2013 - 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 feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Local hard disk autodetection script for OpenSLX linux stateless clients, +# detecting swap and special partitions + +############################################################################# + +# General formatter for the /tmp partition on a local harddisk +diskfm () { +local target=$1 +local fs +local path +for fs in xfs ext3 ext2 ; do + unset available + case $(cat /proc/filesystems) in + *${fs}*) available=yes;; + *) modprobe -q ${fs} 2>/dev/null && available=yes;; + esac + if [ -n ${available} ]; then + unset found + for path in /sbin /bin /usr/sbin /usr/bin /openslx/sbin /openslx/bin; do + if test -x /$path/mkfs.$fs ; then + found=yes + case mkfs.$fs in + mkfs.xfs) + fopt="-f" + mopt="-o noexec" + ;; + mkfs.ext2) + fopt="-Fq" + mopt="-o nocheck,noexec" + ;; + mkfs.reiserfs) + fopt="-f" + mopt="-o noexec" + ;; + esac + mkfs.$fs ${fopt} ${target} >/dev/null 2>&1 #|| error + mkdir -p /run/mount/tmp + mount -t ${fs} ${target} /run/mount/tmp + fi + done + [ -n "$found" ] && break + fi +done +} + +# Check for local harddisks and appropriate partitions +fdisk -l |sed -n "/^\/dev\//p" >/etc/disk.partition + +# Check for standard swap partitions and make them available to the system +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 82 /p"|sed -e "s/[[:space:]].*//") ; do + echo -e "$hdpartnr\tswap\t\tswap\t\tdefaults\t 0 0" >>/etc/fstab +done + +# We use special non assigned partition type (id44) for harddisk scratch +# space, thus no normal filesystem will be incidentally deleted or +# corrupted +for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do + # check for supported filesystem and formatter + ( if diskfm $hdpartnr ; then + # echo "$hdpartnr is mounted to /mnt/tmp at $(sysup)" >/tmp/tmpready + echo -e "$hdpartnr\t/tmp\t\tnoauto\t\tdefaults\t 0 0" >>/etc/fstab + else + echo "formatting failed for some reason " >/tmp/tmpready + fi ) & + break +done + +# Put detected linux partitions (83) into /etc/fstab with "noauto", special +# partition 45 (persistent scratch) to /var/scratch and 46 to /var/openslx +for partid in 83 45 46 ; do + for hdpartnr in $(cat /etc/disk.partition | \ + sed -n -e "/ ${partid} /p"|sed -e "s/[[:space:]].*//") ; do + mkdir -p /media/${hdpartnr#/dev/*} 2>/dev/null + if [ ${partid} -eq 83 ] ; then + echo -e "$hdpartnr\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto,\ +noexec\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 45 ] ; then + #mount -t auto ${hdpartnr} /media/${hdpartnr#/dev/*} + #ln -sf /media/${hdpartnr#/dev/*} /var/scratch + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + elif [ ${partid} -eq 46 ] ; then + # Mount a home directory to (/mnt)/var/home + #mount -t auto ${hdpartnr} /mnt/media/${hdpartnr#/dev/*} \n\ + #test -d /mnt/media/${hdpartnr#/dev/*}/home && \ + # ln -sf /media/${hdpartnr#/dev/*} /var/home + echo -e "${hdpartnr}\t/media/${hdpartnr#/dev/*}\tauto\t\tnoauto\ +\t\t 0 0" >>/tmp/fstab + fi + done +done + diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/disk-tmp b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/disk-tmp new file mode 100755 index 00000000..4378c45c --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/disk-tmp @@ -0,0 +1,24 @@ +#!/bin/sh +# Copyright (c) 2013 - 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 feedback to feedback@openslx.org +# +# General information about OpenSLX can be found under http://openslx.org +# +# Mount local ID44 partition to /tmp after all existing stuff is preserved + +############################################################################# + +# Check if ID44 is available by analysing /etc/fstab for appropriate entry +if cat /proc/mounts | grep -qe "/dev/.*/tmp" ; then + mkdir -p /run/tmp + mv /tmp/* /run/tmp + mount --bind /run/mount/tmp /tmp + umount /run/mount/tmp + mv /run/tmp/* /tmp + rmdir /run/tmp +fi diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build index 0ca8d64c..713c0a3d 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -4,7 +4,7 @@ fetch_source() { } build() { - if [ ! -z "$REQUIRED_PACKAGES" ]; then + if [ ! -z "$REQUIRED_CONTENT_PACKAGES" ]; then COPYLIST="list_dpkg_output" [ -e "${COPYLIST}" ] && rm "${COPYLIST}" list_packet_files >> "${COPYLIST}" diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf index a8bbf386..f5452f53 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf @@ -1,5 +1,5 @@ REQUIRED_MODULES=" kernel" -REQUIRED_DEPENDENCIES="nfs-common aufs-tools squashfs-tools whois xfsprogs" +REQUIRED_INSTALLED_PACKAGES="nfs-common aufs-tools squashfs-tools whois xfsprogs" REQUIRED_BINARIES=" bash more less diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf.zypper b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf.zypper index 1e2ba9c8..3f7f446e 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf.zypper +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf.zypper @@ -1,7 +1,7 @@ pinfo "If aufs install fails, run zypper addrepo http://jftp.inai.de/openSUSE_12.3/ j.eng-i586" REQUIRED_MODULES=" kernel" -REQUIRED_DEPENDENCIES="nfs-client aufs squashfs" -REQUIRED_PACKAGES="timezone" +REQUIRED_INSTALLED_PACKAGES="nfs-client aufs squashfs" +REQUIRED_CONTENT_PACKAGES="timezone" REQUIRED_BINARIES=" bash agetty cat diff --git a/remote/setup_target b/remote/setup_target index 10d6b575..617c409e 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -20,7 +20,7 @@ initial_checks () { read_config () { # unset previous variables from other config files - for VARNAME in "${!REQUIRED_*}"; do + for VARNAME in ${!REQUIRED_*}; do unset $VARNAME done diff --git a/remote/targets/stage32-opensuse/openbox b/remote/targets/stage32-opensuse/openbox new file mode 120000 index 00000000..0fb8d86d --- /dev/null +++ b/remote/targets/stage32-opensuse/openbox @@ -0,0 +1 @@ +../../modules/openbox
\ No newline at end of file diff --git a/remote/targets/stage32-opensuse/vmchooser b/remote/targets/stage32-opensuse/vmchooser new file mode 120000 index 00000000..d918fbdc --- /dev/null +++ b/remote/targets/stage32-opensuse/vmchooser @@ -0,0 +1 @@ +../../modules/vmchooser
\ No newline at end of file |
