diff options
author | Simon Rettberg | 2013-05-14 18:54:48 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-05-14 18:54:48 +0200 |
commit | 362fbbb7c888e125b0270eda89878859eac0e3f4 (patch) | |
tree | 67eb9d52db7d7aa9ce306ccb4f464cd7c275b378 | |
parent | pxelinux.0 (diff) | |
parent | change ipxe source (diff) | |
download | tm-scripts-362fbbb7c888e125b0270eda89878859eac0e3f4.tar.gz tm-scripts-362fbbb7c888e125b0270eda89878859eac0e3f4.tar.xz tm-scripts-362fbbb7c888e125b0270eda89878859eac0e3f4.zip |
Merge branch 'master' of dnbd3:openslx-ng/tm-scripts
-rwxr-xr-x | data/install_server.sh | 41 | ||||
-rw-r--r-- | remote/modules/openbox/data/etc/xdg/openbox/menu.xml | 29 | ||||
-rw-r--r-- | remote/modules/openbox/openbox.build | 18 | ||||
-rw-r--r-- | remote/modules/openbox/openbox.conf | 12 | ||||
-rw-r--r-- | remote/modules/pam/data/etc/skel/README | 1 | ||||
-rw-r--r-- | remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include | 2 | ||||
l--------- | remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service | 1 | ||||
-rw-r--r-- | remote/modules/vmplayer/data/etc/systemd/system/vmware.service | 1 | ||||
-rw-r--r-- | remote/modules/vmplayer/vmplayer.build | 8 | ||||
-rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/bin/dhcp++ | 2 | ||||
-rw-r--r-- | remote/rootfs/rootfs-stage32/rootfs-stage32.build | 5 | ||||
-rw-r--r-- | remote/rootfs/rootfs-stage32/rootfs-stage32.conf | 3 | ||||
l--------- | remote/targets/stage32/openbox | 1 | ||||
-rwxr-xr-x | useful/ultrastrace.php | 17 |
14 files changed, 129 insertions, 12 deletions
diff --git a/data/install_server.sh b/data/install_server.sh index ca67a6ed..be1fc91c 100755 --- a/data/install_server.sh +++ b/data/install_server.sh @@ -1,6 +1,12 @@ #!/bin/sh -TOOLS="git squashfs-tools rsync lighttpd tftpd" +if [ $# -lt 1 ]; then + echo "Usage: $0 <this server's ip>" + exit 1 +fi +SERVER_IP="$1" + +TOOLS="git squashfs-tools rsync lighttpd tftpd gcc binutils make nasm" for tool in $TOOLS; do echo " ###### Installiere $tool ##########" @@ -113,7 +119,6 @@ if [ "$ERR" -gt 0 ]; then exit 1 fi - echo " ##### Klone das mltk repository ########" mkdir -p /opt/openslx @@ -121,8 +126,38 @@ cd /opt/openslx git clone git://git.openslx.org/openslx-ng/tm-scripts +echo " ##### Setup iPXE #######" + +mkdir -p /opt/ipxe +cd /opt/ipxe +git clone git://git.ipxe.org/ipxe.git + +cd ipxe + +# iPXE-Konfiguration einschreiben +cat > pxelinux.ipxe << HEREEND +#!ipxe +set use-cached 1 +dhcp net0 +set net0.dhcp/next-server $SERVER_IP +set net0.dhcp/filename ipxelinux.0 +imgload pxelinux.0 +boot pxelinux.0 +HEREEND + +cd src +make bin/undionly.kkkpxe EMBED=../ipxelinux.ipxe,/opt/openslx/tm-scripts/data/pxelinux.0 + +ERR=$? +if [ "$ERR" -gt 0 ]; then + echo "Fehler beim kompilieren von ipxelinux.0 - Abbruch!" + exit 1 +fi + +cp "ipxelinux.0" "/srv/openslx/tftp/" + echo "....Fertig" -echo "mltk liegt nun im Verzeichnis $(pwd)/tm-scripts" +echo "mltk liegt nun im Verzeichnis /opt/openslx/tm-scripts" echo "Extrahieren und Erstellen der Basissystemdaten:" echo "./mltk remote stage31 -b" echo "./mltk remote stage32 -b" 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..866969f6 --- /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="Terminal"> + <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/pam/data/etc/skel/README b/remote/modules/pam/data/etc/skel/README new file mode 100644 index 00000000..9c558e35 --- /dev/null +++ b/remote/modules/pam/data/etc/skel/README @@ -0,0 +1 @@ +. diff --git a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include index 65db53da..bc93d68b 100644 --- a/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include +++ b/remote/modules/vmplayer/data/etc/openslx/vmware/run-virt.include @@ -421,7 +421,7 @@ esac # check if ide/scsi and hwver of image # read only the first 30 lines to be shure -imghead=$(head -30 ${diskfile}) +imghead=$(head -n 30 ${diskfile}) hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" |\ awk -F '"' '{print $2}') hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" |\ diff --git a/remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service b/remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service new file mode 120000 index 00000000..7deb4820 --- /dev/null +++ b/remote/modules/vmplayer/data/etc/systemd/system/graphical.target.wants/vmware.service @@ -0,0 +1 @@ +../vmware.service
\ No newline at end of file diff --git a/remote/modules/vmplayer/data/etc/systemd/system/vmware.service b/remote/modules/vmplayer/data/etc/systemd/system/vmware.service index 067b15a0..df5331e0 100644 --- a/remote/modules/vmplayer/data/etc/systemd/system/vmware.service +++ b/remote/modules/vmplayer/data/etc/systemd/system/vmware.service @@ -1,6 +1,7 @@ [Unit] Description=Sets up the vmware environment Wants=graphical.target +Before=graphical.target [Service] Type=simple diff --git a/remote/modules/vmplayer/vmplayer.build b/remote/modules/vmplayer/vmplayer.build index 1e3090ac..21d28dec 100644 --- a/remote/modules/vmplayer/vmplayer.build +++ b/remote/modules/vmplayer/vmplayer.build @@ -1,7 +1,9 @@ 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." + if [ "x$(ls /mnt/store/vmware)" == "x" ]; then + mount -t nfs -o ro,async,nolock 132.230.8.113:/srv/vmext /mnt/store/vmware || perror "Could not mount vmware bundle directory. Exiting." + fi ARCH=$(uname -m) [ "$ARCH" = "i686" ] && ARCH=i386 local BUNDLE="$(find /mnt/store/vmware -type f -name "VMware-Player*.${ARCH}.bundle" | head -1)" @@ -29,6 +31,8 @@ build() { cp -r ./src/vmware-vmx/lib/{bin,icu,lib,libconf,scripts} "$TARGET" || perror "Could not copy many things from vmware-vmx." [ ! -L "$TARGET/bin/vmplayer" ] && { ln -s /usr/lib/vmware/bin/appLoader "$TARGET/bin/vmplayer" || perror "Could not link vmplayer to appLoader."; } chmod +x "$TARGET"/bin/* + chmod +x "$MODULE_BUILD_DIR"/usr/{bin,sbin}/* + chmod +x "$TARGET"/lib/*.sh pinfo "Patching LIBCONF_DIR" local file="" for file in $(grep -rl "@@LIBCONF_DIR@@" "$MODULE_BUILD_DIR"); do @@ -49,7 +53,7 @@ build() { post_copy() { # FIXME: gconftool is copied without dependencies - #tarcopy "$(find /usr/lib/ -name gconv -type d)" "$TARGET_BUILD_DIR" + tarcopy "$(find /usr/lib/ -name gconv -type d)" "$TARGET_BUILD_DIR" : } 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 7d639450..0ca8d64c 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -93,8 +93,11 @@ post_copy() { # setup root accoun USER=root PASSWORD='!r00t' add_user + DEMO_ID="$(USER=demo PASSWORD=demo USERHOME=/home/demo USERSHELL=/bin/bash add_user)" - mkdir -p ${TARGET_BUILD_DIR}/root + mkdir -p "${TARGET_BUILD_DIR}/root" + mkdir -p "${TARGET_BUILD_DIR}/home/demo" + chown "$DEMO_ID:$DEMO_ID" "${TARGET_BUILD_DIR}/home/demo" echo "minilinux-$(hostname)" > "${TARGET_BUILD_DIR}/etc/hostname" # check for kernel modules, if not present copy from system diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf index a34634ab..a8bbf386 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.conf +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.conf @@ -27,7 +27,8 @@ REQUIRED_BINARIES=" bash xterm ckbcomp xvidtune - bc" + bc + dirname" REQUIRED_LIBRARIES=" libcap libcidn libcom_err 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 ea8161ea..0caaf64a 100755 --- a/useful/ultrastrace.php +++ b/useful/ultrastrace.php @@ -14,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"); @@ -41,17 +47,22 @@ foreach ($argv as $fname) { $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); |