From 3f48f70dce5ea79774400a5fa5ee807c99b5ef06 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Fri, 7 Feb 2014 14:17:23 +0100 Subject: [50-mltk-blacklist]: Commentary to blacklisted modules --- .../rootfs/rootfs-stage32/data/etc/modprobe.d/50-mltk-blacklist.conf | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3-55-g7522 From 8224a72b79987b39f4b632234d81084d80d98a20 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 7 Feb 2014 18:20:21 +0100 Subject: [rfs-stage31] Some benchmarking/profiling features --- remote/rootfs/rootfs-stage31/data/inc/functions | 8 +++++++- remote/rootfs/rootfs-stage31/data/inc/setup_stage32 | 10 +++++++++- remote/rootfs/rootfs-stage31/data/init | 10 +++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) 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..b542a715 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..." @@ -115,6 +121,8 @@ for mnt in proc sys run ; do done echo "Switching root...." +bench_event "PRESWITCH" "Switching to stage 3.2" +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=/ -- cgit v1.2.3-55-g7522 From 2fa9696eac4c7c3a0402eb4bb63cc9ed35e1b580 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Fri, 7 Feb 2014 19:09:01 +0100 Subject: [printergui, vmchooser] Bugfixes, net systemd service etc., printpwgui --- .../system/network.target.wants/printergui.service | 1 + .../data/etc/systemd/system/printergui.service | 8 ++++++++ .../openslx/scripts/systemd-printergui_preparation | 20 ++++++++++++++++++++ remote/modules/printergui/printergui.build | 10 ++++++---- remote/modules/printergui/printergui.conf | 4 +++- .../data/opt/openslx/scripts/vmchooser-run_virt | 2 +- 6 files changed, 39 insertions(+), 6 deletions(-) create mode 120000 remote/modules/printergui/data/etc/systemd/system/network.target.wants/printergui.service create mode 100644 remote/modules/printergui/data/etc/systemd/system/printergui.service create mode 100755 remote/modules/printergui/data/opt/openslx/scripts/systemd-printergui_preparation 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..7abb1899 100644 --- a/remote/modules/printergui/printergui.conf +++ b/remote/modules/printergui/printergui.conf @@ -1,7 +1,9 @@ REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git" -REQUIRED_COMMIT="e36d365f291702528f8bd47d2f9" +#REQUIRED_COMMIT="e36d365f291702528f8bd47d2f9" +REQUIRED_COMMIT="HEAD" REQUIRED_BINARIES=" printergui + printpwgui " REQUIRED_SYSTEM_FILES=" " 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="$!" -- cgit v1.2.3-55-g7522 From bbff6d544ffd8d631bf119c297dda75bb757ead3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 9 Feb 2014 19:09:12 +0100 Subject: [rfs-stage31] Last benchmark event moved before umount --- remote/rootfs/rootfs-stage31/data/init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index b542a715..95495684 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -115,13 +115,15 @@ 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...." -bench_event "PRESWITCH" "Switching to stage 3.2" 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 -- cgit v1.2.3-55-g7522 From 40ebaece9ed5ae10b4bffa49bf1566a8bf1aa153 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 11 Feb 2014 16:17:35 +0100 Subject: [distribution.inc] Added SYS_CODENAME: Ubuntu eg. -> raring, openSuse eg. -> Dartmouth --- remote/includes/distribution.inc | 1 + 1 file changed, 1 insertion(+) 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" -- cgit v1.2.3-55-g7522 From a99bf124224d3b54a4075a1ce889375fef3bbb3e Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 11 Feb 2014 16:24:28 +0100 Subject: [helper/distribution.inc] Comment: Why this has not meen moved. --- helper/distribution.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helper/distribution.inc b/helper/distribution.inc index 51a01eae..5c371fcf 100644 --- a/helper/distribution.inc +++ b/helper/distribution.inc @@ -1,2 +1,4 @@ # Get simple distribution name +# This is not also being used via ./openslx, not only via ./mltk, +# so it has not been moved to remote/includes. SYS_DISTRIBUTION=$(lsb_release -is | tr '[A-Z]' '[a-z]' | sed -r 's/[^a-z0-9]//g;s/project$//g;s/scientificsl$/scientific/g') -- cgit v1.2.3-55-g7522 From cf8c53cdda98f9c3e1efe6a0fd7e3e84c5bdccb1 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 11 Feb 2014 16:42:02 +0100 Subject: [helper/distribution.inc] Typo in comment: Why this has not meen moved. --- helper/distribution.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper/distribution.inc b/helper/distribution.inc index 5c371fcf..f26ca46c 100644 --- a/helper/distribution.inc +++ b/helper/distribution.inc @@ -1,4 +1,4 @@ # Get simple distribution name -# This is not also being used via ./openslx, not only via ./mltk, +# This is also being used via ./openslx, not only via ./mltk, # so it has not been moved to remote/includes. SYS_DISTRIBUTION=$(lsb_release -is | tr '[A-Z]' '[a-z]' | sed -r 's/[^a-z0-9]//g;s/project$//g;s/scientificsl$/scientific/g') -- cgit v1.2.3-55-g7522 From 15831fa1bbefa657b1b1f8b02352b80e2d0ac1df Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 11 Feb 2014 17:48:10 +0100 Subject: [smbclient] Make sure directory exists before making sure file exists..... --- remote/modules/smbclient/data/etc/tmpfiles.d/ensure-smbconf-exists.conf | 2 ++ 1 file changed, 2 insertions(+) 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 - + -- cgit v1.2.3-55-g7522 From 195206db3c318c20fe6e31c287fc3fa0bee6e98b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 11 Feb 2014 17:52:46 +0100 Subject: [printergui] config cleanup --- remote/modules/printergui/printergui.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/remote/modules/printergui/printergui.conf b/remote/modules/printergui/printergui.conf index 7abb1899..17203d3e 100644 --- a/remote/modules/printergui/printergui.conf +++ b/remote/modules/printergui/printergui.conf @@ -1,5 +1,4 @@ REQUIRED_GIT="git://git.openslx.org/openslx-ng/printergui.git" -#REQUIRED_COMMIT="e36d365f291702528f8bd47d2f9" REQUIRED_COMMIT="HEAD" REQUIRED_BINARIES=" printergui -- cgit v1.2.3-55-g7522