summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgenerate_bootmenu.sh131
-rw-r--r--remote/modules/openbox/data/etc/xdg/openbox/menu.xml29
-rw-r--r--remote/modules/openbox/openbox.build18
-rw-r--r--remote/modules/openbox/openbox.conf12
-rwxr-xr-xremote/modules/vmplayer/data/etc/openslx/vmware/vmware-env7
-rw-r--r--remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf8
-rwxr-xr-xremote/modules/vmplayer/data/opt/openslx/bin/vmplayer10
-rw-r--r--remote/modules/vmplayer/vmplayer.build6
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++2
-rw-r--r--remote/rootfs/rootfs-stage32/rootfs-stage32.build3
l---------remote/targets/stage32/openbox1
-rwxr-xr-xuseful/ultrastrace.php22
12 files changed, 226 insertions, 23 deletions
diff --git a/generate_bootmenu.sh b/generate_bootmenu.sh
new file mode 100755
index 00000000..de3dc24e
--- /dev/null
+++ b/generate_bootmenu.sh
@@ -0,0 +1,131 @@
+#!/bin/bash
+
+# This is a temporary script to create/update the PXE boot menu
+# for OpenSLX-NG. It is designed to facilitate testing in early
+# stages and will be replaced by more sophisticated scripts or tools
+# later on.
+# - Simon Rettberg
+
+MLTK_PID="$$"
+qnd_exit() {
+ unset_quiet
+ kill "$MLTK_PID"
+ [ $# -ge 1 ] && kill "$1"
+}
+
+
+. "helper/logging.inc"
+
+[ $# -lt 1 ] && perror "Usage: $0 <this server's ip address>"
+
+[ ! -d "server/boot" ] && perror "Not in tm-scripts root directory or no cloned systems created."
+
+cd "server/boot" || perror "Could not cd to server/boot"
+
+SERVERIP="$1"
+
+ifconfig | grep -- "$SERVERIP" > /dev/null
+RET=$?
+if [ "x$RET" != "x0" ]; then
+ pwarning "Given server IP '$SERVERIP' not found in ifconfig output. Are you sure this machine is reachable with this address?"
+ sleep 2
+fi
+
+# generate config header
+LINKLOC="/srv/openslx/www"
+if [ -L "$LINKLOC/boot" -o ! -e "$LINKLOC/boot" ]; then
+ ln -sf -t "$LINKLOC" "$(pwd)" "boot" || perror "Could not link $LINKLOC/boot to $(pwd)"
+fi
+mkdir -p "/srv/openslx/tftp/pxelinux.cfg" || perror "Could not create directory /srv/openslx/tftp/pxelinux.cfg"
+CONF="/srv/openslx/tftp/pxelinux.cfg/default"
+
+## This is the template for the boot menu
+cat > "$CONF" << HEREEND
+# generated by openslx-ng
+# if you intend to change this file, remember that it will
+# be overwritten by generate_bootmenu.sh
+# this file was generated $(date)
+
+DEFAULT vesamenu.c32
+
+# static configuration (override with include file)
+NOESCAPE 0
+PROMPT 0
+
+MENU BACKGROUND openslx.png
+MENU WIDTH 78
+MENU MARGIN 9
+MENU PASSWORDMARGIN 9
+MENU ROWS 10
+MENU TABMSGROW 16
+MENU CMDLINEROW 16
+MENU ENDROW -1
+MENU PASSWORDROW 16
+MENU TIMEOUTROW 20
+MENU HELPMSGROW 16
+MENU HELPMSGENDROW -1
+MENU HSHIFT 0
+MENU VSHIFT 7
+
+menu color screen 37;40 #80ffffff #00000000 std
+menu color border 37;40 #40000000 #ff8093a1 std
+menu color title 1;37;40 #ffff8b00 #ff8093a1 std
+menu color unsel 37;40 #fff0f0f0 #ff8093a1 std
+menu color hotkey 1;37;40 #ffff8b00 #ff8093a1 std
+menu color sel 7;37;40 #ff1c2a33 #667799bb all
+menu color hotsel 1;7;37;40 #ffff8b00 #667799bb all
+menu color disabled 1;37;40 #ffff8b00 #ff8093a1 std
+menu color scrollbar 37;40 #40000000 #ee000000 std
+menu color tabmsg 37;40 #ffff8b00 #ff8093a1 std
+menu color cmdmark 1;37;40 #ffff8b00 #ff8093a1 std
+menu color cmdline 37;40 #fff0f0f0 #ff8093a1 std
+menu color pwdborder 37;40 #40000000 #ff8093a1 std
+menu color pwdheader 37;40 #ffff8b00 #ff8093a1 std
+menu color pwdentry 37;40 #ffff8b00 #ff8093a1 std
+menu color timeout_msg 37;40 #fff0f0f0 #ff8093a1 std
+menu color timeout 1;37;40 #ffff8b00 #ff8093a1 std
+menu color help 37;40 #ff1c2a33 #00000000 none
+MENU MSGCOLOR #ff1c2a33 #00000000 none
+
+
+# slxsettings configuration
+TIMEOUT 600
+TOTALTIMEOUT 1800
+MENU TITLE OpenSLX-NG Preview
+
+HEREEND
+
+BASEDIR="$(pwd)"
+LABEL=0
+for BASE in $(ls "$BASEDIR"); do
+ pinfo "Found base $BASE....."
+ for STAGE31 in $(ls "$BASEDIR/$BASE/initramfs-stage31"*); do
+ STAGE31="$(basename "$STAGE31")"
+ SSTAGE31="$(echo "$STAGE31" | cut -c 19-)"
+ [ ! -z "$SSTAGE31" ] && SSTAGE31="(31-$SSTAGE31)"
+ pinfo " Found stage31 $SSTAGE31"
+ for STAGE32 in $(ls "$BASEDIR/$BASE/initramfs-stage32"*); do
+ STAGE32="$(basename "$STAGE32")"
+ SSTAGE32="$(echo "$STAGE32" | cut -c 19-)"
+ [ ! -z "$SSTAGE32" ] && SSTAGE32="(32-$SSTAGE32)"
+ pinfo " Found stage32 $SSTAGE32"
+ for KERNEL in $(ls "$BASEDIR/$BASE/kernel/vmlinuz-"*); do
+ KERNEL="$(basename "$KERNEL")"
+ KKERNEL="$(echo "$KERNEL" | cut -c 9-)"
+ pinfo " Found kernel $KKERNEL"
+ LABEL=$[$LABEL + 1]
+ # write out this combination
+ cat >> "$CONF" << HEREEND
+
+# --- $BASE --- $KERNEL --- $STAGE31 --- $STAGE32 --- #
+LABEL system$LABEL
+ MENU LABEL $BASE ($KKERNEL) $SSTAGE31 $SSTAGE32
+ KERNEL http://$SERVERIP/boot/$BASE/kernel/$KERNEL
+ INITRD http://$SERVERIP/boot/$BASE/$STAGE31,http://$SERVERIP/boot/$BASE/$STAGE32
+ IPAPPEND 3
+HEREEND
+ done
+ done
+ done
+done
+
diff --git a/remote/modules/openbox/data/etc/xdg/openbox/menu.xml b/remote/modules/openbox/data/etc/xdg/openbox/menu.xml
new file mode 100644
index 00000000..b53d6ae6
--- /dev/null
+++ b/remote/modules/openbox/data/etc/xdg/openbox/menu.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openbox_menu xmlns="http://openbox.org/"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://openbox.org/
+ file:///usr/share/openbox/menu.xsd">
+
+<menu id="root-menu" label="Openbox 3">
+ <item label="Cooler Terminal Emulator">
+ <action name="Execute"><execute>xterm</execute></action>
+ </item>
+ <item label="VM Chooser">
+ <action name="Execute"><execute>vmchooser -c /etc/openslx/vmchooser/vmchooser.conf</execute></action>
+ </item>
+ <!-- This requires the presence of the 'menu' package to work -->
+ <menu id="/Debian" />
+ <separator />
+ <menu id="client-list-menu" />
+ <separator />
+ <item label="Restart">
+ <action name="Restart" />
+ </item>
+ <separator />
+ <item label="Exit">
+ <action name="Exit" />
+ </item>
+</menu>
+
+</openbox_menu>
diff --git a/remote/modules/openbox/openbox.build b/remote/modules/openbox/openbox.build
new file mode 100644
index 00000000..3e56fbfb
--- /dev/null
+++ b/remote/modules/openbox/openbox.build
@@ -0,0 +1,18 @@
+fetch_source() {
+ :
+}
+
+build() {
+ COPYLIST="list_dpkg_output"
+ [ -e "$COPYLIST" ] && rm "$COPYLIST"
+
+ list_packet_files >> "$COPYLIST"
+ tarcopy "$(cat "$COPYLIST" | sort -u)" "${MODULE_BUILD_DIR}"
+
+ return 0
+}
+
+post_copy() {
+ [ ! -d "$TARGET_BUILD_DIR/etc/pango" ] && mkdir -p "$TARGET_BUILD_DIR/etc/pango"
+ pango-querymodules > "$TARGET_BUILD_DIR/etc/pango/pango.modules"
+}
diff --git a/remote/modules/openbox/openbox.conf b/remote/modules/openbox/openbox.conf
new file mode 100644
index 00000000..67c63c4c
--- /dev/null
+++ b/remote/modules/openbox/openbox.conf
@@ -0,0 +1,12 @@
+REQUIRED_DEPENDENCIES=" openbox
+ libpango1.0-0"
+REQUIRED_PACKAGES=" openbox
+ libpango1.0-0"
+REQUIRED_BINARIES=" openbox
+ openbox-session"
+REQUIRED_FILES=" /usr/share/xsessions/openbox.desktop"
+REQUIRED_DIRECTORIES=" /etc
+ /usr/lib/openbox
+ /usr/share/themes/Clearlooks
+ /usr/lib/$ARCH_TRIPLET/pango/"
+
diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
index f4901070..41360bb3 100755
--- a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
+++ b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware-env
@@ -14,6 +14,8 @@
# §generated§
# -----------------------------------------------------------------------------
+export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
+
#functions: helper functions
tempdir () {
# Create a special tempfs directory
@@ -54,7 +56,7 @@ if [ -n "$vmnet1" ] ; then
echo "1" >/proc/sys/net/ipv4/conf/vmnet1/forwarding 2>/dev/null
echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null
fi
- /opt/openslx/rootfs/usr/sbin/udhcpd \
+ /opt/openslx/usr/sbin/udhcpd \
-S /etc/vmware/udhcpd/udhcpd-vmnet1.conf
fi
if [ -n "$vmnet8" ] ; then
@@ -77,6 +79,7 @@ fi
vmblock () {
# let point the path directly to the directory where the binary lives
+# TODO: get it to work
/usr/bin/vmware-usbarbitrator
}
@@ -93,7 +96,7 @@ case "$1" in
tempdir
load_modules
vmnetif
- vmblock
+# vmblock
;;
stop)
diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
index a67adc18..5a52ca41 100644
--- a/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
+++ b/remote/modules/vmplayer/data/etc/openslx/vmware/vmware.conf
@@ -1,8 +1,8 @@
# configuration file for vmware background services written in stage3 setup
-vmnet0=true
-vmnet1=192.168.101.1/24
-vmnet1nat=true
-vmnet8=192.168.102.1/24
+#vmnet0=true
+#vmnet1=192.168.101.1/24
+#vmnet1nat=true
+#vmnet8=192.168.102.1/24
# stage1 variables produced during plugin install
version="5.0"
buildversion="1031769"
diff --git a/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer b/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer
index 2b6e8f31..030e9175 100755
--- a/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer
+++ b/remote/modules/vmplayer/data/opt/openslx/bin/vmplayer
@@ -1,14 +1,4 @@
#!/bin/sh
-
-for mod in /lib/modules/vmware/*.ko; do
- insmod "$mod" && continue
- xmessage "Could not load kernel module $mod. vmplayer might fail."
-done
-
-export LIBCONF_DIR=/usr/lib/vmware/libconf
-
-#/usr/lib/vmware/bin/vmplayer $@
-
# radically simplified version of the original script vmplayer by VMware Inc.
PREFIX=/usr/lib/vmware # depends on the vmware location
exec "$PREFIX"'/lib/wrapper-gtk24.sh' \
diff --git a/remote/modules/vmplayer/vmplayer.build b/remote/modules/vmplayer/vmplayer.build
index 07c55c6d..338a6958 100644
--- a/remote/modules/vmplayer/vmplayer.build
+++ b/remote/modules/vmplayer/vmplayer.build
@@ -1,4 +1,7 @@
fetch_source() {
+ #mount vmware bundle directory
+ [ ! -d /mnt/store/vmware ] && mkdir -p /mnt/store/vmware
+ mount -t nfs -o ro,async,nolock 132.230.8.113:/srv/vmext /mnt/store/vmware || perror "Could not mount vmware bundle directory. Exiting."
ARCH=$(uname -m)
[ "$ARCH" = "i686" ] && ARCH=i386
local BUNDLE="$(find /mnt/store/vmware -type f -name "VMware-Player*.${ARCH}.bundle" | head -1)"
@@ -125,6 +128,7 @@ EOF
mkdir -p "$TARGET_BUILD_DIR/lib/modules/vmware/"
cp "/lib/modules/$UTS_RELEASE/vmplayer/"* "$TARGET_BUILD_DIR/lib/modules/vmware/" || perror "Could not cp vmware modules to target!"
+ [ -e /etc/vmware/config ] && rm -f /etc/vmware/config
+ cp /etc/vmware/config.mltk.bak /etc/vmware/config
}
-
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++
index 256c6f49..f3d7d4c2 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++
@@ -7,4 +7,4 @@ NET_IP=$(ip addr show dev ${NET_IF} | grep "inet " | awk -F " " '{print $2}' | a
UDHCPC_OPTS=""
[ ! -z "$NET_IP" ] && UDHCPC_OPTS=" -r $NET_IP "
-/opt/openslx/sbin/udhcpc $UDHCPC_OPTS -O domain -O nissrv -O nisdomain -O wpad -t 8 -s /etc/udhcpc.openslx.script -i $NET_IF
+/opt/openslx/sbin/udhcpc $UDHCPC_OPTS -O domain -O nissrv -O nisdomain -O wpad -t 8 -s /etc/openslx/udhcpc.openslx.script -i $NET_IF
diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build
index bbd88a7e..0ca8d64c 100644
--- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build
+++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build
@@ -62,6 +62,9 @@ post_copy() {
# make basic directory structure
mkdir -p "${TARGET_BUILD_DIR}"/{bin,dev,proc,lib,etc,mnt,sys,var/run,var/lock,var/log,run/lock,run/shm,opt/openslx/mnt}
+ # make openslx log directory
+ mkdir -p "${TARGET_BUILD_DIR}"/var/log/openslx
+
# copy devices from running system
cp -a /dev/{console,kmsg,mem,null,shm,tty,tty0,tty1,tty9,fb0,urandom,zero} \
"${TARGET_BUILD_DIR}"/dev || perror "Copying devices from running system failed."
diff --git a/remote/targets/stage32/openbox b/remote/targets/stage32/openbox
new file mode 120000
index 00000000..0fb8d86d
--- /dev/null
+++ b/remote/targets/stage32/openbox
@@ -0,0 +1 @@
+../../modules/openbox \ No newline at end of file
diff --git a/useful/ultrastrace.php b/useful/ultrastrace.php
index eeff80c2..0caaf64a 100755
--- a/useful/ultrastrace.php
+++ b/useful/ultrastrace.php
@@ -5,6 +5,7 @@ if ($argc < 2) die("$argv[0] <tracefile>\n");
function parseTime($time)
{
+ if (isset($time['ts'])) return $time['ts'];
return $time['h'] * 3600 + $time['m'] * 60 + $time['s'];
}
@@ -13,6 +14,12 @@ $found = array();
array_shift($argv);
+$unique = false;
+if ($argv[0] == '-u') {
+ array_shift($argv);
+ $unique = true;
+}
+
foreach ($argv as $fname) {
$fh = fopen($fname, 'r');
if ($fh === false) die("File not found: $fname\n");
@@ -24,7 +31,7 @@ foreach ($argv as $fname) {
$lineNo++;
$line = fgets($fh);
// open("/lib/x86_64-linux-gnu/tls/x86_64/libkdeui.so.5", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
- if (preg_match('#^(\d+\s+)?(?<h>\d+):(?<m>\d+):(?<s>\d+(\.\d+)?)\s#', $line, $out) >= 1) {
+ if (preg_match('#^(\d+\s+)?((?<h>\d+):(?<m>\d+):(?<s>\d+(\.\d+)?)|(?<ts>\d+\.\d+))\s#', $line, $out) >= 1) {
$time = parseTime($out);
if (isset($lastLine)) {
if ($time < $lastTime) $lastTime -= 86400;
@@ -35,22 +42,27 @@ foreach ($argv as $fname) {
$lastLine = $line;
$lastTime = $time;
}
- if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+)?(?<action>access|stat|lstat|stat64|lstat64|readlink|open|openat|execve)\("(?<lib>[^"]*[^"]*[^/])".*\)\s+=\s+(?<ret>\S+)(\s+(?<err>\S+)\s+|$)#', $line, $out) < 1) continue;
+ if (preg_match('#^(\d+\s+)?(\d+:\d+:\d+\.?\d*\s+|\d+\.\d+\s+)?(?<action>access|stat|lstat|stat64|lstat64|readlink|open|openat|execve)\("(?<lib>[^"]*[^"]*[^/])".*\)\s+=\s+(?<ret>\S+)(\s+(?<err>\S+)\s+|$)#', $line, $out) < 1) continue;
//echo "Match: {$out['lib']} -> {$out['ret']} ({$out['err']})\n";
$file = basename($out['lib']);
$file = preg_replace('/\.so(\.\d+)*$/', '', $file);
if ($out['ret'] < 0) {
+ $str = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out[ 'action'] . ')';
if (isset($found[$file])) {
- $found[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
+ if (!$unique || !in_array($str, $found[$file]))
+ $found[$file][] = $str;
} else {
- $failed[$file][] = ':-( ' . $out['lib'] . ' *** (' . (isset($out['err']) ? $out['err'] : 'Unknown Error') . ') (' . $out['action'] . ')';
+ if (!$unique || !isset($failed[$file]) || !in_array($str, $failed[$file]))
+ $failed[$file][] = $str;
}
} else {
if (isset($failed[$file])) {
$found[$file] = $failed[$file];
unset($failed[$file]);
}
- $found[$file][] = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')';
+ $str = ':-) ' . $out['lib'] . ' (' . $out['action'] . ')';
+ if (!$unique || !isset($found[$file]) || !in_array($str, $found[$file]))
+ $found[$file][] = $str;
}
}
fclose($fh);