This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch feature/openbox in repository live-build-x2go. from f495c9f added support for passing of LDAP parameters new df3069d added multiscreen/xinerama support new d211deb added authorized_keys download support new 34a22d9 added autoupdate script new 137937d fixed indenting in config/includes.chroot/lib/live/config/2600-x2go-getsessions Bitte geben Sie eine Commit-Beschreibung für Ihre Änderungen ein. Zeilen, new 3f5052f changed config/includes.chroot/lib/live/config/2150-setsshkey so it won't fire until the network is up - like config/includes.chroot/lib/live/config/2600-x2go-getsessions new 1110060 executable bit was missing new 9bcb7ef added tftp client and x11vnc (for :0 mirroring) server new 2b1abea added acpid and acpi-support to support keyboard powerbutton "off" new 8338fe6 fixed various syntax errors stemming from perl->bash conversion new 1feb05b fixed further perlisms new df4ed87 openbox configuration refined and documented new db06cd4 removed inotify, no longer needed, never worked for us The 12 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: .../includes.chroot/lib/live/config/2150-setsshkey | 54 +++ .../lib/live/config/2300-autoupdate | 394 ++++++++++++++++++++ .../lib/live/config/2600-x2go-getsessions | 22 +- .../lib/live/config/2700-x2go-powerbuttonmonitor | 2 - .../lib/live/config/2800-x2go-thinclientconfig | 63 ++++ config/package-lists/utils.list.chroot | 2 +- config/package-lists/x2go.list.chroot | 2 +- 7 files changed, 524 insertions(+), 15 deletions(-) create mode 100755 config/includes.chroot/lib/live/config/2150-setsshkey create mode 100755 config/includes.chroot/lib/live/config/2300-autoupdate -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit df3069d77ac90729d17f0ae8933bf8df74a23baa Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Dec 16 02:31:25 2016 +0100 added multiscreen/xinerama support --- .../lib/live/config/2800-x2go-thinclientconfig | 58 ++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 6efdc18..019a6b6 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -17,6 +17,64 @@ cat >/home/user/.xsession <<XSESSION # Spawn PulseAudio pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 'module-udev-detect' --exit-idle-time=65535 & +# additional variable instead of "case $(...) in", as we need the value again later on +XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\\\$1 == "xinerama" { print \\\$2 }') + +# sanitize input +case $XRANDRCMDTAINTED in +"above") + XRANDRCMD="above" + ;; +"below") + XRANDRCMD="below" + ;; +"same-as") + XRANDRCMD="same-as" + ;; +"right-of") + XRANDRCMD="right-of" + ;; +*) + XRANDRCMD="left-of" # default + ;; +esac + +# find out how many touch devices we have +TOUCHDEVICESCOUNT = \$(LANG=C xsetwacom --list devices | wc -l) + +# find out how many mouse devices we have +MICECOUNT = \$(find /dev/input -maxdepth 1 -name "mouse*" | wc -l) + +# loop through the following code block for all connected display devices +for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d ' ' -f1); do + + #remove trailing newline from NEXT_DISPLAY + NEXT_DISPLAY=\${NEXT_DISPLAY%\$'\n'} + + # THIS_DISPLAY won't be defined until the second time the loop is executed, which is a + # neat way of running xrandr only if there are at least two connected display devices + if [ -n \${THIS_DISPLAY+x} ] ; then + + if [ \$TOUCHDEVICESCOUNT -gt 0 ] && [ \$MICECOUNT -lt 1 ] && [ -z \$XRANDRCMDTAINTED ]; then + # we have a touch device and no mice, and no xinerama parameter was set, + # so switch to clone view to make the touch device usable + /usr/bin/xrandr --output \$NEXT_DISPLAY --same-as \$THIS_DISPLAY + + else + # else use whatever is in XRANDRCMD (which is either our default of "left-of", + # or a valid xinerama kernel parameter value) + /usr/bin/xrandr --output \$NEXT_DISPLAY --\$xrandrcmd \$THIS_DISPLAY + fi + + # now set THIS_DISPLAY -> every subsequent iteration of the loop will now enter the code block + # above where [ -n \${THIS_DISPLAY+x} ] is the conditional + THIS_DISPLAY = \$NEXT_DISPLAY + fi +done + +# set screen background to X2Go default blue on all detected screens +xsetroot -solid "#246ed8" + # Spawn openbox openbox & -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit d211debd524a0f437682e9359af576f5a9904705 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Dec 16 02:31:58 2016 +0100 added authorized_keys download support --- .../includes.chroot/lib/live/config/2150-setsshkey | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2150-setsshkey b/config/includes.chroot/lib/live/config/2150-setsshkey new file mode 100755 index 0000000..45572f7 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2150-setsshkey @@ -0,0 +1,44 @@ +#!/bin/sh + +SetSSHKey () +{ + +# Output startup message +# +echo -n " setsshkey" + + +PUBKEYURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^pubkey=/ { print $2 }') + +if [ -n "$PUBKEYURL" ] ; then + + # Set Keyfile + # + mkdir -p /root/.ssh + chmod 600 /root/.ssh + touch /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys + + if echo "$PUBKEY" | grep -q "^tftp://" ; then + PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then + while ! atftp $PUBKEYSERVER -g -r $PUBKEYPATH -l /root/.ssh/authorized_keys ; do + echo "Waiting for SSH Public Key ..." + sleep 5 + done + fi + else + while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do + echo "Waiting for SSH Public Key ..." + sleep 5 + done + fi +fi + +} + +SetSSHKey + -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 11100603e49b2f0d256ce27c7bffe3983d5eadc0 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Dec 17 03:55:47 2016 +0100 executable bit was missing --- .../includes.chroot/lib/live/config/2150-setsshkey | 1 + 1 file changed, 1 insertion(+) diff --git a/config/includes.chroot/lib/live/config/2150-setsshkey b/config/includes.chroot/lib/live/config/2150-setsshkey index e5756ef..a40918d 100755 --- a/config/includes.chroot/lib/live/config/2150-setsshkey +++ b/config/includes.chroot/lib/live/config/2150-setsshkey @@ -45,6 +45,7 @@ else fi GETPUBKEY + chmod 755 /etc/network/if-up.d/getpubkey fi } -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 9bcb7effffbe6242dc8b85ffbe610f41e21326f9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Dec 21 22:21:10 2016 +0100 added tftp client and x11vnc (for :0 mirroring) server --- config/package-lists/utils.list.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/package-lists/utils.list.chroot b/config/package-lists/utils.list.chroot index a07d6e1..b148deb 100644 --- a/config/package-lists/utils.list.chroot +++ b/config/package-lists/utils.list.chroot @@ -1 +1 @@ -psmisc vim screen kbd +atftp psmisc vim screen kbd x11vnc x11vnc-data -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 34a22d954a0a4b1534833d572d3dd936745a87f4 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Dec 16 17:35:02 2016 +0100 added autoupdate script --- .../lib/live/config/2300-autoupdate | 394 ++++++++++++++++++++ 1 file changed, 394 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2300-autoupdate b/config/includes.chroot/lib/live/config/2300-autoupdate new file mode 100755 index 0000000..324f62a --- /dev/null +++ b/config/includes.chroot/lib/live/config/2300-autoupdate @@ -0,0 +1,394 @@ +#!/bin/sh + +cleanup () +{ # discard contents of tmpfs, umount if necessary + if [ -n "$NTFSROOT" ]; then + echo "Removing '$TEMPDIR/*'." + rm -rf $TEMPDIR/* + else + echo "Unmounting '$TEMPDIR'." + umount $TEMPDIR + fi + if rmdir $TEMPDIR; then + echo "Removed empty directory '$TEMPDIR'." + else + echo "Could not remove directory '$TEMPDIR'." + fi + if [ -n "$NTFSROOT" ]; then + if umount $MOUNTPOINT; then + echo "Unmounted '$MOUNTPOINT'." + else + echo "Could not unmount '$MOUNTPOINT'." + fi + fi +} + +AutoUpdateMain () +{ +# Output startup message +# +echo -n " autoupdater (backgrounding update task)" + + +# Background everything +# +( + + +# redirect all output to console #10 +# +exec >/dev/tty10 2>&1 + + +# clear console +# +clear + + +# This is so grep, awk and sed will match the right terms regardless of LANG +# +unset LANG +unset LC_ALL +unset LC_MESSAGES + + +# download url pointing to directory with all required files goes here +DOWNLOADURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^updateurl=/ { print $2 }') + +if [ -z "$\DOWNLOADURL" ]; then + echo "No update URL. Exiting." + return 0 +fi + +# Bandwidth limit goes here +# +#BWLIMITPERCENT=20 # in percent, numeric-only +BWLIMITPERCENT=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^bwlimit=/ { print $2 }') +if [ -z "$\BWLIMITPERCENT" ]; then + BWLIMITPERCENT=20 + echo "Bandwidth limit not set. Defaulting to 20%." +fi + + + +# sleeping a random amount of time to ease load on the update server +# +SLEEPTIME=0 +echo -n "Calculating random update delay (120-900 seconds)..." +while [ $SLEEPTIME -lt 120 ]; do + echo -n "." + # During startup, script is run with /bin/sh, + # even when #!/bin/bash is set, + # so we need to improvise. + RND=$(/bin/bash -c 'echo $RANDOM') + SLEEPTIME=$((RND%900)) +done +echo " " +echo "Sleeping for $SLEEPTIME seconds ..." +sleep $SLEEPTIME + + +# Define our mountpoint and check if we're capable of auto-updating +NTFSROOT=$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '/^ntfs-uuid/ { print $2 }') +if [ -n "$NTFSROOT" ]; then + mkdir -p /lib/live/mount/ntfsroot + mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot + MOUNTPOINT="/lib/live/mount/ntfsroot/" + # create a temporary directory + TEMPDIR=$(mktemp -d --tmpdir=$MOUNTPOINT) +else + MOUNTPOINT="/lib/live/mount/findiso/" + # create a temporary directory and mount a tmpfs there + TEMPDIR=$(mktemp -d --tmpdir=/mnt) + IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR + +fi +if ! ( [ -d "$MOUNTPOINT/boot/live-download" ] && \ + ( \ + [ -d "$MOUNTPOINT/boot/live1" ] || \ + [ -d "$MOUNTPOINT/boot/live2" ] \ + ) \ + ); then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "No directories suitable for update." + return 0 # directories missing, most likely not a writeable medium +fi + + +# define and figure out some paths that we will be needing later on +# +if [ -f "$MOUNTPOINT/syslinux.cfg" ]; then + SYSLINUXPATH="$MOUNTPOINT/" +elif [ -f "$MOUNTPOINT/syslinux/syslinux.cfg" ]; then + SYSLINUXPATH="$MOUNTPOINT/syslinux/" +elif [ -f "$MOUNTPOINT/menu.lst" ]; then + GRUBPATH="$MOUNTPOINT/" +elif [ -f "$MOUNTPOINT/boot/menu.lst" ]; then + GRUBPATH="$MOUNTPOINT/grub/" +elif [ -f "$MOUNTPOINT/boot/grub/menu.lst" ]; then + GRUBPATH="$MOUNTPOINT/boot/grub/" +else + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "No suitable bootloader found." + return 1 +fi + +RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^findiso=/ { print $2 }')")) + +ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH) +RUNNINGSYSTEMNAME=$(basename $RUNNINGSYSTEMFULLPATH) +if [ "$RUNNINGSYSTEMNAME" = "live1" ]; then + OTHERSYSTEMNAME="live2" +elif [ "$RUNNINGSYSTEMNAME" = "live2" ]; then + OTHERSYSTEMNAME="live1" +else + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "Unable to determine path/name of running system." + return 1 +fi +OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") +DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/live-download/") + + +# Now we'll copy the content of the live-download folder to our tempdir +# this is so we can run wget in update mode (-N) or rsync without needing +# write access to our boot medium (write access means increased wear and tear, +# and we want to avoid that especially for media that has no wear-leveling +# like CF cards) +# +while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do + echo "Sleeping 30 seconds ..." + sleep 30 + echo "Retrying ..." +done + + +# Now let's figure out if we're supposed to use wget or rsync for downloading +# +if echo "$DOWNLOADURL" | grep -q "^http" || \ + echo "$DOWNLOADURL" | grep -q "^ftp" + then + # Attempt to determine available bandwidth & to set BWLIMIT accordingly + wget -Nr -o /tmp/dl.log -P /tmp/ -nd \ + --progress=bar:force $DOWNLOADURL/initrd.img + cp --update "/tmp/initrd.img" "$TEMPDIR" + rm "/tmp/initrd.img" + SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ + $7 == "-" { print $5 }' /tmp/dl.log \ + ) + case $SIZEFACTORSTRING in + "" | \ + [0-9]) echo -n "Not enough Bandwidth for update task - " + echo -n "aborting." + cleanup + return 0 + ;; + "KB/s") SIZEFACTOR=1;; + "MB/s") SIZEFACTOR=1024;; + "GB/s") SIZEFACTOR=1048576;; + *) SIZEFACTOR=$((1024*1024*1024));; + esac + DLRATE=$( awk -F' |\(|\)' ' $9 == "saved" && $7 == "-" \ + { print $4 }' /tmp/dl.log \ + ) + BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ + awk ' { print $1*$2*$3/100 }' | \ + awk -F'.' '{ print $1 }' \ + ) # outputs integer kilobytes, not rounded + echo "Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ + --limit-rate=${BWLIMIT}k $DOWNLOADURL" + +elif echo "$DOWNLOADURL" | grep -q "^rsync"; then + + rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/initrd.img \ + $TEMPDIR/initrd.img.new + mv $TEMPDIR/initrd.img.new $TEMPDIR/initrd.img + SIZEFACTORSTRING=$( sed -e's_\(. bytes/sec\)_ \1_' /tmp/dl.log | \ + awk '$4 == "sent" && $12 == "bytes/sec" \ + { print $11 }' \ + ) + case $SIZEFACTORSTRING in + "" | \ + [0-9]) echo -n "Not enough Bandwidth for update task - " + echo -n "aborting." + cleanup + return 0 + ;; + "K") SIZEFACTOR=1;; + "M") SIZEFACTOR=1024;; + "G") SIZEFACTOR=$((1024*1024));; + *) SIZEFACTOR=$((1024*1024*1024));; + esac + DLRATE=$( sed -e's_\(. bytes/sec\)_ \1_' /tmp/dl.log | \ + awk '$4 == "sent" && $12 == "bytes/sec" \ + { print $10 }') + BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ + awk ' { print $1*$2*$3/100 }' | \ + awk -F'.' '{ print $1 }' \ + ) # outputs integer kilobytes, not rounded + echo "Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ + $TEMPDIR" +else + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "Unsupported download mechanism." + return 1 +fi +rm /tmp/dl.log + + +# Proceed to download from update location +# +while ! $DOWNLOADCOMMAND; do + echo "Sleeping 30 seconds ..." + sleep 30 + echo "Retrying ..." +done + +# Now check if these files are different from what we already have in our +# download directory on the boot medium +# +echo "Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." +if diff -q $DOWNLOADPATH $TEMPDIR \ + >/dev/null + + then + cleanup + echo "Nothing to do. - Files on server not newer than '$DOWNLOADPATH'." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium +else + echo "Differences detected. Continuing ..." +fi + + +# If we made it past that point, it's time to update the boot medium, so let's +# remount it rw and async for speed +# +if mount -oremount,rw,async $MOUNTPOINT; then + echo "Remounted '$MOUNTPOINT' as rw and async." +else + echo "Could not remount '$MOUNTPOINT' as rw and async." +fi + + +# Now, we don't want to copy an index.htm(l) file, so let's do away with that +# +rm -f $TEMPDIR/index.ht* + + +# move everything over to the boot medium +# +echo "Moving $TEMPDIR/* => $DOWNLOADPATH" +mv $TEMPDIR/* $DOWNLOADPATH +cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? +if [ -n "$NTFSROOT" ]; then + echo "NTFSROOT detected. Attempting to mount '/dev/disk/by-uuid/$NTFSROOT'." + if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot; then + echo "Mount successful." + else + echo "Failed to mount NTFSROOT." + fi +fi + + +# let's check if we just downloaded a copy of our running system +# +echo "Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" +if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ + [ -d "$OTHERSYSTEMFULLPATH" ] ; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "Nothing to do. Content of $DOWNLOADPATH equals" \ + "$RUNNINGSYSTEMNAME." + return 0 # current is newest, nothing to do, + # we want to keep the old system in OTHERSYSTEMFULLPATH + # as a fallback +fi + + +# make sure our destination path really exists +# +mkdir -p $OTHERSYSTEMFULLPATH + + +# let's check if our destination is already up to date or needs updating +# +echo "Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" +if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo "Nothing to do - content of '$DOWNLOADPATH' equals"\ + "'$OTHERSYSTEMNAME'." + return 0 # OTHERSYSTEMFULLPATH is already up to date +else + # keep rsyncing until the update is complete + echo "Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH + do + echo "Sleeping 30 seconds ..." + sleep 30 + echo "Retrying ..." + done +fi + + +# change default boot to the image we just downloaded and installed +# +if [ -n "$SYSLINUXPATH" ]; then + echo "Changing syslinux default to $OTHERSYSTEMNAME-486." + sed -i -e"/^default/cdefault $OTHERSYSTEMNAME-486" \ + $SYSLINUXPATH/syslinux.cfg + +elif [ -n "$GRUBPATH" ]; then + MENULST=$GRUBPATH/menu.lst + CURRENTDEFAULT=$(awk '/^default/ { print $2 }' $MENULST | tr -d '\r') + CURRENTTITLEPOSITION=$(grep '^title' $MENULST | grep -n "${RUNNINGSYSTEMNAME}-486" | awk -F':' '$2 ~ /'"${RUNNINGSYSTEMNAME}-486"'/ { print $1 }') + CURRENTTITLEPOSITION=$((CURRENTTITLEPOSITION-1)) + OTHERTITLEPOSITION=$(grep '^title' $MENULST | grep -n "${OTHERSYSTEMNAME}-486" | awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}-486"'/ { print $1 }') + OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) + if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then + echo "Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ + $MENULST + else + echo "Not changing GRUB-legacy default." + echo "Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo "while default is set to position '$CURRENTDEFAULT'." + fi +else + echo "Unsupported bootloader." +fi + +# we're on an async mount point, so let's sync to be safe +# +sync + + +# umount tempdir to free memory +# +if [ -d $TEMPDIR ]; then + cleanup +fi + + +# now, change mount back to ro and sync +# +if [ -n "$NTFSROOT" ]; then + umount $MOUNTPOINT +else + mount -oremount,ro,sync $MOUNTPOINT +fi + +) & + +} + +AutoUpdateMain + -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 3f5052f2970aea9d7b215c65cc1cd27a75efcc90 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Dec 17 01:30:36 2016 +0100 changed config/includes.chroot/lib/live/config/2150-setsshkey so it won't fire until the network is up - like config/includes.chroot/lib/live/config/2600-x2go-getsessions --- .../includes.chroot/lib/live/config/2150-setsshkey | 59 +++++++++++--------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2150-setsshkey b/config/includes.chroot/lib/live/config/2150-setsshkey index 45572f7..e5756ef 100755 --- a/config/includes.chroot/lib/live/config/2150-setsshkey +++ b/config/includes.chroot/lib/live/config/2150-setsshkey @@ -3,40 +3,49 @@ SetSSHKey () { -# Output startup message -# -echo -n " setsshkey" + # Output startup message + # + echo -n " setsshkey" -PUBKEYURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^pubkey=/ { print $2 }') + PUBKEYURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^pubkey=/ { print $2 }') -if [ -n "$PUBKEYURL" ] ; then + if [ -n "$PUBKEYURL" ] ; then + cat >/etc/network/if-up.d/getpubkey <<GETPUBKEY +#!/bin/bash +export TERM=linux; - # Set Keyfile - # - mkdir -p /root/.ssh - chmod 600 /root/.ssh - touch /root/.ssh/authorized_keys - chmod 600 /root/.ssh/authorized_keys - - if echo "$PUBKEY" | grep -q "^tftp://" ; then - PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then - while ! atftp $PUBKEYSERVER -g -r $PUBKEYPATH -l /root/.ssh/authorized_keys ; do - echo "Waiting for SSH Public Key ..." - sleep 5 - done - fi - else - while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do +while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do + sleep 2 +done + +# Set Keyfile +# +mkdir -p /root/.ssh +chmod 600 /root/.ssh +touch /root/.ssh/authorized_keys +chmod 600 /root/.ssh/authorized_keys + +if echo "$PUBKEY" | grep -q "^tftp://" ; then + PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then + while ! atftp $PUBKEYSERVER -g -r $PUBKEYPATH -l /root/.ssh/authorized_keys ; do echo "Waiting for SSH Public Key ..." sleep 5 done fi +else + while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do + echo "Waiting for SSH Public Key ..." + sleep 5 + done fi +GETPUBKEY + + fi } -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 137937dec891b85debfcdbc2e9431112e3f2d5c4 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Dec 17 01:29:29 2016 +0100 fixed indenting in config/includes.chroot/lib/live/config/2600-x2go-getsessions Bitte geben Sie eine Commit-Beschreibung für Ihre Änderungen ein. Zeilen, --- .../lib/live/config/2600-x2go-getsessions | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 20006b9..74524fc 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -2,16 +2,16 @@ X2GoGetSessions () { -# Output startup message -# -echo -n " x2go-getsessions" + # Output startup message + # + echo -n " x2go-getsessions" - SESSIONSURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^sessionsurl=/ { print $2 }') - if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then - SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new - cat >/etc/network/if-up.d/getsessions <<GETSESS + SESSIONSURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^sessionsurl=/ { print $2 }') + if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then + SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new + cat >/etc/network/if-up.d/getsessions <<GETSESS #!/bin/bash export TERM=linux; @@ -39,8 +39,8 @@ if [ -s $SESSIONSDESTINATION ] ; then fi GETSESS - chmod 755 /etc/network/if-up.d/getsessions - fi + chmod 755 /etc/network/if-up.d/getsessions + fi } X2GoGetSessions -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit df4ed87719122a833c9a613f082a053bc505fe38 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Dec 22 15:56:38 2016 +0100 openbox configuration refined and documented --- .../lib/live/config/2800-x2go-thinclientconfig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 0c6a163..26875f7 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -7,6 +7,12 @@ X2GoThinClientConfig () # echo -n " x2go-thinclientconfig" +# using xmlstarlet would mean wasting yet another Megabyte of space ... +# disable virtual desktops +sed -i -e 's#<number>4</number>#<number>1</number>#' /etc/xdg/openbox/rc.xml +# disable OpenBox context menu (would be accessible in xinerama) +sed -i -e '\#<action name="ShowMenu"><menu>[a-z-]*-menu</menu></action>#d' /etc/xdg/openbox/rc.xml +# make sure OpenBox maximizes X2GoClient on launch and hides window decorations sed -i -e '\#<applications>#a<application title="X2Go Client" type="normal">' -e '\#<applications>#a<decor>no</decor>' -e '\#<applications>#a</application>' /etc/xdg/openbox/rc.xml cat >/home/user/.xsession <<XSESSION -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit db06cd462b0aace2855e8e41eb51baf7c7911e7f Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Dec 22 15:59:22 2016 +0100 removed inotify, no longer needed, never worked for us --- .../lib/live/config/2700-x2go-powerbuttonmonitor | 2 -- config/package-lists/x2go.list.chroot | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor b/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor index b5e24fc..8f21eaf 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor +++ b/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor @@ -7,8 +7,6 @@ X2GoPowerbuttonMonitor () echo -n " x2go-powerbuttonmonitor" # Spawn Powerbutton-Monitor -# FIXME tut nur manuell gestartet, warum? dash? nohup? /home/user noch gar nicht da? -#/bin/bash -c '( while ((! [ -d /home/user ] ) && ps -C x2goclient --no-header); do sleep 1 ; done ; rm -f /home/user/.halt ; inotifywait -qm -e create /home/user/ | while grep -q "CREATE .halt" ; do poweroff ; chvt 7 ; done ) &' /bin/bash -c '(while ! [ -f /home/user/.halt ] ; do sleep 1 ; done ; poweroff ; chvt 7) &' } diff --git a/config/package-lists/x2go.list.chroot b/config/package-lists/x2go.list.chroot index df477c2..76c3903 100644 --- a/config/package-lists/x2go.list.chroot +++ b/config/package-lists/x2go.list.chroot @@ -1 +1 @@ -x2goclient inotify-tools pulseaudio +x2goclient pulseaudio -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 2b1abea9b80a05d69c4d6ef152b6eb90ae208b38 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Dec 22 00:19:38 2016 +0100 added acpid and acpi-support to support keyboard powerbutton "off" --- config/package-lists/utils.list.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/package-lists/utils.list.chroot b/config/package-lists/utils.list.chroot index b148deb..3772d98 100644 --- a/config/package-lists/utils.list.chroot +++ b/config/package-lists/utils.list.chroot @@ -1 +1 @@ -atftp psmisc vim screen kbd x11vnc x11vnc-data +acpid acpi-support atftp psmisc vim screen kbd x11vnc x11vnc-data -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 8338fe668c8a59a9c0cbd0468e126fa73de201bc Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Dec 22 01:08:30 2016 +0100 fixed various syntax errors stemming from perl->bash conversion --- .../lib/live/config/2800-x2go-thinclientconfig | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 019a6b6..fca482e 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -18,10 +18,10 @@ cat >/home/user/.xsession <<XSESSION pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 'module-udev-detect' --exit-idle-time=65535 & # additional variable instead of "case $(...) in", as we need the value again later on -XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\\\$1 == "xinerama" { print \\\$2 }') +XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '$''1 == "xinerama" { print $''2 }') # sanitize input -case $XRANDRCMDTAINTED in +case \$XRANDRCMDTAINTED in "above") XRANDRCMD="above" ;; @@ -40,10 +40,10 @@ case $XRANDRCMDTAINTED in esac # find out how many touch devices we have -TOUCHDEVICESCOUNT = \$(LANG=C xsetwacom --list devices | wc -l) +TOUCHDEVICESCOUNT=\$(LANG=C xsetwacom --list devices | wc -l) # find out how many mouse devices we have -MICECOUNT = \$(find /dev/input -maxdepth 1 -name "mouse*" | wc -l) +MICECOUNT=\$(find /dev/input -maxdepth 1 -name "mouse*" | wc -l) # loop through the following code block for all connected display devices for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d ' ' -f1); do @@ -63,21 +63,20 @@ for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d ' else # else use whatever is in XRANDRCMD (which is either our default of "left-of", # or a valid xinerama kernel parameter value) - /usr/bin/xrandr --output \$NEXT_DISPLAY --\$xrandrcmd \$THIS_DISPLAY + /usr/bin/xrandr --output \$NEXT_DISPLAY --\$XRANDRCMD \$THIS_DISPLAY fi # now set THIS_DISPLAY -> every subsequent iteration of the loop will now enter the code block # above where [ -n \${THIS_DISPLAY+x} ] is the conditional - THIS_DISPLAY = \$NEXT_DISPLAY + THIS_DISPLAY=\$NEXT_DISPLAY fi done -# set screen background to X2Go default blue on all detected screens -xsetroot -solid "#246ed8" - # Spawn openbox openbox & +# set screen background to X2Go default blue on all detected screens +xsetroot -solid "#246ed8" # Get X2GoConfig BROKERURL=\$(cat /proc/cmdline | \ -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/openbox in repository live-build-x2go. commit 1feb05b346bd4f50f9dd128c1d2f2187000b2d84 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Dec 22 01:15:25 2016 +0100 fixed further perlisms --- .../lib/live/config/2800-x2go-thinclientconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index fca482e..0c6a163 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -17,8 +17,8 @@ cat >/home/user/.xsession <<XSESSION # Spawn PulseAudio pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 'module-udev-detect' --exit-idle-time=65535 & -# additional variable instead of "case $(...) in", as we need the value again later on -XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '$''1 == "xinerama" { print $''2 }') +# additional variable instead of "case \$(...) in", as we need the value again later on +XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "xinerama" { print \$2 }') # sanitize input case \$XRANDRCMDTAINTED in -- Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git