From dc7fd2a83b9f9f92bffc15d74d770cb215ca4db7 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Mon, 23 Mar 2015 15:38:10 +0100 Subject: [systemd, sssd] Patches for openSuse 13.2 --- remote/modules/sssd/module.build | 6 ++++++ remote/modules/systemd/module.build | 4 ++++ 2 files changed, 10 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/sssd/module.build b/remote/modules/sssd/module.build index c6070455..041fd5bd 100644 --- a/remote/modules/sssd/module.build +++ b/remote/modules/sssd/module.build @@ -16,6 +16,12 @@ build() { mkdir -p "${MODULE_BUILD_DIR}/etc/systemd/system" sed "s,%PATH%,${SSSD_PATH},g" "${MODULE_DIR}/templates/sssd-systemd.service" > "${MODULE_BUILD_DIR}/etc/systemd/system/sssd.service" || perror "Could not fill sssd.service template" + # openSuse sssd does not start when /etc/sssd/sssd.conf is not root:root 600! + if [ "$SYS_DISTRIBUTION" == "opensuse" -a "$SYS_VERSION" == "13.2" ]; then + sed -i 's#ExecStart#ExecStartPre=/opt/openslx/bin/chmod 600 /etc/sssd/sssd.conf\nExecStart#g' \ + "${MODULE_BUILD_DIR}/etc/systemd/system/sssd.service" + fi + return 0 } diff --git a/remote/modules/systemd/module.build b/remote/modules/systemd/module.build index 6e1cf4c1..67e019af 100644 --- a/remote/modules/systemd/module.build +++ b/remote/modules/systemd/module.build @@ -99,5 +99,9 @@ post_copy() { if [ "x$(dpkg -s util-linux | grep Version: | cut -d' ' -f2)" == "x2.19.1-2ubuntu3" ]; then sed -i "s/ExecStart=-\/sbin\/agetty --noclear %I 38400 linux/ExecStart=-\/sbin\/agetty %I 38400 linux/g" "${TARGET_BUILD_DIR}/usr/lib/systemd/system/getty@.service" fi + # eg. systemd expects /bin/less: + if [ "$SYS_DISTRIBUTION" == "opensuse" -a "$SYS_VERSION" == "13.2" ]; then + ln -s /usr/bin/less "$TARGET_BUILD_DIR/bin/less" + fi } -- cgit v1.2.3-55-g7522 From 531c3748450af1fa3b8a4a545f6915a7fde8011b Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 25 Mar 2015 14:26:45 +0100 Subject: [netpoint-lightdm] openSuse-specific: First checkin lightdm-Netpoint solution, firefox follws. Need further heavy debugging, this is not production ready. --- .../netpoint-lightdm/data/etc/lightdm/lightdm.conf | 158 +++++++++++++++ .../data/usr/local/bin/guest-account | 3 + .../data/usr/local/bin/guest-cleanup | 6 + .../data/usr/local/bin/guest-session | 4 + .../data/usr/local/bin/guest-setup | 23 +++ .../data/usr/local/bin/netpoint.py | 215 +++++++++++++++++++++ .../usr/local/share/lightdm/ff-google-smaller.png | Bin 0 -> 16703 bytes .../data/usr/local/share/lightdm/ff-rz-smaller.png | Bin 0 -> 72522 bytes .../data/usr/local/share/lightdm/netpoint.css | 16 ++ .../usr/local/share/xgreeters/netpoint.desktop | 5 + remote/modules/netpoint-lightdm/module.build | 11 ++ remote/modules/netpoint-lightdm/module.conf | 3 + .../netpoint-lightdm/module.conf.opensuse.13.2 | 15 ++ 13 files changed, 459 insertions(+) create mode 100644 remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/bin/guest-account create mode 100755 remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup create mode 100755 remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session create mode 100755 remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup create mode 100755 remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-google-smaller.png create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-rz-smaller.png create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.css create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop create mode 100644 remote/modules/netpoint-lightdm/module.build create mode 100644 remote/modules/netpoint-lightdm/module.conf create mode 100644 remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf new file mode 100644 index 00000000..ec372809 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf @@ -0,0 +1,158 @@ +# +# General configuration +# +# start-default-seat = True to always start one seat if none are defined in the configuration +# greeter-user = User to run greeter as +# minimum-display-number = Minimum display number to use for X servers +# minimum-vt = First VT to run displays on +# lock-memory = True to prevent memory from being paged to disk +# user-authority-in-system-dir = True if session authority should be in the system location +# guest-account-script = Script to be run to setup guest account +# logind-check-graphical = True to on start seats that are marked as graphical by logind +# log-directory = Directory to log information to +# run-directory = Directory to put running state in +# cache-directory = Directory to cache to +# sessions-directory = Directory to find sessions +# remote-sessions-directory = Directory to find remote sessions +# greeters-directory = Directory to find greeters +# +[LightDM] +#start-default-seat=true +#greeter-user=lightdm +#minimum-display-number=0 +minimum-vt=1 +#lock-memory=true +#user-authority-in-system-dir=false +guest-account-script=/usr/bin/guest-account +#logind-check-graphical=false +#log-directory=/var/log/lightdm +run-directory=/run/lightdm +#cache-directory=/var/cache/lightdm +#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions +#remote-sessions-directory=/usr/share/lightdm/remote-sessions +#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters + +# +# Seat defaults +# +# type = Seat type (xlocal, xremote) +# pam-service = PAM service to use for login +# pam-autologin-service = PAM service to use for autologin +# pam-greeter-service = PAM service to use for greeters +# xserver-command = X server command to run (can also contain arguments e.g. X -special-option) +# xserver-layout = Layout to pass to X server +# xserver-config = Config file to pass to X server +# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server +# xserver-share = True if the X server is shared for both greeter and session +# xserver-hostname = Hostname of X server (only for type=xremote) +# xserver-display-number = Display number of X server (only for type=xremote) +# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true) +# xdmcp-port = XDMCP UDP/IP port to communicate on +# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf) +# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option) +# unity-compositor-timeout = Number of seconds to wait for compositor to start +# greeter-session = example-greeter +# greeter-hide-users = True to hide the user list +# greeter-allow-guest = True if the greeter should show a guest login option +# greeter-show-manual-login = True if the greeter should offer a manual login option +# greeter-show-remote-login = True if the greeter should offer a remote login option +# user-session = Session to load for users +# allow-user-switching = True if allowed to switch users +# allow-guest = True if guest login is allowed +# guest-session = Session to load for guests (overrides user-session) +# session-wrapper = Wrapper script to run session with +# greeter-wrapper = Wrapper script to run greeter with +# guest-wrapper = Wrapper script to run guest sessions with +# display-setup-script = Script to run when starting a greeter session (runs as root) +# display-stopped-script = Script to run after stopping the display server (runs as root) +# greeter-setup-script = Script to run when starting a greeter (runs as root) +# session-setup-script = Script to run when starting a user session (runs as root) +# session-cleanup-script = Script to run when quitting a user session (runs as root) +# autologin-guest = True to log in as guest by default +# autologin-user = User to log in with by default (overrides autologin-guest) +# autologin-user-timeout = Number of seconds to wait before loading default user +# autologin-session = Session to load for automatic login (overrides user-session) +# autologin-in-background = True if autologin session should not be immediately activated +# exit-on-failure = True if the daemon should exit if this seat fails +# +[SeatDefaults] +#type=xlocal +#pam-service=lightdm +#pam-autologin-service=lightdm-autologin +#pam-greeter-service=lightdm-greeter +#xserver-command=X +#xserver-layout= +#xserver-config= +#xserver-allow-tcp=false +#xserver-share=true +#xserver-hostname= +#xserver-display-number= +#xdmcp-manager= +#xdmcp-port=177 +#xdmcp-key= +#unity-compositor-command=unity-system-compositor +#unity-compositor-timeout=60 +greeter-session=netpoint +greeter-hide-users=false +greeter-allow-guest=true +#greeter-show-manual-login=false +#greeter-show-remote-login=true +#user-session=default +#allow-user-switching=true +allow-guest=true +guest-session=/usr/bin/startxfce4 +session-wrapper=/etc/lightdm/Xsession +#greeter-wrapper= +guest-wrapper=/usr/bin/guest-session +#display-setup-script= +#display-stopped-script= +#greeter-setup-script= +session-setup-script=/usr/bin/guest-setup +session-cleanup-script=/usr/bin/guest-cleanup +#autologin-guest=true +#autologin-user= +#autologin-user-timeout=0 +#autologin-in-background=false +#autologin-session=UNIMPLEMENTED +#exit-on-failure=false + +# +# Seat configuration +# +# Each seat must start with "Seat:". +# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section. +# +#[Seat:0] + +# +# XDMCP Server configuration +# +# enabled = True if XDMCP connections should be allowed +# port = UDP/IP port to listen for connections on +# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf) +# +# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively +# it can be a word and the first 7 characters are used as the key. +# +[XDMCPServer] +#enabled=false +#port=177 +#key= + +# +# VNC Server configuration +# +# enabled = True if VNC connections should be allowed +# command = Command to run Xvnc server with +# port = TCP/IP port to listen for connections on +# width = Width of display to use +# height = Height of display to use +# depth = Color depth of display to use +# +[VNCServer] +#enabled=false +#command=Xvnc +#port=5900 +#width=1024 +#height=768 +#depth=8 diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-account b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-account new file mode 100644 index 00000000..3eed0efc --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-account @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "demo" diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup new file mode 100755 index 00000000..7bd7f219 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup @@ -0,0 +1,6 @@ +#!/bin/sh + +/usr/bin/iptables -F +/usr/bin/iptables -P INPUT ACCEPT +/usr/bin/iptables -P FORWARD ACCEPT +/usr/bin/iptables -P OUTPUT ACCEPT diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session new file mode 100755 index 00000000..2181fdf5 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session @@ -0,0 +1,4 @@ +#!/bin/sh + +exec /usr/bin/metacity & +exec /usr/bin/firefox diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup new file mode 100755 index 00000000..3f9e2293 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup @@ -0,0 +1,23 @@ +#!/bin/sh + +# reset +/usr/bin/iptables -F INPUT +/usr/bin/iptables -F FORWARD +/usr/bin/iptables -F OUTPUT + +if [ "x${USER}" = "xdemo" ]; then + # filter out the internetz + /usr/bin/iptables -P INPUT DROP + /usr/bin/iptables -P FORWARD DROP + /usr/bin/iptables -P OUTPUT DROP + + # block internetz + /usr/bin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + /usr/bin/iptables -A OUTPUT -d 132.230.0.0/16 -j ACCEPT + /usr/bin/iptables -A OUTPUT -d 10.0.0.0/8 -j ACCEPT +else + /usr/bin/iptables -P INPUT ACCEPT + /usr/bin/iptables -P FORWARD ACCEPT + /usr/bin/iptables -P OUTPUT ACCEPT + +fi diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py b/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py new file mode 100755 index 00000000..5f66053c --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py @@ -0,0 +1,215 @@ +#!/usr/bin/env python2 +# +# Author: Matt Fischer +# Copyright (C) 2012 Canonical, Ltd +# +# This program is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. See http://www.gnu.org/copyleft/gpl.html the full text of the +# license. +# +# This code is based on the LightDM GTK Greeter which was written by: +# Robert Ancell + +# required packages: +# liblightdm-gobject-1-0 +# gir1.2-lightdm-1 +# python-gobject +# gir1.2-glib-2.0 +# gir1.2-gtk-3.0 + +from gi.repository import GObject +from gi.repository import GLib +from gi.repository import Gtk +from gi.repository import Gdk +from gi.repository import GdkPixbuf +from gi.repository.GdkPixbuf import InterpType +from gi.repository import LightDM +import sys + +greeter = None + +main = None +split = None + +guest_box = None +guest_text = None +guest_button = None +guest_image = None + +login_box = None +login_text = None +user_box = None +user_text = None +user_username = None +pass_box = None +pass_text = None +pass_password = None + +prompt_box = None +prompt_label = None +prompt_entry = None +message_label = None + +# This Gtk signal is called when the user hits enter after entering a +# username/password or clicks the login button. Since we re-purposed +# the text entry box, we have 3 possible cases to handle here. +# 1) the user is already authenticated, if for example, they don't have +# a password set. +# 2) The username has been passed into LightDM and now we need to pass +# the password +# 3) The username has been entered, but not passed in. We pass it in +# and start the authentication process. +def login_cb(widget): + print >> sys.stderr, "login_cb" + if greeter.get_is_authenticated(): + print >> sys.stderr, "user is already authenticated, starting session" + #start_session() + elif greeter.get_in_authentication(): + print >> sys.stderr, "username was passed in already, send password to LightDM" + print >> sys.stderr, greeter.get_authentication_user() + greeter.respond(pass_password.get_text()) + else: + print >> sys.stderr, "Initial entry of username, send it to LightDM" + greeter.authenticate(user_username.get_text()) + +def guest_cb(widget): + print >> sys.stderr, "guest_cb" + if greeter.get_has_guest_account_hint(): + print >> sys.stderr, "Guest accounts supported" + greeter.authenticate_as_guest() + else: + print >> sys.stderr, "Guest accounts not supported" + + +# Gtk Signal Handlers +handlers = { + "login_cb": login_cb, + "guest_cb": guest_cb +} + +# The show_prompt callback is oddly named, but when you get this +# callback you are supposed to send the password to LightDM next. In +# our example, we re-purpose the prompt and ask the user for the +# password which is then sent the next time the user hits the Login +# button or presses enter. +def show_prompt_cb(greeter, text, promptType): + print >> sys.stderr, "Prompt type: " + str(promptType) + print >> sys.stderr, "Text: " + str(text) + # if this is a password prompt, we want to hide the characters + if promptType == LightDM.PromptType.SECRET: + pass_password.set_visibility(False) + else: + pass_password.set_visibility(True) + greeter.respond(pass_password.get_text()) + + +# If LightDM sends a message back to the greeter, for example, "Login +# failed" or "invalid password" we display it in our message box. +def show_message_cb(text, message_type): + print >> sys.stderr, "In show_message" + print >> sys.stderr, text + message_label.set_text(text) + message_label.show() + +# Callback for after we send LightDM the password, this method +# has to handle a successful login, in which case we start the session +# or a failed login, in which case we tell the user +def authentication_complete_cb(greeter): + if greeter.get_is_authenticated(): + # For our simple example we always start Unity-2d. The LightDM + # API has ways to query available sessions, please see the docs. + if not greeter.start_session_sync("xfce"): + print >> sys.stderr, "Failed to start session" + else: + print >> sys.stderr, "Login failed" + message_label.set_text("LOGIN FAILED") + message_label.show() + +if __name__ == '__main__': + print >> sys.stderr, "Starting up..." + main_loop = GObject.MainLoop () + builder = Gtk.Builder() + greeter = LightDM.Greeter() + styler = Gtk.CssProvider() + css = open('/usr/local/share/lightdm/netpoint.css', 'r') + + css_data = css.read() + css.close() + styler.load_from_data(css_data) + Gtk.StyleContext.add_provider_for_screen( + Gdk.Screen.get_default(), + styler, + Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + ) + + # connect signal handlers to LightDM + greeter.connect ("authentication-complete", authentication_complete_cb) + greeter.connect ("show-message", show_message_cb) + greeter.connect ("show-prompt", show_prompt_cb) + + # connect builder and widgets + # you probably really want to put your .UI file somewhere else + builder.add_from_file("/usr/local/share/lightdm/netpoint.glade") + + main = builder.get_object("main") + split = builder.get_object("split") + sep = builder.get_object("sep") + message_label = builder.get_object("message_label") + print >> sys.stderr, message_label + guest_box = builder.get_object("guest_box") + + guest_outer_box = builder.get_object("guest_outer_box") + guest_internal_box = builder.get_object("guest_internal_box") + guest_text = builder.get_object("guest_text") + guest_button = builder.get_object("guest_button") + guest_image = builder.get_object("guest_image") + login_image = builder.get_object("login_image") + #pixbuf = guest_image.get_pixbuf() + #pixbuf = pixbuf.scale_simple(pixbuf.get_width() * 0.7, pixbuf.get_height() * 0.7, InterpType.HYPER) + #guest_image.set_from_pixbuf(pixbuf) + #pixbuf = login_image.get_pixbuf() + #pixbuf = pixbuf.scale_simple(pixbuf.get_width() * 0.7, pixbuf.get_height() * 0.7, InterpType.HYPER) + #login_image.set_from_pixbuf(pixbuf) + + login_box = builder.get_object("login_box") + login_text = builder.get_object("login_text") + + user_box = builder.get_object("user_box") + user_text = builder.get_object("user_text") + user_username = builder.get_object("user_username") + + pass_box = builder.get_object("pass_box") + pass_text = builder.get_object("pass_text") + pass_password = builder.get_object("pass_password") + + # connect signals to Gtk UI + builder.connect_signals(handlers) + + # connect to greeter + greeter.connect_sync() + + message_label.hide() + + # setup the GUI + main.set_decorated(True) + main.get_root_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.ARROW)) + main.show() + guest_text.show() + guest_button.show() + login_text.show() + user_text.show() + user_username.grab_focus() + user_username.show() + pass_text.show() + pass_password.set_sensitive(True) + pass_password.set_visibility(False) + pass_password.show() + + # fullscreen it + main.resize(Gdk.Screen.width(), Gdk.Screen.height()) + + #print >> sys.stderr, guest_box.get_height() + #print >> sys.stderr, guest_box.get_width() + main_loop.run () diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-google-smaller.png b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-google-smaller.png new file mode 100644 index 00000000..f3b81c32 Binary files /dev/null and b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-google-smaller.png differ diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-rz-smaller.png b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-rz-smaller.png new file mode 100644 index 00000000..f6e4703d Binary files /dev/null and b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/ff-rz-smaller.png differ diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.css b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.css new file mode 100644 index 00000000..7f1f80af --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.css @@ -0,0 +1,16 @@ +#main { + background-color: white; +} +#sep { + -GtkWidget-wide-separators: 1; + -GtkWidget-separator-width: 5; + border-style: solid; + border-width: 2px; + color: grey; +} +#title { + border-top-style: solid; + border-bottom-style: double; + border-width: 3px; + border-color: grey; +} diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop b/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop new file mode 100644 index 00000000..7293c792 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop @@ -0,0 +1,5 @@ +[Desktop Entry] +Name=Netpoint Grita +Comment=Netpoint Grita +Exec=/usr/bin/netpoint.py +Type=Application diff --git a/remote/modules/netpoint-lightdm/module.build b/remote/modules/netpoint-lightdm/module.build new file mode 100644 index 00000000..97e93235 --- /dev/null +++ b/remote/modules/netpoint-lightdm/module.build @@ -0,0 +1,11 @@ +fetch_source() { + : +} + +build() { + : +} + +post_copy() { + : +} diff --git a/remote/modules/netpoint-lightdm/module.conf b/remote/modules/netpoint-lightdm/module.conf new file mode 100644 index 00000000..0cd03752 --- /dev/null +++ b/remote/modules/netpoint-lightdm/module.conf @@ -0,0 +1,3 @@ +REQUIRED_BINARIES="" +REQUIRED_LIBRARIES="" +REQUIRED_DIRECTORIES="" diff --git a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 new file mode 100644 index 00000000..7d2b9c42 --- /dev/null +++ b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 @@ -0,0 +1,15 @@ +REQUIRED_INSTALLED_PACKAGES=" + lightdm + lightdm-gobject-devel + typelib-1_0-LightDM-1 + liblightdm-gobject-1-0 + python-gobject +" + +REQUIRED_CONTENT_PACKAGES=" + lightdm + lightdm-gobject-devel + typelib-1_0-LightDM-1 + liblightdm-gobject-1-0 + python-gobject +" -- cgit v1.2.3-55-g7522 From 03b6efa0ad3c7a5a7d8a7655eaa1e59329807720 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 25 Mar 2015 14:29:45 +0100 Subject: [netpoint-lightdm] Some more files, little bug --- .../netpoint-lightdm/data/etc/lightdm/lightdm.conf | 10 +- .../data/usr/local/share/lightdm/netpoint.glade | 365 +++++++++++++++++++++ 2 files changed, 371 insertions(+), 4 deletions(-) create mode 100644 remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.glade (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf index ec372809..07154848 100644 --- a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf +++ b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf @@ -23,7 +23,7 @@ minimum-vt=1 #lock-memory=true #user-authority-in-system-dir=false -guest-account-script=/usr/bin/guest-account +guest-account-script=/usr/local/bin/guest-account #logind-check-graphical=false #log-directory=/var/log/lightdm run-directory=/run/lightdm @@ -100,15 +100,17 @@ greeter-allow-guest=true #user-session=default #allow-user-switching=true allow-guest=true + guest-session=/usr/bin/startxfce4 session-wrapper=/etc/lightdm/Xsession + #greeter-wrapper= -guest-wrapper=/usr/bin/guest-session +guest-wrapper=/usr/local/bin/guest-session #display-setup-script= #display-stopped-script= #greeter-setup-script= -session-setup-script=/usr/bin/guest-setup -session-cleanup-script=/usr/bin/guest-cleanup +session-setup-script=/usr/local/bin/guest-setup +session-cleanup-script=/usr/local/bin/guest-cleanup #autologin-guest=true #autologin-user= #autologin-user-timeout=0 diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.glade b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.glade new file mode 100644 index 00000000..e2e47416 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/usr/local/share/lightdm/netpoint.glade @@ -0,0 +1,365 @@ + + + + + + main + False + True + True + center-always + 800 + 600 + False + center + + + True + False + vertical + + + title + 100 + True + False + Netpoint 0.1 + + + + + + False + True + 0 + + + + + True + False + False + True + + + sep + 10 + True + False + True + vertical + + + 1 + 0 + + + + + True + False + True + False + True + + + guestbox + True + False + False + False + vertical + True + + + True + False + vertical + + + 100 + True + False + center + center + False + Uni-interner Browser + center + + + + + + False + True + 0 + + + + + True + False + center + False + False + Im Gastmodus können Sie nur auf universitätsinterne Webseiten zugreifen. + center + True + 0 + 0 + + + False + True + 1 + + + + + False + True + 0 + + + + + Surfen als Gast + False + + True + True + True + center + center + + + + False + True + 1 + + + + + 0 + 0 + + + + + guest_image + True + False + 10 + 10 + 10 + 10 + True + True + ff-rz-smaller.png + + + 0 + 1 + + + + + 0 + 0 + + + + + True + False + True + True + True + + + True + False + True + True + vertical + True + + + True + False + vertical + + + 100 + True + False + center + center + False + Internet Browser + center + + + + + + False + True + 0 + + + + + True + False + start + False + Melden Sie sich mit Ihrem RZ-Konto, um auch im Internet zu surfen. + center + True + 0 + 30 + + + False + True + 1 + + + + + True + True + 0 + + + + + True + False + center + vertical + + + True + False + center + center + 3 + 3 + + + True + False + True + 0 + + + + 1 + 1 + + + + + True + False + start + Passwort: + + + 0 + 1 + + + + + True + False + start + Username: + + + 0 + 0 + + + + + True + True + + + + 1 + 0 + + + + + False + True + 0 + + + + + True + False + [message] + + + False + True + 1 + + + + + False + True + 1 + + + + + 0 + 0 + + + + + login_image + True + False + 10 + 10 + 10 + 10 + True + True + ff-google-smaller.png + + + 0 + 1 + + + + + 2 + 0 + + + + + False + True + 1 + + + + + + -- cgit v1.2.3-55-g7522 From 8abaaf6158a49bf7f6e8fbdb1b3eb841e58a6a0b Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 25 Mar 2015 15:17:36 +0100 Subject: [netpoint-lightdm] Some more files, etc/sysconfig --- .../data/etc/sysconfig/displaymanager | 113 +++++++++++++++++++++ .../data/etc/sysconfig/windowmanager | 51 ++++++++++ 2 files changed, 164 insertions(+) create mode 100644 remote/modules/netpoint-lightdm/data/etc/sysconfig/displaymanager create mode 100644 remote/modules/netpoint-lightdm/data/etc/sysconfig/windowmanager (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/etc/sysconfig/displaymanager b/remote/modules/netpoint-lightdm/data/etc/sysconfig/displaymanager new file mode 100644 index 00000000..9a64a124 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/etc/sysconfig/displaymanager @@ -0,0 +1,113 @@ +## Path: Desktop/Display manager +## Type: string(Xorg) +## Default: "Xorg" +# +DISPLAYMANAGER_XSERVER="Xorg" +## Path: Desktop/Display manager +## Description: settings to generate a proper displaymanager config + +## Type: string(kdm,xdm,gdm,wdm,entrance,console,lightdm,sddm) +## Default: "" +# +# Here you can set the default Display manager (kdm/xdm/gdm/wdm/entrance/console). +# all changes in this file require a restart of the displaymanager +# +# DISPLAYMANAGER="kdm" +DISPLAYMANAGER="lightdm" + +## Type: yesno +## Default: no +# +# Allow remote access (XDMCP) to your display manager (xdm/kdm/gdm). Please note +# that a modified kdm or xdm configuration, e.g. by KDE control center +# will not be changed. For gdm, values will be updated after change. +# XDMCP service should run only on trusted networks and you have to disable +# firewall for interfaces, where you want to provide this service. +# +DISPLAYMANAGER_REMOTE_ACCESS="no" + +## Type: yesno +## Default: no +# +# Allow remote access of the user root to your display manager. Note +# that root can never login if DISPLAYMANAGER_SHUTDOWN is "auto" and +# System/Security/Permissions/PERMISSION_SECURITY is "paranoid" +# +DISPLAYMANAGER_ROOT_LOGIN_REMOTE="no" + +## Type: yesno +## Default: yes +# +# Let the displaymanager start a local Xserver. +# Set to "no" for remote-access only. +# Set to "no" on architectures without any Xserver (e.g. s390/s390x). +# +DISPLAYMANAGER_STARTS_XSERVER="yes" + +## Type: yesno +## Default: no +# +# TCP port 6000 of Xserver. When set to "no" (default) Xserver is +# started with "-nolisten tcp". Only set this to "yes" if you really +# need to. Remote X service should run only on trusted networks and +# you have to disable firewall for interfaces, where you want to +# provide this service. Use ssh X11 port forwarding whenever possible. +# +DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="no" + +## Type: string +## Default: +# +# Define the user whom should get logged in without request. If string +# is empty, display standard login dialog. +# +DISPLAYMANAGER_AUTOLOGIN="" + +## Type: yesno +## Default: no +# +# Allow all users to login without password, but ask for the user, if +# DISPLAYMANAGER_AUTOLOGIN is empty. +# +DISPLAYMANAGER_PASSWORD_LESS_LOGIN="no" + +## Type: yesno +## Default: no +# +# Display a combobox for Active Directory domains. +# +DISPLAYMANAGER_AD_INTEGRATION="no" + +## Type: list(root,all,none,auto) +## Default: auto +# +# Determine who will be able to shutdown or reboot the system in kdm. Valid +# values are: "root" (only root can shutdown), "all" (everybody can shutdown), +# "none" (nobody can shutdown from displaymanager), "auto" (follow +# System/Security/Permissions/PERMISSION_SECURITY to decide: "easy local" is +# equal to "all", everything else is equal to "root"). gdm respects the +# PolicyKit settings for ConsoleKit. Shutdown configuration can be done via +# the polkit-default-privs mechanism. +# +DISPLAYMANAGER_SHUTDOWN="auto" +## Path: Desktop/Display manager +## Description: settings to generate a proper displaymanager config +## Config: kdm + +## Type: string +## Default: +# +# Defines extra Server Arguments given to the kdm display manager when +# starting a local display. Useful to override e.g. the -dpi setting. +# +DISPLAYMANAGER_KDM_LOCALARGS="" + +## Type: yesno +## Default: yes +# +# Allow local access of the user root to your display manager. Note +# that root can never login if DISPLAYMANAGER_SHUTDOWN is "auto" and +# System/Security/Permissions/PERMISSION_SECURITY is "paranoid". +# This settings currently works only with KDM. +# +DISPLAYMANAGER_ROOT_LOGIN_LOCAL="yes" diff --git a/remote/modules/netpoint-lightdm/data/etc/sysconfig/windowmanager b/remote/modules/netpoint-lightdm/data/etc/sysconfig/windowmanager new file mode 100644 index 00000000..12120320 --- /dev/null +++ b/remote/modules/netpoint-lightdm/data/etc/sysconfig/windowmanager @@ -0,0 +1,51 @@ +## Type: string +## Default: +## Path: Desktop +## Description: default mouse cursor theme +# +# Name of mouse cursor theme for X11. Possible themes can be found +# in /usr/share/icons/ +# +X_MOUSE_CURSOR="DMZ" +## Path: Desktop/Window manager +## Description: +## Type: string(gnome,kde4,kde,lxde,xfce,twm,icewm) +## Default: kde4 +## Config: profiles,kde,susewm +# +# Here you can set the default window manager (kde, fvwm, ...) +# changes here require at least a re-login +# DEFAULT_WM="kde-plasma" +DEFAULT_WM="xfce" + +## Type: yesno +## Default: yes +# +# install the SuSE extension for new users +# (theme and additional functions) +# +INSTALL_DESKTOP_EXTENSIONS="yes" +## Path: Desktop +## Description: prepare global sycoca database for faster first startup +## Type: list(yes,initial,no) +## Default: initial +# +# building a global sycoca database, which can be used at first user +# login in KDE +# +KDE_BUILD_GLOBAL_SYCOCA="initial" + +## Type: yesno +## Default: yes +# +# To disable IPv6 support within KDE. It might solve large timeouts due to +# broken servers which claim to have IPv6 support, but do not respond. +# +KDE_USE_IPV6="yes" + +## Type: yesno +## Default: yes +# +# IDN support can get disabled to avoid DNS phishing for example. +# +KDE_USE_IDN="yes" -- cgit v1.2.3-55-g7522 From e1a4a5192dedd04dd3c3db6789a9ddf394f7ab42 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 25 Mar 2015 16:27:04 +0100 Subject: [netpoint-lightdm] Some more fixes and extensions --- .../modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf | 6 ++++-- remote/modules/netpoint-lightdm/module.build | 6 +++++- remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf index 07154848..6f38d075 100644 --- a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf +++ b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf @@ -30,7 +30,8 @@ run-directory=/run/lightdm #cache-directory=/var/cache/lightdm #sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions #remote-sessions-directory=/usr/share/lightdm/remote-sessions -#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters + +greeters-directory=/usr/local/share/xgreeters:/usr/share/lightdm/greeters:/usr/share/xgreeters # # Seat defaults @@ -102,7 +103,8 @@ greeter-allow-guest=true allow-guest=true guest-session=/usr/bin/startxfce4 -session-wrapper=/etc/lightdm/Xsession + +# Keine Ahnung session-wrapper=/etc/lightdm/Xsession #greeter-wrapper= guest-wrapper=/usr/local/bin/guest-session diff --git a/remote/modules/netpoint-lightdm/module.build b/remote/modules/netpoint-lightdm/module.build index 97e93235..0c891489 100644 --- a/remote/modules/netpoint-lightdm/module.build +++ b/remote/modules/netpoint-lightdm/module.build @@ -3,7 +3,11 @@ fetch_source() { } build() { - : + COPYLIST="list_dpkg_output" + [ -e "$COPYLIST" ] && rm "$COPYLIST" + + list_packet_files >> "$COPYLIST" + tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}" } post_copy() { diff --git a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 index 7d2b9c42..430ec7d4 100644 --- a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 +++ b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 @@ -4,6 +4,9 @@ REQUIRED_INSTALLED_PACKAGES=" typelib-1_0-LightDM-1 liblightdm-gobject-1-0 python-gobject + icewm-lite + icewm-default + python-base " REQUIRED_CONTENT_PACKAGES=" @@ -12,4 +15,13 @@ REQUIRED_CONTENT_PACKAGES=" typelib-1_0-LightDM-1 liblightdm-gobject-1-0 python-gobject + icewm-lite + icewm-default + python-base " + +REQUIRED_BINARIES+=" + icewm + lightdm +" + -- cgit v1.2.3-55-g7522 From ecca2608a6221ed51507b729fc5c849bd3a975fa Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Wed, 25 Mar 2015 16:53:07 +0100 Subject: [netpoint-lightdm] Some more bug fixes --- remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 index 430ec7d4..4e92a9c0 100644 --- a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 +++ b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 @@ -23,5 +23,11 @@ REQUIRED_CONTENT_PACKAGES=" REQUIRED_BINARIES+=" icewm lightdm + python " +REQUIRED_DIRECTORIES+=" + /usr/lib64/python2.7 + /var/lib/lightdm + /var/lib/lightdm-data +" -- cgit v1.2.3-55-g7522 From 8e5bd20eb2797bf3487e188cefe5d3537eccb422 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 26 Mar 2015 14:44:57 +0100 Subject: [netpoint-lightdm] some further stuff --- remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf | 4 +++- remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session | 4 ++-- remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py | 2 +- .../data/usr/local/share/xgreeters/netpoint.desktop | 2 +- remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 | 7 +++++-- 5 files changed, 12 insertions(+), 7 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf index 6f38d075..3e78eb50 100644 --- a/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf +++ b/remote/modules/netpoint-lightdm/data/etc/lightdm/lightdm.conf @@ -93,7 +93,9 @@ greeters-directory=/usr/local/share/xgreeters:/usr/share/lightdm/greeters:/usr/s #xdmcp-key= #unity-compositor-command=unity-system-compositor #unity-compositor-timeout=60 + greeter-session=netpoint + greeter-hide-users=false greeter-allow-guest=true #greeter-show-manual-login=false @@ -102,7 +104,7 @@ greeter-allow-guest=true #allow-user-switching=true allow-guest=true -guest-session=/usr/bin/startxfce4 +guest-session=/usr/bin/icewm # Keine Ahnung session-wrapper=/etc/lightdm/Xsession diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session index 2181fdf5..2c22a68c 100755 --- a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-session @@ -1,4 +1,4 @@ #!/bin/sh -exec /usr/bin/metacity & -exec /usr/bin/firefox +exec /usr/bin/icewm & +# exec /usr/bin/firefox diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py b/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py index 5f66053c..635fb03f 100755 --- a/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/netpoint.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/python # # Author: Matt Fischer # Copyright (C) 2012 Canonical, Ltd diff --git a/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop b/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop index 7293c792..f03cf498 100644 --- a/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop +++ b/remote/modules/netpoint-lightdm/data/usr/local/share/xgreeters/netpoint.desktop @@ -1,5 +1,5 @@ [Desktop Entry] Name=Netpoint Grita Comment=Netpoint Grita -Exec=/usr/bin/netpoint.py +Exec=/usr/local/bin/netpoint.py Type=Application diff --git a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 index 4e92a9c0..d62f9063 100644 --- a/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 +++ b/remote/modules/netpoint-lightdm/module.conf.opensuse.13.2 @@ -1,5 +1,6 @@ REQUIRED_INSTALLED_PACKAGES=" lightdm + lightdm-gtk-greeter lightdm-gobject-devel typelib-1_0-LightDM-1 liblightdm-gobject-1-0 @@ -7,10 +8,12 @@ REQUIRED_INSTALLED_PACKAGES=" icewm-lite icewm-default python-base + python-gobject2 " REQUIRED_CONTENT_PACKAGES=" lightdm + lightdm-gtk-greeter lightdm-gobject-devel typelib-1_0-LightDM-1 liblightdm-gobject-1-0 @@ -18,16 +21,16 @@ REQUIRED_CONTENT_PACKAGES=" icewm-lite icewm-default python-base + python-gobject2 " REQUIRED_BINARIES+=" icewm lightdm python + lightdm-gtk-greeter " REQUIRED_DIRECTORIES+=" /usr/lib64/python2.7 - /var/lib/lightdm - /var/lib/lightdm-data " -- cgit v1.2.3-55-g7522 From e8fcd655aa689a46c83b99746222f272f4ba5fe4 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 26 Mar 2015 14:50:07 +0100 Subject: [alsa] REQUIRED_INSTALLED für opensus[alsa] REQUIRED_INSTALLED für opensuse --- remote/modules/alsa/module.conf.opensuse | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/alsa/module.conf.opensuse b/remote/modules/alsa/module.conf.opensuse index 17651c29..a9ba1d50 100644 --- a/remote/modules/alsa/module.conf.opensuse +++ b/remote/modules/alsa/module.conf.opensuse @@ -3,3 +3,8 @@ REQUIRED_CONTENT_PACKAGES=" alsa libasound2 " +REQUIRED_INSTALLED_PACKAGES=" + alsa-utils + alsa + libasound2 +" -- cgit v1.2.3-55-g7522 From 5e193e5aab507f7bf09780040e3d1fcdbe0f6e34 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 26 Mar 2015 15:54:58 +0100 Subject: [netpoint-lightdm] guest scripts: path to iptables binary re-set --- .../data/usr/local/bin/guest-cleanup | 10 +++++---- .../data/usr/local/bin/guest-setup | 26 ++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup index 7bd7f219..32179cec 100755 --- a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-cleanup @@ -1,6 +1,8 @@ #!/bin/sh -/usr/bin/iptables -F -/usr/bin/iptables -P INPUT ACCEPT -/usr/bin/iptables -P FORWARD ACCEPT -/usr/bin/iptables -P OUTPUT ACCEPT +IPTABLES=$(/usr/bin/which iptables) + +"$IPTABLES" -F +"$IPTABLES" -P INPUT ACCEPT +"$IPTABLES" -P FORWARD ACCEPT +"$IPTABLES" -P OUTPUT ACCEPT diff --git a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup index 3f9e2293..cb6791fc 100755 --- a/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup +++ b/remote/modules/netpoint-lightdm/data/usr/local/bin/guest-setup @@ -1,23 +1,25 @@ #!/bin/sh +IPTABLES=$(/usr/bin/which iptables) + # reset -/usr/bin/iptables -F INPUT -/usr/bin/iptables -F FORWARD -/usr/bin/iptables -F OUTPUT +"$IPTABLES" -F INPUT +"$IPTABLES" -F FORWARD +"$IPTABLES" -F OUTPUT if [ "x${USER}" = "xdemo" ]; then # filter out the internetz - /usr/bin/iptables -P INPUT DROP - /usr/bin/iptables -P FORWARD DROP - /usr/bin/iptables -P OUTPUT DROP + "$IPTABLES" -P INPUT DROP + "$IPTABLES" -P FORWARD DROP + "$IPTABLES" -P OUTPUT DROP # block internetz - /usr/bin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT - /usr/bin/iptables -A OUTPUT -d 132.230.0.0/16 -j ACCEPT - /usr/bin/iptables -A OUTPUT -d 10.0.0.0/8 -j ACCEPT + "$IPTABLES" -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + "$IPTABLES" -A OUTPUT -d 132.230.0.0/16 -j ACCEPT + "$IPTABLES" -A OUTPUT -d 10.0.0.0/8 -j ACCEPT else - /usr/bin/iptables -P INPUT ACCEPT - /usr/bin/iptables -P FORWARD ACCEPT - /usr/bin/iptables -P OUTPUT ACCEPT + "$IPTABLES" -P INPUT ACCEPT + "$IPTABLES" -P FORWARD ACCEPT + "$IPTABLES" -P OUTPUT ACCEPT fi -- cgit v1.2.3-55-g7522 From de67ad7f7b5d5b8b15c91df3609cc7d093888ce3 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 2 Apr 2015 16:31:08 +0200 Subject: [pam-common-share] removed bash specifics in pam-common-share scripts --- .../openslx/scripts/pam_script_mount_common_share | 96 +++++++++++++--------- .../pam/data/opt/openslx/scripts/pam_script_auth | 2 +- 2 files changed, 60 insertions(+), 38 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share index 85a3fcc0..9600fa4d 100644 --- a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share +++ b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share @@ -1,36 +1,41 @@ ################################################################### # -# This script is a part of the pam_script_auth script -# and is not stand-alone! +# This script is a part of the pam_script_auth script +# and is not stand-alone! # -# It will try to mount the common shares specified in the -# variables of the global slx config '/opt/openslx/config'. -# A primary and a secondary share may be given. Every share -# require following bundle of variables: +# It will try to mount the common shares specified in the +# variables of the global slx config '/opt/openslx/config'. +# An arbitrary number of shares may be given. Every share +# requires following bundle of variables: # # -# SLX_SHARE_[0-9]_AUTH_TYPE [guest|user|pam] -# SLX_SHARE_[0-9]_AUTH_USER -# SLX_SHARE_[0-9]_AUTH_PASS -# SLX_SHARE_[0-9]_PERM [ro|rw] -# SLX_SHARE_[0-9]_PATH +# SLX_SHARE__AUTH_TYPE [guest|user|pam] +# SLX_SHARE__AUTH_USER +# SLX_SHARE__AUTH_PASS +# SLX_SHARE__PERM [ro|rw] +# SLX_SHARE__PATH # -# Example: -# SLX_SHARE_0_PATH='//windows.server/sharename' -# SLX_SHARE_0_AUTH_TYPE='user' -# SLX_SHARE_0_AUTH_USER='shareuser' -# SLX_SHARE_0_AUTH_PASS='sharepass' -# SLX_SHARE_0_PERM='rw' +# Note: is the identifier of the share. # -# Note: When AUTH_TYPE is set to 'pam' or 'guest', -# no need to specify AUTH_USER or AUTH_PASS. +# Example: +# SLX_SHARE_0_PATH='//windows.server/sharename' +# SLX_SHARE_0_AUTH_TYPE='user' +# SLX_SHARE_0_AUTH_USER='shareuser' +# SLX_SHARE_0_AUTH_PASS='sharepass' +# SLX_SHARE_0_PERM='rw' # +# Note: If AUTH_TYPE is set to 'pam' or 'guest', then +# there is no need to specify AUTH_USER or AUTH_PASS +# as it is obviously not needed. # -# usage: mount_share +################################################################### +# +# Internal helper function to mount a share +# usage: mount_share mount_share() { - # only want two arguments + # since we are (hopefully) the only one using this function, we know we need excatly 6 args [ $# -ne 6 ] && { slxlog "pam-share-args" "Wrong number of arguments given! Need 6, $# given."; return; } - + # lets check if we have our variables local SHARE_AUTH_TYPE="$1" local SHARE_AUTH_USER="$2" @@ -43,7 +48,7 @@ mount_share() { [ "x${SHARE_PERM}" != "xrw" ] && SHARE_PERM='ro' # all good: now we can mount depending on the type - # supports: cifs?/nfs? + # supports: cifs?/nfs? if [ "${SHARE_PATH:0:2}" = "//" ]; then # '//' prefixed, assume windows share # prepare common mount options for either authentication type @@ -104,9 +109,14 @@ mount_share() { # always unset credentials unset USER unset PASSWD + elid fi } +################################################################### +# +# MAIN SCRIPT +# # at this point we need the slx config to do anything [ -e "/opt/openslx/config" ] || \ { slxlog "pam-share-noconfig" "File '/opt/openslx/config' not found."; return; } @@ -115,28 +125,40 @@ mount_share() { . /opt/openslx/config || \ { slxlog "pam-share-sourceconfig" "Could not source '/opt/openslx/config'."; return; } +# +# +# # Since many shares can be specified, we need to identify how many we have first. -# We just go over all SLX_SHARE_* variables and check for those ending in _PATH +# We just go over all SLX_SHARE_* variables and check for those ending in _PATH. +# So e.g. for SLX_SHARE_0_PATH= the SHARE variable would be equal to 'SLX_SHARE_0_PATH' # For each of those, a share was specified and we will try to mount it. -for SHARE in ${!SLX_SHARE_*}; do - # skip if the variable doesn't end in _PATH - [[ "$SHARE" =~ .*_PATH$ ]] || continue - # first let's check if we have already mounted it, since we don't have to - # do anything is it already is. - if mount | grep -q "${SHARE}"; then - # already mounted, just skip. +for SHARE in $(grep -E '^SLX_SHARE_[0-9]+_PATH=.*$' /opt/openslx/config); do + # first let's check if we have already mounted it and skip if it is + # TODO: this should be good enough? stronger checks? + if mount | grep -q "$(echo ${SHARE} | awk -F '=' '{print $2}' | tr -d \'\")"; then + # already mounted, just skip + # this should not happen anyway, since the pam_script_auth script also exits + # if the temporary home user directory is already mounted... continue fi - # ok so we have a path in $SHARE, let's extract the number of the share + # ok so we have the full declaration command in $SHARE, + # let's extract the number of the share. # i.e. SLX_SHARE_0_PATH -> share number 0 - # first strip the leading SLX_SHARE_ - SHARE=${SHARE#SLX_SHARE_} + # first just cut everything after '=' + SHARE_NUM="$(echo $SHARE | awk -F '=' '{print $1}')" + # now strip the leading SLX_SHARE_ + SHARE_NUM=${SHARE_NUM#SLX_SHARE_} # now remove the trailing _PATH - SHARE=${SHARE%_PATH} + SHARE_NUM=${SHARE_NUM%_PATH} # now it should be a number, TODO accept more than numbers? Doesn't really matter... # this check is mostly to be sure that the variable splitting worked as it should - [[ "$SHARE" =~ ^[0-9]+$ ]] || continue - eval mount_share \""\$SLX_SHARE_${SHARE}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE}_PERM"\" \""\$SLX_SHARE_${SHARE}_PATH"\" \""$SHARE"\" + # ugly cause we need to be ash compatible ... + if ! echo "${SHARE_NUM}" | grep -q -E '^[0-9]+$'; then + continue + fi + + # now do try to mount the share using the helper function defined on the top of this script + eval mount_share \""\$SLX_SHARE_${SHARE_NUM}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE_NUM}_PERM"\" \""\$SLX_SHARE_${SHARE_NUM}_PATH"\" \""$SHARE_NUM"\" ## unset USER and PASSWD just in case mount_share returned due to an error. unset USER unset PASSWD diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth index 3b8bf676..f9636ced 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth @@ -105,7 +105,7 @@ chown "${PAM_USER}:${USER_GID}" "${COMMON_SHARE_MOUNT_POINT}" || \ [ ! -e "${COMMON_SHARE_MOUNT_SCRIPT}" ] && exit 0 # we do! -COMMON_SHARE_MOUNT_POINT="${COMMON_SHARE_MOUNT_POINT}" PAM_USER="${PAM_USER}" PAM_AUTHTOK="${PAM_AUTHTOK}" USER_UID="${USER_UID}" USER_GID="${USER_GID}" /bin/bash "${COMMON_SHARE_MOUNT_SCRIPT}" || \ +COMMON_SHARE_MOUNT_POINT="${COMMON_SHARE_MOUNT_POINT}" PAM_USER="${PAM_USER}" PAM_AUTHTOK="${PAM_AUTHTOK}" USER_UID="${USER_UID}" USER_GID="${USER_GID}" /bin/ash "${COMMON_SHARE_MOUNT_SCRIPT}" || \ { slxlog "pam-global-sourceshare" "Could not source '${COMMON_SHARE_MOUNT_SCRIPT}'."; exit 1; } # Just try to delete the common share dir. If the mount was successful, it will not work -- cgit v1.2.3-55-g7522 From 6bf34232abf59842dde6916d551343e294013add Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 7 Apr 2015 13:51:00 +0200 Subject: [pam-common-share] fix bad variable name and typo --- .../data/opt/openslx/scripts/pam_script_mount_common_share | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share index 9600fa4d..a492e248 100644 --- a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share +++ b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share @@ -109,7 +109,6 @@ mount_share() { # always unset credentials unset USER unset PASSWD - elid fi } @@ -145,20 +144,20 @@ for SHARE in $(grep -E '^SLX_SHARE_[0-9]+_PATH=.*$' /opt/openslx/config); do # let's extract the number of the share. # i.e. SLX_SHARE_0_PATH -> share number 0 # first just cut everything after '=' - SHARE_NUM="$(echo $SHARE | awk -F '=' '{print $1}')" + SHARE_ID="$(echo $SHARE | awk -F '=' '{print $1}')" # now strip the leading SLX_SHARE_ - SHARE_NUM=${SHARE_NUM#SLX_SHARE_} + SHARE_ID=${SHARE_ID#SLX_SHARE_} # now remove the trailing _PATH - SHARE_NUM=${SHARE_NUM%_PATH} + SHARE_ID=${SHARE_ID%_PATH} # now it should be a number, TODO accept more than numbers? Doesn't really matter... # this check is mostly to be sure that the variable splitting worked as it should # ugly cause we need to be ash compatible ... - if ! echo "${SHARE_NUM}" | grep -q -E '^[0-9]+$'; then + if ! echo "${SHARE_ID}" | grep -q -E '^[0-9]+$'; then continue fi # now do try to mount the share using the helper function defined on the top of this script - eval mount_share \""\$SLX_SHARE_${SHARE_NUM}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE_NUM}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE_NUM}_PERM"\" \""\$SLX_SHARE_${SHARE_NUM}_PATH"\" \""$SHARE_NUM"\" + eval mount_share \""\$SLX_SHARE_${SHARE_ID}_AUTH_TYPE"\" \""\$SLX_SHARE_${SHARE_ID}_AUTH_USER"\" \""\$SLX_SHARE_${SHARE_ID}_AUTH_PASS"\" \""\$SLX_SHARE_${SHARE_ID}_PERM"\" \""\$SLX_SHARE_${SHARE_ID}_PATH"\" \""$SHARE_ID"\" ## unset USER and PASSWD just in case mount_share returned due to an error. unset USER unset PASSWD -- cgit v1.2.3-55-g7522 From b34bc0e6f97ca55b7d6c85b710f9bc40783c41e9 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 7 Apr 2015 15:44:44 +0200 Subject: [pam] fix annoying errors when logging out of ttys loginctl only show graphically logged in users, not on ttys, therefore loginctl will fail when logging out of a tty and dump errors on stderr. Soon everything will be different but still cosmetics :) --- remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close index 4fc2ce6a..9332e0a6 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close @@ -26,7 +26,7 @@ if [ -d "/opt/openslx/scripts/pam_script_ses_close.d" ]; then done fi -OPENSESSION=$(loginctl show-user "$PAM_USER" | grep "Sessions=" | cut -c 10-) +OPENSESSION=$(loginctl show-user "$PAM_USER" 2>/dev/null| grep "Sessions=" | cut -c 10-) SESSIONCOUNT=$(echo "$OPENSESSION" | wc -w) # When using su/sudo there is no session created, so count up by one if [ "x$PAM_SERVICE" = "xsu" -o "x$PAM_SERVICE" = "xsudo" ]; then @@ -55,7 +55,7 @@ if [ "$SESSIONCOUNT" -le "1" ]; then done # just to be sure we check if there's no other open session in the meantime - OPEN2=$(loginctl show-user "$PAM_USER" | grep "Sessions=" | cut -c 10-) + OPEN2=$(loginctl show-user "$PAM_USER" 2>/dev/null | grep "Sessions=" | cut -c 10-) if [ -z "$OPEN2" -o "x$OPENSESSION" = "x$OPEN2" ]; then -- cgit v1.2.3-55-g7522 From fa69e01ba28c3c6b3f706b07fbe0647d3f5e509e Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 7 Apr 2015 15:48:18 +0200 Subject: [pam-common-share] rudimentary nfs-support for common share when SLX_SHARE_0_PATH is not starting with double backslash, it is assumed that we have nfs share. Version negiotation is done by the client, even though we will probably want a finer control for the mount options --- .../openslx/scripts/pam_script_mount_common_share | 87 +++++++++++++--------- 1 file changed, 53 insertions(+), 34 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share index a492e248..670943f4 100644 --- a/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share +++ b/remote/modules/pam-common-share/data/opt/openslx/scripts/pam_script_mount_common_share @@ -54,11 +54,6 @@ mount_share() { # prepare common mount options for either authentication type MOUNT_OPTS="-t cifs -o nounix,uid=${USER_UID},gid=${USER_GID},forceuid,forcegid,nobrl,noacl,$SHARE_PERM" - # flag for failure - SIGNAL=$(mktemp) - rm -f -- "${SIGNAL}" - # output of command - MOUNT_OUTPUT=$(mktemp) # now construct the mount options depending on the type of the share. if [ "${SHARE_AUTH_TYPE}" = "guest" ]; then MOUNT_OPTS="${MOUNT_OPTS},guest,file_mode=0777,dir_mode=0777" @@ -78,44 +73,68 @@ mount_share() { slxlog "pam-share-auth" "Share${SHARE_NUM}: Auth type '${SHARE_AUTH_TYPE}' not supported." return; fi + else + # for now assume NFS-Share, start build options string with default options for all shares + MOUNT_OPTS="-t nfs -o async,nolock" - # we just mount it to the directory with the same name as the - # last directory in the path name of the share - # e.g. //windows.net/lehrpool -> ${COMMON_SHARE_MOUNT_POINT}/lehrpool - local TARGET_DIR="${COMMON_SHARE_MOUNT_POINT}/$(basename ${SHARE_PATH})" - # it exists, so let's create ${COMMON_SHARE_MOUNT_POINT}/lehrpool_${SHARE_NUM} - [ -d "${TARGET_DIR}" ] && TARGET_DIR="${TARGET_DIR}_${SHARE_NUM}" + # TODO: here we will have to evaluate options of NFS-shares - # at this point is TARGET_DIR pointing to the right directory. - mkdir -p "${TARGET_DIR}" || \ - { slxlog "pam-share-mkdirfail" "Share${SHARE_NUM}: Could not create directory '${TARGET_DIR}'. Skipping share."; return; } - # now try to mount it - ( mount ${MOUNT_OPTS} "${SHARE_PATH}" "${TARGET_DIR}" > "${MOUNT_OUTPUT}" 2>&1 || touch "${SIGNAL}" ) & - MOUNT_PID=$! - for COUNTER in 1 1 2 4; do - kill -0 "${MOUNT_PID}" 2>/dev/null || break - sleep "${COUNTER}" - done + # unless specified otherwise, mount the share read-only + [ "x${SHARE_PERM}" != "xrw" ] && SHARE_PERM='ro' + MOUNT_OPTS="${MOUNT_OPTS},${SHARE_PERM}" + fi - # check for failures - if [ -e "${SIGNAL}" ]; then - slxlog "pam-share-mount" "Mount of '${SHARE_PATH}' to '${TARGET_DIR}' failed. (Args: ${MOUNT_OPTS}" "${MOUNT_OUTPUT}" - rm -f -- "${SIGNAL}" - elif kill -9 "${MOUNT_PID}" 2>/dev/null; then - slxlog "pam-share-mount" "Mount of '${SHARE_PATH}' to '${TARGET_DIR}' timed out. (Args: ${MOUNT_OPTS}" "${MOUNT_OUTPUT}" - fi - ( sleep 2; rm -f -- "${MOUNT_OUTPUT}" ) & + ############################################################################ + # + # Following code is independent of the type of share. + # The variable MOUNT_OPTS should have been set correctly + # up to this point. + # + ############################################################################ + + # we just mount it to the directory with the same name as the + # last directory in the path name of the share + # e.g. //windows.net/lehrpool -> ${COMMON_SHARE_MOUNT_POINT}/lehrpool + local TARGET_DIR="${COMMON_SHARE_MOUNT_POINT}/$(basename ${SHARE_PATH})" + # it exists, so let's create ${COMMON_SHARE_MOUNT_POINT}/lehrpool_${SHARE_NUM} + [ -d "${TARGET_DIR}" ] && TARGET_DIR="${TARGET_DIR}_${SHARE_NUM}" + + # at this point is TARGET_DIR pointing to the right directory. + mkdir -p "${TARGET_DIR}" || \ + { slxlog "pam-share-mkdirfail" "Share${SHARE_NUM}: Could not create directory '${TARGET_DIR}'. Skipping share."; return; } + + # flag for failure + SIGNAL=$(mktemp) + rm -f -- "${SIGNAL}" + # output of command + MOUNT_OUTPUT=$(mktemp) + # now try to mount it + ( mount ${MOUNT_OPTS} "${SHARE_PATH}" "${TARGET_DIR}" > "${MOUNT_OUTPUT}" 2>&1 || touch "${SIGNAL}" ) & + MOUNT_PID=$! + for COUNTER in 1 1 2 4; do + kill -0 "${MOUNT_PID}" 2>/dev/null || break + sleep "${COUNTER}" + done - # always unset credentials - unset USER - unset PASSWD + # check for failures + if [ -e "${SIGNAL}" ]; then + slxlog "pam-share-mount" "Mount of '${SHARE_PATH}' to '${TARGET_DIR}' failed. (Args: ${MOUNT_OPTS}" "${MOUNT_OUTPUT}" + rm -f -- "${SIGNAL}" + elif kill -9 "${MOUNT_PID}" 2>/dev/null; then + slxlog "pam-share-mount" "Mount of '${SHARE_PATH}' to '${TARGET_DIR}' timed out. (Args: ${MOUNT_OPTS}" "${MOUNT_OUTPUT}" fi + ( sleep 2; rm -f -- "${MOUNT_OUTPUT}" ) & + + # always unset credentials + unset USER + unset PASSWD } -################################################################### +############################################################################ # -# MAIN SCRIPT +# MAIN LOGIC OVER ALL SHARES # +############################################################################ # at this point we need the slx config to do anything [ -e "/opt/openslx/config" ] || \ { slxlog "pam-share-noconfig" "File '/opt/openslx/config' not found."; return; } -- cgit v1.2.3-55-g7522 From af001dfa0ccf839f07860b25c939a8b730dda433 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Wed, 8 Apr 2015 16:54:33 +0200 Subject: [vmchooser2] TESTING: run_virt generates SHARELW.CFG in B: with share information from /opt/openslx/config --- .../modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt index d41bf564..4af1ad29 100755 --- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt @@ -531,6 +531,11 @@ cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml" xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" # Add our magic openslx binary that sets the correct guest resolution cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/" +for SHARE in $(grep -o -E '^SLX_SHARE_.*_PATH' /opt/openslx/config); do + eval echo -n "\$${SHARE} \$${SHARE%PATH}PERM" >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" + echo -e '\r\n' >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" +done + # Try to use dnbd3 to access the image unset vm_diskfile -- cgit v1.2.3-55-g7522 From 15d817f0ba493102409a6a6c349bb7d6d19f0667 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 9 Apr 2015 14:51:31 +0200 Subject: [vmchooser2] A sick prototype windows batch file, copying this file into fd.img --- .../data/opt/openslx/scripts/vmchooser-run_virt | 1 + .../data/opt/openslx/vmchooser/data/SHARELWS.BAT | 33 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT (limited to 'remote/modules') diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt index 4af1ad29..f0cc5f04 100755 --- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt @@ -531,6 +531,7 @@ cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml" xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" # Add our magic openslx binary that sets the correct guest resolution cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/" +cp "$VMCHOOSER_DIR/data/SHARELWS.BAT" "$VMCHOOSER_DIR/fd-loop/" for SHARE in $(grep -o -E '^SLX_SHARE_.*_PATH' /opt/openslx/config); do eval echo -n "\$${SHARE} \$${SHARE%PATH}PERM" >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" echo -e '\r\n' >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" diff --git a/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT b/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT new file mode 100644 index 00000000..609c4f98 --- /dev/null +++ b/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT @@ -0,0 +1,33 @@ +@echo off + +setlocal EnableDelayedExpansion + +rem Konfigdatei auslesen und erstmal in Feld: +set n=0 +for /f %%i in (b:\sharelw.cfg) do ( + set array[!n!]=%%i + set /A n+=1 +) + +rem Aufruf für net use erzeugen: +set "i=0" +for %%b in (K L M N O P Q R S T U V W X Y Z) do ( + if defined array[!i!] ( + call set aufruf[!i!]=%%b: %%array[!i!]%% + set /A "i+=1" + ) else ( + goto :Schleifenende + ) +) +:Schleifenende + +rem net use-Aufrufe +set "i=0" +:Ausdrucken +if defined aufruf[!i!] ( + call net use %%aufruf[!i!]%% + set /a "i+=1" + GOTO :Ausdrucken +) + +exit /B -- cgit v1.2.3-55-g7522 From 52f1c45f1d777cde11fe5647f66f3878197dad21 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Fri, 10 Apr 2015 17:10:07 +0200 Subject: [vmchooser2] Ugly hack for sharelws.bat to wait 5 sec via ping (as cmd has no wait/sleep etc until Win7) --- .../vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT b/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT index 609c4f98..01838705 100644 --- a/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT +++ b/remote/modules/vmchooser2/data/opt/openslx/vmchooser/data/SHARELWS.BAT @@ -2,6 +2,13 @@ setlocal EnableDelayedExpansion +rem Kein sleep oder timeout bis Win7, also einen +rem haesslichen Hack (Zeitverz. ca. 5 sec) +rem Sinn der Verzoegerung: Mitunter (1/3) wird +rem sonst das erste Netzlaufwerk nicht eingehaengt + +@ping -n 5 localhost> nul + rem Konfigdatei auslesen und erstmal in Feld: set n=0 for /f %%i in (b:\sharelw.cfg) do ( -- cgit v1.2.3-55-g7522 From f282fad2b87faf8c7fafb4c3d25cfc69f32f9cac Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 10 Apr 2015 18:20:55 +0200 Subject: [vmchooser2] generate sharelw.cfg file [wip] --- remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt index 4af1ad29..955b9069 100755 --- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt @@ -531,8 +531,10 @@ cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml" xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" # Add our magic openslx binary that sets the correct guest resolution cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/" +rm "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" for SHARE in $(grep -o -E '^SLX_SHARE_.*_PATH' /opt/openslx/config); do - eval echo -n "\$${SHARE} \$${SHARE%PATH}PERM" >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" + eval "echo -n \$${SHARE} | /opt/openslx/bin/tr '/' '\' " >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" + eval echo -n " \$${SHARE%PATH}AUTH_PASS /user:\$${SHARE%PATH}AUTH_USER" >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" echo -e '\r\n' >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG" done -- cgit v1.2.3-55-g7522 From b60f27776ba0e1cf08ed864abe19dc9ba0283f2f Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 12 May 2015 17:08:08 +0200 Subject: [vbox] CAUTION: COMPATIBILITY BREAK to V3! virtualbox runs now, needs further work eg. fullscreen, Shared folders, less GUI messages etc. --- .../openslx/vmchooser/virtualbox/machine.include | 181 ++++++++++++++------- .../openslx/vmchooser/virtualbox/run-virt.include | 37 ++++- .../vmchooser/virtualbox/virtualbox.include | 6 +- remote/modules/vbox/module.conf | 4 +- remote/modules/vbox/module.conf.ubuntu.14 | 4 +- 5 files changed, 164 insertions(+), 68 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include index d1c77f02..48610aea 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/machine.include @@ -9,39 +9,49 @@ # # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- -# Include file (machine template) for run-virt.include of the OpenSLX virtual- -# box plugin +# Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${machconfig}" - + + + + + + + + - - + + - + + + + + - + + + + - - + + + @@ -51,74 +61,131 @@ cat << EOF > "${machconfig}" - + + + + + + + - <${network_kind}/> + <${network_kind}/> - + - - - - - - + + + + + + + - + - - + + + + + - - - + $sharelist + + - - + + + + + + - --> - - + - + + - - - - - - - - EOF + diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include index 161fcf5a..ddf42f7c 100755 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/run-virt.include @@ -25,7 +25,7 @@ confdir="/tmp/virt/${self}/${USER}/${VM_ID}" # dir for configs export VBOX_USER_HOME=${confdir} # instead of $HOME/.VirtualBox # define dirs and files which can be removed after exit, be carefull! RMDIRS="${snapshotdir} ${confdir} /tmp/virt/.vbox-${USER}-ipc" -rm -rf ${RMDIRS} 2>/dev/null +# rm -rf ${RMDIRS} 2>/dev/null machfolder="${confdir}/Machines" # use vm_shortname for dir and config names since vm_name can be very long machconfig="${machfolder}/${vm_shortname}/${vm_shortname}.xml" @@ -64,6 +64,9 @@ enablevt="false" # VT: Default: not enabled [ ${vtflag} -eq 0 ] && cpu_cores=1 # check for VT, if not available only 1 cpu supported [ ${vtflag} -eq 1 ] && enablevt="true" +# Setting some default variables +shfolders="TRUE" + # set some base configuration depending on the guest operating system case "${vmostype}" in win31*) @@ -74,6 +77,17 @@ case "${vmostype}" in vram="16" cpu_cores=1 enablevt="false" + shfolders="FALSE" + ;; + winnt*) + guestaudio="SB16" + vb_network_card="Am79C973" + vmostype="Windows31" + mem="32" + vram="16" + cpu_cores=1 + enablevt="false" + shfolders="FALSE" ;; win95*) vmostype="Windows95" @@ -83,6 +97,7 @@ case "${vmostype}" in vram="32" cpu_cores=1 enablevt="false" + shfolders="FALSE" ;; win98*) vmostype="Windows98" @@ -91,6 +106,7 @@ case "${vmostype}" in mem="256" vram="64" cpu_cores=1 + shfolders="FALSE" ;; winme*) vmostype="WindowsMe" @@ -99,6 +115,7 @@ case "${vmostype}" in mem="256" vram="64" cpu_cores=1 + shfolders="FALSE" ;; winxp*|windowsxp*) vmostype="WindowsXP" @@ -165,7 +182,8 @@ machineuuid="00000000-0000-0000-0000-${macaddr}" # machine UUID, MAC addr part o machineuuid=$(echo ${machineuuid} | tr "[A-Z]" "[a-z]") # cosmetical, since UUID in lower case # get UUID of VBox image, if not diskless [ ${diskless} -eq 0 ] && diskuuid=$(VBoxManage -q showvdiinfo ${diskfile} \ - | grep UUID | grep -v "Parent UUID" | awk '{print $2}') + | grep UUID | grep -v "Parent UUID" | awk '{print $2}' \ + | grep -v use ) # nec. for VBox >= 4 imgtype="Immutable" # make disk immutable snapshotuuid="34f617be-192a-46b3-a8ae-bce1029e093f" # snapshot UUID is static @@ -335,7 +353,18 @@ writelog "\tShared Folders '${sharename}':\t${sharepath}" ################################################################################ # create Virtualbox.xml -. ${VMCHOOSERVBOX}/virtualbox.include # create Virtualbox.xml + +# Shares given? +if [ "x$shfolders" != "xFALSE" ]; then + sharelist=" + + + " +else + sharelist='' +fi + +source ${VMCHOOSERVBOX}/virtualbox.include # create Virtualbox.xml # remove snapshot disk when using rw images if [ "${imgtype}" != "Immutable" ]; then @@ -345,7 +374,7 @@ fi # TODO: add rawdisk if requested #"raw.vmdk" format="VMDK" type="Writethrough"/> -. ${VMCHOOSERVBOX}/machine.include # create machine.xml +source ${VMCHOOSERVBOX}/machine.include # create machine.xml # remove CD-ROM if not available if [ "${cdrom0}" != "TRUE" ]; then diff --git a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include index 477eebde..36c8ab80 100644 --- a/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include +++ b/remote/modules/vbox/data/opt/openslx/vmchooser/virtualbox/virtualbox.include @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# Copyright (c) 2010..2013 - OpenSLX GmbH +# Copyright (c) 2010..2012 - OpenSLX GmbH # # This program/file is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -10,9 +10,9 @@ # General information about OpenSLX can be found at http://openslx.org # ----------------------------------------------------------------------------- # Include file (general template) for run-virt.include of the virtualbox plugin + cat << EOF > "${confdir}/VirtualBox.xml" - - + diff --git a/remote/modules/vbox/module.conf b/remote/modules/vbox/module.conf index 60cea223..6d79a1e7 100644 --- a/remote/modules/vbox/module.conf +++ b/remote/modules/vbox/module.conf @@ -1,7 +1,7 @@ REQUIRED_VBOX_VERSION_MAJOR="4.3" -REQUIRED_VBOX_VERSION_MINOR="8" +REQUIRED_VBOX_VERSION_MINOR="26" REQUIRED_VBOX_VERSION="$REQUIRED_VBOX_VERSION_MAJOR.$REQUIRED_VBOX_VERSION_MINOR" -REQUIRED_VBOX_VERSIONCODE="92456" +REQUIRED_VBOX_VERSIONCODE="98988" REQUIRED_DIRECTORIES=" /etc diff --git a/remote/modules/vbox/module.conf.ubuntu.14 b/remote/modules/vbox/module.conf.ubuntu.14 index 5691459b..59ed5ca7 100644 --- a/remote/modules/vbox/module.conf.ubuntu.14 +++ b/remote/modules/vbox/module.conf.ubuntu.14 @@ -1,5 +1,5 @@ -REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. Should be changed when - # version for 14.04 appears on virtualbox.org. +REQUIRED_VBOX_OSCODE='Ubuntu~raring' # raring: 13.04, but also used here. Has not be changed when + # version for 14.04 appeared on virtualbox.org. REQUIRED_VBOXBASEURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/virtualbox-${REQUIRED_VBOX_VERSION_MAJOR}_${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}~${REQUIRED_VBOX_OSCODE}_${AMD64_I386}.deb" REQUIRED_VBOXEXTURL="http://download.virtualbox.org/virtualbox/${REQUIRED_VBOX_VERSION}/Oracle_VM_VirtualBox_Extension_Pack-${REQUIRED_VBOX_VERSION}-${REQUIRED_VBOX_VERSIONCODE}.vbox-extpack" -- cgit v1.2.3-55-g7522