summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorChristian Rößler2014-02-11 18:05:34 +0100
committerChristian Rößler2014-02-11 18:05:34 +0100
commit7af4a967ced3c8a791e965dcef1a4be25fb42688 (patch)
tree4588199df31b6aabac9bf3ddf7cc0a0105a24def /remote
parent[kernel] POSSIBLE BREAKER! kernel now per git, -distro switches, added config... (diff)
parent[printergui] config cleanup (diff)
downloadtm-scripts-7af4a967ced3c8a791e965dcef1a4be25fb42688.tar.gz
tm-scripts-7af4a967ced3c8a791e965dcef1a4be25fb42688.tar.xz
tm-scripts-7af4a967ced3c8a791e965dcef1a4be25fb42688.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote')
-rw-r--r--remote/includes/distribution.inc1
l---------remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service1
-rw-r--r--remote/modules/printergui/data/etc/systemd/system/printergui.service8
-rwxr-xr-xremote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation20
-rw-r--r--remote/modules/printergui/printergui.build10
-rw-r--r--remote/modules/printergui/printergui.conf3
-rw-r--r--remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf2
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt2
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/functions8
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/setup_stage3210
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/init12
-rw-r--r--remote/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf4
12 files changed, 72 insertions, 9 deletions
diff --git a/remote/includes/distribution.inc b/remote/includes/distribution.inc
index 64190986..7a7be738 100644
--- a/remote/includes/distribution.inc
+++ b/remote/includes/distribution.inc
@@ -28,6 +28,7 @@ detect_distribution () {
esac
# Get version - we mangle this quite a bit. first make sure it has no spaces, then split version at period (.), underscore (_) and dash (-)
SYS_VERSION=$(lsb_release -rs | tolower)
+ SYS_CODENAME=$(lsb_release -c|cut -f 2) # Codename: eg. Ubuntu raring, openSuse: Dartmouth etc.
local VERSION=$(echo $SYS_VERSION | sed -r 's/\s//g;s/[\._]/ /g;s/-//g')
local STRTMP=""
PRINT_SYS_VERSIONS="*.conf.$SYS_DISTRIBUTION"
diff --git a/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service b/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service
new file mode 120000
index 00000000..40453c80
--- /dev/null
+++ b/remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service
@@ -0,0 +1 @@
+../printergui.service \ No newline at end of file
diff --git a/remote/modules/printergui/data/etc/systemd/system/printergui.service b/remote/modules/printergui/data/etc/systemd/system/printergui.service
new file mode 100644
index 00000000..8b00514c
--- /dev/null
+++ b/remote/modules/printergui/data/etc/systemd/system/printergui.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Printergui - bwLehrpool printing system
+Requires=network.target graphical.target
+After=network.target
+Before=cups.service
+
+[Service]
+ExecStart=/opt/openslx/scripts/systemd-printergui_preparation
diff --git a/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation b/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation
new file mode 100755
index 00000000..33a861e6
--- /dev/null
+++ b/remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation
@@ -0,0 +1,20 @@
+#!/bin/ash
+
+ERR=0
+SRCDIR=/usr/lib/cups/backend
+DESTDIR=/opt/openslx/cups/backend
+PRINTPWGUI=/opt/openslx/cups/printpwgui
+
+if [ ! -d "$DESTDIR" ]; then
+ mkdir -p "$DESTDIR" || exit 1
+fi
+
+mv "$SRCDIR"/* "$DESTDIR"
+
+cd "$SRCDIR"
+for i in "$DESTDIR"/*; do
+ ln -sf "$PRINTPWGUI" $(basename "$i")
+done
+
+exit 0
+
diff --git a/remote/modules/printergui/printergui.build b/remote/modules/printergui/printergui.build
index a11469d2..62b7c103 100644
--- a/remote/modules/printergui/printergui.build
+++ b/remote/modules/printergui/printergui.build
@@ -9,13 +9,15 @@ fetch_source() {
build() {
local SRCDIR="${MODULE_DIR}/src/"
+ local DESTDIR="$MODULE_BUILD_DIR/opt/openslx/cups"
- mkdir -p "$MODULE_BUILD_DIR/opt/openslx/bin"
- cd "${MODULE_BUILD_DIR}/opt/openslx/bin" || perror "Could not cd!"
- pinfo "Running qmake"
- qmake "$SRCDIR/src/printergui.pro" -r -spec linux-g++ || perror "'qmake' failed (e.g. not installed)."
+ mkdir -p "$DESTDIR"
+ cd "$DESTDIR" || perror "Could not cd to $DESTDIR!"
+ pinfo "Running cmake"
+ cmake "$SRCDIR/" || perror "'cmake' failed (e.g. not installed)."
pinfo "Running make"
make || perror "'make' failed."
+ chmod 0700 "$DESTDIR/printpwgui" # So picky cupsd won't drop privileges to lp
}
post_copy() {
mkdir -p "${TARGET_BUILD_DIR}/var/spool/STANDARD"
diff --git a/remote/modules/printergui/printergui.conf b/remote/modules/printergui/printergui.conf
index c556444e..17203d3e 100644
--- a/remote/modules/printergui/printergui.conf
+++ b/remote/modules/printergui/printergui.conf
@@ -1,7 +1,8 @@
REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git"
-REQUIRED_COMMIT="e36d365f291702528f8bd47d2f9"
+REQUIRED_COMMIT="HEAD"
REQUIRED_BINARIES="
printergui
+ printpwgui
"
REQUIRED_SYSTEM_FILES="
"
diff --git a/remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf b/remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf
index 118739d1..f893eb71 100644
--- a/remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf
+++ b/remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf
@@ -1,2 +1,4 @@
# smbspool for some reason insists on reading this file, even if it is empty, otherwise it will bail out
+d /etc/samba 0755 root root -
f /etc/samba/smb.conf 0644 root root -
+
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
index 49fd98d4..9442635a 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
@@ -445,7 +445,7 @@ QUEUE="STANDARD"
# FixMe: Solution for general printer redirection in other cases (iptables on outgoing port)
tcpsvd -E 192.168.101.1 5515 \
lpd "$SPOOLDIR" \
- sh -c "printergui $USER $SPOOLDIR/$QUEUE/\$DATAFILE" &
+ sh -c "/opt/openslx/cups/printergui $USER $SPOOLDIR/$QUEUE/\$DATAFILE" &
# PID to kill the process
PID_LPD="$!"
diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions
index ce510aac..161533ef 100644
--- a/remote/rootfs/rootfs-stage31/data/inc/functions
+++ b/remote/rootfs/rootfs-stage31/data/inc/functions
@@ -23,7 +23,7 @@ drop_shell() {
# Usage:
# read_from_cmdline OPTION
#
-read_from_cmdline(){
+read_from_cmdline() {
[ $# -ne 1 ] && echo "Error - 'read_from_cmdline' requires 1 argument, $# given." && exit 1
local OPTION="$1"
@@ -89,3 +89,9 @@ download() {
return 1
}
+# Add benchmark event to var, including uptime as prefix
+bench_event() {
+ bench_result="${bench_result}$(cut -f 1 -d ' ' "/proc/uptime") $@
+"
+}
+
diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
index ba8bad00..9bf30d25 100755
--- a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
+++ b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
@@ -3,7 +3,7 @@
# This script sets up the stage 3.2.
# - downloads/mounts stage32.sqfs
# - merge it with current rootfs through aufs
-# - will not download, if the "nfs=" is used in the
+# - will not download, if the "nfs=" is used in the
# kernel command line
#
#########################################################################
@@ -56,6 +56,14 @@ if [ $SPLASH -eq 1 ]; then
fi
fi
+# Kinda specific for virtualization environment: Autologin and run VM for benchmarks
+if [ -n "$SLX_BENCHMARK_VM" ]; then
+ # Enable KDM autologin for demo user
+ sed -i 's/^AutoLoginUser=.*//;s/^AutoLoginEnable=.*/AutoLoginEnable=true\nAutoLoginUser=demo/' "${FUTURE_ROOT}/etc/kde4/kdm/kdmrc"
+ # Running the VM automatically has to be taken care of by run-virt and vmchooser. SLX_BENCHMARK_VM should contain
+ # a numeric value for the index in vmchooser
+fi
+
# "Delete" addon hook-script in aufs view
touch "/mnt/opt/openslx/uniontmp/.wh.addon-init"
diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init
index 8789caa5..95495684 100755
--- a/remote/rootfs/rootfs-stage31/data/init
+++ b/remote/rootfs/rootfs-stage31/data/init
@@ -19,9 +19,10 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin
. "/inc/functions"
# mount the important standard directories
-busybox mount -n -t tmpfs -o 'mode=755' run "/run"
[ ! -f /proc/cpuinfo ] && busybox mount -n -t proc proc /proc
+bench_event "KERNEL" "Kernel initialized"
[ ! -d /sys/class ] && busybox mount -n -t sysfs sysfs /sys
+busybox mount -n -t tmpfs -o 'mode=755' run "/run"
# preparations for mounting stage3.2
FUTURE_ROOT="/dev/shm/uniontmp"
@@ -79,6 +80,7 @@ fi
# discover devices
mdev -s
+bench_event "MDEV" "mdev done"
# suppress kernel output if neither DEBUG nor SPLASH is set
if [ $SPLASH -eq 0 ]; then
@@ -88,14 +90,18 @@ fi
[ $DEBUG -ge 4 ] && drop_shell "Requested Debug Shell: before network."
. "/inc/setup_network" || . "/inc/setup_network_retry" || drop_shell "Error setting up network"
+bench_event "NETWORK" "Network up and running"
[ $DEBUG -ge 3 ] && drop_shell "Requested Debug Shell: after network/before configuring."
. "/inc/activate_sysconfig" || drop_shell "Could not source /bin/activate_sysconfig"
+bench_event "CONFIG" "Downloaded config"
+# From here on, we have all the vars from /opt/openslx/config
[ $DEBUG -ge 2 ] && drop_shell "Requested Debug Shell: after configuration/before stage32."
. "/inc/setup_stage32" || drop_shell "Problem setting up stage3.2"
+bench_event "STAGE32" "Downloaded stage 3.2"
# copy files needed for stage3.2 to FUTURE_ROOT
echo "Copying busybox etc. to stage32..."
@@ -109,12 +115,16 @@ fi
# one last debug shell if activated
[ $DEBUG -ge 1 ] && drop_shell "Requested Debug Shell: before switch_root."
+# need /proc for this ;)
+bench_event "PRESWITCH" "Switching to stage 3.2"
+
# unmount filesystems
for mnt in proc sys run ; do
busybox umount -f -l "/$mnt" 2>/dev/null
done
echo "Switching root...."
+echo "$bench_result" > "${FUTURE_ROOT}/opt/openslx/.benchmark"
# Prepare environment (HOME is needed as a hack for nss_ldap with ssl and no caching)
unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF DEBUG OLDPWD
export HOME=/
diff --git a/remote/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf b/remote/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf
index 17e42fcf..00be09ca 100644
--- a/remote/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf
+++ b/remote/rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf
@@ -3,5 +3,9 @@
# Intel corporation 82Q35 Express MEI controller spams syslog under
# some 3.0 kernels
blacklist mei
+
+# pcspeaker device driver
blacklist pcspkr
+
+# Strange device driver for alsa via pcspeaker
blacklist snd-pcsp