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 674f12e Check for branding.svg when applying branding image - not background.svg. new 6b7e053 make sure Alt-F4 is non-functional new 2dc0325 off-by-one-error new abab9f0 trying to shrink the image; note: squashfs excludes must not begin with "/", "./", or "../" when using wildcards new 81ee79a trying to fix "cifs-utils not found" error when building netboot image while deleting apt lists to save space new b025f3e OpenBox Keybindings need to be disabled entirely, they interfere with Xephyr and the like. new 95b71dd 2800-x2go-thinclientconfig: added quotation marks new 3f94816 more reliable way of determining that IP has been assigned new a15fbba more reliable way of determining that IP has been assigned new 4983dce more reliable way of determining that IP has been assigned new f1cf658 added output: when sleeping while waiting for an IP, print out which script is waiting. new 820a66b make getsessions delete thinclient_sessions file if boot parameter was passed; make thinclientconfig wait for valid thinclient_sessions file unless broker mode is active new 90ef1e7 added numbers to if-up.d script file names so we can enforce the sequence of execution new 15119df we need to escape $0, as it will contain the name of the script generating the if-up.d script if we don't new b66b461 attempt to background all network-related tasks new aec9d94 fixes missing escape -> hostname -I was never executed new 35b27fd Variable name was wrong in one place new eaf2a2f un-did backgrounding new 7bd59cb changed script numbering to four-digit, beginning with 0100 new 9864947 added timestamps to log output, fixed log output in 2200 and 2600 new 6938589 added timestamps, switched log output to | tee -a /dev/tty9 like in the other scripts new 04edee3 escape sign wass missingonce again ... new cdc01cd improved log output new 55cf2a8 last commit was incomplete, and included one escape too much per echo new 655a2ec and again, missing escapes new 8d30d6d indentation was wrong new a9d86a5 more missing escapes new e75d92e more superfluous escapes removed new 98db258 tty9 -> tty(first unused VT) new 4b66f5f removed old commented-out code new 25b9cdb switched liveupdate to tty(next-available-VT) logging and timestamped output new f8ba909 some log output was still lacking the timestamp new d4d4db2 improved ramdisk size calculation new 02ee3a3 removed wrong comment new 4ce959f moved "wait until unused VT becomes available" from 2300 to 2000 new f6501d2 added hwclock and ntpdate packages for future use in a set-time-on-boot script new 8f974b4 hwclock is not a package on its own, but contained in util-linux new bf9d1d0 renamed files to make space for a new 2000- file new c4eaed8 renamed files; delete old names from git new 51a85b0 first attempt at making all if-up scripts wait until an unused VT is available for log output new dd5d2c1 removed "wait for VT" block, as it is now in a separate script new 0c19362 no timestamp here, as clock is most likely wrong new 63d3dda added time setting script new 9078723 fixed HEREDOCs new fb18ee2 create debug output in file new fccd509 logging was still broken new 8929fb1 next try: backgrounding this task instead of starting it when network becomes available new 4877a17 yet another attempt at getting logging to work new e6adc05 if-up scripts should exit with a NOP when a local network device is changing to up, rather than a real network device new 340dfdc removed unused code new e1f812d deleted script file that didn't work anyways new e54868e renamed settime script new b0cfb00 all if-up tasks are now sent into the background and told to wait until tty becomes available also, fixed indention in tcpprint new 3376857 removed unneccessary escapes new ed74d89 added missing escapes new 043f850 do not clear the console new 8361617 /bin/sh instead of /bin/bash requires the use of "echo" instead of "echo -en" new 76832d5 wait until regular ntpdate if-up.d call has finished new dee643c added debug output new 1d69e1e autoupdate-patch for ramdisk mode new 228e1a6 do not trigger on METHOD="none" (which is set when IFACE="--all") new 1b8fcf7 typofix new 66ad99b added debug code again new caa8891 changed log output message new 84f1def typofix new 9daa18b path was wrong new 8c854f3 added resiliency in case download directory is missing, fixed imagesize calculation new f9b904f added sleep to increase chance that ntpdate manages to connect new 7fe794d IMGSIZEDOWNLOAD was missing a filter that limits its content to $1 (awk-style) new c9e5616 improved logging, added error detection for mount process new dae2a3a increased log output new 85042ce expanded logging, changed log messages new a910baf inserted proper umount/remount_ro -> moved into subroutine, as req'd in two places new afb741f removed a cleanup command that would umount /lib/live/mount/findiso when in ramdisk mode, which is a stupid thing to do new 8ef9d17 when trying to find the right storage device to deploy an update to in ramdisk mode, use read-only mounts at first new ab0a9b7 using mv would accumulate clutter in $DOWNLOADPATH if any extra files are present in the source; switched to rsync --delete and rm instead new b8c9a67 only rm if rsync was successful new c83e7e2 improved logging new a3ab3a2 /bin/sh seems to insist on blank between { and # new 5c6e17b improved logging new 7b6faa2 only attempt umount when path is a mounted device / improved logging new 49c3dd3 in ramdisk mode, storage should be umounted at the end of an (attempted) upgrade new 2ef220a in /bin/sh, echo -en is not supported, but echo -n is and should thus be used new 5846430 mproved logging: bandwidth test should now output progress bar. new 04fdedb added version and booted system info output, indentation fixed new dd651a2 renamed file to better represent what it does new eef01db added steps to further reduce clutter buildup, changed/improved logging new b28a492 make autoupdater show available versions before and after update new 8f555be wget param change had unintended side effects - log file was empty. rsync does not need the tee helper construct. Various spelling fixes in log output. new 6b6e54c typofix new 6631e55 more typofixes new de210f5 write timestamps to text file, for easier querying by checkscripts new a251b88 logfile will now also contain which environment is the running one new 079a962 added code to check timestamp before download new e418832 typofix new ceec20c mountpoint detection must come earlier in the script, or MOUNTPOINT variable will be empty when it's already needed by other script parts new 69d76bc variable name was wrong new b3a3618 speed optimization, also addedoutputto /var/run/banner where ssh should pick it up new 4e1c7fc further speed improvements, also, enable banner in sshd config if it was disabled new 570aabf looks like debian-live doesn't use /var/run/banner new 8bd3644 we need to strip the ANSI as it doesn't work in issue.net via SSH new 4b36d75 test: use motd instead of issue.net new 814f5f2 switched to motd instead of issue.net, removed motd display from pam login so it doesn't appear twice on local login new f234cab motd and issue are now written to simultaneously; once finished, all unused VTs are reloaded to make sure they display the new /etc/issue new eca1cbd changed logfile format new 8544d1e make sure to match to end of line only new 4a0fe27 timestamp is now checked before BWLIMIT is determined -> faster, less traffic new 73df872 tempdir preparation only needs to take place if we need to perform an update or if checking the timestamp failed (the latter part is still missing -> next commit). Also, checking the return code didn't work as expected. Finally, some style fixes. new 743a697 tempdir preparation only needs to take place if we need to perform an update or if checking the timestamp failed. Also, indentation was wrong. new 22adcfb fixed a copy-paste-induced error new 3c9a566 nvertedsequence of timestamp and envname, fixes problem that marker for active env isn't set, also, easier on the eyes new e2312ed booted env and build version should go to motd, too new 7564e58 reversed order of timestamping output; fixed error in related logfile content creation new 41904a0 added code to support background and branding parameters new 7c1f365 fixed missing escapes new 62d23fe fixed more missing escapes new 6e84ed1 syntax fixes new 465fbe5 syntax fix new c5969b8 inverted if condition, no need for a "!" here ... new 7020248 syntax fix new bb9da76 fixed an error that kept Xinerama from working (would always clone screens instead) new 08d1101 fixed regression that would allow right-click context menu again new 7b4f2d4 make sure OpenBox' ToggleMaximize is disabled, or else clicking the top row of pixels will un-maximize X2GoClient new 4f83001 added support to preselect session via boot parameter new 1576484 syntax fix new 425671f commented out i386-only package (geode Xorg driver) new 391d500 replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values new 134cc44 added support for blanks in session names (no quotes required in parameter) new a123dad replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values new e23cac0 added filters and quotes for some additional security, added missing escapes new 17876c1 fixed overzealous filter new 137174c syntaxfix new f5a3ba4 quoting fixed new aea30bf fix to display timestamp/version information regardless of squashfs file name new c32b1e0 fixed useless use of cat made sure double/single quotes work for parameters with spaces new 590e302 added trickle package, to limit bandwidth usage; added bandwidth throttling code: single throttle value limits upstream; if multiple values are specified, first is upstream, second is downstream new 00887b8 changed throttling code so it allows for "unlimited" values by specifying "u" instead of a number new fc93a82 rearranged detection sequence of throttling commands, also, rearranged parameter sequence to match trickle defaults: -d -u -t -l -L; Added code to determine maximum line speed for "u" values new 41097bb added comments explaining default values new 63a0773 fixed missing escapes new f2aa49c added script to add and store SSH host keys when proper media is present new aec4ae5 renamed 2510-x2go-getopensshportableclientkey -> 2270-getsshclientkeysfrommedia as the contents have been changed to a more generic form - it is now no longer specific to X2Go new 802cb5e make sure file permissions are correct, even when copying from vfat; make sure all keys are generated before storing on media new f1edd48 executable bit was missing new 8632333 fixed syntax error stemming from copypasta new 3b36432 dash's echo does not understand -e, thus removed new c5ed5f6 backgrounded entire task, added error checks and log output new 6b4d232 removed unneccessary escapes new c11e112 added umount command for self-mounted devices new 62d1ce1 separate umount added, for when the condition isn't matched new aca77b7 added "finished" marker new f92593b added check for already-running sshd new 1ee37c0 changed routine to be more like GetSSHHostKeysFromMedia, also, added check so it waits until GetSSHHostKeysFromMedia is done new 618e89a wildcards were missing for additional directories new da56f85 added checks so only keyfiles are copied new a9f3c9e added check so key copy routine only runs when "copysecring" boot parameter is set new c52187c added '@' as allowed character in broker URL, sessionselect, and LDAP parameters new 35a7952 added libfreerdp-plugins-standard so drive forwarding works with xfreerdp new ba7168f added required dependencies for previously added package new f345a56 config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig: fix VT switching on slow resource downloads. new a774a3c config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig: whitespace and quoting fixups. The 160 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/2000-settime | 48 ++ .../lib/live/config/2000-showifconfig | 39 -- .../lib/live/config/2100-show-sysconf | 68 +++ .../lib/live/config/2150-getsshpubkeysfromserver | 54 -- .../live/config/{2100-lockuser => 2200-lockuser} | 0 .../lib/live/config/2200-xserver-xorg-getxorgconf | 45 -- .../lib/live/config/2250-getsshpubkeysfromserver | 67 +++ .../lib/live/config/2260-getsshhostkeysfrommedia | 119 +++++ .../lib/live/config/2270-getsshclientkeysfrommedia | 118 +++++ .../lib/live/config/2300-live-autoupdate | 433 ---------------- .../lib/live/config/2300-xserver-xorg-getxorgconf | 59 +++ .../lib/live/config/2400-live-autoupdate | 568 +++++++++++++++++++++ .../config/2410-x2go-getopensshportableclientkey | 46 -- ...ppsessions => 2500-x2go-getportableappsessions} | 0 .../live/config/{2500-tcpprint => 2600-tcpprint} | 24 +- .../lib/live/config/2600-x2go-getsessions | 46 -- .../lib/live/config/2700-x2go-getsessions | 62 +++ .../lib/live/config/2710-x2go-getbranding | 61 +++ .../lib/live/config/2720-x2go-getbg | 61 +++ ...rbuttonmonitor => 2800-x2go-powerbuttonmonitor} | 0 .../lib/live/config/2800-x2go-thinclientconfig | 189 ------- .../lib/live/config/2900-x2go-thinclientconfig | 245 +++++++++ config/package-lists/desktop.list.chroot | 2 +- config/package-lists/live.list.chroot | 1 + config/package-lists/utils.list.chroot | 3 + config/package-lists/x2go.list.chroot | 4 + config/rootfs/excludes | 4 + 27 files changed, 1504 insertions(+), 862 deletions(-) create mode 100755 config/includes.chroot/lib/live/config/2000-settime delete mode 100755 config/includes.chroot/lib/live/config/2000-showifconfig create mode 100755 config/includes.chroot/lib/live/config/2100-show-sysconf delete mode 100755 config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver rename config/includes.chroot/lib/live/config/{2100-lockuser => 2200-lockuser} (100%) delete mode 100755 config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf create mode 100755 config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver create mode 100755 config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia create mode 100755 config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia delete mode 100755 config/includes.chroot/lib/live/config/2300-live-autoupdate create mode 100755 config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf create mode 100755 config/includes.chroot/lib/live/config/2400-live-autoupdate delete mode 100755 config/includes.chroot/lib/live/config/2410-x2go-getopensshportableclientkey rename config/includes.chroot/lib/live/config/{2400-x2go-getportableappsessions => 2500-x2go-getportableappsessions} (100%) rename config/includes.chroot/lib/live/config/{2500-tcpprint => 2600-tcpprint} (65%) delete mode 100755 config/includes.chroot/lib/live/config/2600-x2go-getsessions create mode 100755 config/includes.chroot/lib/live/config/2700-x2go-getsessions create mode 100755 config/includes.chroot/lib/live/config/2710-x2go-getbranding create mode 100755 config/includes.chroot/lib/live/config/2720-x2go-getbg rename config/includes.chroot/lib/live/config/{2700-x2go-powerbuttonmonitor => 2800-x2go-powerbuttonmonitor} (100%) delete mode 100755 config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig create mode 100755 config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig create mode 100644 config/rootfs/excludes -- 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 6b7e053c26359fd32511ebed1e598f0f3717ffe2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Feb 25 12:37:53 2017 +0100 make sure Alt-F4 is non-functional --- config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 519e31c..176093a 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -12,6 +12,8 @@ echo -n " x2go-thinclientconfig" 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 +# disable OpenBox Alt-F4 +sed -i -e '/<keybind key="A-F4">/,+3d' /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 -- 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 81ee79ac236fe907a50fb01778d8680513f43195 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Feb 26 18:01:17 2017 +0100 trying to fix "cifs-utils not found" error when building netboot image while deleting apt lists to save space --- config/package-lists/live.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/config/package-lists/live.list.chroot b/config/package-lists/live.list.chroot index ca96ff1..5972111 100644 --- a/config/package-lists/live.list.chroot +++ b/config/package-lists/live.list.chroot @@ -1,3 +1,4 @@ +cifs-utils console-setup console-setup-linux fuse -- 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 2dc032566ad3f011837708a6f90f9ad6a4a4e582 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Feb 25 13:47:40 2017 +0100 off-by-one-error --- config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 176093a..d8ab8d1 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -13,7 +13,7 @@ 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 # disable OpenBox Alt-F4 -sed -i -e '/<keybind key="A-F4">/,+3d' /etc/xdg/openbox/rc.xml +sed -i -e '/<keybind key="A-F4">/,+2d' /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 -- 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 b025f3edb102d7bc6834c32b827c6217919672ab Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Feb 26 18:02:54 2017 +0100 OpenBox Keybindings need to be disabled entirely, they interfere with Xephyr and the like. --- config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index d8ab8d1..204d1c2 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -10,10 +10,9 @@ 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 -# disable OpenBox Alt-F4 -sed -i -e '/<keybind key="A-F4">/,+2d' /etc/xdg/openbox/rc.xml +# disable OpenBox keyboard bindings +# this also disables the context menu (would be accessible in xinerama) and things like Alt-F4 for X2GoClient, Xephyr, etc. +sed -i -e '/<keyboard>/,/<\/keyboard>/{//!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 -- 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 abab9f0dcb901fb6ce912bd68723250a390f1e08 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Feb 26 18:00:29 2017 +0100 trying to shrink the image; note: squashfs excludes must not begin with "/", "./", or "../" when using wildcards --- config/rootfs/excludes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/rootfs/excludes b/config/rootfs/excludes new file mode 100644 index 0000000..58dacc4 --- /dev/null +++ b/config/rootfs/excludes @@ -0,0 +1,4 @@ +usr/share/doc/* +usr/share/locale/* +usr/share/man/* +var/lib/apt/lists/* -- 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 95b71dd77d20c916e4bc9b1406c188bac243fe25 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Apr 24 16:17:40 2017 +0200 2800-x2go-thinclientconfig: added quotation marks --- config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 204d1c2..39d884f 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -60,7 +60,7 @@ for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d ' # 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 [ -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, -- 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 90ef1e7c9b1a5b5984aea7f84a6ee245098704d9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 17:44:37 2017 +0200 added numbers to if-up.d script file names so we can enforce the sequence of execution --- config/includes.chroot/lib/live/config/2000-showifconfig | 4 ++-- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 4 ++-- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 4 ++-- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 69d8e84..d0521b5 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -12,7 +12,7 @@ echo -n " showifconfig" # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else # Output the result on virtual terminal 9 -cat >/etc/network/if-up.d/showips <<SHOWIPS +cat >/etc/network/if-up.d/000-showips <<SHOWIPS #!/bin/bash export TERM=linux; @@ -33,7 +33,7 @@ echo "\$IPMSG" >> /etc/issue; echo "\$IPMSG" >> /etc/issue.net SHOWIPS -chmod 755 /etc/network/if-up.d/showips +chmod 755 /etc/network/if-up.d/000-showips } diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 01ba31f..e3e7ebb 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -13,7 +13,7 @@ GetSSHPubKeysFromServer () awk -F'=' ' /^pubkey=/ { print $2 }') if [ -n "$PUBKEYURL" ] ; then - cat >/etc/network/if-up.d/getsshpubkeysfromserver <<GETPUBKEY + cat >/etc/network/if-up.d/010-getsshpubkeysfromserver <<GETPUBKEY #!/bin/bash export TERM=linux; @@ -46,7 +46,7 @@ else fi GETPUBKEY - chmod 755 /etc/network/if-up.d/getsshpubkeysfromserver + chmod 755 /etc/network/if-up.d/010-getsshpubkeysfromserver fi } diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 3fa2a29..d9dcf4e 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -11,7 +11,7 @@ echo -n " xserver-xorg-getxorgconf" awk -F'=' ' /^xorgconfurl=/ { print $2 }') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then XORGCONFDESTINATION=/etc/X11/xorg.conf.new - cat >/etc/network/if-up.d/getxorgconf <<GETXORG + cat >/etc/network/if-up.d/020-getxorgconf <<GETXORG #!/bin/bash export TERM=linux; @@ -40,7 +40,7 @@ if [ -s $XORGCONFDESTINATION ] ; then fi GETXORG - chmod 755 /etc/network/if-up.d/getxorgconf + chmod 755 /etc/network/if-up.d/020-getxorgconf fi } XServerXorgGetXorgConf diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index a022684..4ae1562 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -14,7 +14,7 @@ X2GoGetSessions () # it might have been customized at image creation time mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new - cat >/etc/network/if-up.d/getsessions <<GETSESS + cat >/etc/network/if-up.d/030-getsessions <<GETSESS #!/bin/bash export TERM=linux; @@ -43,7 +43,7 @@ if [ -s $SESSIONSDESTINATION ] ; then fi GETSESS - chmod 755 /etc/network/if-up.d/getsessions + chmod 755 /etc/network/if-up.d/030-getsessions 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 15119df7e42413cf06eda66ca469eb10a7cdf854 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 18:57:05 2017 +0200 we need to escape $0, as it will contain the name of the script generating the if-up.d script if we don't --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index d0521b5..ee4c1f2 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/000-showips <<SHOWIPS export TERM=linux; while [ -z "$(hostname -I)" ] ; do - echo "'$0' is waiting for a client IP." + echo "'\$0' is waiting for a client IP." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index e3e7ebb..e8277dc 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "$(hostname -I)" ] ; do - echo "'$0' is waiting for a client IP." + echo "'\$0' is waiting for a client IP." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index d9dcf4e..1ec5870 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "$(hostname -I)" ] ; do - echo "'$0' is waiting for a client IP." + echo "'\$0' is waiting for a client IP." sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 4ae1562..7a90aca 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "$(hostname -I)" ] ; do - echo "'$0' is waiting for a client IP." + echo "'\$0' is waiting for a client IP." sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 4983dce906c07a526ca7f8f71b04a34afe4d910d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 14:43:04 2017 +0200 more reliable way of determining that IP has been assigned --- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index e613d35..614fc40 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -17,7 +17,7 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do +while [ -z "$(hostname -I)" ] ; do sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 2dd20da..6c892f5 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -15,7 +15,7 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do +while [ -z "$(hostname -I)" ] ; do sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then -- 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 820a66b935d438b96a1b4e5d931f6632dfd4b3d1 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 15:00:54 2017 +0200 make getsessions delete thinclient_sessions file if boot parameter was passed; make thinclientconfig wait for valid thinclient_sessions file unless broker mode is active --- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 3 +++ config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index a3c476c..a022684 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -10,6 +10,9 @@ X2GoGetSessions () tr ' ' '\n' | \ awk -F'=' ' /^sessionsurl=/ { print $2 }') if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then + # only mv this file if SESSIONSURL was set. If not, leave it in place - as + # it might have been customized at image creation time + mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new cat >/etc/network/if-up.d/getsessions <<GETSESS #!/bin/bash diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig index 39d884f..96ab5a2 100755 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig @@ -107,6 +107,13 @@ if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" else SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" + while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do + OLDCON=$(fgconsole) + chvt 1 + echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." + sleep 2 + done + [ -n "$OLDCON" ] && chvt $OLDCON fi if [ -n "\$LDAP" ] ; then if [ -n "\$LDAP1" ] ; then -- 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 f1cf658f2294107e78820cff2f75741a7048791f Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 14:47:31 2017 +0200 added output: when sleeping while waiting for an IP, print out which script is waiting. --- config/includes.chroot/lib/live/config/2000-showifconfig | 1 + config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 1 + config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 1 + config/includes.chroot/lib/live/config/2600-x2go-getsessions | 1 + 4 files changed, 4 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index b3e6f89..69d8e84 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,6 +17,7 @@ cat >/etc/network/if-up.d/showips <<SHOWIPS export TERM=linux; while [ -z "$(hostname -I)" ] ; do + echo "'$0' is waiting for a client IP." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 614fc40..01ba31f 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,6 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "$(hostname -I)" ] ; do + echo "'$0' is waiting for a client IP." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 6c892f5..3fa2a29 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,6 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "$(hostname -I)" ] ; do + echo "'$0' is waiting for a client IP." sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index c628283..a3c476c 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -16,6 +16,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "$(hostname -I)" ] ; do + echo "'$0' is waiting for a client IP." sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 3f94816d32b046a5e558bd14df1c5be6c33a83e9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 14:39:41 2017 +0200 more reliable way of determining that IP has been assigned --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 20896d4..b3e6f89 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -16,7 +16,7 @@ cat >/etc/network/if-up.d/showips <<SHOWIPS #!/bin/bash export TERM=linux; -while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do +while [ -z "$(hostname -I)" ] ; do sleep 2 done -- 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 a15fbba71a7a099c5def51623f2507de7779d221 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 14:41:42 2017 +0200 more reliable way of determining that IP has been assigned --- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 74524fc..c628283 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -15,7 +15,7 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -while ! ip a | grep -v "inet 127.0.0.1" | grep -v "inet6 ::1/128" | grep -q inet ; do +while [ -z "$(hostname -I)" ] ; do sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 35b27fd825e6b1ccf6f5958c96a03626c987aaf5 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 21:53:40 2017 +0200 Variable name was wrong in one place --- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index d73dcf1..217ce24 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -30,7 +30,7 @@ export TERM=linux; touch /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys - if echo "$PUBKEY" | grep -q "^tftp://" ; then + if echo "$PUBKEYURL" | grep -q "^tftp://" ; then PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then -- 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 b66b461b6bee1337c2f0acf9f060e580baa5a35a Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 20:54:32 2017 +0200 attempt to background all network-related tasks --- .../lib/live/config/2000-showifconfig | 32 ++++++++------- .../lib/live/config/2150-getsshpubkeysfromserver | 48 +++++++++++----------- .../lib/live/config/2200-xserver-xorg-getxorgconf | 47 ++++++++++----------- .../lib/live/config/2600-x2go-getsessions | 47 ++++++++++----------- 4 files changed, 90 insertions(+), 84 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index ee4c1f2..4c9169c 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -16,21 +16,23 @@ cat >/etc/network/if-up.d/000-showips <<SHOWIPS #!/bin/bash export TERM=linux; -while [ -z "$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - sleep 2 -done - -IPMSG=\$(LANG=C \ -/sbin/ip a | \ -/bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ -GREP_COLOR="1;32" \ -/bin/grep -P --color=always "link/ether .*? |$" ); \ -IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); -sed -i '/^- /d' /etc/issue; -sed -i '/^- /d' /etc/issue.net; -echo "\$IPMSG" >> /etc/issue; -echo "\$IPMSG" >> /etc/issue.net +( + while [ -z "$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + sleep 2 + done + + IPMSG=\$(LANG=C \ + /sbin/ip a | \ + /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ + GREP_COLOR="1;32" \ + /bin/grep -P --color=always "link/ether .*? |$" ); \ + IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); + sed -i '/^- /d' /etc/issue; + sed -i '/^- /d' /etc/issue.net; + echo "\$IPMSG" >> /etc/issue; + echo "\$IPMSG" >> /etc/issue.net +) & SHOWIPS chmod 755 /etc/network/if-up.d/000-showips diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index e8277dc..c1f5dc4 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -17,33 +17,35 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -while [ -z "$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - 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 +( + while [ -z "$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + 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 -else - while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do - echo "Waiting for SSH Public Key ..." - sleep 5 - done -fi +) & GETPUBKEY chmod 755 /etc/network/if-up.d/010-getsshpubkeysfromserver diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 1ec5870..fb9f7ea 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -15,30 +15,31 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -while [ -z "$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - sleep 2 -done -if echo "$XORGCONFURL" | grep -q "^tftp://" ; then - XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then - while ! atftp $XORGCONFSERVER -g -r $XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo "Waiting for xorg.conf download ..." - sleep 5 - done - fi -else - while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo "Waiting for xorg.conf download ..." - sleep 5 - done -fi - -if [ -s $XORGCONFDESTINATION ] ; then - mv $XORGCONFDESTINATION /etc/X11/xorg.conf -fi +( + while [ -z "$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." + sleep 2 + done + if echo "$XORGCONFURL" | grep -q "^tftp://" ; then + XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then + while ! atftp $XORGCONFSERVER -g -r $XORGCONFPATH -l $XORGCONFDESTINATION ; do + echo "Waiting for xorg.conf download ..." + sleep 5 + done + fi + else + while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do + echo "Waiting for xorg.conf download ..." + sleep 5 + done + fi + if [ -s $XORGCONFDESTINATION ] ; then + mv $XORGCONFDESTINATION /etc/X11/xorg.conf + fi +) & GETXORG chmod 755 /etc/network/if-up.d/020-getxorgconf fi diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 7a90aca..8163cf6 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -18,30 +18,31 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -while [ -z "$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - sleep 2 -done -if echo "$SESSIONSURL" | grep -q "^tftp://" ; then - SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then - while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo "Waiting for session config data ..." - sleep 5 - done - fi -else - while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo "Waiting for session config data ..." - sleep 5 - done -fi - -if [ -s $SESSIONSDESTINATION ] ; then - mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions -fi +( + while [ -z "$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." + sleep 2 + done + if echo "$SESSIONSURL" | grep -q "^tftp://" ; then + SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then + while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do + echo "Waiting for session config data ..." + sleep 5 + done + fi + else + while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do + echo "Waiting for session config data ..." + sleep 5 + done + fi + if [ -s $SESSIONSDESTINATION ] ; then + mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions + fi +) & GETSESS chmod 755 /etc/network/if-up.d/030-getsessions 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 7bd59cbb07a98adf85045d741059332bd9c85ae5 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 21:56:56 2017 +0200 changed script numbering to four-digit, beginning with 0100 --- config/includes.chroot/lib/live/config/2000-showifconfig | 4 ++-- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 4 ++-- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 4 ++-- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index f227384..f1b8236 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -12,7 +12,7 @@ echo -n " showifconfig" # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else # Output the result on virtual terminal 9 -cat >/etc/network/if-up.d/000-showips <<SHOWIPS +cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; @@ -33,7 +33,7 @@ echo "\$IPMSG" >> /etc/issue; echo "\$IPMSG" >> /etc/issue.net SHOWIPS -chmod 755 /etc/network/if-up.d/000-showips +chmod 755 /etc/network/if-up.d/0100-showips } diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 16616f6..f2ab3b3 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -13,7 +13,7 @@ GetSSHPubKeysFromServer () awk -F'=' ' /^pubkey=/ { print $2 }') if [ -n "$PUBKEYURL" ] ; then - cat >/etc/network/if-up.d/010-getsshpubkeysfromserver <<GETPUBKEY + cat >/etc/network/if-up.d/0200-getsshpubkeysfromserver <<GETPUBKEY #!/bin/bash export TERM=linux; @@ -46,7 +46,7 @@ else fi GETPUBKEY - chmod 755 /etc/network/if-up.d/010-getsshpubkeysfromserver + chmod 755 /etc/network/if-up.d/0200-getsshpubkeysfromserver fi } diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index bfd8d69..94bc31a 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -11,7 +11,7 @@ echo -n " xserver-xorg-getxorgconf" awk -F'=' ' /^xorgconfurl=/ { print $2 }') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then XORGCONFDESTINATION=/etc/X11/xorg.conf.new - cat >/etc/network/if-up.d/020-getxorgconf <<GETXORG + cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG #!/bin/bash export TERM=linux; @@ -39,7 +39,7 @@ if [ -s $XORGCONFDESTINATION ] ; then mv $XORGCONFDESTINATION /etc/X11/xorg.conf fi GETXORG - chmod 755 /etc/network/if-up.d/020-getxorgconf + chmod 755 /etc/network/if-up.d/0300-getxorgconf fi } XServerXorgGetXorgConf diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 2ff8d2b..6e63262 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -14,7 +14,7 @@ X2GoGetSessions () # it might have been customized at image creation time mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new - cat >/etc/network/if-up.d/030-getsessions <<GETSESS + cat >/etc/network/if-up.d/0400-getsessions <<GETSESS #!/bin/bash export TERM=linux; @@ -42,7 +42,7 @@ if [ -s $SESSIONSDESTINATION ] ; then mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions fi GETSESS - chmod 755 /etc/network/if-up.d/030-getsessions + chmod 755 /etc/network/if-up.d/0400-getsessions 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 aec9d940f1603e4d8daadc88c122d1c33a33744f Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 21:51:28 2017 +0200 fixes missing escape -> hostname -I was never executed --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 4c9169c..5ae4a1e 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/000-showips <<SHOWIPS export TERM=linux; ( - while [ -z "$(hostname -I)" ] ; do + while [ -z "\$(hostname -I)" ] ; do echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index c1f5dc4..d73dcf1 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; ( - while [ -z "$(hostname -I)" ] ; do + while [ -z "\$(hostname -I)" ] ; do echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index fb9f7ea..e474167 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; ( - while [ -z "$(hostname -I)" ] ; do + while [ -z "\$(hostname -I)" ] ; do echo "'\$0' is waiting for a client IP." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 8163cf6..aa00f3a 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; ( - while [ -z "$(hostname -I)" ] ; do + while [ -z "\$(hostname -I)" ] ; do echo "'\$0' is waiting for a client IP." sleep 2 done -- 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 eaf2a2ffcd39a5764923283a7e733c06d590ab9a Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Fri Jul 21 21:55:08 2017 +0200 un-did backgrounding --- .../lib/live/config/2000-showifconfig | 32 +++++++-------- .../lib/live/config/2150-getsshpubkeysfromserver | 48 +++++++++++----------- .../lib/live/config/2200-xserver-xorg-getxorgconf | 40 +++++++++--------- .../lib/live/config/2600-x2go-getsessions | 40 +++++++++--------- 4 files changed, 76 insertions(+), 84 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 5ae4a1e..f227384 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -16,23 +16,21 @@ cat >/etc/network/if-up.d/000-showips <<SHOWIPS #!/bin/bash export TERM=linux; -( - while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 - sleep 2 - done - - IPMSG=\$(LANG=C \ - /sbin/ip a | \ - /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ - GREP_COLOR="1;32" \ - /bin/grep -P --color=always "link/ether .*? |$" ); \ - IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); - sed -i '/^- /d' /etc/issue; - sed -i '/^- /d' /etc/issue.net; - echo "\$IPMSG" >> /etc/issue; - echo "\$IPMSG" >> /etc/issue.net -) & +while [ -z "\$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + sleep 2 +done + +IPMSG=\$(LANG=C \ +/sbin/ip a | \ +/bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ +GREP_COLOR="1;32" \ +/bin/grep -P --color=always "link/ether .*? |$" ); \ +IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); +sed -i '/^- /d' /etc/issue; +sed -i '/^- /d' /etc/issue.net; +echo "\$IPMSG" >> /etc/issue; +echo "\$IPMSG" >> /etc/issue.net SHOWIPS chmod 755 /etc/network/if-up.d/000-showips diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 217ce24..16616f6 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -17,35 +17,33 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -( - while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 - 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 "$PUBKEYURL" | 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 [ -z "\$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + 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 "$PUBKEYURL" | 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 chmod 755 /etc/network/if-up.d/010-getsshpubkeysfromserver diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index e474167..bfd8d69 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -15,31 +15,29 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -( - while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - sleep 2 - done - if echo "$XORGCONFURL" | grep -q "^tftp://" ; then - XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then - while ! atftp $XORGCONFSERVER -g -r $XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo "Waiting for xorg.conf download ..." - sleep 5 - done - fi - else - while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do +while [ -z "\$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." + sleep 2 +done +if echo "$XORGCONFURL" | grep -q "^tftp://" ; then + XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then + while ! atftp $XORGCONFSERVER -g -r $XORGCONFPATH -l $XORGCONFDESTINATION ; do echo "Waiting for xorg.conf download ..." - sleep 5 + sleep 5 done fi +else + while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do + echo "Waiting for xorg.conf download ..." + sleep 5 + done +fi - if [ -s $XORGCONFDESTINATION ] ; then - mv $XORGCONFDESTINATION /etc/X11/xorg.conf - fi -) & +if [ -s $XORGCONFDESTINATION ] ; then + mv $XORGCONFDESTINATION /etc/X11/xorg.conf +fi GETXORG chmod 755 /etc/network/if-up.d/020-getxorgconf fi diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index aa00f3a..2ff8d2b 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -18,31 +18,29 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -( - while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." - sleep 2 - done - if echo "$SESSIONSURL" | grep -q "^tftp://" ; then - SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then - while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo "Waiting for session config data ..." - sleep 5 - done - fi - else - while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do +while [ -z "\$(hostname -I)" ] ; do + echo "'\$0' is waiting for a client IP." + sleep 2 +done +if echo "$SESSIONSURL" | grep -q "^tftp://" ; then + SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then + while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do echo "Waiting for session config data ..." - sleep 5 + sleep 5 done fi +else + while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do + echo "Waiting for session config data ..." + sleep 5 + done +fi - if [ -s $SESSIONSDESTINATION ] ; then - mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions - fi -) & +if [ -s $SESSIONSDESTINATION ] ; then + mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions +fi GETSESS chmod 755 /etc/network/if-up.d/030-getsessions 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 4b66f5f0ee815ef68be31e84291bdc50cedfe0ae Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 01:22:16 2017 +0200 removed old commented-out code --- config/includes.chroot/lib/live/config/2000-showifconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 6ebb066..77fd1ce 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -7,7 +7,6 @@ ShowIFConfig () # echo -n " showifconfig" -#setterm -term linux -r >/dev/tty9 # Make sure no language-specific stuff interferes with our matching # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else -- 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 25b9cdb78203c3bf3939ace7d9da1a47c1cb3e38 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 01:33:35 2017 +0200 switched liveupdate to tty(next-available-VT) logging and timestamped output --- .../lib/live/config/2300-live-autoupdate | 94 +++++++++++----------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate index 8b351fd..6af3b8d 100755 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate @@ -35,13 +35,13 @@ echo -n " live-autoupdater (backgrounding update task)" ( # wait until terminal is available -while ! [ -c /dev/tty10 ] ; do +while ! [ -c /dev/tty$(fgconsole -n) ] ; do sleep 10 done -# redirect all output to console #10 +# redirect all output to first available VT console # -exec >/dev/tty10 2>&1 +exec >/dev/tty$(fgconsole -n) 2>&1 # clear console @@ -62,7 +62,7 @@ DOWNLOADURL=$(cat /proc/cmdline | \ awk -F'=' ' /^updateurl=/ { print $2 }') if [ -z "$DOWNLOADURL" ]; then - echo "No update URL. Exiting." + echo -en "\n$(date +'%F | %T | ')'\$0': No update URL. Exiting." return 0 fi @@ -74,7 +74,7 @@ BWLIMITPERCENT=$(cat /proc/cmdline | \ awk -F'=' ' /^bwlimit=/ { print $2 }') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 - echo "Bandwidth limit not set. Defaulting to 20%." + echo -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." fi @@ -88,7 +88,7 @@ if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then MAXSLEEPTIME=900 fi SLEEPTIME=0 -echo "Calculating random update delay (120-$MAXSLEEPTIME seconds)..." +echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." # During startup, script is run with /bin/sh, # even when #!/bin/bash is set, # so we need to improvise. @@ -97,7 +97,7 @@ SLEEPTIME=$((RND%MAXSLEEPTIME)) if [ $SLEEPTIME -lt 120 ]; then SLEEPTIME=$((SLEEPTIME+120)) fi -echo "Sleeping for $SLEEPTIME seconds ..." +echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping for $SLEEPTIME seconds ..." sleep $SLEEPTIME @@ -116,9 +116,9 @@ if [ -n "$NTFSROOT" ]; then fi if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo "Mounted '/dev/disk/by-uuid/$NTFSROOT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." else - echo "Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." fi # TODO: Further error handling MOUNTPOINT="/lib/live/mount/ntfsroot/" @@ -139,7 +139,7 @@ if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ ) \ ); then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "No directories suitable for update." + echo -en "\n$(date +'%F | %T | ')'\$0': No directories suitable for update." return 0 # directories missing, most likely not a writeable medium fi @@ -158,7 +158,7 @@ elif [ -f "$MOUNTPOINT/boot/grub/menu.lst" ]; then GRUBPATH="$MOUNTPOINT/boot/grub/" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "No suitable bootloader found." + echo -en "\n$(date +'%F | %T | ')'\$0': No suitable bootloader found." return 1 fi @@ -174,7 +174,7 @@ elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then OTHERSYSTEMNAME="X2Go-live1" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "Unable to determine path/name of running system." + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." return 1 fi OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") @@ -188,9 +188,9 @@ DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") # like CF cards) # while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do - echo "Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." sleep 30 - echo "Retrying ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." done @@ -210,7 +210,7 @@ if echo "$DOWNLOADURL" | grep -q "^http" || \ ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -n "Not enough Bandwidth for update task - " + [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -228,7 +228,7 @@ if echo "$DOWNLOADURL" | grep -q "^http" || \ awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo "Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" @@ -244,7 +244,7 @@ elif echo "$DOWNLOADURL" | grep -q "^rsync"; then ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -n "Not enough Bandwidth for update task - " + [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -261,12 +261,12 @@ elif echo "$DOWNLOADURL" | grep -q "^rsync"; then awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo "Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "Unsupported download mechanism." + echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." return 1 fi rm /tmp/dl.log @@ -275,25 +275,25 @@ rm /tmp/dl.log # Proceed to download from update location # while ! $DOWNLOADCOMMAND; do - echo "Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." sleep 30 - echo "Retrying ..." + echo -en "\n$(date +'%F | %T | ')'\$0': 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' ..." +echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." if diff -q $DOWNLOADPATH $TEMPDIR \ >/dev/null then cleanup - echo "Nothing to do. - Files on server not newer than '$DOWNLOADPATH'." + echo -en "\n$(date +'%F | %T | ')'\$0': 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 ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Differences detected. Continuing ..." fi @@ -301,9 +301,9 @@ fi # remount it rw and async for speed # if mount -oremount,rw,async $MOUNTPOINT; then - echo "Remounted '$MOUNTPOINT' as rw and async." + echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." else - echo "Could not remount '$MOUNTPOINT' as rw and async." + echo -en "\n$(date +'%F | %T | ')'\$0': Could not remount '$MOUNTPOINT' as rw and async." fi @@ -314,26 +314,26 @@ rm -f $TEMPDIR/index.ht* # move everything over to the boot medium # -echo "Moving $TEMPDIR/* => $DOWNLOADPATH" +echo -en "\n$(date +'%F | %T | ')'\$0': 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'." + echo -en "\n$(date +'%F | %T | ')'\$0': 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." + echo -en "\n$(date +'%F | %T | ')'\$0': Mount successful." else - echo "Failed to mount NTFSROOT." + echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." fi fi # let's check if we just downloaded a copy of our running system # -echo "Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" +echo -en "\n$(date +'%F | %T | ')'\$0': 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" \ + echo -en "\n$(date +'%F | %T | ')'\$0': 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 @@ -348,20 +348,20 @@ mkdir -p $OTHERSYSTEMFULLPATH # let's check if our destination is already up to date or needs updating # -echo "Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" +echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "Nothing to do - content of '$DOWNLOADPATH' equals"\ + echo -en "\n$(date +'%F | %T | ')'\$0': 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" + echo -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH do - echo "Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." sleep 30 - echo "Retrying ..." + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." done fi @@ -369,7 +369,7 @@ fi # change default boot to the image we just downloaded and installed # if [ -n "$SYSLINUXPATH" ]; then - echo "Changing syslinux default to $OTHERSYSTEMNAME." + echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ $SYSLINUXPATH/syslinux.cfg @@ -385,16 +385,16 @@ elif [ -n "$GRUBPATH" ]; then awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo "Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + echo -en "\n$(date +'%F | %T | ')'\$0': 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'." + echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." + echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." fi else - echo "Unsupported bootloader." + echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported bootloader." fi # we're on an async mount point, so let's sync to be safe @@ -413,15 +413,15 @@ fi # if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo "Unmounted '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." else - echo "Unable to unmount '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." fi else if mount -oremount,ro,sync $MOUNTPOINT; then - echo "Remounted '$MOUNTPOINT' ro and sync." + echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." else - echo "Unable to remount '$MOUNTPOINT' ro and sync." + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." fi 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 9864947ad5d19c41a983603d3dc6110eef2d8e1b Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 00:29:13 2017 +0200 added timestamps to log output, fixed log output in 2200 and 2600 --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index f1b8236..99ddb60 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index f2ab3b3..511a8a4 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 94bc31a..8ae3472 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." + echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 6e63262..3d2f623 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "'\$0' is waiting for a client IP." + echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 69385899a378d9704645f2ddc37d2d224a6eb4cf Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 00:34:08 2017 +0200 added timestamps, switched log output to | tee -a /dev/tty9 like in the other scripts --- config/includes.chroot/lib/live/config/2500-tcpprint | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint index 6026f44..68bbe5c 100755 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ b/config/includes.chroot/lib/live/config/2500-tcpprint @@ -28,7 +28,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -e "\nSetting up local printers ..." >>/dev/tty9 + echo -e "\n$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +52,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo "Mapping $PRINTERDEV => $PORTNUMBER" >>/dev/tty9 + echo "$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -n "xinetd needs to be restarted, trying to do that ..." >>/dev/tty9 + echo -n "$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 if /etc/init.d/xinetd restart; then - echo -n " success. All done." >>/dev/tty9 + echo -n " success. All done." | tee -a /dev/tty9 else - echo -n " error." >>/dev/tty9 + echo -n " error." | tee -a /dev/tty9 fi else - echo -n "No xinetd restart necessary. All done." >>/dev/tty9 + echo -n "$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 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 04edee3cd4194e0dc03908b13635efaf7e04eca9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 01:29:23 2017 +0200 escape sign wass missingonce again ... --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- .../includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- .../includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2500-tcpprint | 8 ++++---- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 99ddb60..e42ccf4 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 511a8a4..382a797 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 8ae3472..0bb16a7 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint index 68bbe5c..a7cb327 100755 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ b/config/includes.chroot/lib/live/config/2500-tcpprint @@ -28,7 +28,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -e "\n$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 + echo -e "\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +52,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo "$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 + echo "\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -n "$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 + echo -n "\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 if /etc/init.d/xinetd restart; then echo -n " success. All done." | tee -a /dev/tty9 else echo -n " error." | tee -a /dev/tty9 fi else - echo -n "$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 + echo -n "\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 fi ) & diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 3d2f623..f0a7848 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 cdc01cd4d39493cbb34731feda4412851e23a6e9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 11:53:55 2017 +0200 improved log output --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- .../includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- .../includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2500-tcpprint | 8 ++++---- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index e42ccf4..faa5918 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 382a797..3070fa2 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 0bb16a7..4955f7b 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint index a7cb327..c22e235 100755 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ b/config/includes.chroot/lib/live/config/2500-tcpprint @@ -28,7 +28,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -e "\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 + echo -en "\\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +52,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo "\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 + echo -en "\\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -n "\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 + echo -en "\\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 if /etc/init.d/xinetd restart; then echo -n " success. All done." | tee -a /dev/tty9 else echo -n " error." | tee -a /dev/tty9 fi else - echo -n "\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 + echo -en "\\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 fi ) & diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index f0a7848..da0135b 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo "\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then @@ -27,13 +27,13 @@ if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo "Waiting for session config data ..." + echo -en "\\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo "Waiting for session config data ..." + echo -en "\\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 sleep 5 done 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 55cf2a87846a2858ad2afffce18c0063a94ec43f Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 12:39:17 2017 +0200 last commit was incomplete, and included one escape too much per echo --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- .../includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- .../includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2500-tcpprint | 8 ++++---- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index faa5918..0f96fdf 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 3070fa2..0042e3d 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 4955f7b..31587c5 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -n "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint index c22e235..477a53d 100755 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ b/config/includes.chroot/lib/live/config/2500-tcpprint @@ -28,7 +28,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -en "\\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +52,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo -en "\\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -en "\\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 if /etc/init.d/xinetd restart; then echo -n " success. All done." | tee -a /dev/tty9 else echo -n " error." | tee -a /dev/tty9 fi else - echo -en "\\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 fi ) & diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index da0135b..3af8c22 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -en "\\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then -- 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 655a2ec48654ec737f0622a1c979b335583dfc65 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 13:10:22 2017 +0200 and again, missing escapes --- config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 0042e3d..22dc9fd 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -32,7 +32,7 @@ chmod 600 /root/.ssh/authorized_keys if echo "$PUBKEYURL" | grep -q "^tftp://" ; then PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then + 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 -- 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 a9d86a58ad7f2d6d270f4a7f1243d472bda27e76 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 13:13:11 2017 +0200 more missing escapes --- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 4 ++-- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index a36fc1f..e89a565 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -22,8 +22,8 @@ done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$XORGCONFSERVER" ] && [ -n "$XORGCONFPATH" ] ; then - while ! atftp $XORGCONFSERVER -g -r $XORGCONFPATH -l $XORGCONFDESTINATION ; do + if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then + while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do echo "Waiting for xorg.conf download ..." sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 3af8c22..e63d06a 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -25,8 +25,8 @@ done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "$SESSIONSSERVER" ] && [ -n "$SESSIONSPATH" ] ; then - while ! atftp $SESSIONSSERVER -g -r $SESSIONSPATH -l $SESSIONSDESTINATION ; do + if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then + while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do echo -en "\\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 sleep 5 done -- 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 8d30d6d744b96e9fbbd3691e77ba6d36e63d6371 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 13:10:51 2017 +0200 indentation was wrong --- config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index 31587c5..a36fc1f 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -10,8 +10,8 @@ echo -n " xserver-xorg-getxorgconf" tr ' ' '\n' | \ awk -F'=' ' /^xorgconfurl=/ { print $2 }') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then - XORGCONFDESTINATION=/etc/X11/xorg.conf.new - cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG + XORGCONFDESTINATION=/etc/X11/xorg.conf.new + cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG #!/bin/bash export TERM=linux; -- 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 e75d92eca3a2488d4ea446a6f781b68cc6e0cc4d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Jul 22 13:14:00 2017 +0200 more superfluous escapes removed --- config/includes.chroot/lib/live/config/2600-x2go-getsessions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index e63d06a..7e633ac 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -27,13 +27,13 @@ if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 sleep 5 done 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 98db2587e218d052a0556ce2ca9d0e5d35171f53 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 01:19:47 2017 +0200 tty9 -> tty(first unused VT) --- config/includes.chroot/lib/live/config/2000-showifconfig | 2 +- .../lib/live/config/2150-getsshpubkeysfromserver | 2 +- .../lib/live/config/2200-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2500-tcpprint | 12 ++++++------ config/includes.chroot/lib/live/config/2600-x2go-getsessions | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 0f96fdf..6ebb066 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -17,7 +17,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver index 22dc9fd..21f0c31 100755 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver @@ -18,7 +18,7 @@ GetSSHPubKeysFromServer () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf index e89a565..06794b1 100755 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf @@ -16,7 +16,7 @@ echo -n " xserver-xorg-getxorgconf" export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint index 477a53d..2bb453b 100755 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ b/config/includes.chroot/lib/live/config/2500-tcpprint @@ -28,7 +28,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -en "\n\$(date +'%F | %T | ')Setting up local printers ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +52,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(fgconsole -n) PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(fgconsole -n) if /etc/init.d/xinetd restart; then - echo -n " success. All done." | tee -a /dev/tty9 + echo -n " success. All done." | tee -a /dev/tty\$(fgconsole -n) else - echo -n " error." | tee -a /dev/tty9 + echo -n " error." | tee -a /dev/tty\$(fgconsole -n) fi else - echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(fgconsole -n) fi ) & diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions index 7e633ac..eff3073 100755 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2600-x2go-getsessions @@ -19,7 +19,7 @@ X2GoGetSessions () export TERM=linux; while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then @@ -27,13 +27,13 @@ if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty9 + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) sleep 5 done 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 4ce959fb86eb0ee08a06f396835487c3d3253ced Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 13:09:23 2017 +0200 moved "wait until unused VT becomes available" from 2300 to 2000 --- config/includes.chroot/lib/live/config/2000-showifconfig | 5 +++++ config/includes.chroot/lib/live/config/2300-live-autoupdate | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 24268ac..9467e47 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -7,6 +7,11 @@ ShowIFConfig () # echo -n " showifconfig" +# wait until terminal is available +while ! [ -c /dev/tty$(fgconsole -n) ] ; do + sleep 10 +done + # Make sure no language-specific stuff interferes with our matching # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate index d09130d..7e88812 100755 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate @@ -34,11 +34,6 @@ echo -n " live-autoupdater (backgrounding update task)" # ( -# wait until terminal is available -while ! [ -c /dev/tty$(fgconsole -n) ] ; do - sleep 10 -done - # redirect all output to first available VT console # exec >/dev/tty$(fgconsole -n) 2>&1 -- 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 51a85b004563714441508906fbb9e8d1374df74d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 14:54:33 2017 +0200 first attempt at making all if-up scripts wait until an unused VT is available for log output --- .../lib/live/config/2000-waitforvts | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts new file mode 100755 index 0000000..8d558e6 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -0,0 +1,24 @@ +#!/bin/bash + +WaitForVTs () +{ + +# Output startup message +# +echo -n " waitforvts" + +cat >/etc/network/if-up.d/0000-waitforvts <<SHOWIPS +#!/bin/bash +export TERM=linux; + +# wait until terminal is available +while ! [ -c /dev/tty$(fgconsole -n) ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for an unused VT to become available." + sleep 2 +done + +chmod 755 /etc/network/if-up.d/0000-waitforvts + +} + +WaitForVTs -- 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 8f974b4d1e37296c57dba65d31bfdf06cbadde40 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 13:44:30 2017 +0200 hwclock is not a package on its own, but contained in util-linux --- 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 2eda261..930954e 100644 --- a/config/package-lists/utils.list.chroot +++ b/config/package-lists/utils.list.chroot @@ -2,7 +2,6 @@ acpid acpi-support atftp ca-certificates -hwclock kbd ntpdate openssh-client @@ -12,6 +11,7 @@ openssl psmisc rsync screen +util-linux vim wget xinetd -- 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 c4eaed83630534adc98302818c6bd473dd9e61ca Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 14:46:36 2017 +0200 renamed files; delete old names from git --- .../lib/live/config/2000-showifconfig | 43 -- .../includes.chroot/lib/live/config/2100-lockuser | 20 - .../lib/live/config/2150-getsshpubkeysfromserver | 55 --- .../lib/live/config/2200-xserver-xorg-getxorgconf | 45 --- .../lib/live/config/2300-live-autoupdate | 439 --------------------- .../live/config/2400-x2go-getportableappsessions | 23 -- .../config/2410-x2go-getopensshportableclientkey | 46 --- .../includes.chroot/lib/live/config/2500-tcpprint | 76 ---- .../lib/live/config/2600-x2go-getsessions | 49 --- .../lib/live/config/2700-x2go-powerbuttonmonitor | 13 - .../lib/live/config/2800-x2go-thinclientconfig | 197 --------- 11 files changed, 1006 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig deleted file mode 100755 index 9467e47..0000000 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -ShowIFConfig () -{ - -# Output startup message -# -echo -n " showifconfig" - -# wait until terminal is available -while ! [ -c /dev/tty$(fgconsole -n) ] ; do - sleep 10 -done - -# Make sure no language-specific stuff interferes with our matching -# grep: highlight everything that matches "inet" to the end of its line -# and also (-E, |$) show every line that has an end => Everything else -cat >/etc/network/if-up.d/0100-showips <<SHOWIPS -#!/bin/bash -export TERM=linux; - -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) - sleep 2 -done - -IPMSG=\$(LANG=C \ -/sbin/ip a | \ -/bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ -GREP_COLOR="1;32" \ -/bin/grep -P --color=always "link/ether .*? |$" ); \ -IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); -sed -i '/^- /d' /etc/issue; -sed -i '/^- /d' /etc/issue.net; -echo "\$IPMSG" >> /etc/issue; -echo "\$IPMSG" >> /etc/issue.net -SHOWIPS - -chmod 755 /etc/network/if-up.d/0100-showips - -} - -ShowIFConfig diff --git a/config/includes.chroot/lib/live/config/2100-lockuser b/config/includes.chroot/lib/live/config/2100-lockuser deleted file mode 100755 index 1cbcc15..0000000 --- a/config/includes.chroot/lib/live/config/2100-lockuser +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -LockUser () -{ - -# Output startup message -# -echo -n " lockuser" - - -# Set password -# -if grep -q "\W*nouser\W*" /proc/cmdline ; then - passwd -l user >/dev/null -fi - -} - -LockUser - diff --git a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver deleted file mode 100755 index 21f0c31..0000000 --- a/config/includes.chroot/lib/live/config/2150-getsshpubkeysfromserver +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -GetSSHPubKeysFromServer () -{ - - # Output startup message - # - echo -n " getsshpubkeysfromserver" - - - PUBKEYURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^pubkey=/ { print $2 }') - - if [ -n "$PUBKEYURL" ] ; then - cat >/etc/network/if-up.d/0200-getsshpubkeysfromserver <<GETPUBKEY -#!/bin/bash -export TERM=linux; - -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) - 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 "$PUBKEYURL" | 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 - - chmod 755 /etc/network/if-up.d/0200-getsshpubkeysfromserver - fi - -} - -GetSSHPubKeysFromServer - diff --git a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf deleted file mode 100755 index 06794b1..0000000 --- a/config/includes.chroot/lib/live/config/2200-xserver-xorg-getxorgconf +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -XServerXorgGetXorgConf () -{ -# Output startup message -# -echo -n " xserver-xorg-getxorgconf" - - XORGCONFURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^xorgconfurl=/ { print $2 }') - if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then - XORGCONFDESTINATION=/etc/X11/xorg.conf.new - cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG -#!/bin/bash -export TERM=linux; - -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) - sleep 2 -done -if echo "$XORGCONFURL" | grep -q "^tftp://" ; then - XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then - while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo "Waiting for xorg.conf download ..." - sleep 5 - done - fi -else - while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo "Waiting for xorg.conf download ..." - sleep 5 - done -fi - -if [ -s $XORGCONFDESTINATION ] ; then - mv $XORGCONFDESTINATION /etc/X11/xorg.conf -fi -GETXORG - chmod 755 /etc/network/if-up.d/0300-getxorgconf - fi -} -XServerXorgGetXorgConf diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate deleted file mode 100755 index 7e88812..0000000 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ /dev/null @@ -1,439 +0,0 @@ -#!/bin/sh - -cleanup () -{ # discard contents of tmpfs, umount if necessary - if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Removing '$TEMPDIR/*'." - rm -rf $TEMPDIR/* - else - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounting '$TEMPDIR'." - umount $TEMPDIR - fi - if rmdir $TEMPDIR; then - echo -en "\n$(date +'%F | %T | ')'\$0': Removed empty directory '$TEMPDIR'." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Could not remove directory '$TEMPDIR'." - fi - if [ -n "$NTFSROOT" ]; then - if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Could not unmount '$MOUNTPOINT'." - fi - fi -} - -LiveAutoUpdateMain () -{ -# Output startup message -# -echo -n " live-autoupdater (backgrounding update task)" - - -# Background everything -# -( - -# redirect all output to first available VT console -# -exec >/dev/tty$(fgconsole -n) 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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." -fi - - - -# sleeping a random amount of time to ease load on the update server -# -MAXSLEEPTIME=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') -if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then - MAXSLEEPTIME=900 -fi -SLEEPTIME=0 -echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." -# 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%MAXSLEEPTIME)) -if [ $SLEEPTIME -lt 120 ]; then - SLEEPTIME=$((SLEEPTIME+120)) -fi -echo -en "\n$(date +'%F | %T | ')'\$0': 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 - # This is in case we've been passed an incomplete UUID and/or one with dashes - # For example, "vol c:" on Windows will return the last 8 digits of the UUID - # only, and separate them with a dash. - if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(echo $NTFSROOT | tr -d '-') - if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) - fi - fi - - if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." - fi - # TODO: Further error handling - 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) - - if [ -d /lib/live/mount/findiso/ ] ; then - # if we have access to the entire filesystem, use the - # directory size as base size for the current image - - # and if the download directory is even bigger, use that size - IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") - IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") - [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD - else - IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') - fi - # multiply current size by 1.5 as safety margin - mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR - -fi -if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ - ( \ - [ -d "$MOUNTPOINT/boot/X2Go-live1" ] || \ - [ -d "$MOUNTPOINT/boot/X2Go-live2" ] \ - ) \ - ); then - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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" = "X2Go-live1" ]; then - OTHERSYSTEMNAME="X2Go-live2" -elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then - OTHERSYSTEMNAME="X2Go-live1" -else - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." - return 1 -fi -OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") -DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") - - -# Now we'll copy the content of the X2Go-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 -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." - sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': 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/x2go-tce-initrd.img - cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" - rm "/tmp/x2go-tce-initrd.img" - SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ - $7 == "-" { print $5 }' /tmp/dl.log | \ - tail -1 \ - ) - case $SIZEFACTORSTRING in - "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': 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 | \ - tail -1 - ) - BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ - awk ' { print $1*$2*$3/100 }' | \ - awk -F'.' '{ print $1 }' \ - ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" - DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ - --progress=bar:force \ - --limit-rate=${BWLIMIT}k $DOWNLOADURL" - -elif echo "$DOWNLOADURL" | grep -q "^rsync"; then - - rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ - $TEMPDIR/x2go-tce-initrd.img.new - mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" - DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ - $TEMPDIR" -else - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." - return 1 -fi -rm /tmp/dl.log - - -# Proceed to download from update location -# -while ! $DOWNLOADCOMMAND; do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." - sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." -done - -# Now check if these files are different from what we already have in our -# download directory on the boot medium -# -echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." -if diff -q $DOWNLOADPATH $TEMPDIR \ - >/dev/null - - then - cleanup - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." -else - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Moving $TEMPDIR/* => $DOWNLOADPATH" -mv $TEMPDIR/* $DOWNLOADPATH -cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? -if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Mount successful." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." - fi -fi - - -# let's check if we just downloaded a copy of our running system -# -echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" -if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ - [ -d "$OTHERSYSTEMFULLPATH" ] ; then - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" -if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" - while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH - do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." - sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." - done -fi - - -# change default boot to the image we just downloaded and installed -# -if [ -n "$SYSLINUXPATH" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." - sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ - $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}" | - awk -F':' '$2 ~ /'"${RUNNINGSYSTEMNAME}"'/ { print $1 }') - CURRENTTITLEPOSITION=$((CURRENTTITLEPOSITION-1)) - OTHERTITLEPOSITION=$(grep '^title' $MENULST | - grep -n "${OTHERSYSTEMNAME}" | - awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') - OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) - if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." - sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ - $MENULST - else - echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." - echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," - echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." - fi -else - echo -en "\n$(date +'%F | %T | ')'\$0': 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 - if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." - fi -else - if mount -oremount,ro,sync $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." - else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." - fi -fi - -) & - -} - -LiveAutoUpdateMain - diff --git a/config/includes.chroot/lib/live/config/2400-x2go-getportableappsessions b/config/includes.chroot/lib/live/config/2400-x2go-getportableappsessions deleted file mode 100755 index 4e417db..0000000 --- a/config/includes.chroot/lib/live/config/2400-x2go-getportableappsessions +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -X2GoGetPortableAppSessions () -{ - -# Output startup message -# -echo -n " x2go-getportableappsessions" - -# This script is for using the iso-hybrid image along with the "second partition" patch -# it allows you to share a configuration between X2GoClient for Windows in portable -# mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions - -if [ -L /dev/disk/by-label/PORTABLEAPP ]; then - mkdir -p /media/PORTABLEAPP && \ - mount -o sync /dev/disk/by-label/PORTABLEAPP /media/PORTABLEAPP && \ - ln -sf /media/PORTABLEAPP/x2goclient/sessions /etc/x2go/x2gothinclient_sessions -else - true -fi -} - -X2GoGetPortableAppSessions diff --git a/config/includes.chroot/lib/live/config/2410-x2go-getopensshportableclientkey b/config/includes.chroot/lib/live/config/2410-x2go-getopensshportableclientkey deleted file mode 100755 index 1f7b486..0000000 --- a/config/includes.chroot/lib/live/config/2410-x2go-getopensshportableclientkey +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - - -X2GoGetOpenSSHPortableClientKey () -{ - # Output startup message - # - echo -n " x2go-getopensshportableclientkey" - - # This script is for using the iso-hybrid image along with the "second partition" patch - # it allows you to share ssh secret keys between X2GoClient for Windows in portable - # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions - - # Homedir of client side X2Go ThinClient Account - # - X2GOHOME="/home/user/" - - # Homedir of Portable App Installation - # - HOME="/media/PORTABLEAPP/" - - if [ -d "$HOME" ] && [ -d "$X2GOHOME" ]; then - - # create .ssh-Directory in case it doesn't exist - # - mkdir -p $(readlink -m "$X2GOHOME/.ssh/") - - for KEYFILE in $HOME/ssh/* ; do - [ -s "$KEYFILE" ] || continue - KEYDESTPATH="$X2GOHOME/.ssh/$(basename "$KEYFILE")" - touch "$KEYDESTPATH" - chown user:user \ - $KEYDESTPATH - chmod 600 $KEYDESTPATH - cat $(readlink -m "$KEYFILE")>$KEYDESTPATH - - done - - # this is so the path name in the sessions file matches again - # (cannot use .ssh on FAT, for example) - ln -s $X2GOHOME/.ssh $X2GOHOME/ssh - fi -} - -X2GoGetOpenSSHPortableClientKey - diff --git a/config/includes.chroot/lib/live/config/2500-tcpprint b/config/includes.chroot/lib/live/config/2500-tcpprint deleted file mode 100755 index 2bb453b..0000000 --- a/config/includes.chroot/lib/live/config/2500-tcpprint +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -TcpPrint () -{ - -# Output startup message -# -echo -n " tcpprint" - -if grep -q "\W*tcpprint\W*" /proc/cmdline ; then - TCPPRINTONLYFROM=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') - if [ -n "$TCPPRINTONLYFROM" ] ; then - TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM" - fi - # Backgrounding - ( - - while ! lsmod | grep -q "^lp"; do - # Wait till modprobe lp has occurred - # -> this means /dev is fully populated - # => USB-Printers can be detected now, too - sleep 30 - done - - PRINTERDEVICES="" - [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) - PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) - - # Create a listening port for a TCP/9100-RAW-printer - # - # printers may be at /dev/lp_ and at /dev/usb/lp_ - PRINTERCOUNT=0 - for PRINTERDEV in $PRINTERDEVICES; do - PORTNUMBER=$((PRINTERCOUNT+9100)) - echo "jetdirect${PRINTERCOUNT} ${PORTNUMBER}/tcp" >>/etc/services - cat >/etc/xinetd.d/jetdirect${PRINTERCOUNT} << JETDIRCONF -service jetdirect${PRINTERCOUNT} -{ - socket_type = stream - protocol = tcp - wait = no - user = root - server = /bin/dd - server_args = of=$PRINTERDEV bs=1024k - groups = yes - disable = no - instances = 1 - $TCPPRINTONLYFROM -} -JETDIRCONF - echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(fgconsole -n) - PRINTERCOUNT=$((PRINTERCOUNT+1)) - done - - echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect - - if ps -C xinetd --no-header >/dev/null ; then - echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(fgconsole -n) - if /etc/init.d/xinetd restart; then - echo -n " success. All done." | tee -a /dev/tty\$(fgconsole -n) - else - echo -n " error." | tee -a /dev/tty\$(fgconsole -n) - fi - else - echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(fgconsole -n) - fi - - ) & -fi -} - -TcpPrint diff --git a/config/includes.chroot/lib/live/config/2600-x2go-getsessions b/config/includes.chroot/lib/live/config/2600-x2go-getsessions deleted file mode 100755 index eff3073..0000000 --- a/config/includes.chroot/lib/live/config/2600-x2go-getsessions +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -X2GoGetSessions () -{ - # 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 - # only mv this file if SESSIONSURL was set. If not, leave it in place - as - # it might have been customized at image creation time - mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old - SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new - cat >/etc/network/if-up.d/0400-getsessions <<GETSESS -#!/bin/bash -export TERM=linux; - -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) - sleep 2 -done -if echo "$SESSIONSURL" | grep -q "^tftp://" ; then - SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then - while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) - sleep 5 - done - fi -else - while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) - sleep 5 - done -fi - -if [ -s $SESSIONSDESTINATION ] ; then - mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions -fi -GETSESS - chmod 755 /etc/network/if-up.d/0400-getsessions - fi -} - -X2GoGetSessions diff --git a/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor b/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor deleted file mode 100755 index 8f21eaf..0000000 --- a/config/includes.chroot/lib/live/config/2700-x2go-powerbuttonmonitor +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -X2GoPowerbuttonMonitor () -{ -# Output startup message -# -echo -n " x2go-powerbuttonmonitor" - -# Spawn Powerbutton-Monitor -/bin/bash -c '(while ! [ -f /home/user/.halt ] ; do sleep 1 ; done ; poweroff ; chvt 7) &' -} - -X2GoPowerbuttonMonitor diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig deleted file mode 100755 index 96ab5a2..0000000 --- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig +++ /dev/null @@ -1,197 +0,0 @@ -#!/bin/bash - -X2GoThinClientConfig () -{ - -# Output startup message -# -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 keyboard bindings -# this also disables the context menu (would be accessible in xinerama) and things like Alt-F4 for X2GoClient, Xephyr, etc. -sed -i -e '/<keyboard>/,/<\/keyboard>/{//!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 -# inspired by -# http://code.x2go.org/gitweb?p=x2gothinclient.git;a=blob_plain;f=displaymanag... -# check the above file for ideas before reinventing the wheel - -# 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 - -# Spawn openbox -openbox & - -# set screen background to X2Go default blue on all detected screens -xsetroot -solid "#246ed8" - -# Get X2GoConfig -BROKERURL=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^broker-url=/ { print \$2 }') -LDAP=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - sed 's/^ldap=/ldap#/' | \ - awk -F'#' ' /^ldap#/ { print \$2 }') -LDAP1=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - sed 's/^ldap1=/ldap1#/' | \ - awk -F'#' ' /^ldap1#/ { print \$2 }') -LDAP2=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - sed 's/^ldap2=/ldap2#/' | \ - awk -F'#' ' /^ldap2#/ { print \$2 }') - -# Spawn X2GoClient -if [ -n "\$BROKERURL" ]; then - SESSIONFROM="--broker-url=\$BROKERURL" -else - SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" - while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do - OLDCON=$(fgconsole) - chvt 1 - echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." - sleep 2 - done - [ -n "$OLDCON" ] && chvt $OLDCON -fi -if [ -n "\$LDAP" ] ; then - if [ -n "\$LDAP1" ] ; then - BACKUPLDAP="--ldap1=\$LDAP1" - if [ -n "\$LDAP2" ] ; then - BACKUPLDAP="\$BACKUPLDAP --ldap2=\$LDAP2" - fi - fi - LDAPPARAMS="--ldap=\$LDAP \$BACKUPLDAP" -else - LDAPPARAMS="" -fi - -BLANKINGTIME=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "blank" { print \$2 }') -if [ -n "\$BLANKINGTIME" ]; then - DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}')) - if [ \${DPMSARR[0]} -eq 0 ]; then - # Disable screensaver and DPMS Power Saving if requested - xset s off - if ! grep -q '\W*nodpms\W*' /proc/cmdline; then - xset -dpms - fi - else - xset s on - xset s \${DPMSARR[0]} - if ! grep -q '\W*nodpms\W*' /proc/cmdline; then - # Yes, "+dpms dpms" is intentional. - xset +dpms dpms \${DPMSARR[0]} \${DPMSARR[1]} \${DPMSARR[2]} - fi - fi -fi - -# handle additional options for x2goclient passed in as boot parameters -ADDOPTS="" - -# append custom background image if one was retrieved to additional options -if [ -e "/home/user/custom/background.svg" ]; then - ADDOPTS="\$ADDOPTS --background='/home/user/custom/background.svg'" -fi - -# append custom branding image if one was retrieved to additional options -if [ -e "/home/user/custom/branding.svg" ]; then - ADDOPTS="\$ADDOPTS --branding='/home/user/custom/branding.svg'" -fi - -x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$ADDOPTS -XSESSION - -chown user:user /home/user/.xsession -chmod 644 /home/user/.xsession - -# This is needed for File Sharing support (USB media and the like) -mkdir -p /home/user/{export,logins,mounts} -chown user:user /home/user/{export,logins,mounts} -chmod 700 /home/user/{export,logins,mounts} - -# handle custom images passed in on boot parameters -mkdir "/home/user/custom" -chown user:user "/home/user/custom" -chmod 755 "/home/user/custom" -BGURL="$(tr ' ' '\n' < /proc/cmdline | \ - awk -F'=' ' /^backgroundurl=/ { print $2 }')" -if [ -n "$BGURL" ]; then - /usr/bin/wget "$BGURL" -q -O "/home/user/custom/background.svg" -fi -BRNDURL="$(tr ' ' '\n' < /proc/cmdline | \ - awk -F'=' ' /^brandingurl=/ { print $2 }')" -if [ -n "$BRNDURL" ]; then - /usr/bin/wget "$BRNDURL" -q -O "/home/user/custom/branding.svg" -fi - -#only try to set permissions if files exist -CUSTFILES=("/home/user/custom/"*) -if [ -e "${CUSTFILES[0]}" ]; then - chown user:user "/home/user/custom/"* - chmod 644 "/home/user/custom/"* -fi - -} - -X2GoThinClientConfig -- 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 f6501d277b0d770fc0011881b645ca12c935bfa6 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 13:10:28 2017 +0200 added hwclock and ntpdate packages for future use in a set-time-on-boot script --- config/package-lists/utils.list.chroot | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/package-lists/utils.list.chroot b/config/package-lists/utils.list.chroot index 27d8716..2eda261 100644 --- a/config/package-lists/utils.list.chroot +++ b/config/package-lists/utils.list.chroot @@ -2,7 +2,9 @@ acpid acpi-support atftp ca-certificates +hwclock kbd +ntpdate openssh-client openssh-server openssh-sftp-server -- 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 02ee3a3d811e0a1a00973d78967b22d17a5d815e Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 13:08:20 2017 +0200 removed wrong comment --- config/includes.chroot/lib/live/config/2000-showifconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-showifconfig b/config/includes.chroot/lib/live/config/2000-showifconfig index 77fd1ce..24268ac 100755 --- a/config/includes.chroot/lib/live/config/2000-showifconfig +++ b/config/includes.chroot/lib/live/config/2000-showifconfig @@ -10,7 +10,6 @@ echo -n " showifconfig" # Make sure no language-specific stuff interferes with our matching # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else -# Output the result on virtual terminal 9 cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; -- 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 f8ba909b029982e57a3c429ef09597896f1452f2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 10:26:08 2017 +0200 some log output was still lacking the timestamp --- config/includes.chroot/lib/live/config/2300-live-autoupdate | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate index 6af3b8d..0639616 100755 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate @@ -3,22 +3,22 @@ cleanup () { # discard contents of tmpfs, umount if necessary if [ -n "$NTFSROOT" ]; then - echo "Removing '$TEMPDIR/*'." + echo -en "\n$(date +'%F | %T | ')'\$0': Removing '$TEMPDIR/*'." rm -rf $TEMPDIR/* else - echo "Unmounting '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounting '$TEMPDIR'." umount $TEMPDIR fi if rmdir $TEMPDIR; then - echo "Removed empty directory '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'\$0': Removed empty directory '$TEMPDIR'." else - echo "Could not remove directory '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'\$0': Could not remove directory '$TEMPDIR'." fi if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo "Unmounted '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." else - echo "Could not unmount '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Could not unmount '$MOUNTPOINT'." fi 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 d4d4db211cec5cde6a3a53cbb53efbf6d7a0d1ab Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 11:16:47 2017 +0200 improved ramdisk size calculation --- config/includes.chroot/lib/live/config/2300-live-autoupdate | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2300-live-autoupdate b/config/includes.chroot/lib/live/config/2300-live-autoupdate index 0639616..d09130d 100755 --- a/config/includes.chroot/lib/live/config/2300-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2300-live-autoupdate @@ -128,7 +128,18 @@ 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}') + + if [ -d /lib/live/mount/findiso/ ] ; then + # if we have access to the entire filesystem, use the + # directory size as base size for the current image - + # and if the download directory is even bigger, use that size + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") + [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD + else + IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + fi + # multiply current size by 1.5 as safety margin mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR 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 bf9d1d070fbf59399da1faf983028568a11871a7 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 14:32:47 2017 +0200 renamed files to make space for a new 2000- file --- .../lib/live/config/2100-showifconfig | 43 ++ .../includes.chroot/lib/live/config/2200-lockuser | 20 + .../lib/live/config/2250-getsshpubkeysfromserver | 55 +++ .../lib/live/config/2300-xserver-xorg-getxorgconf | 45 +++ .../lib/live/config/2400-live-autoupdate | 439 +++++++++++++++++++++ .../live/config/2500-x2go-getportableappsessions | 23 ++ .../config/2510-x2go-getopensshportableclientkey | 46 +++ .../includes.chroot/lib/live/config/2600-tcpprint | 76 ++++ .../lib/live/config/2700-x2go-getsessions | 49 +++ .../lib/live/config/2800-x2go-powerbuttonmonitor | 13 + .../lib/live/config/2900-x2go-thinclientconfig | 162 ++++++++ 11 files changed, 971 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig new file mode 100755 index 0000000..9467e47 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -0,0 +1,43 @@ +#!/bin/bash + +ShowIFConfig () +{ + +# Output startup message +# +echo -n " showifconfig" + +# wait until terminal is available +while ! [ -c /dev/tty$(fgconsole -n) ] ; do + sleep 10 +done + +# Make sure no language-specific stuff interferes with our matching +# grep: highlight everything that matches "inet" to the end of its line +# and also (-E, |$) show every line that has an end => Everything else +cat >/etc/network/if-up.d/0100-showips <<SHOWIPS +#!/bin/bash +export TERM=linux; + +while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + sleep 2 +done + +IPMSG=\$(LANG=C \ +/sbin/ip a | \ +/bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ +GREP_COLOR="1;32" \ +/bin/grep -P --color=always "link/ether .*? |$" ); \ +IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); +sed -i '/^- /d' /etc/issue; +sed -i '/^- /d' /etc/issue.net; +echo "\$IPMSG" >> /etc/issue; +echo "\$IPMSG" >> /etc/issue.net +SHOWIPS + +chmod 755 /etc/network/if-up.d/0100-showips + +} + +ShowIFConfig diff --git a/config/includes.chroot/lib/live/config/2200-lockuser b/config/includes.chroot/lib/live/config/2200-lockuser new file mode 100755 index 0000000..1cbcc15 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2200-lockuser @@ -0,0 +1,20 @@ +#!/bin/sh + +LockUser () +{ + +# Output startup message +# +echo -n " lockuser" + + +# Set password +# +if grep -q "\W*nouser\W*" /proc/cmdline ; then + passwd -l user >/dev/null +fi + +} + +LockUser + diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver new file mode 100755 index 0000000..21f0c31 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -0,0 +1,55 @@ +#!/bin/sh + +GetSSHPubKeysFromServer () +{ + + # Output startup message + # + echo -n " getsshpubkeysfromserver" + + + PUBKEYURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^pubkey=/ { print $2 }') + + if [ -n "$PUBKEYURL" ] ; then + cat >/etc/network/if-up.d/0200-getsshpubkeysfromserver <<GETPUBKEY +#!/bin/bash +export TERM=linux; + +while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + 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 "$PUBKEYURL" | 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 + + chmod 755 /etc/network/if-up.d/0200-getsshpubkeysfromserver + fi + +} + +GetSSHPubKeysFromServer + diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf new file mode 100755 index 0000000..06794b1 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -0,0 +1,45 @@ +#!/bin/sh + +XServerXorgGetXorgConf () +{ +# Output startup message +# +echo -n " xserver-xorg-getxorgconf" + + XORGCONFURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^xorgconfurl=/ { print $2 }') + if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then + XORGCONFDESTINATION=/etc/X11/xorg.conf.new + cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG +#!/bin/bash +export TERM=linux; + +while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + sleep 2 +done +if echo "$XORGCONFURL" | grep -q "^tftp://" ; then + XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then + while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do + echo "Waiting for xorg.conf download ..." + sleep 5 + done + fi +else + while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do + echo "Waiting for xorg.conf download ..." + sleep 5 + done +fi + +if [ -s $XORGCONFDESTINATION ] ; then + mv $XORGCONFDESTINATION /etc/X11/xorg.conf +fi +GETXORG + chmod 755 /etc/network/if-up.d/0300-getxorgconf + fi +} +XServerXorgGetXorgConf diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate new file mode 100755 index 0000000..7e88812 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -0,0 +1,439 @@ +#!/bin/sh + +cleanup () +{ # discard contents of tmpfs, umount if necessary + if [ -n "$NTFSROOT" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': Removing '$TEMPDIR/*'." + rm -rf $TEMPDIR/* + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounting '$TEMPDIR'." + umount $TEMPDIR + fi + if rmdir $TEMPDIR; then + echo -en "\n$(date +'%F | %T | ')'\$0': Removed empty directory '$TEMPDIR'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Could not remove directory '$TEMPDIR'." + fi + if [ -n "$NTFSROOT" ]; then + if umount $MOUNTPOINT; then + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Could not unmount '$MOUNTPOINT'." + fi + fi +} + +LiveAutoUpdateMain () +{ +# Output startup message +# +echo -n " live-autoupdater (backgrounding update task)" + + +# Background everything +# +( + +# redirect all output to first available VT console +# +exec >/dev/tty$(fgconsole -n) 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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." +fi + + + +# sleeping a random amount of time to ease load on the update server +# +MAXSLEEPTIME=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') +if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then + MAXSLEEPTIME=900 +fi +SLEEPTIME=0 +echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." +# 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%MAXSLEEPTIME)) +if [ $SLEEPTIME -lt 120 ]; then + SLEEPTIME=$((SLEEPTIME+120)) +fi +echo -en "\n$(date +'%F | %T | ')'\$0': 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 + # This is in case we've been passed an incomplete UUID and/or one with dashes + # For example, "vol c:" on Windows will return the last 8 digits of the UUID + # only, and separate them with a dash. + if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then + NTFSROOT=$(echo $NTFSROOT | tr -d '-') + if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then + NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) + fi + fi + + if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then + echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + fi + # TODO: Further error handling + 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) + + if [ -d /lib/live/mount/findiso/ ] ; then + # if we have access to the entire filesystem, use the + # directory size as base size for the current image - + # and if the download directory is even bigger, use that size + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") + [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD + else + IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + fi + # multiply current size by 1.5 as safety margin + mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR + +fi +if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ + ( \ + [ -d "$MOUNTPOINT/boot/X2Go-live1" ] || \ + [ -d "$MOUNTPOINT/boot/X2Go-live2" ] \ + ) \ + ); then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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" = "X2Go-live1" ]; then + OTHERSYSTEMNAME="X2Go-live2" +elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then + OTHERSYSTEMNAME="X2Go-live1" +else + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." + return 1 +fi +OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") +DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") + + +# Now we'll copy the content of the X2Go-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 -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + sleep 30 + echo -en "\n$(date +'%F | %T | ')'\$0': 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/x2go-tce-initrd.img + cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" + rm "/tmp/x2go-tce-initrd.img" + SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ + $7 == "-" { print $5 }' /tmp/dl.log | \ + tail -1 \ + ) + case $SIZEFACTORSTRING in + "" | \ + [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': 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 | \ + tail -1 + ) + BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ + awk ' { print $1*$2*$3/100 }' | \ + awk -F'.' '{ print $1 }' \ + ) # outputs integer kilobytes, not rounded + echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ + --progress=bar:force \ + --limit-rate=${BWLIMIT}k $DOWNLOADURL" + +elif echo "$DOWNLOADURL" | grep -q "^rsync"; then + + rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ + $TEMPDIR/x2go-tce-initrd.img.new + mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ + $TEMPDIR" +else + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." + return 1 +fi +rm /tmp/dl.log + + +# Proceed to download from update location +# +while ! $DOWNLOADCOMMAND; do + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + sleep 30 + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." +done + +# Now check if these files are different from what we already have in our +# download directory on the boot medium +# +echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." +if diff -q $DOWNLOADPATH $TEMPDIR \ + >/dev/null + + then + cleanup + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." +else + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Moving $TEMPDIR/* => $DOWNLOADPATH" +mv $TEMPDIR/* $DOWNLOADPATH +cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? +if [ -n "$NTFSROOT" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Mount successful." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." + fi +fi + + +# let's check if we just downloaded a copy of our running system +# +echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" +if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ + [ -d "$OTHERSYSTEMFULLPATH" ] ; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" +if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH + do + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + sleep 30 + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + done +fi + + +# change default boot to the image we just downloaded and installed +# +if [ -n "$SYSLINUXPATH" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." + sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ + $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}" | + awk -F':' '$2 ~ /'"${RUNNINGSYSTEMNAME}"'/ { print $1 }') + CURRENTTITLEPOSITION=$((CURRENTTITLEPOSITION-1)) + OTHERTITLEPOSITION=$(grep '^title' $MENULST | + grep -n "${OTHERSYSTEMNAME}" | + awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') + OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) + if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ + $MENULST + else + echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." + echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." + fi +else + echo -en "\n$(date +'%F | %T | ')'\$0': 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 + if umount $MOUNTPOINT; then + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." + fi +else + if mount -oremount,ro,sync $MOUNTPOINT; then + echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." + fi +fi + +) & + +} + +LiveAutoUpdateMain + diff --git a/config/includes.chroot/lib/live/config/2500-x2go-getportableappsessions b/config/includes.chroot/lib/live/config/2500-x2go-getportableappsessions new file mode 100755 index 0000000..4e417db --- /dev/null +++ b/config/includes.chroot/lib/live/config/2500-x2go-getportableappsessions @@ -0,0 +1,23 @@ +#!/bin/sh + +X2GoGetPortableAppSessions () +{ + +# Output startup message +# +echo -n " x2go-getportableappsessions" + +# This script is for using the iso-hybrid image along with the "second partition" patch +# it allows you to share a configuration between X2GoClient for Windows in portable +# mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions + +if [ -L /dev/disk/by-label/PORTABLEAPP ]; then + mkdir -p /media/PORTABLEAPP && \ + mount -o sync /dev/disk/by-label/PORTABLEAPP /media/PORTABLEAPP && \ + ln -sf /media/PORTABLEAPP/x2goclient/sessions /etc/x2go/x2gothinclient_sessions +else + true +fi +} + +X2GoGetPortableAppSessions diff --git a/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey b/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey new file mode 100755 index 0000000..1f7b486 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey @@ -0,0 +1,46 @@ +#!/bin/sh + + +X2GoGetOpenSSHPortableClientKey () +{ + # Output startup message + # + echo -n " x2go-getopensshportableclientkey" + + # This script is for using the iso-hybrid image along with the "second partition" patch + # it allows you to share ssh secret keys between X2GoClient for Windows in portable + # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions + + # Homedir of client side X2Go ThinClient Account + # + X2GOHOME="/home/user/" + + # Homedir of Portable App Installation + # + HOME="/media/PORTABLEAPP/" + + if [ -d "$HOME" ] && [ -d "$X2GOHOME" ]; then + + # create .ssh-Directory in case it doesn't exist + # + mkdir -p $(readlink -m "$X2GOHOME/.ssh/") + + for KEYFILE in $HOME/ssh/* ; do + [ -s "$KEYFILE" ] || continue + KEYDESTPATH="$X2GOHOME/.ssh/$(basename "$KEYFILE")" + touch "$KEYDESTPATH" + chown user:user \ + $KEYDESTPATH + chmod 600 $KEYDESTPATH + cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + + done + + # this is so the path name in the sessions file matches again + # (cannot use .ssh on FAT, for example) + ln -s $X2GOHOME/.ssh $X2GOHOME/ssh + fi +} + +X2GoGetOpenSSHPortableClientKey + diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint new file mode 100755 index 0000000..2bb453b --- /dev/null +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -0,0 +1,76 @@ +#!/bin/bash + +TcpPrint () +{ + +# Output startup message +# +echo -n " tcpprint" + +if grep -q "\W*tcpprint\W*" /proc/cmdline ; then + TCPPRINTONLYFROM=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') + if [ -n "$TCPPRINTONLYFROM" ] ; then + TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM" + fi + # Backgrounding + ( + + while ! lsmod | grep -q "^lp"; do + # Wait till modprobe lp has occurred + # -> this means /dev is fully populated + # => USB-Printers can be detected now, too + sleep 30 + done + + PRINTERDEVICES="" + [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) + PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" + + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + + # Create a listening port for a TCP/9100-RAW-printer + # + # printers may be at /dev/lp_ and at /dev/usb/lp_ + PRINTERCOUNT=0 + for PRINTERDEV in $PRINTERDEVICES; do + PORTNUMBER=$((PRINTERCOUNT+9100)) + echo "jetdirect${PRINTERCOUNT} ${PORTNUMBER}/tcp" >>/etc/services + cat >/etc/xinetd.d/jetdirect${PRINTERCOUNT} << JETDIRCONF +service jetdirect${PRINTERCOUNT} +{ + socket_type = stream + protocol = tcp + wait = no + user = root + server = /bin/dd + server_args = of=$PRINTERDEV bs=1024k + groups = yes + disable = no + instances = 1 + $TCPPRINTONLYFROM +} +JETDIRCONF + echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(fgconsole -n) + PRINTERCOUNT=$((PRINTERCOUNT+1)) + done + + echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect + + if ps -C xinetd --no-header >/dev/null ; then + echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(fgconsole -n) + if /etc/init.d/xinetd restart; then + echo -n " success. All done." | tee -a /dev/tty\$(fgconsole -n) + else + echo -n " error." | tee -a /dev/tty\$(fgconsole -n) + fi + else + echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(fgconsole -n) + fi + + ) & +fi +} + +TcpPrint diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions new file mode 100755 index 0000000..eff3073 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -0,0 +1,49 @@ +#!/bin/sh + +X2GoGetSessions () +{ + # 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 + # only mv this file if SESSIONSURL was set. If not, leave it in place - as + # it might have been customized at image creation time + mv /etc/x2go/x2gothinclient_sessions /etc/x2go/x2gothinclient_sessions_old + SESSIONSDESTINATION=/etc/x2go/x2gothinclient_sessions_new + cat >/etc/network/if-up.d/0400-getsessions <<GETSESS +#!/bin/bash +export TERM=linux; + +while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + sleep 2 +done +if echo "$SESSIONSURL" | grep -q "^tftp://" ; then + SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then + while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) + sleep 5 + done + fi +else + while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) + sleep 5 + done +fi + +if [ -s $SESSIONSDESTINATION ] ; then + mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions +fi +GETSESS + chmod 755 /etc/network/if-up.d/0400-getsessions + fi +} + +X2GoGetSessions diff --git a/config/includes.chroot/lib/live/config/2800-x2go-powerbuttonmonitor b/config/includes.chroot/lib/live/config/2800-x2go-powerbuttonmonitor new file mode 100755 index 0000000..8f21eaf --- /dev/null +++ b/config/includes.chroot/lib/live/config/2800-x2go-powerbuttonmonitor @@ -0,0 +1,13 @@ +#!/bin/sh + +X2GoPowerbuttonMonitor () +{ +# Output startup message +# +echo -n " x2go-powerbuttonmonitor" + +# Spawn Powerbutton-Monitor +/bin/bash -c '(while ! [ -f /home/user/.halt ] ; do sleep 1 ; done ; poweroff ; chvt 7) &' +} + +X2GoPowerbuttonMonitor diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig new file mode 100755 index 0000000..87fbae9 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -0,0 +1,162 @@ +#!/bin/bash + +X2GoThinClientConfig () +{ + +# Output startup message +# +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 keyboard bindings +# this also disables the context menu (would be accessible in xinerama) and things like Alt-F4 for X2GoClient, Xephyr, etc. +sed -i -e '/<keyboard>/,/<\/keyboard>/{//!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 +# inspired by +# http://code.x2go.org/gitweb?p=x2gothinclient.git;a=blob_plain;f=displaymanag... +# check the above file for ideas before reinventing the wheel + +# 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 + +# Spawn openbox +openbox & + +# set screen background to X2Go default blue on all detected screens +xsetroot -solid "#246ed8" + +# Get X2GoConfig +BROKERURL=\$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^broker-url=/ { print \$2 }') +LDAP=\$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + sed 's/^ldap=/ldap#/' | \ + awk -F'#' ' /^ldap#/ { print \$2 }') +LDAP1=\$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + sed 's/^ldap1=/ldap1#/' | \ + awk -F'#' ' /^ldap1#/ { print \$2 }') +LDAP2=\$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + sed 's/^ldap2=/ldap2#/' | \ + awk -F'#' ' /^ldap2#/ { print \$2 }') + +# Spawn X2GoClient +if [ -n "\$BROKERURL" ]; then + SESSIONFROM="--broker-url=\$BROKERURL" +else + SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" + while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do + OLDCON=$(fgconsole) + chvt 1 + echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." + sleep 2 + done + [ -n "$OLDCON" ] && chvt $OLDCON +fi +if [ -n "\$LDAP" ] ; then + if [ -n "\$LDAP1" ] ; then + BACKUPLDAP="--ldap1=\$LDAP1" + if [ -n "\$LDAP2" ] ; then + BACKUPLDAP="\$BACKUPLDAP --ldap2=\$LDAP2" + fi + fi + LDAPPARAMS="--ldap=\$LDAP \$BACKUPLDAP" +else + LDAPPARAMS="" +fi + +BLANKINGTIME=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "blank" { print \$2 }') +if [ -n "\$BLANKINGTIME" ]; then + DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}')) + if [ \${DPMSARR[0]} -eq 0 ]; then + # Disable screensaver and DPMS Power Saving if requested + xset s off + if ! grep -q '\W*nodpms\W*' /proc/cmdline; then + xset -dpms + fi + else + xset s on + xset s \${DPMSARR[0]} + if ! grep -q '\W*nodpms\W*' /proc/cmdline; then + # Yes, "+dpms dpms" is intentional. + xset +dpms dpms \${DPMSARR[0]} \${DPMSARR[1]} \${DPMSARR[2]} + fi + fi +fi + +x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM +XSESSION + +chown user:user /home/user/.xsession +chmod 644 /home/user/.xsession + +# This is needed for File Sharing support (USB media and the like) +mkdir -p /home/user/{export,logins,mounts} +chown user:user /home/user/{export,logins,mounts} +chmod 700 /home/user/{export,logins,mounts} + +} + +X2GoThinClientConfig -- 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 9078723e1217927ee9a6babedaf3a9d77bb06bb9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 16:34:18 2017 +0200 fixed HEREDOCs --- config/includes.chroot/lib/live/config/2000-waitforvts | 3 ++- config/includes.chroot/lib/live/config/2050-settime | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts index 43fca6d..3d62af7 100755 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -7,7 +7,7 @@ WaitForVTs () # echo -n " waitforvts" -cat >/etc/network/if-up.d/0000-waitforvts <<SHOWIPS +cat >/etc/network/if-up.d/0000-waitforvts <<WAITFORVTS #!/bin/bash export TERM=linux; @@ -16,6 +16,7 @@ while ! [ -c /dev/tty$(fgconsole -n) ] ; do echo -en "\n'\$0' is waiting for an unused VT to become available." sleep 2 done +WAITFORVTS chmod 755 /etc/network/if-up.d/0000-waitforvts diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2050-settime index dddfb1d..549e48b 100755 --- a/config/includes.chroot/lib/live/config/2050-settime +++ b/config/includes.chroot/lib/live/config/2050-settime @@ -7,7 +7,7 @@ SetTime () # echo -n " settime" -cat >/etc/network/if-up.d/0050-settime <<SHOWIPS +cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; @@ -20,6 +20,7 @@ if ntpdate-debian -s && hwclock --systohc ; then else echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty\$(fgconsole -n) fi +SETTIME chmod 755 /etc/network/if-up.d/0050-settime -- 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 0c19362c802ae27753b65d30dfdf52105305de18 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 14:59:18 2017 +0200 no timestamp here, as clock is most likely wrong --- config/includes.chroot/lib/live/config/2000-waitforvts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts index 8d558e6..43fca6d 100755 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -13,7 +13,7 @@ export TERM=linux; # wait until terminal is available while ! [ -c /dev/tty$(fgconsole -n) ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for an unused VT to become available." + echo -en "\n'\$0' is waiting for an unused VT to become available." sleep 2 done -- 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 fb18ee2d354dfe10326b7635d0390add7f579555 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 17:32:28 2017 +0200 create debug output in file --- config/includes.chroot/lib/live/config/2000-waitforvts | 1 + 1 file changed, 1 insertion(+) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts index 3d62af7..69567c0 100755 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -16,6 +16,7 @@ while ! [ -c /dev/tty$(fgconsole -n) ] ; do echo -en "\n'\$0' is waiting for an unused VT to become available." sleep 2 done +fgconsole -n >/var/run/availablevt WAITFORVTS chmod 755 /etc/network/if-up.d/0000-waitforvts -- 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 63d3ddaa3849b168273ee193e4a999f34d051763 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 15:08:00 2017 +0200 added time setting script --- .../includes.chroot/lib/live/config/2050-settime | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2050-settime new file mode 100755 index 0000000..dddfb1d --- /dev/null +++ b/config/includes.chroot/lib/live/config/2050-settime @@ -0,0 +1,28 @@ +#!/bin/bash + +SetTime () +{ + +# Output startup message +# +echo -n " settime" + +cat >/etc/network/if-up.d/0050-settime <<SHOWIPS +#!/bin/bash +export TERM=linux; + +while [ -z "\$(hostname -I)" ] ; do + echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + sleep 2 +done +if ntpdate-debian -s && hwclock --systohc ; then + echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty\$(fgconsole -n) +else + echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty\$(fgconsole -n) +fi + +chmod 755 /etc/network/if-up.d/0050-settime + +} + +SetTime -- 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 dd5d2c10b72700c7ab1df8a36275e0d01ecd5a18 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 14:55:25 2017 +0200 removed "wait for VT" block, as it is now in a separate script --- config/includes.chroot/lib/live/config/2100-showifconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index 9467e47..24268ac 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -7,11 +7,6 @@ ShowIFConfig () # echo -n " showifconfig" -# wait until terminal is available -while ! [ -c /dev/tty$(fgconsole -n) ] ; do - sleep 10 -done - # Make sure no language-specific stuff interferes with our matching # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else -- 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 4877a174306d5ebfdb6350b63e0212953c28223b Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 21:34:44 2017 +0200 yet another attempt at getting logging to work --- config/includes.chroot/lib/live/config/2050-settime | 11 +++-------- config/includes.chroot/lib/live/config/2100-showifconfig | 7 +------ .../lib/live/config/2250-getsshpubkeysfromserver | 11 +++-------- .../lib/live/config/2300-xserver-xorg-getxorgconf | 11 +++-------- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- config/includes.chroot/lib/live/config/2600-tcpprint | 12 ++++++------ config/includes.chroot/lib/live/config/2700-x2go-getsessions | 11 +++-------- 7 files changed, 20 insertions(+), 45 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2050-settime index d429469..b5c17e3 100755 --- a/config/includes.chroot/lib/live/config/2050-settime +++ b/config/includes.chroot/lib/live/config/2050-settime @@ -11,19 +11,14 @@ cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; -while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 -done - while [ -z "\$(hostname -I)" ] ; do - echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done if ntpdate-debian -s && hwclock --systohc ; then - echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 else - echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8 fi SETTIME diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index eda2123..81a1276 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -14,13 +14,8 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; -while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 -done - while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 8aedf12..d96284d 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -17,13 +17,8 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 -done - while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done @@ -39,13 +34,13 @@ if echo "$PUBKEYURL" | grep -q "^tftp://" ; then 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 -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 sleep 5 done fi diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 9aea82c..3996e85 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -15,13 +15,8 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 -done - while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then @@ -29,13 +24,13 @@ if echo "$XORGCONFURL" | grep -q "^tftp://" ; then XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 sleep 5 done fi diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index badcc7a..9f3bdfa 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -36,7 +36,7 @@ echo -n " live-autoupdater (backgrounding update task)" # redirect all output to first available VT console # -exec >/dev/tty$(cat /var/run/availablevt) 2>&1 +exec >/dev/tty8 2>&1 # clear console diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index a0a571c..d5005ae 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -34,7 +34,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 # Create a listening port for a TCP/9100-RAW-printer # @@ -58,21 +58,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty8 PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty8 if /etc/init.d/xinetd restart; then - echo -n " success. All done." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -n " success. All done." | tee -a /dev/tty8 else - echo -n " error." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -n " error." | tee -a /dev/tty8 fi else - echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty8 fi ) & diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 1c9ad7c..2ee6792 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -18,13 +18,8 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 -done - while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then @@ -32,13 +27,13 @@ if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(cat /var/run/availablevt) + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 sleep 5 done 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 340dfdc80c5f874c00872ad145c2ac76ce0abe97 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 22:38:07 2017 +0200 removed unused code --- config/includes.chroot/lib/live/config/2600-tcpprint | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index d5005ae..a2b1355 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -9,11 +9,6 @@ echo -n " tcpprint" if grep -q "\W*tcpprint\W*" /proc/cmdline ; then - while ! [ -s /var/run/availablevt ] ; do - echo -en "\n'\$0' is waiting for a free console." - sleep 2 - done - TCPPRINTONLYFROM=$(cat /proc/cmdline | \ tr ' ' '\n' | \ awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') -- 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 fccd509fd072b1c75aa2f3ffc23aeae652bfc6db Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 19:27:26 2017 +0200 logging was still broken --- config/includes.chroot/lib/live/config/2000-waitforvts | 2 +- config/includes.chroot/lib/live/config/2050-settime | 11 ++++++++--- .../includes.chroot/lib/live/config/2100-showifconfig | 7 ++++++- .../lib/live/config/2250-getsshpubkeysfromserver | 11 ++++++++--- .../lib/live/config/2300-xserver-xorg-getxorgconf | 11 ++++++++--- .../lib/live/config/2400-live-autoupdate | 2 +- config/includes.chroot/lib/live/config/2600-tcpprint | 18 ++++++++++++------ .../lib/live/config/2700-x2go-getsessions | 11 ++++++++--- 8 files changed, 52 insertions(+), 21 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts index 69567c0..d1b10a7 100755 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -12,7 +12,7 @@ cat >/etc/network/if-up.d/0000-waitforvts <<WAITFORVTS export TERM=linux; # wait until terminal is available -while ! [ -c /dev/tty$(fgconsole -n) ] ; do +while [ \$(fgconsole -n) -lt 7 ] || ! [ -c /dev/tty\$(fgconsole -n) ] ; do echo -en "\n'\$0' is waiting for an unused VT to become available." sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2050-settime index 549e48b..d429469 100755 --- a/config/includes.chroot/lib/live/config/2050-settime +++ b/config/includes.chroot/lib/live/config/2050-settime @@ -11,14 +11,19 @@ cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; +while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 +done + while [ -z "\$(hostname -I)" ] ; do - echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 2 done if ntpdate-debian -s && hwclock --systohc ; then - echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty\$(cat /var/run/availablevt) else - echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty\$(cat /var/run/availablevt) fi SETTIME diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index 24268ac..eda2123 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -14,8 +14,13 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; +while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 +done + while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 2 done diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 21f0c31..8aedf12 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -17,8 +17,13 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; +while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 +done + while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 2 done @@ -34,13 +39,13 @@ if echo "$PUBKEYURL" | grep -q "^tftp://" ; then 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 ..." + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done fi else while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do - echo "Waiting for SSH Public Key ..." + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done fi diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 06794b1..9aea82c 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -15,8 +15,13 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; +while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 +done + while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 2 done if echo "$XORGCONFURL" | grep -q "^tftp://" ; then @@ -24,13 +29,13 @@ if echo "$XORGCONFURL" | grep -q "^tftp://" ; then XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo "Waiting for xorg.conf download ..." + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done fi else while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo "Waiting for xorg.conf download ..." + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done fi diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 7e88812..badcc7a 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -36,7 +36,7 @@ echo -n " live-autoupdater (backgrounding update task)" # redirect all output to first available VT console # -exec >/dev/tty$(fgconsole -n) 2>&1 +exec >/dev/tty$(cat /var/run/availablevt) 2>&1 # clear console diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index 2bb453b..a0a571c 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -8,6 +8,12 @@ TcpPrint () echo -n " tcpprint" if grep -q "\W*tcpprint\W*" /proc/cmdline ; then + + while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 + done + TCPPRINTONLYFROM=$(cat /proc/cmdline | \ tr ' ' '\n' | \ awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') @@ -28,7 +34,7 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) # Create a listening port for a TCP/9100-RAW-printer # @@ -52,21 +58,21 @@ service jetdirect${PRINTERCOUNT} $TCPPRINTONLYFROM } JETDIRCONF - echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')Mapping $PRINTERDEV => $PORTNUMBER" | tee -a /dev/tty\$(cat /var/run/availablevt) PRINTERCOUNT=$((PRINTERCOUNT+1)) done echo "#Local printer config: Done." >/etc/xinetd.d/jetdirect if ps -C xinetd --no-header >/dev/null ; then - echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')xinetd needs to be restarted, trying to do that ..." | tee -a /dev/tty\$(cat /var/run/availablevt) if /etc/init.d/xinetd restart; then - echo -n " success. All done." | tee -a /dev/tty\$(fgconsole -n) + echo -n " success. All done." | tee -a /dev/tty\$(cat /var/run/availablevt) else - echo -n " error." | tee -a /dev/tty\$(fgconsole -n) + echo -n " error." | tee -a /dev/tty\$(cat /var/run/availablevt) fi else - echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')No xinetd restart necessary. All done." | tee -a /dev/tty\$(cat /var/run/availablevt) fi ) & diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index eff3073..1c9ad7c 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -18,8 +18,13 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; +while ! [ -s /var/run/availablevt ] ; do + echo -en "\n'\$0' is waiting for a free console." + sleep 2 +done + while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 2 done if echo "$SESSIONSURL" | grep -q "^tftp://" ; then @@ -27,13 +32,13 @@ if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(fgconsole -n) + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty\$(cat /var/run/availablevt) sleep 5 done 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 8929fb107ced6f45dd20e75e32d3bdf1a3cadc3b Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 20:42:51 2017 +0200 next try: backgrounding this task instead of starting it when network becomes available --- .../lib/live/config/2000-waitforvts | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts index d1b10a7..ac78d84 100755 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ b/config/includes.chroot/lib/live/config/2000-waitforvts @@ -7,19 +7,21 @@ WaitForVTs () # echo -n " waitforvts" -cat >/etc/network/if-up.d/0000-waitforvts <<WAITFORVTS -#!/bin/bash -export TERM=linux; +#cat >/etc/network/if-up.d/0000-waitforvts <<WAITFORVTS +##!/bin/bash +#export TERM=linux; -# wait until terminal is available -while [ \$(fgconsole -n) -lt 7 ] || ! [ -c /dev/tty\$(fgconsole -n) ] ; do - echo -en "\n'\$0' is waiting for an unused VT to become available." - sleep 2 -done -fgconsole -n >/var/run/availablevt -WAITFORVTS +( + # wait until terminal is available + while [ \$(fgconsole -n) -lt 7 ] || ! [ -c /dev/tty\$(fgconsole -n) ] ; do + echo -en "\n'\$0' is waiting for an unused VT to become available." + sleep 2 + done + fgconsole -n >/var/run/availablevt +) & +#WAITFORVTS -chmod 755 /etc/network/if-up.d/0000-waitforvts +#chmod 755 /etc/network/if-up.d/0000-waitforvts } -- 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 e6adc05a3618e66d85109a3cd2c974b0eb1439cb Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 22:35:51 2017 +0200 if-up scripts should exit with a NOP when a local network device is changing to up, rather than a real network device --- config/includes.chroot/lib/live/config/2050-settime | 4 ++++ config/includes.chroot/lib/live/config/2100-showifconfig | 4 ++++ config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver | 4 ++++ config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf | 4 ++++ config/includes.chroot/lib/live/config/2700-x2go-getsessions | 4 ++++ 5 files changed, 20 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2050-settime index b5c17e3..dc062cd 100755 --- a/config/includes.chroot/lib/live/config/2050-settime +++ b/config/includes.chroot/lib/live/config/2050-settime @@ -11,6 +11,10 @@ cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; +if [ "$METHOD" = loopback ]; then + exit 0 +fi + while [ -z "\$(hostname -I)" ] ; do echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index 81a1276..afa8722 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -14,6 +14,10 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; +if [ "$METHOD" = loopback ]; then + exit 0 +fi + while [ -z "\$(hostname -I)" ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index d96284d..4749db2 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -17,6 +17,10 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; +if [ "$METHOD" = loopback ]; then + exit 0 +fi + while [ -z "\$(hostname -I)" ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 3996e85..eb14799 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -15,6 +15,10 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; +if [ "$METHOD" = loopback ]; then + exit 0 +fi + while [ -z "\$(hostname -I)" ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 2ee6792..bd59a57 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -18,6 +18,10 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; +if [ "$METHOD" = loopback ]; then + exit 0 +fi + while [ -z "\$(hostname -I)" ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 -- 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 e1f812d6cda6daadd97a38a4b76aa964af0a5924 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 22:39:41 2017 +0200 deleted script file that didn't work anyways --- .../lib/live/config/2000-waitforvts | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-waitforvts b/config/includes.chroot/lib/live/config/2000-waitforvts deleted file mode 100755 index ac78d84..0000000 --- a/config/includes.chroot/lib/live/config/2000-waitforvts +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -WaitForVTs () -{ - -# Output startup message -# -echo -n " waitforvts" - -#cat >/etc/network/if-up.d/0000-waitforvts <<WAITFORVTS -##!/bin/bash -#export TERM=linux; - -( - # wait until terminal is available - while [ \$(fgconsole -n) -lt 7 ] || ! [ -c /dev/tty\$(fgconsole -n) ] ; do - echo -en "\n'\$0' is waiting for an unused VT to become available." - sleep 2 - done - fgconsole -n >/var/run/availablevt -) & -#WAITFORVTS - -#chmod 755 /etc/network/if-up.d/0000-waitforvts - -} - -WaitForVTs -- 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 e54868e6a5f69f16d2671f9e3746702aca3a21a2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 22:40:28 2017 +0200 renamed settime script --- config/includes.chroot/lib/live/config/{2050-settime => 2000-settime} | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2050-settime b/config/includes.chroot/lib/live/config/2000-settime similarity index 100% rename from config/includes.chroot/lib/live/config/2050-settime rename to config/includes.chroot/lib/live/config/2000-settime -- 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 043f850e4b27ca8b6b159b09cb711d612438a2ac Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 23:34:27 2017 +0200 do not clear the console --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index bc09631..f4c523b 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -43,12 +43,6 @@ echo -n " live-autoupdater (backgrounding update task)" # exec >/dev/tty8 2>&1 - - # clear console - # - clear - - # This is so grep, awk and sed will match the right terms regardless of LANG # unset LANG -- 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 b0cfb0074a7052d6253c4bcc4e752bba02dd5109 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 22:53:03 2017 +0200 all if-up tasks are now sent into the background and told to wait until tty becomes available also, fixed indention in tcpprint --- .../includes.chroot/lib/live/config/2000-settime | 24 +- .../lib/live/config/2100-showifconfig | 36 +- .../lib/live/config/2250-getsshpubkeysfromserver | 52 +- .../lib/live/config/2300-xserver-xorg-getxorgconf | 44 +- .../lib/live/config/2400-live-autoupdate | 707 +++++++++++---------- .../includes.chroot/lib/live/config/2600-tcpprint | 5 + .../lib/live/config/2700-x2go-getsessions | 44 +- 7 files changed, 476 insertions(+), 436 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index dc062cd..67afe90 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -15,15 +15,21 @@ if [ "$METHOD" = loopback ]; then exit 0 fi -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 - sleep 2 -done -if ntpdate-debian -s && hwclock --systohc ; then - echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 -else - echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8 -fi +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + if ntpdate-debian -s && hwclock --systohc ; then + echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 + else + echo -en "\n\$(date +'%F | %T | ')'\$0' - error setting time. Timestamps will be based on CMOS Clock." | tee -a /dev/tty8 + fi +) & SETTIME chmod 755 /etc/network/if-up.d/0050-settime diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index afa8722..6851dde 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -18,21 +18,27 @@ if [ "$METHOD" = loopback ]; then exit 0 fi -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 - sleep 2 -done - -IPMSG=\$(LANG=C \ -/sbin/ip a | \ -/bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ -GREP_COLOR="1;32" \ -/bin/grep -P --color=always "link/ether .*? |$" ); \ -IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); -sed -i '/^- /d' /etc/issue; -sed -i '/^- /d' /etc/issue.net; -echo "\$IPMSG" >> /etc/issue; -echo "\$IPMSG" >> /etc/issue.net +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + + IPMSG=\$(LANG=C \ + /sbin/ip a | \ + /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ + GREP_COLOR="1;32" \ + /bin/grep -P --color=always "link/ether .*? |$" ); \ + IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); + sed -i '/^- /d' /etc/issue; + sed -i '/^- /d' /etc/issue.net; + echo "\$IPMSG" >> /etc/issue; + echo "\$IPMSG" >> /etc/issue.net +) & SHOWIPS chmod 755 /etc/network/if-up.d/0100-showips diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 4749db2..8cfb1f5 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -21,33 +21,39 @@ if [ "$METHOD" = loopback ]; then exit 0 fi -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 - 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 "$PUBKEYURL" | 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 +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + 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 "$PUBKEYURL" | 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 -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 + sleep 5 + done + fi + else + while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 sleep 5 done fi -else - while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 - sleep 5 - done -fi +) & GETPUBKEY chmod 755 /etc/network/if-up.d/0200-getsshpubkeysfromserver diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index eb14799..94a6c70 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -19,29 +19,35 @@ if [ "$METHOD" = loopback ]; then exit 0 fi -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 - sleep 2 -done -if echo "$XORGCONFURL" | grep -q "^tftp://" ; then - XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then - while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + if echo "$XORGCONFURL" | grep -q "^tftp://" ; then + XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then + while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do + echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 + sleep 5 + done + fi + else + while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 - sleep 5 + sleep 5 done fi -else - while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 - sleep 5 - done -fi -if [ -s $XORGCONFDESTINATION ] ; then - mv $XORGCONFDESTINATION /etc/X11/xorg.conf -fi + if [ -s $XORGCONFDESTINATION ] ; then + mv $XORGCONFDESTINATION /etc/X11/xorg.conf + fi +) & GETXORG chmod 755 /etc/network/if-up.d/0300-getxorgconf fi diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 9f3bdfa..24e7c54 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -34,402 +34,407 @@ echo -n " live-autoupdater (backgrounding update task)" # ( -# redirect all output to first available VT console -# -exec >/dev/tty8 2>&1 + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + # redirect all output to first available VT console + # + exec >/dev/tty8 2>&1 -# clear console -# -clear + # 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 + # 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 -en "\n$(date +'%F | %T | ')'\$0': No update URL. Exiting." - return 0 -fi + # download url pointing to directory with all required files goes here + DOWNLOADURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^updateurl=/ { print $2 }') -# 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 -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." -fi + if [ -z "$DOWNLOADURL" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." + fi -# sleeping a random amount of time to ease load on the update server -# -MAXSLEEPTIME=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ - awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') -if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then - MAXSLEEPTIME=900 -fi -SLEEPTIME=0 -echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." -# 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%MAXSLEEPTIME)) -if [ $SLEEPTIME -lt 120 ]; then - SLEEPTIME=$((SLEEPTIME+120)) -fi -echo -en "\n$(date +'%F | %T | ')'\$0': 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 - # This is in case we've been passed an incomplete UUID and/or one with dashes - # For example, "vol c:" on Windows will return the last 8 digits of the UUID - # only, and separate them with a dash. - if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(echo $NTFSROOT | tr -d '-') + + # sleeping a random amount of time to ease load on the update server + # + MAXSLEEPTIME=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') + if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then + MAXSLEEPTIME=900 + fi + SLEEPTIME=0 + echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." + # 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%MAXSLEEPTIME)) + if [ $SLEEPTIME -lt 120 ]; then + SLEEPTIME=$((SLEEPTIME+120)) + fi + echo -en "\n$(date +'%F | %T | ')'\$0': 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 + # This is in case we've been passed an incomplete UUID and/or one with dashes + # For example, "vol c:" on Windows will return the last 8 digits of the UUID + # only, and separate them with a dash. if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) + NTFSROOT=$(echo $NTFSROOT | tr -d '-') + if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then + NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) + fi fi - fi - if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then + echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + fi + # TODO: Further error handling + MOUNTPOINT="/lib/live/mount/ntfsroot/" + # create a temporary directory + TEMPDIR=$(mktemp -d --tmpdir=$MOUNTPOINT) else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + MOUNTPOINT="/lib/live/mount/findiso/" + # create a temporary directory and mount a tmpfs there + TEMPDIR=$(mktemp -d --tmpdir=/mnt) + + if [ -d /lib/live/mount/findiso/ ] ; then + # if we have access to the entire filesystem, use the + # directory size as base size for the current image - + # and if the download directory is even bigger, use that size + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") + [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD + else + IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + fi + # multiply current size by 1.5 as safety margin + mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR + fi - # TODO: Further error handling - 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) - - if [ -d /lib/live/mount/findiso/ ] ; then - # if we have access to the entire filesystem, use the - # directory size as base size for the current image - - # and if the download directory is even bigger, use that size - IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") - IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") - [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD - else - IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ + ( \ + [ -d "$MOUNTPOINT/boot/X2Go-live1" ] || \ + [ -d "$MOUNTPOINT/boot/X2Go-live2" ] \ + ) \ + ); then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': No directories suitable for update." + return 0 # directories missing, most likely not a writeable medium fi - # multiply current size by 1.5 as safety margin - mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR - -fi -if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ - ( \ - [ -d "$MOUNTPOINT/boot/X2Go-live1" ] || \ - [ -d "$MOUNTPOINT/boot/X2Go-live2" ] \ - ) \ - ); then - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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" = "X2Go-live1" ]; then - OTHERSYSTEMNAME="X2Go-live2" -elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then - OTHERSYSTEMNAME="X2Go-live1" -else - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." - return 1 -fi -OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") -DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") - - -# Now we'll copy the content of the X2Go-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 -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." - sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': 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/x2go-tce-initrd.img - cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" - rm "/tmp/x2go-tce-initrd.img" - SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ - $7 == "-" { print $5 }' /tmp/dl.log | \ - tail -1 \ - ) - case $SIZEFACTORSTRING in - "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': 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 | \ - tail -1 - ) - BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ - awk ' { print $1*$2*$3/100 }' | \ - awk -F'.' '{ print $1 }' \ - ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" - DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ - --progress=bar:force \ - --limit-rate=${BWLIMIT}k $DOWNLOADURL" - -elif echo "$DOWNLOADURL" | grep -q "^rsync"; then - - rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ - $TEMPDIR/x2go-tce-initrd.img.new - mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" - DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ - $TEMPDIR" -else - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." - return 1 -fi -rm /tmp/dl.log - - -# Proceed to download from update location -# -while ! $DOWNLOADCOMMAND; do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." - sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." -done - -# Now check if these files are different from what we already have in our -# download directory on the boot medium -# -echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." -if diff -q $DOWNLOADPATH $TEMPDIR \ - >/dev/null - - then - cleanup - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." -else - echo -en "\n$(date +'%F | %T | ')'\$0': 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* + # 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 -en "\n$(date +'%F | %T | ')'\$0': No suitable bootloader found." + return 1 + fi + RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^findiso=/ { print $2 }')")) -# move everything over to the boot medium -# -echo -en "\n$(date +'%F | %T | ')'\$0': Moving $TEMPDIR/* => $DOWNLOADPATH" -mv $TEMPDIR/* $DOWNLOADPATH -cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? -if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Mount successful." + ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH) + RUNNINGSYSTEMNAME=$(basename $RUNNINGSYSTEMFULLPATH) + if [ "$RUNNINGSYSTEMNAME" = "X2Go-live1" ]; then + OTHERSYSTEMNAME="X2Go-live2" + elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then + OTHERSYSTEMNAME="X2Go-live1" else - echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." + return 1 fi -fi + OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") + DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") -# let's check if we just downloaded a copy of our running system -# -echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" -if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ - [ -d "$OTHERSYSTEMFULLPATH" ] ; then - [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 + # Now we'll copy the content of the X2Go-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 -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + sleep 30 + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + done -# let's check if our destination is already up to date or needs updating -# -echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" -if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then + # 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/x2go-tce-initrd.img + cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" + rm "/tmp/x2go-tce-initrd.img" + SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ + $7 == "-" { print $5 }' /tmp/dl.log | \ + tail -1 \ + ) + case $SIZEFACTORSTRING in + "" | \ + [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': 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 | \ + tail -1 + ) + BWLIMIT=$( echo "$DLRATE $SIZEFACTOR $BWLIMITPERCENT" | \ + awk ' { print $1*$2*$3/100 }' | \ + awk -F'.' '{ print $1 }' \ + ) # outputs integer kilobytes, not rounded + echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ + --progress=bar:force \ + --limit-rate=${BWLIMIT}k $DOWNLOADURL" + + elif echo "$DOWNLOADURL" | grep -q "^rsync"; then + + rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ + $TEMPDIR/x2go-tce-initrd.img.new + mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-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 -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ + $TEMPDIR" + else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" - while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH - do + echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." + return 1 + fi + rm /tmp/dl.log + + + # Proceed to download from update location + # + while ! $DOWNLOADCOMMAND; do echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." sleep 30 echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." done -fi + # Now check if these files are different from what we already have in our + # download directory on the boot medium + # + echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." + if diff -q $DOWNLOADPATH $TEMPDIR \ + >/dev/null + + then + cleanup + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Differences detected. Continuing ..." + fi -# change default boot to the image we just downloaded and installed -# -if [ -n "$SYSLINUXPATH" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." - sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ - $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}" | - awk -F':' '$2 ~ /'"${RUNNINGSYSTEMNAME}"'/ { print $1 }') - CURRENTTITLEPOSITION=$((CURRENTTITLEPOSITION-1)) - OTHERTITLEPOSITION=$(grep '^title' $MENULST | - grep -n "${OTHERSYSTEMNAME}" | - awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') - OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) - if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." - sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ - $MENULST + + # 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 -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." else - echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." - echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," - echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." + echo -en "\n$(date +'%F | %T | ')'\$0': Could not remount '$MOUNTPOINT' as rw and async." fi -else - echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported bootloader." -fi -# we're on an async mount point, so let's sync to be safe -# -sync + # Now, we don't want to copy an index.htm(l) file, so let's do away with that + # + rm -f $TEMPDIR/index.ht* -# umount tempdir to free memory -# -if [ -d $TEMPDIR ]; then - cleanup -fi + + # move everything over to the boot medium + # + echo -en "\n$(date +'%F | %T | ')'\$0': Moving $TEMPDIR/* => $DOWNLOADPATH" + mv $TEMPDIR/* $DOWNLOADPATH + cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? + if [ -n "$NTFSROOT" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Mount successful." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." + fi + fi -# now, change mount back to ro and sync -# -if [ -n "$NTFSROOT" ]; then - if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + # let's check if we just downloaded a copy of our running system + # + echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" + if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ + [ -d "$OTHERSYSTEMFULLPATH" ] ; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" + if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then + [ -n "$NTFSROOT" ] && umount $MOUNTPOINT + echo -en "\n$(date +'%F | %T | ')'\$0': Nothing to do - content of '$DOWNLOADPATH' equals"\ + "'$OTHERSYSTEMNAME'." + return 0 # OTHERSYSTEMFULLPATH is already up to date else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." + # keep rsyncing until the update is complete + echo -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH + do + echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + sleep 30 + echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + done fi -else - if mount -oremount,ro,sync $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." + + + # change default boot to the image we just downloaded and installed + # + if [ -n "$SYSLINUXPATH" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." + sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ + $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}" | + awk -F':' '$2 ~ /'"${RUNNINGSYSTEMNAME}"'/ { print $1 }') + CURRENTTITLEPOSITION=$((CURRENTTITLEPOSITION-1)) + OTHERTITLEPOSITION=$(grep '^title' $MENULST | + grep -n "${OTHERSYSTEMNAME}" | + awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') + OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) + if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then + echo -en "\n$(date +'%F | %T | ')'\$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ + $MENULST + else + echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." + echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." + fi else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." + echo -en "\n$(date +'%F | %T | ')'\$0': 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 + if umount $MOUNTPOINT; then + echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." + fi + else + if mount -oremount,ro,sync $MOUNTPOINT; then + echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." + else + echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." + fi fi -fi ) & diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index a2b1355..1da6e7b 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -25,6 +25,11 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then sleep 30 done + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + PRINTERDEVICES="" [ -d /dev/usb ] && PRINTERDEVICES=$(find /dev/usb -type c -name "lp*" | sort) PRINTERDEVICES="$PRINTERDEVICES $(find /dev/ -maxdepth 1 -type c -name "lp*" | sort)" diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index bd59a57..ebbb3c0 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -22,29 +22,35 @@ if [ "$METHOD" = loopback ]; then exit 0 fi -while [ -z "\$(hostname -I)" ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 - sleep 2 -done -if echo "$SESSIONSURL" | grep -q "^tftp://" ; then - SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) - if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then - while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + if echo "$SESSIONSURL" | grep -q "^tftp://" ; then + SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then + while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do + echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 + sleep 5 + done + fi + else + while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 - sleep 5 + sleep 5 done fi -else - while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 - sleep 5 - done -fi -if [ -s $SESSIONSDESTINATION ] ; then - mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions -fi + if [ -s $SESSIONSDESTINATION ] ; then + mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions + fi +) & GETSESS chmod 755 /etc/network/if-up.d/0400-getsessions 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 3376857adc8fb2d76f4965fb3439756c2087039d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 23:29:46 2017 +0200 removed unneccessary escapes --- .../lib/live/config/2400-live-autoupdate | 102 ++++++++++----------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 24e7c54..bc09631 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -3,22 +3,22 @@ cleanup () { # discard contents of tmpfs, umount if necessary if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Removing '$TEMPDIR/*'." + echo -en "\n$(date +'%F | %T | ')'$0': Removing '$TEMPDIR/*'." rm -rf $TEMPDIR/* else - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounting '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'$0': Unmounting '$TEMPDIR'." umount $TEMPDIR fi if rmdir $TEMPDIR; then - echo -en "\n$(date +'%F | %T | ')'\$0': Removed empty directory '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'$0': Removed empty directory '$TEMPDIR'." else - echo -en "\n$(date +'%F | %T | ')'\$0': Could not remove directory '$TEMPDIR'." + echo -en "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." fi if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo -en "\n$(date +'%F | %T | ')'\$0': Could not unmount '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." fi fi } @@ -35,7 +35,7 @@ echo -n " live-autoupdater (backgrounding update task)" ( while ! [ -c /dev/tty8 ] ; do - echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + echo -en "\n\$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." sleep 2 done @@ -62,7 +62,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^updateurl=/ { print $2 }') if [ -z "$DOWNLOADURL" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': No update URL. Exiting." + echo -en "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." return 0 fi @@ -74,7 +74,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^bwlimit=/ { print $2 }') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 - echo -en "\n$(date +'%F | %T | ')'\$0': Bandwidth limit not set. Defaulting to 20%." + echo -en "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." fi @@ -88,7 +88,7 @@ echo -n " live-autoupdater (backgrounding update task)" MAXSLEEPTIME=900 fi SLEEPTIME=0 - echo -en "\n$(date +'%F | %T | ')'\$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." + echo -en "\n$(date +'%F | %T | ')'$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." # During startup, script is run with /bin/sh, # even when #!/bin/bash is set, # so we need to improvise. @@ -97,7 +97,7 @@ echo -n " live-autoupdater (backgrounding update task)" if [ $SLEEPTIME -lt 120 ]; then SLEEPTIME=$((SLEEPTIME+120)) fi - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping for $SLEEPTIME seconds ..." + echo -en "\n$(date +'%F | %T | ')'$0': Sleeping for $SLEEPTIME seconds ..." sleep $SLEEPTIME @@ -116,9 +116,9 @@ echo -n " live-autoupdater (backgrounding update task)" fi if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo -en "\n$(date +'%F | %T | ')'\$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + echo -en "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo -en "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." fi # TODO: Further error handling MOUNTPOINT="/lib/live/mount/ntfsroot/" @@ -150,7 +150,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) \ ); then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': No directories suitable for update." + echo -en "\n$(date +'%F | %T | ')'$0': No directories suitable for update." return 0 # directories missing, most likely not a writeable medium fi @@ -169,7 +169,7 @@ echo -n " live-autoupdater (backgrounding update task)" GRUBPATH="$MOUNTPOINT/boot/grub/" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': No suitable bootloader found." + echo -en "\n$(date +'%F | %T | ')'$0': No suitable bootloader found." return 1 fi @@ -185,7 +185,7 @@ echo -n " live-autoupdater (backgrounding update task)" OTHERSYSTEMNAME="X2Go-live1" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to determine path/name of running system." + echo -en "\n$(date +'%F | %T | ')'$0': Unable to determine path/name of running system." return 1 fi OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") @@ -199,9 +199,9 @@ echo -n " live-autoupdater (backgrounding update task)" # like CF cards) # while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." done @@ -221,7 +221,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': Not enough Bandwidth for update task - " + [0-9]) echo -en "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -239,7 +239,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -en "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" @@ -255,7 +255,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'\$0': Not enough Bandwidth for update task - " + [0-9]) echo -en "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -272,12 +272,12 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'\$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -en "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported download mechanism - aborting." + echo -en "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." return 1 fi rm /tmp/dl.log @@ -286,25 +286,25 @@ echo -n " live-autoupdater (backgrounding update task)" # Proceed to download from update location # while ! $DOWNLOADCOMMAND; do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." done # Now check if these files are different from what we already have in our # download directory on the boot medium # - echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." + echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." if diff -q $DOWNLOADPATH $TEMPDIR \ >/dev/null then cleanup - echo -en "\n$(date +'%F | %T | ')'\$0': Nothing to do. - Files on server not newer than '$DOWNLOADPATH'." + echo -en "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Differences detected. Continuing ..." + echo -en "\n$(date +'%F | %T | ')'$0': Differences detected. Continuing ..." fi @@ -312,9 +312,9 @@ echo -n " live-autoupdater (backgrounding update task)" # remount it rw and async for speed # if mount -oremount,rw,async $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' as rw and async." + echo -en "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' as rw and async." else - echo -en "\n$(date +'%F | %T | ')'\$0': Could not remount '$MOUNTPOINT' as rw and async." + echo -en "\n$(date +'%F | %T | ')'$0': Could not remount '$MOUNTPOINT' as rw and async." fi @@ -325,26 +325,26 @@ echo -n " live-autoupdater (backgrounding update task)" # move everything over to the boot medium # - echo -en "\n$(date +'%F | %T | ')'\$0': Moving $TEMPDIR/* => $DOWNLOADPATH" + echo -en "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" mv $TEMPDIR/* $DOWNLOADPATH cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': NTFSROOT detected. Attempting to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo -en "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Mount successful." + echo -en "\n$(date +'%F | %T | ')'$0': Mount successful." else - echo -en "\n$(date +'%F | %T | ')'\$0': Failed to mount NTFSROOT." + echo -en "\n$(date +'%F | %T | ')'$0': Failed to mount NTFSROOT." fi fi # let's check if we just downloaded a copy of our running system # - echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" + echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ [ -d "$OTHERSYSTEMFULLPATH" ] ; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Nothing to do. Content of $DOWNLOADPATH equals" \ + echo -en "\n$(date +'%F | %T | ')'$0': 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 @@ -359,20 +359,20 @@ echo -n " live-autoupdater (backgrounding update task)" # let's check if our destination is already up to date or needs updating # - echo -en "\n$(date +'%F | %T | ')'\$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" + echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'\$0': Nothing to do - content of '$DOWNLOADPATH' equals"\ + echo -en "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'\$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + echo -en "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH do - echo -en "\n$(date +'%F | %T | ')'\$0': Sleeping 30 seconds ..." + echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'\$0': Retrying ..." + echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." done fi @@ -380,7 +380,7 @@ echo -n " live-autoupdater (backgrounding update task)" # change default boot to the image we just downloaded and installed # if [ -n "$SYSLINUXPATH" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing syslinux default to $OTHERSYSTEMNAME." + echo -en "\n$(date +'%F | %T | ')'$0': Changing syslinux default to $OTHERSYSTEMNAME." sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ $SYSLINUXPATH/syslinux.cfg @@ -396,16 +396,16 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo -en "\n$(date +'%F | %T | ')'\$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + echo -en "\n$(date +'%F | %T | ')'$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ $MENULST else - echo -en "\n$(date +'%F | %T | ')'\$0': Not changing GRUB-legacy default." - echo -en "\n$(date +'%F | %T | ')'\$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," - echo -en "\n$(date +'%F | %T | ')'\$0': while default is set to position '$CURRENTDEFAULT'." + echo -en "\n$(date +'%F | %T | ')'$0': Not changing GRUB-legacy default." + echo -en "\n$(date +'%F | %T | ')'$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo -en "\n$(date +'%F | %T | ')'$0': while default is set to position '$CURRENTDEFAULT'." fi else - echo -en "\n$(date +'%F | %T | ')'\$0': Unsupported bootloader." + echo -en "\n$(date +'%F | %T | ')'$0': Unsupported bootloader." fi # we're on an async mount point, so let's sync to be safe @@ -424,15 +424,15 @@ echo -n " live-autoupdater (backgrounding update task)" # if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Unmounted '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to unmount '$MOUNTPOINT'." + echo -en "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." fi else if mount -oremount,ro,sync $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'\$0': Remounted '$MOUNTPOINT' ro and sync." + echo -en "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." else - echo -en "\n$(date +'%F | %T | ')'\$0': Unable to remount '$MOUNTPOINT' ro and sync." + echo -en "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." fi 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 836161752985738d1a69077d0844c1884e8e8708 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 23:38:47 2017 +0200 /bin/sh instead of /bin/bash requires the use of "echo" instead of "echo -en" --- .../lib/live/config/2400-live-autoupdate | 104 +++++++++++---------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index f4c523b..b1960dc 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -1,24 +1,26 @@ #!/bin/sh +# this is not /bin/bash, so "echo -en" is not supported, but the default when calling "echo" + cleanup () { # discard contents of tmpfs, umount if necessary if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'$0': Removing '$TEMPDIR/*'." + echo "\n$(date +'%F | %T | ')'$0': Removing '$TEMPDIR/*'." rm -rf $TEMPDIR/* else - echo -en "\n$(date +'%F | %T | ')'$0': Unmounting '$TEMPDIR'." + echo "\n$(date +'%F | %T | ')'$0': Unmounting '$TEMPDIR'." umount $TEMPDIR fi if rmdir $TEMPDIR; then - echo -en "\n$(date +'%F | %T | ')'$0': Removed empty directory '$TEMPDIR'." + echo "\n$(date +'%F | %T | ')'$0': Removed empty directory '$TEMPDIR'." else - echo -en "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." + echo "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." fi if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo -en "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." + echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." fi fi } @@ -35,7 +37,7 @@ echo -n " live-autoupdater (backgrounding update task)" ( while ! [ -c /dev/tty8 ] ; do - echo -en "\n\$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." + echo "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." sleep 2 done @@ -56,7 +58,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^updateurl=/ { print $2 }') if [ -z "$DOWNLOADURL" ]; then - echo -en "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." + echo "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." return 0 fi @@ -68,7 +70,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^bwlimit=/ { print $2 }') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 - echo -en "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." + echo "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." fi @@ -82,7 +84,7 @@ echo -n " live-autoupdater (backgrounding update task)" MAXSLEEPTIME=900 fi SLEEPTIME=0 - echo -en "\n$(date +'%F | %T | ')'$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." + echo "\n$(date +'%F | %T | ')'$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." # During startup, script is run with /bin/sh, # even when #!/bin/bash is set, # so we need to improvise. @@ -91,7 +93,7 @@ echo -n " live-autoupdater (backgrounding update task)" if [ $SLEEPTIME -lt 120 ]; then SLEEPTIME=$((SLEEPTIME+120)) fi - echo -en "\n$(date +'%F | %T | ')'$0': Sleeping for $SLEEPTIME seconds ..." + echo "\n$(date +'%F | %T | ')'$0': Sleeping for $SLEEPTIME seconds ..." sleep $SLEEPTIME @@ -110,9 +112,9 @@ echo -n " live-autoupdater (backgrounding update task)" fi if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo -en "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + echo "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." else - echo -en "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." fi # TODO: Further error handling MOUNTPOINT="/lib/live/mount/ntfsroot/" @@ -144,7 +146,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) \ ); then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': No directories suitable for update." + echo "\n$(date +'%F | %T | ')'$0': No directories suitable for update." return 0 # directories missing, most likely not a writeable medium fi @@ -163,7 +165,7 @@ echo -n " live-autoupdater (backgrounding update task)" GRUBPATH="$MOUNTPOINT/boot/grub/" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': No suitable bootloader found." + echo "\n$(date +'%F | %T | ')'$0': No suitable bootloader found." return 1 fi @@ -179,7 +181,7 @@ echo -n " live-autoupdater (backgrounding update task)" OTHERSYSTEMNAME="X2Go-live1" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': Unable to determine path/name of running system." + echo "\n$(date +'%F | %T | ')'$0': Unable to determine path/name of running system." return 1 fi OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") @@ -193,9 +195,9 @@ echo -n " live-autoupdater (backgrounding update task)" # like CF cards) # while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do - echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo "\n$(date +'%F | %T | ')'$0': Retrying ..." done @@ -215,7 +217,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -233,7 +235,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" @@ -249,7 +251,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -en "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -266,12 +268,12 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo -en "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." + echo "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." return 1 fi rm /tmp/dl.log @@ -280,25 +282,25 @@ echo -n " live-autoupdater (backgrounding update task)" # Proceed to download from update location # while ! $DOWNLOADCOMMAND; do - echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo "\n$(date +'%F | %T | ')'$0': Retrying ..." done # Now check if these files are different from what we already have in our # download directory on the boot medium # - echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." + echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." if diff -q $DOWNLOADPATH $TEMPDIR \ >/dev/null then cleanup - echo -en "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$DOWNLOADPATH'." + echo "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'$0': Differences detected. Continuing ..." + echo "\n$(date +'%F | %T | ')'$0': Differences detected. Continuing ..." fi @@ -306,9 +308,9 @@ echo -n " live-autoupdater (backgrounding update task)" # remount it rw and async for speed # if mount -oremount,rw,async $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' as rw and async." + echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' as rw and async." else - echo -en "\n$(date +'%F | %T | ')'$0': Could not remount '$MOUNTPOINT' as rw and async." + echo "\n$(date +'%F | %T | ')'$0': Could not remount '$MOUNTPOINT' as rw and async." fi @@ -319,26 +321,26 @@ echo -n " live-autoupdater (backgrounding update task)" # move everything over to the boot medium # - echo -en "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" + echo "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" mv $TEMPDIR/* $DOWNLOADPATH cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? if [ -n "$NTFSROOT" ]; then - echo -en "\n$(date +'%F | %T | ')'$0': NTFSROOT detected. Attempting to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'$0': Mount successful." + echo "\n$(date +'%F | %T | ')'$0': Mount successful." else - echo -en "\n$(date +'%F | %T | ')'$0': Failed to mount NTFSROOT." + echo "\n$(date +'%F | %T | ')'$0': Failed to mount NTFSROOT." fi fi # let's check if we just downloaded a copy of our running system # - echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" + echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ [ -d "$OTHERSYSTEMFULLPATH" ] ; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': Nothing to do. Content of $DOWNLOADPATH equals" \ + echo "\n$(date +'%F | %T | ')'$0': 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 @@ -353,20 +355,20 @@ echo -n " live-autoupdater (backgrounding update task)" # let's check if our destination is already up to date or needs updating # - echo -en "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" + echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo -en "\n$(date +'%F | %T | ')'$0': Nothing to do - content of '$DOWNLOADPATH' equals"\ + echo "\n$(date +'%F | %T | ')'$0': 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 -en "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + echo "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH do - echo -en "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo -en "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo "\n$(date +'%F | %T | ')'$0': Retrying ..." done fi @@ -374,7 +376,7 @@ echo -n " live-autoupdater (backgrounding update task)" # change default boot to the image we just downloaded and installed # if [ -n "$SYSLINUXPATH" ]; then - echo -en "\n$(date +'%F | %T | ')'$0': Changing syslinux default to $OTHERSYSTEMNAME." + echo "\n$(date +'%F | %T | ')'$0': Changing syslinux default to $OTHERSYSTEMNAME." sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ $SYSLINUXPATH/syslinux.cfg @@ -390,16 +392,16 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo -en "\n$(date +'%F | %T | ')'$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + echo "\n$(date +'%F | %T | ')'$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ $MENULST else - echo -en "\n$(date +'%F | %T | ')'$0': Not changing GRUB-legacy default." - echo -en "\n$(date +'%F | %T | ')'$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," - echo -en "\n$(date +'%F | %T | ')'$0': while default is set to position '$CURRENTDEFAULT'." + echo "\n$(date +'%F | %T | ')'$0': Not changing GRUB-legacy default." + echo "\n$(date +'%F | %T | ')'$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo "\n$(date +'%F | %T | ')'$0': while default is set to position '$CURRENTDEFAULT'." fi else - echo -en "\n$(date +'%F | %T | ')'$0': Unsupported bootloader." + echo "\n$(date +'%F | %T | ')'$0': Unsupported bootloader." fi # we're on an async mount point, so let's sync to be safe @@ -418,15 +420,15 @@ echo -n " live-autoupdater (backgrounding update task)" # if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo -en "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." + echo "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." fi else if mount -oremount,ro,sync $MOUNTPOINT; then - echo -en "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." + echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." else - echo -en "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." + echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." fi 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 ed74d89c28047ce8be58eae901648c90f905e973 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sun Jul 23 23:31:27 2017 +0200 added missing escapes --- config/includes.chroot/lib/live/config/2000-settime | 2 +- config/includes.chroot/lib/live/config/2100-showifconfig | 2 +- config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2700-x2go-getsessions | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index 67afe90..04ec578 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -11,7 +11,7 @@ cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; -if [ "$METHOD" = loopback ]; then +if [ "\$METHOD" = loopback ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index 6851dde..c45f67e 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -14,7 +14,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; -if [ "$METHOD" = loopback ]; then +if [ "\$METHOD" = loopback ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 8cfb1f5..c25c709 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -17,7 +17,7 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -if [ "$METHOD" = loopback ]; then +if [ "\$METHOD" = loopback ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 94a6c70..5c36309 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -15,7 +15,7 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -if [ "$METHOD" = loopback ]; then +if [ "\$METHOD" = loopback ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index ebbb3c0..d87affe 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -18,7 +18,7 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -if [ "$METHOD" = loopback ]; then +if [ "\$METHOD" = loopback ]; then exit 0 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 76832d52e2d81d799e67181e55bd18edd9671b3e Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 00:11:31 2017 +0200 wait until regular ntpdate if-up.d call has finished --- config/includes.chroot/lib/live/config/2000-settime | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index 04ec578..ba16b24 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -24,6 +24,10 @@ fi echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done + while [ -f /var/lock/ntpdate ] ; do + echo -en "\n'\$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8 + sleep 2 + done if ntpdate-debian -s && hwclock --systohc ; then echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 else -- 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 dee643ca510a73b414cf9dea1805b670051d1c25 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 00:18:54 2017 +0200 added debug output --- config/includes.chroot/lib/live/config/2000-settime | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index ba16b24..e41b57f 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -15,11 +15,14 @@ if [ "\$METHOD" = loopback ]; then exit 0 fi -( +( while ! [ -c /dev/tty8 ] ; do echo -en "\n'\$0' is waiting for tty8 to become available." sleep 2 done + + echo -en "\n'\$0': DEBUG: METHOD is '\$METHOD', IFACE is '\$IFACE'." | tee -a /dev/tty8 + while [ -z "\$(hostname -I)" ] ; do echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 -- 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 1d69e1ebbd6ffd5d86879927d4afd391330a28e5 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 01:05:49 2017 +0200 autoupdate-patch for ramdisk mode --- .../lib/live/config/2400-live-autoupdate | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index b1960dc..c5a30ce 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -16,7 +16,7 @@ cleanup () else echo "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." fi - if [ -n "$NTFSROOT" ]; then + if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then if umount $MOUNTPOINT; then echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else @@ -62,6 +62,29 @@ echo -n " live-autoupdater (backgrounding update task)" return 0 fi + if ! [ -d /lib/live/mount/findiso ] ; then + LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') + TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) + FINDFILE=(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') + [ -z "$FINDFILE" ] && exit 0 + for PARTITON in $LISTOFPARTITIONS ; do + mount $PARTITION $TEMPMOUNT + if ! [ -f $FINDFILE ] ; then + umount $TEMPMOUNT + else + umount $TEMPMOUNT + mkdir /lib/live/mount/findiso + mount $PARTITION /lib/live/mount/findiso + RAMDISKMODE="yes" + break + fi + done + fi + if ! [ -d /lib/live/mount/findiso ] ; then + echo "\n$(date +'%F | %T | ')'$0': Local update directory not found. Exiting." + return 0 + fi + # Bandwidth limit goes here # #BWLIMITPERCENT=20 # in percent, numeric-only @@ -430,6 +453,9 @@ echo -n " live-autoupdater (backgrounding update task)" else echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." fi + if [ -n "$RAMDISKMODE" ] ; then + umount $MOUNTPOINT + fi 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 228e1a699fd32d1bd3113d020ac61ffc7242f259 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 01:22:07 2017 +0200 do not trigger on METHOD="none" (which is set when IFACE="--all") --- config/includes.chroot/lib/live/config/2000-settime | 4 +--- config/includes.chroot/lib/live/config/2100-showifconfig | 2 +- config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver | 2 +- config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf | 2 +- config/includes.chroot/lib/live/config/2700-x2go-getsessions | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index e41b57f..40468b0 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -11,7 +11,7 @@ cat >/etc/network/if-up.d/0050-settime <<SETTIME #!/bin/bash export TERM=linux; -if [ "\$METHOD" = loopback ]; then +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then exit 0 fi @@ -21,8 +21,6 @@ fi sleep 2 done - echo -en "\n'\$0': DEBUG: METHOD is '\$METHOD', IFACE is '\$IFACE'." | tee -a /dev/tty8 - while [ -z "\$(hostname -I)" ] ; do echo -en "\n'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index c45f67e..9ccb02b 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -14,7 +14,7 @@ cat >/etc/network/if-up.d/0100-showips <<SHOWIPS #!/bin/bash export TERM=linux; -if [ "\$METHOD" = loopback ]; then +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index c25c709..4f2abfd 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -17,7 +17,7 @@ GetSSHPubKeysFromServer () #!/bin/bash export TERM=linux; -if [ "\$METHOD" = loopback ]; then +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 5c36309..f8d7eb4 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -15,7 +15,7 @@ echo -n " xserver-xorg-getxorgconf" #!/bin/bash export TERM=linux; -if [ "\$METHOD" = loopback ]; then +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then exit 0 fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index d87affe..792c6b9 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -18,7 +18,7 @@ X2GoGetSessions () #!/bin/bash export TERM=linux; -if [ "\$METHOD" = loopback ]; then +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then exit 0 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 1b8fcf7e51827378671990ad3f23a3b7cb171b4c Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 01:53:15 2017 +0200 typofix --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index c5a30ce..f891700 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -65,7 +65,7 @@ echo -n " live-autoupdater (backgrounding update task)" if ! [ -d /lib/live/mount/findiso ] ; then LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) - FINDFILE=(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') + FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') [ -z "$FINDFILE" ] && exit 0 for PARTITON in $LISTOFPARTITIONS ; do mount $PARTITION $TEMPMOUNT -- 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 84f1def51cf82ccab6c021edfd8e772a9e8c1fe2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 02:34:03 2017 +0200 typofix --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index f891700..ed498bb 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -67,7 +67,7 @@ echo -n " live-autoupdater (backgrounding update task)" TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') [ -z "$FINDFILE" ] && exit 0 - for PARTITON in $LISTOFPARTITIONS ; do + for PARTITION in $LISTOFPARTITIONS ; do mount $PARTITION $TEMPMOUNT if ! [ -f $FINDFILE ] ; then umount $TEMPMOUNT -- 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 66ad99be725abcbd9aeb331e792e302d4a9ef3e5 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 01:55:52 2017 +0200 added debug code again --- config/includes.chroot/lib/live/config/2000-settime | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index 40468b0..d4efb7c 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -29,6 +29,8 @@ fi echo -en "\n'\$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8 sleep 2 done + echo -en "\n\$(date +'%F | %T | ')'\$0': METHOD: '\$METHOD' - IFACE: '\$IFACE'." | tee -a /dev/tty8 + if ntpdate-debian -s && hwclock --systohc ; then echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 else -- 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 caa88916cd9fb9f25c99f5561cb4fbf84a342ff3 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 02:31:57 2017 +0200 changed log output message --- config/includes.chroot/lib/live/config/2000-settime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index d4efb7c..1e9d5b2 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -29,7 +29,7 @@ fi echo -en "\n'\$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8 sleep 2 done - echo -en "\n\$(date +'%F | %T | ')'\$0': METHOD: '\$METHOD' - IFACE: '\$IFACE'." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')'\$0': Interface '\$IFACE' is up - attempting to set time via ntp ..." | tee -a /dev/tty8 if ntpdate-debian -s && hwclock --systohc ; then echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 -- 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 9daa18b86af1dad563e97d60d3f9525aee8b5863 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 02:35:15 2017 +0200 path was wrong --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index ed498bb..62a618c 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -69,7 +69,7 @@ echo -n " live-autoupdater (backgrounding update task)" [ -z "$FINDFILE" ] && exit 0 for PARTITION in $LISTOFPARTITIONS ; do mount $PARTITION $TEMPMOUNT - if ! [ -f $FINDFILE ] ; then + if ! [ -f "$TEMPMOUNT/$FINDFILE" ] ; then umount $TEMPMOUNT else umount $TEMPMOUNT -- 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 7fe794d94f8ca9d64e7a6f3a1f563554c2736e18 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 12:35:24 2017 +0200 IMGSIZEDOWNLOAD was missing a filter that limits its content to $1 (awk-style) --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index fc9681c..94128ca 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -153,7 +153,7 @@ echo -n " live-autoupdater (backgrounding update task)" # directory size as base size for the current image - # and if the download directory is even bigger, use that size IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))" | awk '{ print $1}') - IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" || echo "0") + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" | awk '{ print $1}' || echo "0") [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD else IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') -- 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 8c854f3b94d6579ecb75e1d956e104806d3741c8 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 03:24:28 2017 +0200 added resiliency in case download directory is missing, fixed imagesize calculation --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 62a618c..fc9681c 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -152,8 +152,8 @@ echo -n " live-autoupdater (backgrounding update task)" # if we have access to the entire filesystem, use the # directory size as base size for the current image - # and if the download directory is even bigger, use that size - IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))") - IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download") + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))" | awk '{ print $1}') + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" || echo "0") [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD else IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') -- 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 f9b904f8c2b122ed8cdcefcc04c21a1606bc4228 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 11:50:30 2017 +0200 added sleep to increase chance that ntpdate manages to connect --- config/includes.chroot/lib/live/config/2000-settime | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2000-settime b/config/includes.chroot/lib/live/config/2000-settime index 1e9d5b2..cb0ada3 100755 --- a/config/includes.chroot/lib/live/config/2000-settime +++ b/config/includes.chroot/lib/live/config/2000-settime @@ -29,8 +29,10 @@ fi echo -en "\n'\$0' is waiting for a previous ntpdate call to finish." | tee -a /dev/tty8 sleep 2 done - echo -en "\n\$(date +'%F | %T | ')'\$0': Interface '\$IFACE' is up - attempting to set time via ntp ..." | tee -a /dev/tty8 - + echo -en "\n\$(date +'%F | %T | ')'\$0': Interface '\$IFACE' is up - attempting to set time via ntp in 20 seconds ..." | tee -a /dev/tty8 + + sleep 20 # make sure IP, Route, DNS are all up + if ntpdate-debian -s && hwclock --systohc ; then echo -en "\n\$(date +'%F | %T | ')'\$0' - time has been set." | tee -a /dev/tty8 else -- 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 85042cef4c895dee1afaf608fa4e6bc127d6bcd9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 18:19:05 2017 +0200 expanded logging, changed log messages --- config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 4f2abfd..7365b9b 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -38,18 +38,19 @@ fi touch /root/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys + echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting SSH public keyfile download ..." | tee -a /dev/tty8 if echo "$PUBKEYURL" | 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 -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for SSH Public Key ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (wget) ..." | tee -a /dev/tty8 sleep 5 done 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 afb741fc42d1a73a8aa986005a64d1df3adfb796 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 20:02:36 2017 +0200 removed a cleanup command that would umount /lib/live/mount/findiso when in ramdisk mode, which is a stupid thing to do --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 1 - 1 file changed, 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 22e2778..0ec265a 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -380,7 +380,6 @@ echo -n " live-autoupdater (backgrounding update task)" # echo "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" mv $TEMPDIR/* $DOWNLOADPATH - cleanup # FIXME ist dieses Cleanup gerechtfertigt oder macht es dummfoog? if [ -n "$NTFSROOT" ]; then echo "\n$(date +'%F | %T | ')'$0': 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 -- 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 ab0a9b70cd2537a11a18ab66a2415edc0a51a901 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 20:19:59 2017 +0200 using mv would accumulate clutter in $DOWNLOADPATH if any extra files are present in the source; switched to rsync --delete and rm instead --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 3f1e0fd..6b6ac3f 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -379,7 +379,9 @@ echo -n " live-autoupdater (backgrounding update task)" # move everything over to the boot medium # echo "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" - mv $TEMPDIR/* $DOWNLOADPATH + # using mv would accumulate clutter in $DOWNLOADPATH if any extra files are present in the source + rsync -aPv --inplace --delete --modify-window=1 $TEMPDIR/ $DOWNLOADPATH/ + rm -rf $TEMPDIR/* if [ -n "$NTFSROOT" ]; then echo "\n$(date +'%F | %T | ')'$0': 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 -- 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 c9e5616405325b28e58b57156e60bc352c64a1c2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 14:28:25 2017 +0200 improved logging, added error detection for mount process --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 94128ca..94e2657 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -63,6 +63,7 @@ echo -n " live-autoupdater (backgrounding update task)" fi if ! [ -d /lib/live/mount/findiso ] ; then + echo "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') @@ -73,9 +74,14 @@ echo -n " live-autoupdater (backgrounding update task)" umount $TEMPMOUNT else umount $TEMPMOUNT + rmdir $TEMPMOUNT mkdir /lib/live/mount/findiso - mount $PARTITION /lib/live/mount/findiso - RAMDISKMODE="yes" + if mount $PARTITION /lib/live/mount/findiso ; then + echo "\n$(date +'%F | %T | ')'$0': mounted $PARTITION as '/lib/live/mount/findiso'." + RAMDISKMODE="yes" + else + echo "\n$(date +'%F | %T | ')'$0': error mounting $PARTITION as '/lib/live/mount/findiso'." + fi break fi done -- 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 dae2a3a578840eec5886578b41a9b816c2eab588 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 14:36:26 2017 +0200 increased log output --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 94e2657..b736ade 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -223,11 +223,13 @@ echo -n " live-autoupdater (backgrounding update task)" # and we want to avoid that especially for media that has no wear-leveling # like CF cards) # + echo -n "\n$(date +'%F | %T | ')'$0': Preparing tempdir ..." while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 echo "\n$(date +'%F | %T | ')'$0': Retrying ..." done + echo " done." # Now let's figure out if we're supposed to use wget or rsync for downloading @@ -236,6 +238,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo "$DOWNLOADURL" | grep -q "^ftp" then # Attempt to determine available bandwidth & to set BWLIMIT accordingly + echo "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget." wget -Nr -o /tmp/dl.log -P /tmp/ -nd \ --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" @@ -271,6 +274,8 @@ echo -n " live-autoupdater (backgrounding update task)" elif echo "$DOWNLOADURL" | grep -q "^rsync"; then + # Attempt to determine available bandwidth & to set BWLIMIT accordingly + echo "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync." rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ $TEMPDIR/x2go-tce-initrd.img.new mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-initrd.img @@ -310,10 +315,11 @@ echo -n " live-autoupdater (backgrounding update task)" # Proceed to download from update location # + echo "\n$(date +'%F | %T | ')'$0': starting download ..." while ! $DOWNLOADCOMMAND; do - echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo "\n$(date +'%F | %T | ')'$0': an error occurred; sleeping 30 seconds ..." sleep 30 - echo "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo "\n$(date +'%F | %T | ')'$0': retrying ..." done # Now check if these files are different from what we already have in our -- 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 8ef9d170100fd9b6f5e2779107188a157f1c56a1 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 20:03:56 2017 +0200 when trying to find the right storage device to deploy an update to in ramdisk mode, use read-only mounts at first --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 0ec265a..3f1e0fd 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -91,14 +91,14 @@ echo -n " live-autoupdater (backgrounding update task)" FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') [ -z "$FINDFILE" ] && exit 0 for PARTITION in $LISTOFPARTITIONS ; do - mount $PARTITION $TEMPMOUNT + mount -oro $PARTITION $TEMPMOUNT if ! [ -f "$TEMPMOUNT/$FINDFILE" ] ; then umount $TEMPMOUNT else umount $TEMPMOUNT rmdir $TEMPMOUNT mkdir /lib/live/mount/findiso - if mount $PARTITION /lib/live/mount/findiso ; then + if mount -oro $PARTITION /lib/live/mount/findiso ; then echo "\n$(date +'%F | %T | ')'$0': mounted $PARTITION as '/lib/live/mount/findiso'." RAMDISKMODE="yes" else -- 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 a910baf173e4ccba378d5ada61f51b11660feb25 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 19:21:19 2017 +0200 inserted proper umount/remount_ro -> moved into subroutine, as req'd in two places --- .../lib/live/config/2400-live-autoupdate | 41 +++++++++++++--------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index b736ade..22e2778 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -2,6 +2,28 @@ # this is not /bin/bash, so "echo -en" is not supported, but the default when calling "echo" +umount_or_remount_ro () +{# change mount back to ro and sync + # + if [ -n "$NTFSROOT" ]; then + if umount $MOUNTPOINT; then + echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + else + echo "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." + fi + else + if mount -oremount,ro,sync $MOUNTPOINT; then + echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." + else + echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." + fi + if [ -n "$RAMDISKMODE" ] ; then + umount $MOUNTPOINT + fi + fi + +} + cleanup () { # discard contents of tmpfs, umount if necessary if [ -n "$NTFSROOT" ]; then @@ -377,6 +399,8 @@ echo -n " live-autoupdater (backgrounding update task)" [ -n "$NTFSROOT" ] && umount $MOUNTPOINT echo "\n$(date +'%F | %T | ')'$0': Nothing to do. Content of $DOWNLOADPATH equals" \ "$RUNNINGSYSTEMNAME." + # now, change mount back to ro and sync + umount_or_remount_ro return 0 # current is newest, nothing to do, # we want to keep the old system in OTHERSYSTEMFULLPATH # as a fallback @@ -453,22 +477,7 @@ echo -n " live-autoupdater (backgrounding update task)" # now, change mount back to ro and sync # - if [ -n "$NTFSROOT" ]; then - if umount $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." - else - echo "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." - fi - else - if mount -oremount,ro,sync $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." - else - echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." - fi - if [ -n "$RAMDISKMODE" ] ; then - umount $MOUNTPOINT - fi - fi + umount_or_remount_ro ) & -- 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 58464302489487180005c7530cd2b444b987d87f Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 10:49:21 2017 +0200 mproved logging: bandwidth test should now output progress bar. --- .../includes.chroot/lib/live/config/2400-live-autoupdate | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 8fdae01..7d6d4db 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -259,9 +259,10 @@ echo -n " live-autoupdater (backgrounding update task)" echo "$DOWNLOADURL" | grep -q "^ftp" then # Attempt to determine available bandwidth & to set BWLIMIT accordingly - echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget." - wget -Nr -o /tmp/dl.log -P /tmp/ -nd \ - --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img + echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget.\n" + wget -Nr -o - -P /tmp/ -nd \ + --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img | \ + tee /tmp/dl.log cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" rm "/tmp/x2go-tce-initrd.img" SIZEFACTORSTRING=$( awk -F' |\(|\)' ' $9 == "saved" && \ @@ -296,9 +297,10 @@ echo -n " live-autoupdater (backgrounding update task)" elif echo "$DOWNLOADURL" | grep -q "^rsync"; then # Attempt to determine available bandwidth & to set BWLIMIT accordingly - echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync." - rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ - $TEMPDIR/x2go-tce-initrd.img.new + echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync.\n" + rsync -hh -aPv -W --inplace --log-file=- $DOWNLOADURL/x2go-tce-initrd.img \ + $TEMPDIR/x2go-tce-initrd.img.new | \ + tee /tmp/dl.log mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-initrd.img SIZEFACTORSTRING=$( sed -e's_\(. bytes/sec\)_ \1_' /tmp/dl.log | \ awk '$4 == "sent" && $12 == "bytes/sec" \ -- 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 2ef220aa5adb37ce7573c11cf2df648625644396 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 10:46:04 2017 +0200 in /bin/sh, echo -en is not supported, but echo -n is and should thus be used --- .../lib/live/config/2400-live-autoupdate | 120 ++++++++++----------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index c93cd53..8fdae01 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -1,20 +1,20 @@ #!/bin/sh -# this is not /bin/bash, so "echo -en" is not supported, but the default when calling "echo" +# this is not /bin/bash, so "echo -e" is not supported, but the default when calling "echo" umount_or_remount_ro () { # change mount back to ro and sync if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then if umount $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + echo -n "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." + echo -n "\n$(date +'%F | %T | ')'$0': Unable to unmount '$MOUNTPOINT'." fi else if mount -oremount,ro,sync $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." + echo -n "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' ro and sync." else - echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." + echo -n "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." fi fi @@ -23,24 +23,24 @@ umount_or_remount_ro () cleanup () { # discard contents of tmpfs, umount if necessary if [ -n "$NTFSROOT" ]; then - echo "\n$(date +'%F | %T | ')'$0': Removing '$TEMPDIR/*'." + echo -n "\n$(date +'%F | %T | ')'$0': Removing '$TEMPDIR/*'." rm -rf $TEMPDIR/* else - echo "\n$(date +'%F | %T | ')'$0': Unmounting '$TEMPDIR'." + echo -n "\n$(date +'%F | %T | ')'$0': Unmounting '$TEMPDIR'." umount $TEMPDIR fi if rmdir $TEMPDIR; then - echo "\n$(date +'%F | %T | ')'$0': Removed empty directory '$TEMPDIR'." + echo -n "\n$(date +'%F | %T | ')'$0': Removed empty directory '$TEMPDIR'." else - echo "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." + echo -n "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." fi if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then if grep -q "$MOUNTPOINT" /proc/mounts ; then - echo "\n$(date +'%F | %T | ')'$0': '$MOUNTPOINT' is mounted, attempting umount." + echo -n "\n$(date +'%F | %T | ')'$0': '$MOUNTPOINT' is mounted, attempting umount." if umount $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + echo -n "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else - echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." + echo -n "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." fi fi fi @@ -58,7 +58,7 @@ echo -n " live-autoupdater (backgrounding update task)" ( while ! [ -c /dev/tty8 ] ; do - echo "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." sleep 2 done @@ -79,12 +79,12 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^updateurl=/ { print $2 }') if [ -z "$DOWNLOADURL" ]; then - echo "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." + echo -n "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." return 0 fi if ! [ -d /lib/live/mount/findiso ] ; then - echo "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." + echo -n "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') @@ -98,17 +98,17 @@ echo -n " live-autoupdater (backgrounding update task)" rmdir $TEMPMOUNT mkdir /lib/live/mount/findiso if mount -oro $PARTITION /lib/live/mount/findiso ; then - echo "\n$(date +'%F | %T | ')'$0': mounted $PARTITION as '/lib/live/mount/findiso'." + echo -n "\n$(date +'%F | %T | ')'$0': mounted $PARTITION as '/lib/live/mount/findiso'." RAMDISKMODE="yes" else - echo "\n$(date +'%F | %T | ')'$0': error mounting $PARTITION as '/lib/live/mount/findiso'." + echo -n "\n$(date +'%F | %T | ')'$0': error mounting $PARTITION as '/lib/live/mount/findiso'." fi break fi done fi if ! [ -d /lib/live/mount/findiso ] ; then - echo "\n$(date +'%F | %T | ')'$0': Local update directory not found. Exiting." + echo -n "\n$(date +'%F | %T | ')'$0': Local update directory not found. Exiting." return 0 fi @@ -120,7 +120,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F'=' ' /^bwlimit=/ { print $2 }') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 - echo "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." + echo -n "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." fi @@ -134,7 +134,7 @@ echo -n " live-autoupdater (backgrounding update task)" MAXSLEEPTIME=900 fi SLEEPTIME=0 - echo "\n$(date +'%F | %T | ')'$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." + echo -n "\n$(date +'%F | %T | ')'$0': Calculating random update delay (120-$MAXSLEEPTIME seconds)..." # During startup, script is run with /bin/sh, # even when #!/bin/bash is set, # so we need to improvise. @@ -143,7 +143,7 @@ echo -n " live-autoupdater (backgrounding update task)" if [ $SLEEPTIME -lt 120 ]; then SLEEPTIME=$((SLEEPTIME+120)) fi - echo "\n$(date +'%F | %T | ')'$0': Sleeping for $SLEEPTIME seconds ..." + echo -n "\n$(date +'%F | %T | ')'$0': Sleeping for $SLEEPTIME seconds ..." sleep $SLEEPTIME @@ -162,9 +162,9 @@ echo -n " live-autoupdater (backgrounding update task)" fi if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + echo -n "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." else - echo "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo -n "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." fi # TODO: Further error handling MOUNTPOINT="/lib/live/mount/ntfsroot/" @@ -196,7 +196,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) \ ); then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': No directories suitable for update." + echo -n "\n$(date +'%F | %T | ')'$0': No directories suitable for update." return 0 # directories missing, most likely not a writeable medium fi @@ -215,7 +215,7 @@ echo -n " live-autoupdater (backgrounding update task)" GRUBPATH="$MOUNTPOINT/boot/grub/" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': No suitable bootloader found." + echo -n "\n$(date +'%F | %T | ')'$0': No suitable bootloader found." return 1 fi @@ -231,7 +231,7 @@ echo -n " live-autoupdater (backgrounding update task)" OTHERSYSTEMNAME="X2Go-live1" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': Unable to determine path/name of running system." + echo -n "\n$(date +'%F | %T | ')'$0': Unable to determine path/name of running system." return 1 fi OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") @@ -246,9 +246,9 @@ echo -n " live-autoupdater (backgrounding update task)" # echo -n "\n$(date +'%F | %T | ')'$0': Preparing tempdir ..." while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do - echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo -n "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo -n "\n$(date +'%F | %T | ')'$0': Retrying ..." done echo " done." @@ -259,7 +259,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo "$DOWNLOADURL" | grep -q "^ftp" then # Attempt to determine available bandwidth & to set BWLIMIT accordingly - echo "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget." + echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget." wget -Nr -o /tmp/dl.log -P /tmp/ -nd \ --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" @@ -270,7 +270,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -288,7 +288,7 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -n "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" @@ -296,7 +296,7 @@ echo -n " live-autoupdater (backgrounding update task)" elif echo "$DOWNLOADURL" | grep -q "^rsync"; then # Attempt to determine available bandwidth & to set BWLIMIT accordingly - echo "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync." + echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync." rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ $TEMPDIR/x2go-tce-initrd.img.new mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-initrd.img @@ -306,7 +306,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -323,12 +323,12 @@ echo -n " live-autoupdater (backgrounding update task)" awk ' { print $1*$2*$3/100 }' | \ awk -F'.' '{ print $1 }' \ ) # outputs integer kilobytes, not rounded - echo "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" + echo -n "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." + echo -n "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." return 1 fi rm /tmp/dl.log @@ -336,27 +336,27 @@ echo -n " live-autoupdater (backgrounding update task)" # Proceed to download from update location # - echo "\n$(date +'%F | %T | ')'$0': starting download ..." + echo -n "\n$(date +'%F | %T | ')'$0': starting download ..." while ! $DOWNLOADCOMMAND; do - echo "\n$(date +'%F | %T | ')'$0': an error occurred; sleeping 30 seconds ..." + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred; sleeping 30 seconds ..." sleep 30 - echo "\n$(date +'%F | %T | ')'$0': retrying ..." + echo -n "\n$(date +'%F | %T | ')'$0': retrying ..." done # Now check if these files are different from what we already have in our # download directory on the boot medium # - echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." + echo -n "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$TEMPDIR' ..." if diff -q $DOWNLOADPATH $TEMPDIR \ >/dev/null then cleanup - echo "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$DOWNLOADPATH'." + echo -n "\n$(date +'%F | %T | ')'$0': 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 "\n$(date +'%F | %T | ')'$0': Differences detected. Continuing ..." + echo -n "\n$(date +'%F | %T | ')'$0': Differences detected. Continuing ..." fi @@ -364,9 +364,9 @@ echo -n " live-autoupdater (backgrounding update task)" # remount it rw and async for speed # if mount -oremount,rw,async $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' as rw and async." + echo -n "\n$(date +'%F | %T | ')'$0': Remounted '$MOUNTPOINT' as rw and async." else - echo "\n$(date +'%F | %T | ')'$0': Could not remount '$MOUNTPOINT' as rw and async." + echo -n "\n$(date +'%F | %T | ')'$0': Could not remount '$MOUNTPOINT' as rw and async." fi @@ -377,27 +377,27 @@ echo -n " live-autoupdater (backgrounding update task)" # move everything over to the boot medium # - echo "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" + echo -n "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" # using mv would accumulate clutter in $DOWNLOADPATH if any extra files are present in the source rsync -aPv --inplace --delete --modify-window=1 $TEMPDIR/ $DOWNLOADPATH/ && \ rm -rf $TEMPDIR/* if [ -n "$NTFSROOT" ]; then - echo "\n$(date +'%F | %T | ')'$0': NTFSROOT detected. Attempting to mount '/dev/disk/by-uuid/$NTFSROOT'." + echo -n "\n$(date +'%F | %T | ')'$0': 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 "\n$(date +'%F | %T | ')'$0': Mount successful." + echo -n "\n$(date +'%F | %T | ')'$0': Mount successful." else - echo "\n$(date +'%F | %T | ')'$0': Failed to mount NTFSROOT." + echo -n "\n$(date +'%F | %T | ')'$0': Failed to mount NTFSROOT." fi fi # let's check if we just downloaded a copy of our running system # - echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" + echo -n "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$RUNNINGSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $RUNNINGSYSTEMFULLPATH >/dev/null && \ [ -d "$OTHERSYSTEMFULLPATH" ] ; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': Nothing to do. Content of $DOWNLOADPATH equals" \ + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. Content of $DOWNLOADPATH equals" \ "$RUNNINGSYSTEMNAME." # now, change mount back to ro and sync umount_or_remount_ro @@ -414,20 +414,20 @@ echo -n " live-autoupdater (backgrounding update task)" # let's check if our destination is already up to date or needs updating # - echo "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" + echo -n "\n$(date +'%F | %T | ')'$0': Diff'ing '$DOWNLOADPATH' '$OTHERSYSTEMFULLPATH'" if diff -q $DOWNLOADPATH $OTHERSYSTEMFULLPATH >/dev/null; then [ -n "$NTFSROOT" ] && umount $MOUNTPOINT - echo "\n$(date +'%F | %T | ')'$0': Nothing to do - content of '$DOWNLOADPATH' equals"\ + echo -n "\n$(date +'%F | %T | ')'$0': 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 "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + echo -n "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH do - echo "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + echo -n "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 - echo "\n$(date +'%F | %T | ')'$0': Retrying ..." + echo -n "\n$(date +'%F | %T | ')'$0': Retrying ..." done fi @@ -435,7 +435,7 @@ echo -n " live-autoupdater (backgrounding update task)" # change default boot to the image we just downloaded and installed # if [ -n "$SYSLINUXPATH" ]; then - echo "\n$(date +'%F | %T | ')'$0': Changing syslinux default to $OTHERSYSTEMNAME." + echo -n "\n$(date +'%F | %T | ')'$0': Changing syslinux default to $OTHERSYSTEMNAME." sed -i -e"/^default/cdefault $OTHERSYSTEMNAME" \ $SYSLINUXPATH/syslinux.cfg @@ -451,16 +451,16 @@ echo -n " live-autoupdater (backgrounding update task)" awk -F':' '$2 ~ /'"${OTHERSYSTEMNAME}"'/ { print $1 }') OTHERTITLEPOSITION=$((OTHERTITLEPOSITION-1)) if [ "$CURRENTTITLEPOSITION" = "$CURRENTDEFAULT" ]; then - echo "\n$(date +'%F | %T | ')'$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." + echo -n "\n$(date +'%F | %T | ')'$0': Changing GRUB-legacy default to $OTHERTITLEPOSITION ..." sed -i -e"/^default/cdefault $OTHERTITLEPOSITION" \ $MENULST else - echo "\n$(date +'%F | %T | ')'$0': Not changing GRUB-legacy default." - echo "\n$(date +'%F | %T | ')'$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," - echo "\n$(date +'%F | %T | ')'$0': while default is set to position '$CURRENTDEFAULT'." + echo -n "\n$(date +'%F | %T | ')'$0': Not changing GRUB-legacy default." + echo -n "\n$(date +'%F | %T | ')'$0': Reason: We're at boot position '$CURRENTTITLEPOSITION'," + echo -n "\n$(date +'%F | %T | ')'$0': while default is set to position '$CURRENTDEFAULT'." fi else - echo "\n$(date +'%F | %T | ')'$0': Unsupported bootloader." + echo -n "\n$(date +'%F | %T | ')'$0': Unsupported bootloader." fi # we're on an async mount point, so let's sync to be safe -- 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 49c3dd3c2a3c9bffe3d3ecb1ea775f9386e0a390 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 09:45:57 2017 +0200 in ramdisk mode, storage should be umounted at the end of an (attempted) upgrade --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index b384aec..c93cd53 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -4,7 +4,7 @@ umount_or_remount_ro () { # change mount back to ro and sync - if [ -n "$NTFSROOT" ]; then + if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then if umount $MOUNTPOINT; then echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." else @@ -16,9 +16,6 @@ umount_or_remount_ro () else echo "\n$(date +'%F | %T | ')'$0': Unable to remount '$MOUNTPOINT' ro and sync." fi - if [ -n "$RAMDISKMODE" ] ; then - umount $MOUNTPOINT - fi 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 7b6faa2b997a0c46028b36ddd6995ef97467eff4 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 00:23:52 2017 +0200 only attempt umount when path is a mounted device / improved logging --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index cdcc34f..b384aec 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -38,10 +38,13 @@ cleanup () echo "\n$(date +'%F | %T | ')'$0': Could not remove directory '$TEMPDIR'." fi if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then - if umount $MOUNTPOINT; then - echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." - else - echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." + if grep -q "$MOUNTPOINT" /proc/mounts ; then + echo "\n$(date +'%F | %T | ')'$0': '$MOUNTPOINT' is mounted, attempting umount." + if umount $MOUNTPOINT; then + echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." + else + echo "\n$(date +'%F | %T | ')'$0': Could not unmount '$MOUNTPOINT'." + fi fi 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 a3ab3a21909ab8eff5fa971f0b223a8fe139a67c Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 21:25:43 2017 +0200 /bin/sh seems to insist on blank between { and # --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 9392c8c..cdcc34f 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -3,8 +3,7 @@ # this is not /bin/bash, so "echo -en" is not supported, but the default when calling "echo" umount_or_remount_ro () -{# change mount back to ro and sync - # +{ # change mount back to ro and sync if [ -n "$NTFSROOT" ]; then if umount $MOUNTPOINT; then echo "\n$(date +'%F | %T | ')'$0': Unmounted '$MOUNTPOINT'." -- 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 c83e7e2f31f490f651d2d5afb7e0036a4dd80b03 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 21:20:51 2017 +0200 improved logging --- .../includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf | 6 ++++-- config/includes.chroot/lib/live/config/2700-x2go-getsessions | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index f8d7eb4..15b5c2a 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -28,18 +28,20 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done + + echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting xorg.conf download ..." | tee -a /dev/tty8 if echo "$XORGCONFURL" | grep -q "^tftp://" ; then XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do - echo -en "\n\$(date +'%F | %T | ')'\$0': Waiting for xorg.conf download ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (wget) ..." | tee -a /dev/tty8 sleep 5 done fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 792c6b9..4105948 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -31,18 +31,20 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 sleep 2 done + + echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting session config data download ..." | tee -a /dev/tty8 if echo "$SESSIONSURL" | grep -q "^tftp://" ; then SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')still waiting for session config data (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do - echo -en "\n\$(date +'%F | %T | ')Waiting for session config data ..." | tee -a /dev/tty8 + echo -en "\n\$(date +'%F | %T | ')still waiting for session config data (wget) ..." | tee -a /dev/tty8 sleep 5 done 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 b8c9a6777d8d401835873a1aded13d5cf3f87827 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 20:20:41 2017 +0200 only rm if rsync was successful --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 6b6ac3f..9392c8c 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -380,7 +380,7 @@ echo -n " live-autoupdater (backgrounding update task)" # echo "\n$(date +'%F | %T | ')'$0': Moving $TEMPDIR/* => $DOWNLOADPATH" # using mv would accumulate clutter in $DOWNLOADPATH if any extra files are present in the source - rsync -aPv --inplace --delete --modify-window=1 $TEMPDIR/ $DOWNLOADPATH/ + rsync -aPv --inplace --delete --modify-window=1 $TEMPDIR/ $DOWNLOADPATH/ && \ rm -rf $TEMPDIR/* if [ -n "$NTFSROOT" ]; then echo "\n$(date +'%F | %T | ')'$0': NTFSROOT detected. Attempting to mount '/dev/disk/by-uuid/$NTFSROOT'." -- 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 5c6e17b28235a7de01e30bca559a51f7a4c09dfc Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Mon Jul 24 22:51:55 2017 +0200 improved logging --- config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver | 1 + config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf | 2 ++ config/includes.chroot/lib/live/config/2700-x2go-getsessions | 1 + 3 files changed, 4 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 7365b9b..2e278cc 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -54,6 +54,7 @@ fi sleep 5 done fi + echo -en "\n\$(date +'%F | %T | ')'\$0': SSH public keyfile download complete." | tee -a /dev/tty8 ) & GETPUBKEY diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 15b5c2a..a5e0a4b 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -46,6 +46,8 @@ fi done fi + echo -en "\n\$(date +'%F | %T | ')'\$0': xorg.conf download complete." | tee -a /dev/tty8 + if [ -s $XORGCONFDESTINATION ] ; then mv $XORGCONFDESTINATION /etc/X11/xorg.conf fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 4105948..6a4901c 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -49,6 +49,7 @@ fi done fi + echo -en "\n\$(date +'%F | %T | ')'\$0': session config data download complete." | tee -a /dev/tty8 if [ -s $SESSIONSDESTINATION ] ; then mv $SESSIONSDESTINATION /etc/x2go/x2gothinclient_sessions 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 8f555bed517c4093cf302c5fc5ca22f7bb24a578 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 14:17:36 2017 +0200 wget param change had unintended side effects - log file was empty. rsync does not need the tee helper construct. Various spelling fixes in log output. --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index b5a56ec..bdf770c 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -273,8 +273,8 @@ echo -n " live-autoupdater (backgrounding update task)" then # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget.\n" - wget -Nr -o - -P /tmp/ -nd \ - --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img | \ + wget -Nr -P /tmp/ -nd \ + --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img 2>&1 | \ tee /tmp/dl.log cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" rm "/tmp/x2go-tce-initrd.img" @@ -284,7 +284,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough bandwidth for update task - " echo -n "aborting." cleanup return 0 @@ -311,9 +311,8 @@ echo -n " live-autoupdater (backgrounding update task)" # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync.\n" - rsync -hh -aPv -W --inplace --log-file=- $DOWNLOADURL/x2go-tce-initrd.img \ - $TEMPDIR/x2go-tce-initrd.img.new | \ - tee /tmp/dl.log + rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ + $TEMPDIR/x2go-tce-initrd.img.new mv $TEMPDIR/x2go-tce-initrd.img.new $TEMPDIR/x2go-tce-initrd.img SIZEFACTORSTRING=$( sed -e's_\(. bytes/sec\)_ \1_' /tmp/dl.log | \ awk '$4 == "sent" && $12 == "bytes/sec" \ @@ -321,7 +320,7 @@ echo -n " live-autoupdater (backgrounding update task)" ) case $SIZEFACTORSTRING in "" | \ - [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough Bandwidth for update task - " + [0-9]) echo -n "\n$(date +'%F | %T | ')'$0': Not enough bandwidth for update task - " echo -n "aborting." cleanup return 0 -- 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 6631e55bcb49f78acec41d3596da0997324b167d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 16:29:15 2017 +0200 more typofixes --- config/includes.chroot/lib/live/config/2100-show-sysconf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 0e0d48c..0839c77 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -42,8 +42,8 @@ fi if grep -q findiso /proc/cmdline ; then BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) - echo "- Booted Environment: $BOOTEDENV" >> /etc/issue - echo "- Booted Environment: $BOOTEDENV" >> /etc/issue.net + echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue + echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net fi if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then -- 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 de210f555624f1deb23acea2a1f6130bde50de24 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 17:44:10 2017 +0200 write timestamps to text file, for easier querying by checkscripts --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index bdf770c..cc33e7b 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -7,9 +7,12 @@ show_versions () LISTOFTIMESTAMPFILES=$(find /lib/live/mount/findiso/boot -name "x2go-tce-timestamp") if [ -n "$LISTOFTIMESTAMPFILES" ]; then echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" + echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do + echo "$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done + echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps 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 b28a492685d148e57c76263dc276738ac954eef1 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 13:23:51 2017 +0200 make autoupdater show available versions before and after update --- .../includes.chroot/lib/live/config/2400-live-autoupdate | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 7418e2e..b5a56ec 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -2,6 +2,17 @@ # this is not /bin/bash, so "echo -e" is not supported, but the default when calling "echo" +show_versions () +{ # This prints the TCE versions that are stored on the local medium to the log output + LISTOFTIMESTAMPFILES=$(find /lib/live/mount/findiso/boot -name "x2go-tce-timestamp") + if [ -n "$LISTOFTIMESTAMPFILES" ]; then + echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" + for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do + echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" + done + fi +} + umount_or_remount_ro () { # change mount back to ro and sync if [ -n "$NTFSROOT" ] || [ -n "$RAMDISKMODE" ] ; then @@ -112,6 +123,8 @@ echo -n " live-autoupdater (backgrounding update task)" return 0 fi + show_versions + # Bandwidth limit goes here # #BWLIMITPERCENT=20 # in percent, numeric-only @@ -439,6 +452,7 @@ echo -n " live-autoupdater (backgrounding update task)" fi fi + show_versions # change default boot to the image we just downloaded and installed # -- 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 dd651a2d68b060ef324f902afe77014255bad64a Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 12:09:04 2017 +0200 renamed file to better represent what it does --- .../lib/live/config/{2100-showifconfig => 2100-show-sysconf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-show-sysconf similarity index 100% rename from config/includes.chroot/lib/live/config/2100-showifconfig rename to config/includes.chroot/lib/live/config/2100-show-sysconf -- 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 6b6e54cc7d32a666ee9939b5e01b817d131dbb25 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 15:43:33 2017 +0200 typofix --- config/includes.chroot/lib/live/config/2100-show-sysconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 0b0cea1..0e0d48c 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -41,7 +41,7 @@ fi echo "\$IPMSG" >> /etc/issue.net if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' $1 == "findiso" { print \$2 }'))) + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) echo "- Booted Environment: $BOOTEDENV" >> /etc/issue echo "- Booted Environment: $BOOTEDENV" >> /etc/issue.net 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 04fdedb5345d9d22c8f93ab04a217cc19860ccbc Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 12:08:13 2017 +0200 added version and booted system info output, indentation fixed --- .../lib/live/config/2100-showifconfig | 42 ++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-showifconfig b/config/includes.chroot/lib/live/config/2100-showifconfig index 9ccb02b..0b0cea1 100755 --- a/config/includes.chroot/lib/live/config/2100-showifconfig +++ b/config/includes.chroot/lib/live/config/2100-showifconfig @@ -1,16 +1,16 @@ #!/bin/bash -ShowIFConfig () +ShowSysConf () { # Output startup message # -echo -n " showifconfig" +echo -n " show-sysconf" # Make sure no language-specific stuff interferes with our matching # grep: highlight everything that matches "inet" to the end of its line # and also (-E, |$) show every line that has an end => Everything else -cat >/etc/network/if-up.d/0100-showips <<SHOWIPS +cat >/etc/network/if-up.d/0100-show-sysconf <<SHOWSYSCONF #!/bin/bash export TERM=linux; @@ -29,20 +29,34 @@ fi done IPMSG=\$(LANG=C \ - /sbin/ip a | \ - /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ - GREP_COLOR="1;32" \ - /bin/grep -P --color=always "link/ether .*? |$" ); \ - IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ); - sed -i '/^- /d' /etc/issue; - sed -i '/^- /d' /etc/issue.net; - echo "\$IPMSG" >> /etc/issue; + /sbin/ip a | \ + /bin/grep -P --color=always "inet.*? [\. 0-9a-f:/]*? |$" | \ + GREP_COLOR="1;32" \ + /bin/grep -P --color=always "link/ether .*? |$" ) + + IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ) + sed -i '/^- /d' /etc/issue + sed -i '/^- /d' /etc/issue.net + echo "\$IPMSG" >> /etc/issue echo "\$IPMSG" >> /etc/issue.net + + if grep -q findiso /proc/cmdline ; then + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' $1 == "findiso" { print \$2 }'))) + echo "- Booted Environment: $BOOTEDENV" >> /etc/issue + echo "- Booted Environment: $BOOTEDENV" >> /etc/issue.net + fi + + if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then + TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) + HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP") + echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue + echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net + fi ) & -SHOWIPS +SHOWSYSCONF -chmod 755 /etc/network/if-up.d/0100-showips +chmod 755 /etc/network/if-up.d/0100-show-sysconf } -ShowIFConfig +ShowSysConf -- 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 eef01db9a262c138501315bd67e29f3041b01fe4 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 12:19:43 2017 +0200 added steps to further reduce clutter buildup, changed/improved logging --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 7d6d4db..7418e2e 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -424,13 +424,19 @@ echo -n " live-autoupdater (backgrounding update task)" return 0 # OTHERSYSTEMFULLPATH is already up to date else # keep rsyncing until the update is complete - echo -n "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH" + echo -n "\n$(date +'%F | %T | ')'$0': Copying $DOWNLOADPATH/ => $OTHERSYSTEMFULLPATH ..." while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $OTHERSYSTEMFULLPATH do echo -n "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." sleep 30 echo -n "\n$(date +'%F | %T | ')'$0': Retrying ..." done + echo -n "\n$(date +'%F | %T | ')'$0': done." + if rm -rf $DOWNLOADPATH/* ; then + echo -n "\n$(date +'%F | %T | ')'$0': INFO: purged download directory to avoid clutter buildup." + else + echo -n "\n$(date +'%F | %T | ')'$0': ERROR: unable to purge download directory." + fi 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 079a9626128acd54e91e5b0933660f1960bb7cd0 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 18:33:15 2017 +0200 added code to check timestamp before download --- .../lib/live/config/2400-live-autoupdate | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index ae16e48..30187a0 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -312,6 +312,9 @@ echo -n " live-autoupdater (backgrounding update task)" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" + DOWNLOADCOMMANDFORTIMESTAMP="wget -Nr -l 1 -nd -P "$TEMPDIR" \ + --progress=bar:force \ + --limit-rate=${BWLIMIT}k $DOWNLOADURL/x2go-tce-timestamp" elif echo "$DOWNLOADURL" | grep -q "^rsync"; then @@ -346,6 +349,8 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" + DOWNLOADCOMMANDFORTIMESTAMP="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/x2go-tce-timestamp \ + $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT echo -n "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." @@ -354,8 +359,23 @@ echo -n " live-autoupdater (backgrounding update task)" rm /tmp/dl.log + # Proceed to download from update location # + echo -n "\n$(date +'%F | %T | ')'$0': starting timestamp download ..." + if ! $DOWNLOADCOMMANDFORTIMESTAMP; then + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." + else + RUNNINGVERSION=$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) + if [ $RUNNINGVERSION) -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then + cleanup + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGSYSTEMVERSION - $(date --date=@$RUNNINGSYSTEMVERSION))." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium + fi + fi + echo -n "\n$(date +'%F | %T | ')'$0': starting download ..." while ! $DOWNLOADCOMMAND; do echo -n "\n$(date +'%F | %T | ')'$0': an error occurred; sleeping 30 seconds ..." -- 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 e41883256e3504bf8141c1fa7a83630ab96e4a85 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 19:53:53 2017 +0200 typofix --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 30187a0..d526d98 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -367,7 +367,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." else RUNNINGVERSION=$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) - if [ $RUNNINGVERSION) -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then + if [ $RUNNINGVERSION -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then cleanup echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGSYSTEMVERSION - $(date --date=@$RUNNINGSYSTEMVERSION))." -- 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 69d76bc4526442e839869a7143593064c7cb8844 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 02:44:20 2017 +0200 variable name was wrong --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 7bea7e0..ef504af 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -369,7 +369,7 @@ echo -n " live-autoupdater (backgrounding update task)" if [ $RUNNINGVERSION -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then cleanup echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." - echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGSYSTEMVERSION - $(date --date=@$RUNNINGSYSTEMVERSION))." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." return 0 # current is newest, nothing to do, we want to avoid # unneccessary writes to the medium 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 ceec20c14f5087caa4191af1b162875adbad73cd Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 00:21:05 2017 +0200 mountpoint detection must come earlier in the script, or MOUNTPOINT variable will be empty when it's already needed by other script parts --- .../lib/live/config/2400-live-autoupdate | 85 +++++++++++----------- 1 file changed, 42 insertions(+), 43 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index d526d98..7bea7e0 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -87,6 +87,48 @@ echo -n " live-autoupdater (backgrounding update task)" unset LC_ALL unset LC_MESSAGES + # 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 + # This is in case we've been passed an incomplete UUID and/or one with dashes + # For example, "vol c:" on Windows will return the last 8 digits of the UUID + # only, and separate them with a dash. + if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then + NTFSROOT=$(echo $NTFSROOT | tr -d '-') + if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then + NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) + fi + fi + + if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then + echo -n "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." + else + echo -n "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." + fi + # TODO: Further error handling + 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) + + if [ -d /lib/live/mount/findiso/ ] ; then + # if we have access to the entire filesystem, use the + # directory size as base size for the current image - + # and if the download directory is even bigger, use that size + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))" | awk '{ print $1}') + IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" | awk '{ print $1}' || echo "0") + [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD + else + IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') + fi + # multiply current size by 1.5 as safety margin + mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR + + fi # determine our booted environment as well as the other available ones RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ @@ -149,7 +191,6 @@ echo -n " live-autoupdater (backgrounding update task)" fi - # sleeping a random amount of time to ease load on the update server # MAXSLEEPTIME=$(cat /proc/cmdline | \ @@ -172,48 +213,6 @@ echo -n " live-autoupdater (backgrounding update task)" 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 - # This is in case we've been passed an incomplete UUID and/or one with dashes - # For example, "vol c:" on Windows will return the last 8 digits of the UUID - # only, and separate them with a dash. - if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(echo $NTFSROOT | tr -d '-') - if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) - fi - fi - - if mount -t ntfs-3g -rw /dev/disk/by-uuid/$NTFSROOT /lib/live/mount/ntfsroot ; then - echo -n "\n$(date +'%F | %T | ')'$0': Mounted '/dev/disk/by-uuid/$NTFSROOT'." - else - echo -n "\n$(date +'%F | %T | ')'$0': Unable to mount '/dev/disk/by-uuid/$NTFSROOT'." - fi - # TODO: Further error handling - 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) - - if [ -d /lib/live/mount/findiso/ ] ; then - # if we have access to the entire filesystem, use the - # directory size as base size for the current image - - # and if the download directory is even bigger, use that size - IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))" | awk '{ print $1}') - IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" | awk '{ print $1}' || echo "0") - [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD - else - IMGSIZE=$(df /lib/live/mount/medium | awk ' /medium/ { print $2}') - fi - # multiply current size by 1.5 as safety margin - mount -t tmpfs -osize=$((IMGSIZE*15/10))k tmpfs $TEMPDIR - - fi if ! ( [ -d "$MOUNTPOINT/boot/X2Go-live-download" ] && \ ( \ [ -d "$MOUNTPOINT/boot/X2Go-live1" ] || \ -- 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 4e1c7fc76e64d74cd406ce9996d47e98c37cd958 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 03:57:39 2017 +0200 further speed improvements, also, enable banner in sshd config if it was disabled --- config/includes.chroot/lib/live/config/2100-show-sysconf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index d88a791..4a2c5c5 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -26,6 +26,15 @@ fi TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP") fi + + # clear old entries + sed -i '/^- /d' /etc/issue + sed -i '/^- /d' /etc/issue.net + sed -i '/^- /d' /var/run/banner + + # enable banner in sshd config if it was disabled + sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config + while ! [ -c /dev/tty8 ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." sleep 2 @@ -42,15 +51,12 @@ fi /bin/grep -P --color=always "link/ether .*? |$" ) IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ) - sed -i '/^- /d' /etc/issue echo "\$IPMSG" >> /etc/issue [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue - sed -i '/^- /d' /etc/issue.net echo "\$IPMSG" >> /etc/issue.net [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net - sed -i '/^- /d' /var/run/banner echo "\$IPMSG" >> /var/run/banner [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /var/run/banner [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /var/run/banner -- 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 b3a361843836aac6c67014fe267a1c860cef87e9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 03:52:36 2017 +0200 speed optimization, also addedoutputto /var/run/banner where ssh should pick it up --- .../lib/live/config/2100-show-sysconf | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 0839c77..d88a791 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -19,6 +19,13 @@ if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then fi ( + if grep -q findiso /proc/cmdline ; then + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) + fi + if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then + TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) + HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP") + fi while ! [ -c /dev/tty8 ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." sleep 2 @@ -36,22 +43,17 @@ fi IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ) sed -i '/^- /d' /etc/issue - sed -i '/^- /d' /etc/issue.net echo "\$IPMSG" >> /etc/issue + [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue + [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue + sed -i '/^- /d' /etc/issue.net echo "\$IPMSG" >> /etc/issue.net - - if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) - echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue - echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net - fi - - if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then - TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) - HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP") - echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue - echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net - fi + [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net + [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net + sed -i '/^- /d' /var/run/banner + echo "\$IPMSG" >> /var/run/banner + [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /var/run/banner + [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /var/run/banner ) & SHOWSYSCONF -- 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 a251b88ae36db0dd24a2dbc06650cd76b3e09eaa Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Jul 25 17:52:17 2017 +0200 logfile will now also contain which environment is the running one --- .../lib/live/config/2400-live-autoupdate | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index cc33e7b..ae16e48 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -9,9 +9,10 @@ show_versions () echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do - echo "$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps + echo ";;$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done + sed -i "s/;$RUNNINGSYSTEMNAME/X;$RUNNINGSYSTEMNAME/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps fi } @@ -87,6 +88,14 @@ echo -n " live-autoupdater (backgrounding update task)" unset LC_MESSAGES + # determine our booted environment as well as the other available ones + RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^findiso=/ { print $2 }')")) + + ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH) + RUNNINGSYSTEMNAME=$(basename $RUNNINGSYSTEMFULLPATH) + # download url pointing to directory with all required files goes here DOWNLOADURL=$(cat /proc/cmdline | \ tr ' ' '\n' | \ @@ -235,12 +244,6 @@ echo -n " live-autoupdater (backgrounding update task)" 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" = "X2Go-live1" ]; then OTHERSYSTEMNAME="X2Go-live2" elif [ "$RUNNINGSYSTEMNAME" = "X2Go-live2" ]; then -- 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 4a0fe2713ed034e8867e04b74757c700d5619d08 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 17:17:59 2017 +0200 timestamp is now checked before BWLIMIT is determined -> faster, less traffic --- .../lib/live/config/2400-live-autoupdate | 66 ++++++++++++++++------ 1 file changed, 48 insertions(+), 18 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 2e749ee..0770aca 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -2,6 +2,20 @@ # this is not /bin/bash, so "echo -e" is not supported, but the default when calling "echo" +check_timestamp () +{ #this attempts to download a timestamp file + echo -n "\n$(date +'%F | %T | ')'$0': starting timestamp download ..." + if ! $DOWNLOADCOMMANDFORTIMESTAMP; then + return 1 + else + RUNNINGVERSION=$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) + if [ $RUNNINGVERSION -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then + return 5 + fi + fi + return 0 +} + show_versions () { # This prints the TCE versions that are stored on the local medium to the log output LISTOFTIMESTAMPFILES=$(find /lib/live/mount/findiso/boot -name "x2go-tce-timestamp") @@ -276,6 +290,23 @@ echo -n " live-autoupdater (backgrounding update task)" if echo "$DOWNLOADURL" | grep -q "^http" || \ echo "$DOWNLOADURL" | grep -q "^ftp" then + DOWNLOADCOMMANDFORTIMESTAMP="wget -Nr -l 1 -nd -P "$TEMPDIR" \ + --progress=bar:force \ + $DOWNLOADURL/x2go-tce-timestamp" + + check_timestamp + if [ $? -eq 1 ]; then + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." + elif [ $? -eq 5 ]; then + cleanup + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium + else + : # NOP + fi + # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget.\n" wget -Nr -P /tmp/ -nd \ @@ -311,12 +342,26 @@ echo -n " live-autoupdater (backgrounding update task)" DOWNLOADCOMMAND="wget -Nr -l 1 -nd -P "$TEMPDIR" \ --progress=bar:force \ --limit-rate=${BWLIMIT}k $DOWNLOADURL" - DOWNLOADCOMMANDFORTIMESTAMP="wget -Nr -l 1 -nd -P "$TEMPDIR" \ - --progress=bar:force \ - --limit-rate=${BWLIMIT}k $DOWNLOADURL/x2go-tce-timestamp" elif echo "$DOWNLOADURL" | grep -q "^rsync"; then + DOWNLOADCOMMANDFORTIMESTAMP="rsync -aPv --inplace $DOWNLOADURL/x2go-tce-timestamp \ + $TEMPDIR" + + check_timestamp + if [ $? -eq 1 ]; then + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." + elif [ $? -eq 5 ]; then + cleanup + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium + else + : # NOP + fi + + # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for rsync.\n" rsync -hh -aPv -W --inplace --log-file=/tmp/dl.log $DOWNLOADURL/x2go-tce-initrd.img \ @@ -348,8 +393,6 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': Determined bandwidth limit: '$BWLIMIT KB/s'" DOWNLOADCOMMAND="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/ \ $TEMPDIR" - DOWNLOADCOMMANDFORTIMESTAMP="rsync -aPv --inplace --bwlimit=$BWLIMIT $DOWNLOADURL/x2go-tce-timestamp \ - $TEMPDIR" else [ -n "$NTFSROOT" ] && umount $MOUNTPOINT echo -n "\n$(date +'%F | %T | ')'$0': Unsupported download mechanism - aborting." @@ -361,19 +404,6 @@ echo -n " live-autoupdater (backgrounding update task)" # Proceed to download from update location # - echo -n "\n$(date +'%F | %T | ')'$0': starting timestamp download ..." - if ! $DOWNLOADCOMMANDFORTIMESTAMP; then - echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." - else - RUNNINGVERSION=$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) - if [ $RUNNINGVERSION -ge $(cat $TEMPDIR/x2go-tce-timestamp) ] ; then - cleanup - echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." - echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." - return 0 # current is newest, nothing to do, we want to avoid - # unneccessary writes to the medium - fi - fi echo -n "\n$(date +'%F | %T | ')'$0': starting download ..." while ! $DOWNLOADCOMMAND; do -- 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 73df8727a7770a268a75b329266408c7d48cba4d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 19:03:39 2017 +0200 tempdir preparation only needs to take place if we need to perform an update or if checking the timestamp failed (the latter part is still missing -> next commit). Also, checking the return code didn't work as expected. Finally, some style fixes. --- .../lib/live/config/2400-live-autoupdate | 51 ++++++++++++---------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 0770aca..f539b60 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -2,8 +2,25 @@ # this is not /bin/bash, so "echo -e" is not supported, but the default when calling "echo" +prepare_tempdir () +{ # prepare temporary directory by filling it with the contents of our download folder + # Now we'll copy the content of the X2Go-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) + # + echo -n "\n$(date +'%F | %T | ')'$0': Preparing tempdir ..." + while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do + echo -n "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." + sleep 30 + echo -n "\n$(date +'%F | %T | ')'$0': Retrying ..." + done + echo " done." +} + check_timestamp () -{ #this attempts to download a timestamp file +{ # this attempts to download a timestamp file echo -n "\n$(date +'%F | %T | ')'$0': starting timestamp download ..." if ! $DOWNLOADCOMMANDFORTIMESTAMP; then return 1 @@ -17,7 +34,7 @@ check_timestamp () } show_versions () -{ # This prints the TCE versions that are stored on the local medium to the log output +{ # this prints the TCE versions that are stored on the local medium to the log output LISTOFTIMESTAMPFILES=$(find /lib/live/mount/findiso/boot -name "x2go-tce-timestamp") if [ -n "$LISTOFTIMESTAMPFILES" ]; then echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" @@ -269,22 +286,6 @@ echo -n " live-autoupdater (backgrounding update task)" OTHERSYSTEMFULLPATH=$(readlink -m "$ALLSYSTEMSROOT/$OTHERSYSTEMNAME") DOWNLOADPATH=$(readlink -m "$ALLSYSTEMSROOT/X2Go-live-download/") - - # Now we'll copy the content of the X2Go-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) - # - echo -n "\n$(date +'%F | %T | ')'$0': Preparing tempdir ..." - while ! rsync -aPv --inplace --modify-window=1 $DOWNLOADPATH/ $TEMPDIR; do - echo -n "\n$(date +'%F | %T | ')'$0': Sleeping 30 seconds ..." - sleep 30 - echo -n "\n$(date +'%F | %T | ')'$0': Retrying ..." - done - echo " done." - - # Now let's figure out if we're supposed to use wget or rsync for downloading # if echo "$DOWNLOADURL" | grep -q "^http" || \ @@ -295,16 +296,17 @@ echo -n " live-autoupdater (backgrounding update task)" $DOWNLOADURL/x2go-tce-timestamp" check_timestamp - if [ $? -eq 1 ]; then + CTRC=$? + if [ $CTRC -eq 1 ]; then echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." - elif [ $? -eq 5 ]; then + elif [ $CTRC -eq 5 ]; then cleanup echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." return 0 # current is newest, nothing to do, we want to avoid # unneccessary writes to the medium else - : # NOP + prepare_tempdir fi # Attempt to determine available bandwidth & to set BWLIMIT accordingly @@ -349,16 +351,17 @@ echo -n " live-autoupdater (backgrounding update task)" $TEMPDIR" check_timestamp - if [ $? -eq 1 ]; then + CTRC=$? + if [ $CTRC -eq 1 ]; then echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." - elif [ $? -eq 5 ]; then + elif [ $CTRC -eq 5 ]; then cleanup echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." return 0 # current is newest, nothing to do, we want to avoid # unneccessary writes to the medium else - : # NOP + prepare_tempdir 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 570aabfb5c672a5050f74b9bebd67678fc7423d6 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 04:00:21 2017 +0200 looks like debian-live doesn't use /var/run/banner --- config/includes.chroot/lib/live/config/2100-show-sysconf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 4a2c5c5..7217fc6 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -30,7 +30,6 @@ fi # clear old entries sed -i '/^- /d' /etc/issue sed -i '/^- /d' /etc/issue.net - sed -i '/^- /d' /var/run/banner # enable banner in sshd config if it was disabled sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config @@ -57,9 +56,6 @@ fi echo "\$IPMSG" >> /etc/issue.net [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net - echo "\$IPMSG" >> /var/run/banner - [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /var/run/banner - [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /var/run/banner ) & SHOWSYSCONF -- 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 8bd3644d4a12dae406a683f14cccb740c40ecd13 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 04:05:12 2017 +0200 we need to strip the ANSI as it doesn't work in issue.net via SSH --- config/includes.chroot/lib/live/config/2100-show-sysconf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 7217fc6..3962c9b 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -53,7 +53,8 @@ fi echo "\$IPMSG" >> /etc/issue [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue - echo "\$IPMSG" >> /etc/issue.net + # we need to strip the ANSI as it doesn't work in issue.net via SSH + echo "\$IPMSG" | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" >> /etc/issue.net [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net ) & -- 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 4b36d75bbd71484f1159290d3315627f3cc7bae9 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 10:40:47 2017 +0200 test: use motd instead of issue.net --- config/includes.chroot/lib/live/config/2100-show-sysconf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 3962c9b..70dcae3 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -29,10 +29,11 @@ fi # clear old entries sed -i '/^- /d' /etc/issue - sed -i '/^- /d' /etc/issue.net + #sed -i '/^- /d' /etc/issue.net + #sed -i '/^- /d' /etc/motd - # enable banner in sshd config if it was disabled - sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config + ## enable banner in sshd config if it was disabled + #sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config while ! [ -c /dev/tty8 ] ; do echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." @@ -57,6 +58,9 @@ fi echo "\$IPMSG" | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" >> /etc/issue.net [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net + echo "\$IPMSG" >> /etc/motd + [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/motd + [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/motd ) & SHOWSYSCONF -- 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 f234cab41bae91f67d6957322375abda149a5999 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 16:53:08 2017 +0200 motd and issue are now written to simultaneously; once finished, all unused VTs are reloaded to make sure they display the new /etc/issue --- config/includes.chroot/lib/live/config/2100-show-sysconf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 1725540..f3cf38b 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -52,12 +52,12 @@ fi /bin/grep -P --color=always "link/ether .*? |$" ) IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ) - echo "\$IPMSG" >> /etc/issue + echo "\$IPMSG" | tee -a /etc/motd >> /etc/issue [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue - echo "\$IPMSG" >> /etc/motd - [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/motd - [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/motd + + # make sure all unused VTs show the new /etc/issue + ps -C getty --no-header | awk '{ print \$1 }' | xargs -n 1 kill -1 ) & SHOWSYSCONF -- 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 814f5f2955ba9d4d8802d62090c171373f7641a6 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 13:39:36 2017 +0200 switched to motd instead of issue.net, removed motd display from pam login so it doesn't appear twice on local login --- config/includes.chroot/lib/live/config/2100-show-sysconf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 70dcae3..1725540 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -29,8 +29,9 @@ fi # clear old entries sed -i '/^- /d' /etc/issue - #sed -i '/^- /d' /etc/issue.net - #sed -i '/^- /d' /etc/motd + # delete motd call from pam login, so we don't get the same greeting twice when logging in locally + sed -i '/^session optional pam_motd.so/d' /etc/pam.d/login + ## enable banner in sshd config if it was disabled #sed -i 's/^#Banner/Banner/' /etc/ssh/sshd_config @@ -54,10 +55,6 @@ fi echo "\$IPMSG" >> /etc/issue [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue - # we need to strip the ANSI as it doesn't work in issue.net via SSH - echo "\$IPMSG" | sed -r "s/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g" >> /etc/issue.net - [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue.net - [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue.net echo "\$IPMSG" >> /etc/motd [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/motd [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/motd -- 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 eca1cbdc2d1a05b5372ae30b7e0617a4f2dc19b0 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 17:03:54 2017 +0200 changed logfile format --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index ef504af..0b27b31 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -9,10 +9,10 @@ show_versions () echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do - echo ";;$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps + echo "$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done - sed -i "s/;$RUNNINGSYSTEMNAME/X;$RUNNINGSYSTEMNAME/i" /var/run/x2go-tce-timestamps + sed -i "s/$RUNNINGSYSTEMNAME;/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps 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 8544d1e5096282648e8d6e96d86f7000745364d1 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 17:04:29 2017 +0200 make sure to match to end of line only --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 0b27b31..2e749ee 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -12,7 +12,7 @@ show_versions () echo "$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done - sed -i "s/$RUNNINGSYSTEMNAME;/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps + sed -i "s/$RUNNINGSYSTEMNAME;$/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps 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 7c1f365e476c4929ed0d2623f2e90ccb75879025 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:27:23 2017 +0200 fixed missing escapes --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 01e20d1..584cf11 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -112,7 +112,7 @@ if grep -q ' branding=' /proc/cmdline; then echo "'$0' is waiting for a valid '/etc/x2go/branding.svg' file." sleep 2 done - [ -n "$OLDCON" ] && chvt $OLDCON + [ -n "\$OLDCON" ] && chvt \$OLDCON \$BRANDING='--branding=/etc/x2go/branding.svg' fi BACKGROUND='' @@ -123,7 +123,7 @@ if grep -q ' bg=' /proc/cmdline; then echo "'$0' is waiting for a valid '/etc/x2go/bg.svg' file." sleep 2 done - [ -n "$OLDCON" ] && chvt $OLDCON + [ -n "\$OLDCON" ] && chvt \$OLDCON \$BACKGROUND='--background=/etc/x2go/bg.svg' fi @@ -138,7 +138,7 @@ else echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." sleep 2 done - [ -n "$OLDCON" ] && chvt $OLDCON + [ -n "\$OLDCON" ] && chvt \$OLDCON fi if [ -n "\$LDAP" ] ; then if [ -n "\$LDAP1" ] ; then -- 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 41904a044f248eac2a6d53ea761df9762b9959b2 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 16:09:51 2017 +0200 added code to support background and branding parameters --- .../lib/live/config/2710-x2go-getbranding | 61 ++++++++++++++++++++++ .../lib/live/config/2720-x2go-getbg | 61 ++++++++++++++++++++++ .../lib/live/config/2900-x2go-thinclientconfig | 29 +++++++++- 3 files changed, 149 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding new file mode 100755 index 0000000..992371e --- /dev/null +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -0,0 +1,61 @@ +#!/bin/sh + +X2GoGetBranding () +{ + # Output startup message + # + echo -n " x2go-getbranding" + + + BRANDINGURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^branding=/ { print $2 }') + BRANDINGDESTINATION=/etc/x2go/branding.svg + + if [ -n "$BRANDINGURL"] ; then + cat >/etc/network/if-up.d/0410-getbranding <<GETBRAND +#!/bin/bash +export TERM=linux; + +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then + exit 0 +fi + +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + + echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting branding SVG download ..." | tee -a /dev/tty8 + if echo "$BRANDINGURL" | grep -q "^tftp://" ; then + BRANDINGSERVER=$(echo "$BRANDINGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + BRANDINGPATH=$(echo "$BRANDINGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$BRANDINGSERVER" ] && [ -n "\$BRANDINGPATH" ] ; then + while ! atftp \$BRANDINGSERVER -g -r \$BRANDINGPATH -l ${BRANDINGDESTINATION}.tmp ; do + echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (tftp) ..." | tee -a /dev/tty8 + sleep 5 + done + fi + else + while ! wget -q -O ${BRANDINGDESTINATION}.tmp $BRANDINGURL ; do + echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (wget) ..." | tee -a /dev/tty8 + sleep 5 + done + fi + + echo -en "\n\$(date +'%F | %T | ')'\$0': branding SVG download complete." | tee -a /dev/tty8 + if ! [ -s ${BRANDINGDESTINATION}.tmp ] ; then + mv ${BRANDINGDESTINATION}.tmp $BRANDINGDESTINATION + fi +) & +GETBRAND + chmod 755 /etc/network/if-up.d/0410-getbranding + fi +} + +X2GoGetBranding diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg new file mode 100755 index 0000000..f15cad2 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -0,0 +1,61 @@ +#!/bin/sh + +X2GoGetBG () +{ + # Output startup message + # + echo -n " x2go-getbg" + + + BGURL=$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^bg=/ { print $2 }') + BGDESTINATION=/etc/x2go/bg.svg + + if [ -n "$BGURL"] ; then + cat >/etc/network/if-up.d/0420-getbg <<GETBG +#!/bin/bash +export TERM=linux; + +if [ "\$METHOD" = "loopback" ] || [ "\$METHOD" = "none" ]; then + exit 0 +fi + +( + while ! [ -c /dev/tty8 ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done + while [ -z "\$(hostname -I)" ] ; do + echo -en "\n\$(date +'%F | %T | ')'\$0' is waiting for a client IP." | tee -a /dev/tty8 + sleep 2 + done + + echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting background SVG download ..." | tee -a /dev/tty8 + if echo "$BGURL" | grep -q "^tftp://" ; then + BGSERVER=$(echo "$BGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) + BGPATH=$(echo "$BGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + if [ -n "\$BGSERVER" ] && [ -n "\$BGPATH" ] ; then + while ! atftp \$BGSERVER -g -r \$BGPATH -l ${BGDESTINATION}.tmp ; do + echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (tftp) ..." | tee -a /dev/tty8 + sleep 5 + done + fi + else + while ! wget -q -O ${BGDESTINATION}.tmp $BGURL ; do + echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (wget) ..." | tee -a /dev/tty8 + sleep 5 + done + fi + + echo -en "\n\$(date +'%F | %T | ')'\$0': background SVG download complete." | tee -a /dev/tty8 + if ! [ -s ${BGDESTINATION}.tmp ] ; then + mv ${BGDESTINATION}.tmp $BGDESTINATION + fi +) & +GETBG + chmod 755 /etc/network/if-up.d/0420-getbg + fi +} + +X2GoGetBranding diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 87fbae9..01e20d1 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -102,13 +102,38 @@ LDAP2=\$(cat /proc/cmdline | \ sed 's/^ldap2=/ldap2#/' | \ awk -F'#' ' /^ldap2#/ { print \$2 }') + +# Check for background and branding SVGs +BRANDING='' +if grep -q ' branding=' /proc/cmdline; then + while ! [ -s /etc/x2go/branding.svg ]; do + OLDCON=\$(fgconsole) + chvt 1 + echo "'$0' is waiting for a valid '/etc/x2go/branding.svg' file." + sleep 2 + done + [ -n "$OLDCON" ] && chvt $OLDCON + \$BRANDING='--branding=/etc/x2go/branding.svg' +fi +BACKGROUND='' +if grep -q ' bg=' /proc/cmdline; then + while ! [ -s /etc/x2go/bg.svg ]; do + OLDCON=\$(fgconsole) + chvt 1 + echo "'$0' is waiting for a valid '/etc/x2go/bg.svg' file." + sleep 2 + done + [ -n "$OLDCON" ] && chvt $OLDCON + \$BACKGROUND='--background=/etc/x2go/bg.svg' +fi + # Spawn X2GoClient if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" else SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do - OLDCON=$(fgconsole) + OLDCON=\$(fgconsole) chvt 1 echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." sleep 2 @@ -146,7 +171,7 @@ if [ -n "\$BLANKINGTIME" ]; then fi fi -x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM +x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING XSESSION chown user:user /home/user/.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 7564e5899c043ed85a499c837cae142d0eb56ffa Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Jul 27 13:55:21 2017 +0200 reversed order of timestamping output; fixed error in related logfile content creation --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index fbb7b60..5a8f8ca 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -40,8 +40,8 @@ show_versions () echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do - echo "$(basename $(cat $TIMESTAMPFILE));$(dirname $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps - echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" + echo "$(cat $TIMESTAMPFILE);$(basename $(dirname $TIMESTAMPFILE));" >>/var/run/x2go-tce-timestamps + echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(cat $TIMESTAMPFILE) - $(dirname $TIMESTAMPFILE)) - $(date --date=@$(cat $TIMESTAMPFILE))" done sed -i "s/$RUNNINGSYSTEMNAME;$/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps -- 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 e2312edf14f9114c3eb148101f5fe466bd6f1d4e Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Jul 27 12:50:53 2017 +0200 booted env and build version should go to motd, too --- config/includes.chroot/lib/live/config/2100-show-sysconf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index f3cf38b..8354c71 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -53,8 +53,8 @@ fi IPMSG=\$( sed 's/^/- /' <<< "\$IPMSG" ) echo "\$IPMSG" | tee -a /etc/motd >> /etc/issue - [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" >> /etc/issue - [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" >> /etc/issue + [ -n "\$BOOTEDENV" ] && echo "- Booted Environment: \$BOOTEDENV" | tee -a /etc/motd >> /etc/issue + [ -n "\$TIMESTAMP" ] && echo "- Build Version: \$TIMESTAMP (\$HUMANTIMESTAMP)" | tee -a /etc/motd >> /etc/issue # make sure all unused VTs show the new /etc/issue ps -C getty --no-header | awk '{ print \$1 }' | xargs -n 1 kill -1 -- 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 3c9a566921cbee560fa4935285b2ef5ef514d39b Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Thu Jul 27 01:47:13 2017 +0200 nvertedsequence of timestamp and envname, fixes problem that marker for active env isn't set, also, easier on the eyes --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 332b872..fbb7b60 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -40,7 +40,7 @@ show_versions () echo -n "\n$(date +'%F | %T | ')'$0': List of locally stored TCE versions:" echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do - echo "$(basename $(dirname $TIMESTAMPFILE));$(cat $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps + echo "$(basename $(cat $TIMESTAMPFILE));$(dirname $TIMESTAMPFILE);" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done sed -i "s/$RUNNINGSYSTEMNAME;$/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps -- 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 22adcfb60f207571670da139e449d5bc778cd497 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 20:17:27 2017 +0200 fixed a copy-paste-induced error --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 1 - 1 file changed, 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index b707e30..332b872 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -365,7 +365,6 @@ echo -n " live-autoupdater (backgrounding update task)" : # NOP fi prepare_tempdir - fi # Attempt to determine available bandwidth & to set BWLIMIT accordingly -- 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 743a697e5165bbaa50bd7f4fd38415585fe0172d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Jul 26 19:08:21 2017 +0200 tempdir preparation only needs to take place if we need to perform an update or if checking the timestamp failed. Also, indentation was wrong. --- .../lib/live/config/2400-live-autoupdate | 31 ++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index f539b60..b707e30 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -298,16 +298,17 @@ echo -n " live-autoupdater (backgrounding update task)" check_timestamp CTRC=$? if [ $CTRC -eq 1 ]; then - echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." elif [ $CTRC -eq 5 ]; then - cleanup - echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." - echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." - return 0 # current is newest, nothing to do, we want to avoid - # unneccessary writes to the medium + cleanup + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium else - prepare_tempdir + : # NOP fi + prepare_tempdir # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget.\n" @@ -353,15 +354,17 @@ echo -n " live-autoupdater (backgrounding update task)" check_timestamp CTRC=$? if [ $CTRC -eq 1 ]; then - echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." + echo -n "\n$(date +'%F | %T | ')'$0': an error occurred during timestamp download; trying full download instead ..." elif [ $CTRC -eq 5 ]; then - cleanup - echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." - echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." - return 0 # current is newest, nothing to do, we want to avoid - # unneccessary writes to the medium + cleanup + echo -n "\n$(date +'%F | %T | ')'$0': Nothing to do. - Files on server not newer than '$RUNNINGSYSTEMNAME'." + echo -n "\n$(date +'%F | %T | ')'$0': ('$RUNNINGSYSTEMNAME' is Version $RUNNINGVERSION - $(date --date=@$RUNNINGVERSION))." + return 0 # current is newest, nothing to do, we want to avoid + # unneccessary writes to the medium else - prepare_tempdir + : # NOP + fi + prepare_tempdir 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 62d23fee8c9266e5e0b2679f07f6e10e869f19e8 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:28:42 2017 +0200 fixed more missing escapes --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 584cf11..c951e06 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -109,7 +109,7 @@ if grep -q ' branding=' /proc/cmdline; then while ! [ -s /etc/x2go/branding.svg ]; do OLDCON=\$(fgconsole) chvt 1 - echo "'$0' is waiting for a valid '/etc/x2go/branding.svg' file." + echo "'\$0' is waiting for a valid '/etc/x2go/branding.svg' file." sleep 2 done [ -n "\$OLDCON" ] && chvt \$OLDCON @@ -120,7 +120,7 @@ if grep -q ' bg=' /proc/cmdline; then while ! [ -s /etc/x2go/bg.svg ]; do OLDCON=\$(fgconsole) chvt 1 - echo "'$0' is waiting for a valid '/etc/x2go/bg.svg' file." + echo "'\$0' is waiting for a valid '/etc/x2go/bg.svg' file." sleep 2 done [ -n "\$OLDCON" ] && chvt \$OLDCON @@ -135,7 +135,7 @@ else while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do OLDCON=\$(fgconsole) chvt 1 - echo "'$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." + echo "'\$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." sleep 2 done [ -n "\$OLDCON" ] && chvt \$OLDCON -- 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 6e84ed1bfa9659a4b0292934a40d5e55309e2151 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:31:22 2017 +0200 syntax fixes --- config/includes.chroot/lib/live/config/2720-x2go-getbg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg index f15cad2..ccbf90a 100755 --- a/config/includes.chroot/lib/live/config/2720-x2go-getbg +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -12,7 +12,7 @@ X2GoGetBG () awk -F'=' ' /^bg=/ { print $2 }') BGDESTINATION=/etc/x2go/bg.svg - if [ -n "$BGURL"] ; then + if [ -n "$BGURL" ] ; then cat >/etc/network/if-up.d/0420-getbg <<GETBG #!/bin/bash export TERM=linux; @@ -58,4 +58,4 @@ GETBG fi } -X2GoGetBranding +X2GoGetBG -- 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 465fbe5f0c7fb351ab78885a28e30864b10302b6 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:33:52 2017 +0200 syntax fix --- config/includes.chroot/lib/live/config/2710-x2go-getbranding | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding index 992371e..39dfc5a 100755 --- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -12,7 +12,7 @@ X2GoGetBranding () awk -F'=' ' /^branding=/ { print $2 }') BRANDINGDESTINATION=/etc/x2go/branding.svg - if [ -n "$BRANDINGURL"] ; then + if [ -n "$BRANDINGURL" ] ; then cat >/etc/network/if-up.d/0410-getbranding <<GETBRAND #!/bin/bash export TERM=linux; -- 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 c5969b8bad21857cb948aaadcff1c1e76fd49eb0 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:35:18 2017 +0200 inverted if condition, no need for a "!" here ... --- config/includes.chroot/lib/live/config/2710-x2go-getbranding | 2 +- config/includes.chroot/lib/live/config/2720-x2go-getbg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding index 39dfc5a..f652c2f 100755 --- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -49,7 +49,7 @@ fi fi echo -en "\n\$(date +'%F | %T | ')'\$0': branding SVG download complete." | tee -a /dev/tty8 - if ! [ -s ${BRANDINGDESTINATION}.tmp ] ; then + if [ -s ${BRANDINGDESTINATION}.tmp ] ; then mv ${BRANDINGDESTINATION}.tmp $BRANDINGDESTINATION fi ) & diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg index ccbf90a..a3855be 100755 --- a/config/includes.chroot/lib/live/config/2720-x2go-getbg +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -49,7 +49,7 @@ fi fi echo -en "\n\$(date +'%F | %T | ')'\$0': background SVG download complete." | tee -a /dev/tty8 - if ! [ -s ${BGDESTINATION}.tmp ] ; then + if [ -s ${BGDESTINATION}.tmp ] ; then mv ${BGDESTINATION}.tmp $BGDESTINATION 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 7020248ed450e68c01546a6ed4eec721fb94e70d Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Sat Sep 16 18:39:21 2017 +0200 syntax fix --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index c951e06..b0d896e 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -113,7 +113,7 @@ if grep -q ' branding=' /proc/cmdline; then sleep 2 done [ -n "\$OLDCON" ] && chvt \$OLDCON - \$BRANDING='--branding=/etc/x2go/branding.svg' + BRANDING='--branding=/etc/x2go/branding.svg' fi BACKGROUND='' if grep -q ' bg=' /proc/cmdline; then @@ -124,7 +124,7 @@ if grep -q ' bg=' /proc/cmdline; then sleep 2 done [ -n "\$OLDCON" ] && chvt \$OLDCON - \$BACKGROUND='--background=/etc/x2go/bg.svg' + BACKGROUND='--background=/etc/x2go/bg.svg' fi # Spawn X2GoClient -- 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 bb9da76748ff2203cddcb08fb83d00c75f7419ea Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Sep 19 15:20:48 2017 +0200 fixed an error that kept Xinerama from working (would always clone screens instead) --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index b0d896e..6f629f7 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -73,10 +73,10 @@ for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d ' /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 + # 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 done # Spawn 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 08d1101c8b4e799ddfe252c9daedcb759c3d2072 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Tue Oct 3 15:28:21 2017 +0200 fixed regression that would allow right-click context menu again --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 6f629f7..526eeab 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -13,6 +13,7 @@ sed -i -e 's#<number>4</number>#<number>1</number>#' /etc/xdg/openbox/rc.xml # disable OpenBox keyboard bindings # this also disables the context menu (would be accessible in xinerama) and things like Alt-F4 for X2GoClient, Xephyr, etc. sed -i -e '/<keyboard>/,/<\/keyboard>/{//!d}' /etc/xdg/openbox/rc.xml +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 -- 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 7b4f2d4513aac36e8f77ac79e3544968bef49c62 Author: Stefan Baur (BAUR-ITCS) <kontakt@baur-itcs.de> Date: Wed Oct 18 12:22:45 2017 +0200 make sure OpenBox' ToggleMaximize is disabled, or else clicking the top row of pixels will un-maximize X2GoClient --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 526eeab..c8479e4 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -16,6 +16,8 @@ sed -i -e '/<keyboard>/,/<\/keyboard>/{//!d}' /etc/xdg/openbox/rc.xml 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 +#make sure OpenBox' ToggleMaximize is disabled, or else clicking the top row of pixels will un-maximize X2GoClient +sed -i -e '/ToggleMaximize/d' /etc/xdg/openbox/rc.xml cat >/home/user/.xsession <<XSESSION # inspired by -- 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 4f8300156c12afa6b80fe4e79886b8a4ba498245 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Oct 24 01:52:11 2017 +0200 added support to preselect session via boot parameter --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index c8479e4..36add67 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -92,6 +92,9 @@ xsetroot -solid "#246ed8" BROKERURL=\$(cat /proc/cmdline | \ tr ' ' '\n' | \ awk -F'=' ' /^broker-url=/ { print \$2 }') +SESSIONSELECT=\$(cat /proc/cmdline | \ + tr ' ' '\n' | \ + awk -F'=' ' /^session=/ { print \$2 }') LDAP=\$(cat /proc/cmdline | \ tr ' ' '\n' | \ sed 's/^ldap=/ldap#/' | \ @@ -131,6 +134,9 @@ if grep -q ' bg=' /proc/cmdline; then fi # Spawn X2GoClient +if [ -n "\$SESSIONSELECT" ]; then + STARTSESSION="--session=\$SESSIONSELECT" +else if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" else @@ -174,7 +180,7 @@ if [ -n "\$BLANKINGTIME" ]; then fi fi -x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING +x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION XSESSION chown user:user /home/user/.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 a123dadd3af41604da1c1e03ebc0e9162241e3d1 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Wed Oct 25 22:57:25 2017 +0200 replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values --- config/includes.chroot/lib/live/config/2100-show-sysconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 8354c71..50cb56d 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -20,7 +20,7 @@ fi ( if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | tr " " "\n" | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) fi if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) -- 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 e23cac061757302ad412284a865a42ff0be36e21 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Wed Oct 25 23:43:03 2017 +0200 added filters and quotes for some additional security, added missing escapes --- .../lib/live/config/2100-show-sysconf | 2 +- .../lib/live/config/2250-getsshpubkeysfromserver | 11 ++++++----- .../lib/live/config/2300-xserver-xorg-getxorgconf | 11 ++++++----- .../lib/live/config/2400-live-autoupdate | 20 ++++++++++++-------- config/includes.chroot/lib/live/config/2600-tcpprint | 3 ++- .../lib/live/config/2700-x2go-getsessions | 11 ++++++----- .../lib/live/config/2710-x2go-getbranding | 7 ++++--- .../includes.chroot/lib/live/config/2720-x2go-getbg | 11 ++++++----- .../lib/live/config/2900-x2go-thinclientconfig | 17 +++++++++++------ 9 files changed, 54 insertions(+), 39 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 50cb56d..7e7309a 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -20,7 +20,7 @@ fi ( if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }'))) + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }' | tr -dc 'a-zA-Z0-9. _\-'))) fi if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 76152fa..e6cac51 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -10,7 +10,8 @@ GetSSHPubKeysFromServer () PUBKEYURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^pubkey=/ { print $2 }') + awk -F'=' ' /^pubkey=/ { print $2 }' |\ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -n "$PUBKEYURL" ] ; then cat >/etc/network/if-up.d/0200-getsshpubkeysfromserver <<GETPUBKEY @@ -40,16 +41,16 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting SSH public keyfile download ..." | tee -a /dev/tty8 if echo "$PUBKEYURL" | grep -q "^tftp://" ; then - PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + 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 + while ! atftp "\$PUBKEYSERVER" -g -r "\$PUBKEYPATH" -l /root/.ssh/authorized_keys ; do echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else - while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do + while ! wget -q -O - "$PUBKEYURL" >/root/.ssh/authorized_keys ; do echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for download (wget) ..." | tee -a /dev/tty8 sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index 9824e8d..c20e59f 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -8,7 +8,8 @@ echo -n " xserver-xorg-getxorgconf" XORGCONFURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^xorgconfurl=/ { print $2 }') + awk -F'=' ' /^xorgconfurl=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then XORGCONFDESTINATION=/etc/X11/xorg.conf.new cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG @@ -31,16 +32,16 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting xorg.conf download ..." | tee -a /dev/tty8 if echo "$XORGCONFURL" | grep -q "^tftp://" ; then - XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + XORGCONFSERVER=$(echo "$XORGCONFURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' ) + XORGCONFPATH=$(echo "$XORGCONFURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' ) if [ -n "\$XORGCONFSERVER" ] && [ -n "\$XORGCONFPATH" ] ; then - while ! atftp \$XORGCONFSERVER -g -r \$XORGCONFPATH -l $XORGCONFDESTINATION ; do + while ! atftp "\$XORGCONFSERVER" -g -r "\$XORGCONFPATH" -l $XORGCONFDESTINATION ; do echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else - while ! wget -q -O $XORGCONFDESTINATION $XORGCONFURL ; do + while ! wget -q -O $XORGCONFDESTINATION "$XORGCONFURL" ; do echo -en "\n\$(date +'%F | %T | ')'\$0': still waiting for xorg.conf download (wget) ..." | tee -a /dev/tty8 sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 08649a7..00b05ad 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -119,7 +119,7 @@ echo -n " live-autoupdater (backgrounding update task)" unset LC_MESSAGES # Define our mountpoint and check if we're capable of auto-updating - NTFSROOT=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '/^ntfs-uuid/ { print $2 }') + NTFSROOT=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '/^ntfs-uuid/ { print $2 }' | tr -dc 'a-zA-Z0-9_\-') if [ -n "$NTFSROOT" ]; then mkdir -p /lib/live/mount/ntfsroot # This is in case we've been passed an incomplete UUID and/or one with dashes @@ -150,7 +150,7 @@ echo -n " live-autoupdater (backgrounding update task)" # if we have access to the entire filesystem, use the # directory size as base size for the current image - # and if the download directory is even bigger, use that size - IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }'))" | awk '{ print $1}') + IMGSIZE=$(du -s "/lib/live/mount/findiso/$(dirname $(sed -e 's/^.*findiso/findiso/' -e 's/ .*$//' /proc/cmdline | awk -F '=' '{ print $2 }' | tr -dc 'a-zA-Z0-9./ _\-'))" | awk '{ print $1}') IMGSIZEDOWNLOAD=$(du -s "/lib/live/mount/findiso/boot/X2Go-live-download" | awk '{ print $1}' || echo "0") [ $IMGSIZEDOWNLOAD -gt $IMGSIZE ] && IMGSIZE=$IMGSIZEDOWNLOAD else @@ -164,7 +164,8 @@ echo -n " live-autoupdater (backgrounding update task)" # determine our booted environment as well as the other available ones RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^findiso=/ { print $2 }')")) + awk -F'=' ' /^findiso=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9./ _\-')")) ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH) RUNNINGSYSTEMNAME=$(basename $RUNNINGSYSTEMFULLPATH) @@ -172,7 +173,8 @@ echo -n " live-autoupdater (backgrounding update task)" # download url pointing to directory with all required files goes here DOWNLOADURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^updateurl=/ { print $2 }') + awk -F'=' ' /^updateurl=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -z "$DOWNLOADURL" ]; then echo -n "\n$(date +'%F | %T | ')'$0': No update URL. Exiting." @@ -183,7 +185,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) - FINDFILE=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '$1 == "findiso" { print $2 }') + FINDFILE=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '$1 == "findiso" { print $2 }' | tr -dc 'a-zA-Z0-9./ _\-') [ -z "$FINDFILE" ] && exit 0 for PARTITION in $LISTOFPARTITIONS ; do mount -oro $PARTITION $TEMPMOUNT @@ -215,7 +217,8 @@ echo -n " live-autoupdater (backgrounding update task)" #BWLIMITPERCENT=20 # in percent, numeric-only BWLIMITPERCENT=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^bwlimit=/ { print $2 }') + awk -F'=' ' /^bwlimit=/ { print $2 }' | \ + tr -dc '0-9') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 echo -n "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." @@ -226,7 +229,8 @@ echo -n " live-autoupdater (backgrounding update task)" # MAXSLEEPTIME=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') + awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }' | \ + tr -dc '0-9') if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then MAXSLEEPTIME=900 fi @@ -313,7 +317,7 @@ echo -n " live-autoupdater (backgrounding update task)" # Attempt to determine available bandwidth & to set BWLIMIT accordingly echo -n "\n$(date +'%F | %T | ')'$0': Attempting to determine available bandwidth for wget.\n" wget -Nr -P /tmp/ -nd \ - --progress=bar:force $DOWNLOADURL/x2go-tce-initrd.img 2>&1 | \ + --progress=bar:force "$DOWNLOADURL/x2go-tce-initrd.img" 2>&1 | \ tee /tmp/dl.log cp --update "/tmp/x2go-tce-initrd.img" "$TEMPDIR" rm "/tmp/x2go-tce-initrd.img" diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index c25747e..b9fa523 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -11,7 +11,8 @@ if grep -q "\W*tcpprint\W*" /proc/cmdline ; then TCPPRINTONLYFROM=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') + awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.\-') if [ -n "$TCPPRINTONLYFROM" ] ; then TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM" fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 4488e60..4972b92 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -8,7 +8,8 @@ X2GoGetSessions () SESSIONSURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^sessionsurl=/ { print $2 }') + awk -F'=' ' /^sessionsurl=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then # only mv this file if SESSIONSURL was set. If not, leave it in place - as # it might have been customized at image creation time @@ -34,16 +35,16 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting session config data download ..." | tee -a /dev/tty8 if echo "$SESSIONSURL" | grep -q "^tftp://" ; then - SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + SESSIONSSERVER=$(echo "$SESSIONSURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' ) + SESSIONSPATH=$(echo "$SESSIONSURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' ) if [ -n "\$SESSIONSSERVER" ] && [ -n "\$SESSIONSPATH" ] ; then - while ! atftp \$SESSIONSSERVER -g -r \$SESSIONSPATH -l $SESSIONSDESTINATION ; do + while ! atftp "\$SESSIONSSERVER" -g -r "\$SESSIONSPATH" -l $SESSIONSDESTINATION ; do echo -en "\n\$(date +'%F | %T | ')still waiting for session config data (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else - while ! wget -q -O $SESSIONSDESTINATION $SESSIONSURL ; do + while ! wget -q -O $SESSIONSDESTINATION "$SESSIONSURL" ; do echo -en "\n\$(date +'%F | %T | ')still waiting for session config data (wget) ..." | tee -a /dev/tty8 sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding index e100b68..e9297e1 100755 --- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -9,7 +9,8 @@ X2GoGetBranding () BRANDINGURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^branding=/ { print $2 }') + awk -F'=' ' /^branding=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') BRANDINGDESTINATION=/etc/x2go/branding.svg if [ -n "$BRANDINGURL" ] ; then @@ -36,13 +37,13 @@ fi BRANDINGSERVER=$(echo "$BRANDINGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) BRANDINGPATH=$(echo "$BRANDINGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) if [ -n "\$BRANDINGSERVER" ] && [ -n "\$BRANDINGPATH" ] ; then - while ! atftp \$BRANDINGSERVER -g -r \$BRANDINGPATH -l ${BRANDINGDESTINATION}.tmp ; do + while ! atftp "\$BRANDINGSERVER" -g -r "\$BRANDINGPATH" -l ${BRANDINGDESTINATION}.tmp ; do echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else - while ! wget -q -O ${BRANDINGDESTINATION}.tmp $BRANDINGURL ; do + while ! wget -q -O ${BRANDINGDESTINATION}.tmp "$BRANDINGURL" ; do echo -en "\n\$(date +'%F | %T | ')still waiting for branding SVG download (wget) ..." | tee -a /dev/tty8 sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg index 83b9927..caae25e 100755 --- a/config/includes.chroot/lib/live/config/2720-x2go-getbg +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -9,7 +9,8 @@ X2GoGetBG () BGURL=$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^bg=/ { print $2 }') + awk -F'=' ' /^bg=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') BGDESTINATION=/etc/x2go/bg.svg if [ -n "$BGURL" ] ; then @@ -33,16 +34,16 @@ fi echo -en "\n\$(date +'%F | %T | ')'\$0': Attempting background SVG download ..." | tee -a /dev/tty8 if echo "$BGURL" | grep -q "^tftp://" ; then - BGSERVER=$(echo "$BGURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' ) - BGPATH=$(echo "$BGURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' ) + BGSERVER=$(echo "$BGURL" | sed 's#^tftp://\([^/;]*\)/.*$#\1#' ) + BGPATH=$(echo "$BGURL" | sed 's#^tftp://[^/;]*/\([^;]*\)$#\1#' ) if [ -n "\$BGSERVER" ] && [ -n "\$BGPATH" ] ; then - while ! atftp \$BGSERVER -g -r \$BGPATH -l ${BGDESTINATION}.tmp ; do + while ! atftp "\$BGSERVER" -g -r "\$BGPATH" -l ${BGDESTINATION}.tmp ; do echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (tftp) ..." | tee -a /dev/tty8 sleep 5 done fi else - while ! wget -q -O ${BGDESTINATION}.tmp $BGURL ; do + while ! wget -q -O ${BGDESTINATION}.tmp "$BGURL" ; do echo -en "\n\$(date +'%F | %T | ')still waiting for background SVG download (wget) ..." | tee -a /dev/tty8 sleep 5 done diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index e588422..72dc7b7 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -91,22 +91,27 @@ xsetroot -solid "#246ed8" # Get X2GoConfig BROKERURL=\$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^broker-url=/ { print \$2 }') + awk -F'=' ' /^broker-url=/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') SESSIONSELECT=\$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^session=/ { print \$2 }') + awk -F'=' ' /^session=/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:/ _\-') LDAP=\$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap=/ldap#/' | \ - awk -F'#' ' /^ldap#/ { print \$2 }') + awk -F'#' ' /^ldap#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') LDAP1=\$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap1=/ldap1#/' | \ - awk -F'#' ' /^ldap1#/ { print \$2 }') + awk -F'#' ' /^ldap1#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') LDAP2=\$(cat /proc/cmdline | \ sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap2=/ldap2#/' | \ - awk -F'#' ' /^ldap2#/ { print \$2 }') + awk -F'#' ' /^ldap2#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') # Check for background and branding SVGs @@ -161,7 +166,7 @@ else LDAPPARAMS="" fi -BLANKINGTIME=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "blank" { print \$2 }') +BLANKINGTIME=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "blank" { print \$2 }' | tr -dc '0-9:') if [ -n "\$BLANKINGTIME" ]; then DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}')) if [ \${DPMSARR[0]} -eq 0 ]; then -- 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 134cc44b827378d10fa624c5c94c1bbc327d769f Author: Stefan Baur <kontakt@baur-itcs.de> Date: Wed Oct 25 22:15:06 2017 +0200 added support for blanks in session names (no quotes required in parameter) --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 821b103..e588422 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -135,7 +135,7 @@ fi # Spawn X2GoClient if [ -n "\$SESSIONSELECT" ]; then - STARTSESSION="--session=\$SESSIONSELECT" + STARTSESSION="--session='\$SESSIONSELECT'" fi if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" @@ -180,7 +180,7 @@ if [ -n "\$BLANKINGTIME" ]; then fi fi -x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION +eval x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION XSESSION chown user:user /home/user/.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 1576484a7719c7f01f67a70a50c89d3482f87f8a Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Oct 24 01:52:57 2017 +0200 syntax fix --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 36add67..dea8f09 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -136,7 +136,7 @@ fi # Spawn X2GoClient if [ -n "\$SESSIONSELECT" ]; then STARTSESSION="--session=\$SESSIONSELECT" -else +fi if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" else -- 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 425671fc87abc31e1f6ec9fc23ada905fa55d2ae Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Oct 24 01:54:36 2017 +0200 commented out i386-only package (geode Xorg driver) --- config/package-lists/desktop.list.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/package-lists/desktop.list.chroot b/config/package-lists/desktop.list.chroot index bc2d8fc..9d571b0 100644 --- a/config/package-lists/desktop.list.chroot +++ b/config/package-lists/desktop.list.chroot @@ -2,7 +2,7 @@ x11vnc x11vnc-data xserver-xorg-input-wacom xserver-xorg-video-all -xserver-xorg-video-geode +# for i386 only #xserver-xorg-video-geode xserver-xorg-video-qxl xserver-xorg nodm -- 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 391d50014230e7f2b7f37ad84a28142cac605ded Author: Stefan Baur <kontakt@baur-itcs.de> Date: Wed Oct 25 19:50:53 2017 +0200 replaced tr ' ' '\n' with the more elaborate sed -e 's/ \([^ ]*\)=/\n\1=/g' to catch blanks in values --- .../lib/live/config/2250-getsshpubkeysfromserver | 2 +- .../lib/live/config/2300-xserver-xorg-getxorgconf | 2 +- .../includes.chroot/lib/live/config/2400-live-autoupdate | 14 +++++++------- config/includes.chroot/lib/live/config/2600-tcpprint | 2 +- .../includes.chroot/lib/live/config/2700-x2go-getsessions | 2 +- .../includes.chroot/lib/live/config/2710-x2go-getbranding | 2 +- config/includes.chroot/lib/live/config/2720-x2go-getbg | 2 +- .../lib/live/config/2900-x2go-thinclientconfig | 14 +++++++------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index 2e278cc..76152fa 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -9,7 +9,7 @@ GetSSHPubKeysFromServer () PUBKEYURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^pubkey=/ { print $2 }') if [ -n "$PUBKEYURL" ] ; then diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index a5e0a4b..9824e8d 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -7,7 +7,7 @@ XServerXorgGetXorgConf () echo -n " xserver-xorg-getxorgconf" XORGCONFURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^xorgconfurl=/ { print $2 }') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then XORGCONFDESTINATION=/etc/X11/xorg.conf.new diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 5a8f8ca..08649a7 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -119,7 +119,7 @@ echo -n " live-autoupdater (backgrounding update task)" unset LC_MESSAGES # Define our mountpoint and check if we're capable of auto-updating - NTFSROOT=$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '/^ntfs-uuid/ { print $2 }') + NTFSROOT=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '/^ntfs-uuid/ { print $2 }') if [ -n "$NTFSROOT" ]; then mkdir -p /lib/live/mount/ntfsroot # This is in case we've been passed an incomplete UUID and/or one with dashes @@ -128,7 +128,7 @@ echo -n " live-autoupdater (backgrounding update task)" if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then NTFSROOT=$(echo $NTFSROOT | tr -d '-') if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) + NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | sed -e 's/ \([^ ]*\)=/\n\1=/g' | head -1)) fi fi @@ -163,7 +163,7 @@ echo -n " live-autoupdater (backgrounding update task)" # determine our booted environment as well as the other available ones RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^findiso=/ { print $2 }')")) ALLSYSTEMSROOT=$(dirname $RUNNINGSYSTEMFULLPATH) @@ -171,7 +171,7 @@ echo -n " live-autoupdater (backgrounding update task)" # download url pointing to directory with all required files goes here DOWNLOADURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^updateurl=/ { print $2 }') if [ -z "$DOWNLOADURL" ]; then @@ -183,7 +183,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) - FINDFILE=$(cat /proc/cmdline | tr " " "\n" | awk -F '=' '$1 == "findiso" { print $2 }') + FINDFILE=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '$1 == "findiso" { print $2 }') [ -z "$FINDFILE" ] && exit 0 for PARTITION in $LISTOFPARTITIONS ; do mount -oro $PARTITION $TEMPMOUNT @@ -214,7 +214,7 @@ echo -n " live-autoupdater (backgrounding update task)" # #BWLIMITPERCENT=20 # in percent, numeric-only BWLIMITPERCENT=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^bwlimit=/ { print $2 }') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 @@ -225,7 +225,7 @@ echo -n " live-autoupdater (backgrounding update task)" # sleeping a random amount of time to ease load on the update server # MAXSLEEPTIME=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }') if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then MAXSLEEPTIME=900 diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index 1da6e7b..c25747e 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -10,7 +10,7 @@ echo -n " tcpprint" if grep -q "\W*tcpprint\W*" /proc/cmdline ; then TCPPRINTONLYFROM=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }') if [ -n "$TCPPRINTONLYFROM" ] ; then TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM" diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 6a4901c..4488e60 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -7,7 +7,7 @@ X2GoGetSessions () echo -n " x2go-getsessions" SESSIONSURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^sessionsurl=/ { print $2 }') if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then # only mv this file if SESSIONSURL was set. If not, leave it in place - as diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding index f652c2f..e100b68 100755 --- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -8,7 +8,7 @@ X2GoGetBranding () BRANDINGURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^branding=/ { print $2 }') BRANDINGDESTINATION=/etc/x2go/branding.svg diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg index a3855be..83b9927 100755 --- a/config/includes.chroot/lib/live/config/2720-x2go-getbg +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -8,7 +8,7 @@ X2GoGetBG () BGURL=$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^bg=/ { print $2 }') BGDESTINATION=/etc/x2go/bg.svg diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index dea8f09..821b103 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -28,7 +28,7 @@ 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 | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "xinerama" { print \$2 }') # sanitize input case \$XRANDRCMDTAINTED in @@ -90,21 +90,21 @@ xsetroot -solid "#246ed8" # Get X2GoConfig BROKERURL=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^broker-url=/ { print \$2 }') SESSIONSELECT=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ awk -F'=' ' /^session=/ { print \$2 }') LDAP=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap=/ldap#/' | \ awk -F'#' ' /^ldap#/ { print \$2 }') LDAP1=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap1=/ldap1#/' | \ awk -F'#' ' /^ldap1#/ { print \$2 }') LDAP2=\$(cat /proc/cmdline | \ - tr ' ' '\n' | \ + sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ sed 's/^ldap2=/ldap2#/' | \ awk -F'#' ' /^ldap2#/ { print \$2 }') @@ -161,7 +161,7 @@ else LDAPPARAMS="" fi -BLANKINGTIME=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\$1 == "blank" { print \$2 }') +BLANKINGTIME=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "blank" { print \$2 }') if [ -n "\$BLANKINGTIME" ]; then DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}')) if [ \${DPMSARR[0]} -eq 0 ]; then -- 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 fc93a8204b62140ea2676d036324a46ef96d926c Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 14:00:48 2017 +0100 rearranged detection sequence of throttling commands, also, rearranged parameter sequence to match trickle defaults: -d -u -t -l -L; Added code to determine maximum line speed for "u" values --- .../lib/live/config/2900-x2go-thinclientconfig | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 4f57544..65f1717 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -183,21 +183,34 @@ fi THROTTLINGCOMMAND="" THROTTLEVALUES=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "throttle" { print \$2 }' | tr -dc '0-9.:u') if [ -n "\$THROTTLEVALUES" ]; then + # determine maximum line speed + # look for all interfaces in state "up", then read their speed value from the file named speed + # just ignore the output if there is none, then sort numeric, unique, and read last line=highest, + # then sanitize + MAXSPEEDMBIT=$(grep -l "up" /sys/class/net/*/operstate | xargs -n1 dirname | xargs -n 1 -I XXX cat XXX/speed 2>/dev/null | sort -n -u | tail -1 | tr -dc '0-9.') + MAXSPEEDKBYTE=$((MAXSPEEDMBIT*128)) #Megabit * 1024 / 8 -> KiloByte + THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.u]*\$/ && \$2 ~/^[0-9\.u]*\$/ && \$3 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) - if [ -n "\${THROTTLEARR[4]}" ] && [ "\${THROTTLEARR[4]}" != "u" ] ; then - THROTTLELATENCY="-L \${THROTTLEARR[4]}" + if [ -n "\${THROTTLEARR[0]}" ] && [ "\${THROTTLEARR[0]}" != "u" ]; then + THROTTLEDOWN="-d \${THROTTLEARR[0]}" + elif [ "\${THROTTLEARR[0]}" = "u" ]; then + THROTTLEDOWN="-d \$MAXSPEEDKBYTE" fi - if [ -n "\${THROTTLEARR[3]}" ] && [ "\${THROTTLEARR[3]}" != "u" ]; then - THROTTLELENGTH="-l \${THROTTLEARR[3]}" + if [ -n "\${THROTTLEARR[1]}" ] && [ "\${THROTTLEARR[1]}" != "u" ]; then + THROTTLEUP="-u \${THROTTLEARR[1]}" + elif [ "\${THROTTLEARR[1]}" = "u" ]; then + THROTTLEUP="-d \$MAXSPEEDKBYTE" + elif [ -z "\${THROTTLEARR[1]}" ] ; then + THROTTLEUP="-d \${THROTTLEARR[0]}" fi - if [ -n "\${THROTTLEARR[2]}" ] && [ "\${THROTTLEARR[2]}" != "u" ]; then + if [ -n "\${THROTTLEARR[2]}" ] ; then THROTTLETIME="-t \${THROTTLEARR[2]}" fi - if [ -n "\${THROTTLEARR[1]}" ] && [ "\${THROTTLEARR[1]}" != "u" ]; then - THROTTLEDOWN="-d \${THROTTLEARR[1]}" + if [ -n "\${THROTTLEARR[3]}" ] ; then + THROTTLELENGTH="-l \${THROTTLEARR[3]}" fi - if [ -n "\${THROTTLEARR[0]}" ] && [ "\${THROTTLEARR[0]}" != "u" ]; then - THROTTLEUP="-u \${THROTTLEARR[0]}" + if [ -n "\${THROTTLEARR[4]}" ] ; then + THROTTLELATENCY="-L \${THROTTLEARR[4]}" fi # only set THROTTLINGCOMMAND if at least one value was detected and sanitized properly if [ -n "\$THROTTLEUP" ] || [ -n "\$THROTTLEDOWN" ] || [ -n "\$THROTTLETIME" ] || [ -n "\$THROTTLELENGTH" ] || [ -n "\$THROTTLELATENCY" ]; then -- 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 590e30206718215bab63a5e0113d6bb767c5b975 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 10:54:15 2017 +0100 added trickle package, to limit bandwidth usage; added bandwidth throttling code: single throttle value limits upstream; if multiple values are specified, first is upstream, second is downstream --- .../lib/live/config/2900-x2go-thinclientconfig | 26 +++++++++++++++++++++- config/package-lists/utils.list.chroot | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index e5dbdbe..17df60a 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -180,7 +180,31 @@ if [ -n "\$BLANKINGTIME" ]; then fi fi -eval x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION +THROTTLINGCOMMAND="" +THROTTLEVALUES=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "throttle" { print \$2 }' | tr -dc '0-9.:') +if [ -n "\$THROTTLEVALUES" ]; then + THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.]*\$/ && \$2 ~/^[0-9\.]*\$/ && \$3 ~/^[0-9\.]*\$/ && \$4 ~/^[0-9\.]*\$/ && \$4 ~/^[0-9\.]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) + if [ -n "\${THROTTLEARR[4]}" ]; then + THROTTLELATENCY="-L \${THROTTLEARR[4]}" + fi + if [ -n "\${THROTTLEARR[3]}" ]; then + THROTTLELENGTH="-l \${THROTTLEARR[3]}" + fi + if [ -n "\${THROTTLEARR[2]}" ]; then + THROTTLETIME="-t \${THROTTLEARR[2]}" + fi + if [ -n "\${THROTTLEARR[1]}" ]; then + THROTTLEDOWN="-d \${THROTTLEARR[1]}" + fi + if [ -n "\${THROTTLEARR[0]}" ]; then + THROTTLEUP="-u \${THROTTLEARR[0]}" + THROTTLINGCOMMAND="trickle -s \$THROTTLEDOWN \$THROTTLEUP \$THROTTLETIME \$THROTTLELENGTH \$THROTTLELATENCY" + fi +# only set THROTTLINGCOMMAND if at least one value was detected and sanitized properly +fi + + +eval \$THROTTLINGCOMMAND x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION XSESSION chown user:user /home/user/.xsession diff --git a/config/package-lists/utils.list.chroot b/config/package-lists/utils.list.chroot index 930954e..be4701c 100644 --- a/config/package-lists/utils.list.chroot +++ b/config/package-lists/utils.list.chroot @@ -11,6 +11,7 @@ openssl psmisc rsync screen +trickle util-linux vim wget -- 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 c32b1e095479d682fbe163990f06e0eea628d772 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 10:51:36 2017 +0100 fixed useless use of cat made sure double/single quotes work for parameters with spaces --- .../lib/live/config/2100-show-sysconf | 2 +- .../lib/live/config/2250-getsshpubkeysfromserver | 3 +- .../lib/live/config/2300-xserver-xorg-getxorgconf | 7 ++-- .../lib/live/config/2400-live-autoupdate | 26 ++++++------- .../includes.chroot/lib/live/config/2600-tcpprint | 7 ++-- .../lib/live/config/2700-x2go-getsessions | 7 ++-- .../lib/live/config/2710-x2go-getbranding | 7 ++-- .../lib/live/config/2720-x2go-getbg | 7 ++-- .../lib/live/config/2900-x2go-thinclientconfig | 45 ++++++++++------------ 9 files changed, 48 insertions(+), 63 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 35b86c5..f703a6c 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -20,7 +20,7 @@ fi ( if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }')) | tr -dc 'a-zA-Z0-9. _\-') + BOOTEDENV=\$(basename \$(dirname \$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F'=' ' \$1 == "findiso" { print \$2 }')) | tr -dc 'a-zA-Z0-9. _\-') fi for TIMESTAMPFILE in /lib/live/mount/rootfs/*/lib; do TIMESTAMP=\$(stat -c %Y \$TIMESTAMPFILE) diff --git a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver index e6cac51..473fe01 100755 --- a/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver +++ b/config/includes.chroot/lib/live/config/2250-getsshpubkeysfromserver @@ -8,8 +8,7 @@ GetSSHPubKeysFromServer () echo -n " getsshpubkeysfromserver" - PUBKEYURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ + PUBKEYURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ awk -F'=' ' /^pubkey=/ { print $2 }' |\ tr -dc 'a-zA-Z0-9.:/?%_\-') diff --git a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf index c20e59f..9390e9e 100755 --- a/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf +++ b/config/includes.chroot/lib/live/config/2300-xserver-xorg-getxorgconf @@ -6,10 +6,9 @@ XServerXorgGetXorgConf () # echo -n " xserver-xorg-getxorgconf" - XORGCONFURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^xorgconfurl=/ { print $2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') + XORGCONFURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^xorgconfurl=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -n "$XORGCONFURL" ] && [ -d /etc/X11 ] ; then XORGCONFDESTINATION=/etc/X11/xorg.conf.new cat >/etc/network/if-up.d/0300-getxorgconf <<GETXORG diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 7e94258..919cb44 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -119,7 +119,7 @@ echo -n " live-autoupdater (backgrounding update task)" unset LC_MESSAGES # Define our mountpoint and check if we're capable of auto-updating - NTFSROOT=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '/^ntfs-uuid/ { print $2 }' | tr -dc 'a-zA-Z0-9_\-') + NTFSROOT=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '/^ntfs-uuid/ { print $2 }' | tr -dc 'a-zA-Z0-9_\-') if [ -n "$NTFSROOT" ]; then mkdir -p /lib/live/mount/ntfsroot # This is in case we've been passed an incomplete UUID and/or one with dashes @@ -128,7 +128,7 @@ echo -n " live-autoupdater (backgrounding update task)" if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then NTFSROOT=$(echo $NTFSROOT | tr -d '-') if ! [ -L "/dev/disk/by-uuid/$NTFSROOT" ]; then - NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | sed -e 's/ \([^ ]*\)=/\n\1=/g' | head -1)) + NTFSROOT=$(basename $(echo /dev/disk/by-uuid/*$NTFSROOT | tr ' ' '\n' | head -1)) fi fi @@ -162,8 +162,7 @@ echo -n " live-autoupdater (backgrounding update task)" fi # determine our booted environment as well as the other available ones - RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ + RUNNINGSYSTEMFULLPATH=$(dirname $(readlink -m "$MOUNTPOINT/$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ awk -F'=' ' /^findiso=/ { print $2 }' | \ tr -dc 'a-zA-Z0-9./ _\-')")) @@ -171,8 +170,7 @@ echo -n " live-autoupdater (backgrounding update task)" RUNNINGSYSTEMNAME=$(basename $RUNNINGSYSTEMFULLPATH) # download url pointing to directory with all required files goes here - DOWNLOADURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ + DOWNLOADURL=$( sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ awk -F'=' ' /^updateurl=/ { print $2 }' | \ tr -dc 'a-zA-Z0-9.:/?%_\-') @@ -185,7 +183,7 @@ echo -n " live-autoupdater (backgrounding update task)" echo -n "\n$(date +'%F | %T | ')'$0': '/lib/live/mount/findiso' directory not found. Scanning for partitions." LISTOFPARTITIONS=$(grep -H ^0$ /sys/block/*/removable | awk -F '/' '{ print $4 }' | xargs -n 1 -I XXX fdisk -l /dev/XXX 2>/dev/null | awk '$0 ~ /Linux$/ { print $1}') TEMPMOUNT=$(mktemp -d -p /lib/live/mount/) - FINDFILE=$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '$1 == "findiso" { print $2 }' | tr -dc 'a-zA-Z0-9./ _\-') + FINDFILE=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '$1 == "findiso" { print $2 }' | tr -dc 'a-zA-Z0-9./ _\-') [ -z "$FINDFILE" ] && exit 0 for PARTITION in $LISTOFPARTITIONS ; do mount -oro $PARTITION $TEMPMOUNT @@ -215,10 +213,9 @@ echo -n " live-autoupdater (backgrounding update task)" # Bandwidth limit goes here # #BWLIMITPERCENT=20 # in percent, numeric-only - BWLIMITPERCENT=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^bwlimit=/ { print $2 }' | \ - tr -dc '0-9') + BWLIMITPERCENT=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^bwlimit=/ { print $2 }' | \ + tr -dc '0-9') if [ -z "$BWLIMITPERCENT" ]; then BWLIMITPERCENT=20 echo -n "\n$(date +'%F | %T | ')'$0': Bandwidth limit not set. Defaulting to 20%." @@ -227,10 +224,9 @@ echo -n " live-autoupdater (backgrounding update task)" # sleeping a random amount of time to ease load on the update server # - MAXSLEEPTIME=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }' | \ - tr -dc '0-9') + MAXSLEEPTIME=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^updatesleep=/ && $2 ~ /^[0-9]*$/ { print $2 }' | \ + tr -dc '0-9') if [ -z "$MAXSLEEPTIME" ] || [ $MAXSLEEPTIME -lt 240 ] ; then MAXSLEEPTIME=900 fi diff --git a/config/includes.chroot/lib/live/config/2600-tcpprint b/config/includes.chroot/lib/live/config/2600-tcpprint index b9fa523..600008a 100755 --- a/config/includes.chroot/lib/live/config/2600-tcpprint +++ b/config/includes.chroot/lib/live/config/2600-tcpprint @@ -9,10 +9,9 @@ echo -n " tcpprint" if grep -q "\W*tcpprint\W*" /proc/cmdline ; then - TCPPRINTONLYFROM=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }' | \ - tr -dc 'a-zA-Z0-9.\-') + TCPPRINTONLYFROM=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^tcpprintonlyfrom=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.\-') if [ -n "$TCPPRINTONLYFROM" ] ; then TCPPRINTONLYFROM="only_from = $TCPPRINTONLYFROM" fi diff --git a/config/includes.chroot/lib/live/config/2700-x2go-getsessions b/config/includes.chroot/lib/live/config/2700-x2go-getsessions index 4972b92..9af7813 100755 --- a/config/includes.chroot/lib/live/config/2700-x2go-getsessions +++ b/config/includes.chroot/lib/live/config/2700-x2go-getsessions @@ -6,10 +6,9 @@ X2GoGetSessions () # echo -n " x2go-getsessions" - SESSIONSURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^sessionsurl=/ { print $2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') + SESSIONSURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^sessionsurl=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') if [ -n "$SESSIONSURL" ] && [ -d /etc/x2go ] ; then # only mv this file if SESSIONSURL was set. If not, leave it in place - as # it might have been customized at image creation time diff --git a/config/includes.chroot/lib/live/config/2710-x2go-getbranding b/config/includes.chroot/lib/live/config/2710-x2go-getbranding index e9297e1..71bdfaa 100755 --- a/config/includes.chroot/lib/live/config/2710-x2go-getbranding +++ b/config/includes.chroot/lib/live/config/2710-x2go-getbranding @@ -7,10 +7,9 @@ X2GoGetBranding () echo -n " x2go-getbranding" - BRANDINGURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^branding=/ { print $2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') + BRANDINGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^branding=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') BRANDINGDESTINATION=/etc/x2go/branding.svg if [ -n "$BRANDINGURL" ] ; then diff --git a/config/includes.chroot/lib/live/config/2720-x2go-getbg b/config/includes.chroot/lib/live/config/2720-x2go-getbg index caae25e..b211f85 100755 --- a/config/includes.chroot/lib/live/config/2720-x2go-getbg +++ b/config/includes.chroot/lib/live/config/2720-x2go-getbg @@ -7,10 +7,9 @@ X2GoGetBG () echo -n " x2go-getbg" - BGURL=$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^bg=/ { print $2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') + BGURL=$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^bg=/ { print $2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') BGDESTINATION=/etc/x2go/bg.svg if [ -n "$BGURL" ] ; then diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 72dc7b7..e5dbdbe 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -28,7 +28,7 @@ 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 | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "xinerama" { print \$2 }') +XRANDRCMDTAINTED=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "xinerama" { print \$2 }') # sanitize input case \$XRANDRCMDTAINTED in @@ -89,29 +89,24 @@ openbox & xsetroot -solid "#246ed8" # Get X2GoConfig -BROKERURL=\$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^broker-url=/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') -SESSIONSELECT=\$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - awk -F'=' ' /^session=/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:/ _\-') -LDAP=\$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - sed 's/^ldap=/ldap#/' | \ - awk -F'#' ' /^ldap#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') -LDAP1=\$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - sed 's/^ldap1=/ldap1#/' | \ - awk -F'#' ' /^ldap1#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') -LDAP2=\$(cat /proc/cmdline | \ - sed -e 's/ \([^ ]*\)=/\n\1=/g' | \ - sed 's/^ldap2=/ldap2#/' | \ - awk -F'#' ' /^ldap2#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') +BROKERURL=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^broker-url=/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:/?%_\-') +SESSIONSELECT=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + awk -F'=' ' /^session=/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:/ _\-') +LDAP=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + sed 's/^ldap=/ldap#/' | \ + awk -F'#' ' /^ldap#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') +LDAP1=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + sed 's/^ldap1=/ldap1#/' | \ + awk -F'#' ' /^ldap1#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') +LDAP2=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ + sed 's/^ldap2=/ldap2#/' | \ + awk -F'#' ' /^ldap2#/ { print \$2 }' | \ + tr -dc 'a-zA-Z0-9.:_\-') # Check for background and branding SVGs @@ -166,7 +161,7 @@ else LDAPPARAMS="" fi -BLANKINGTIME=\$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F '=' '\$1 == "blank" { print \$2 }' | tr -dc '0-9:') +BLANKINGTIME=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "blank" { print \$2 }' | tr -dc '0-9:') if [ -n "\$BLANKINGTIME" ]; then DPMSARR=(\$(echo \$BLANKINGTIME | awk -F ':' '\$1 ~/^[0-9]*\$/ && \$2 ~/^[0-9]*\$/ && \$3 ~/^[0-9]*\$/ { print \$1 " " \$2 " " \$3}')) if [ \${DPMSARR[0]} -eq 0 ]; then -- 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 00887b892cffe3f1113680a9a496b3fc0100df93 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 10:57:37 2017 +0100 changed throttling code so it allows for "unlimited" values by specifying "u" instead of a number --- .../lib/live/config/2900-x2go-thinclientconfig | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 17df60a..4f57544 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -181,29 +181,30 @@ if [ -n "\$BLANKINGTIME" ]; then fi THROTTLINGCOMMAND="" -THROTTLEVALUES=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "throttle" { print \$2 }' | tr -dc '0-9.:') +THROTTLEVALUES=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | awk -F '=' '\$1 == "throttle" { print \$2 }' | tr -dc '0-9.:u') if [ -n "\$THROTTLEVALUES" ]; then - THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.]*\$/ && \$2 ~/^[0-9\.]*\$/ && \$3 ~/^[0-9\.]*\$/ && \$4 ~/^[0-9\.]*\$/ && \$4 ~/^[0-9\.]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) - if [ -n "\${THROTTLEARR[4]}" ]; then + THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.u]*\$/ && \$2 ~/^[0-9\.u]*\$/ && \$3 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) + if [ -n "\${THROTTLEARR[4]}" ] && [ "\${THROTTLEARR[4]}" != "u" ] ; then THROTTLELATENCY="-L \${THROTTLEARR[4]}" fi - if [ -n "\${THROTTLEARR[3]}" ]; then + if [ -n "\${THROTTLEARR[3]}" ] && [ "\${THROTTLEARR[3]}" != "u" ]; then THROTTLELENGTH="-l \${THROTTLEARR[3]}" fi - if [ -n "\${THROTTLEARR[2]}" ]; then + if [ -n "\${THROTTLEARR[2]}" ] && [ "\${THROTTLEARR[2]}" != "u" ]; then THROTTLETIME="-t \${THROTTLEARR[2]}" fi - if [ -n "\${THROTTLEARR[1]}" ]; then + if [ -n "\${THROTTLEARR[1]}" ] && [ "\${THROTTLEARR[1]}" != "u" ]; then THROTTLEDOWN="-d \${THROTTLEARR[1]}" fi - if [ -n "\${THROTTLEARR[0]}" ]; then + if [ -n "\${THROTTLEARR[0]}" ] && [ "\${THROTTLEARR[0]}" != "u" ]; then THROTTLEUP="-u \${THROTTLEARR[0]}" + fi + # only set THROTTLINGCOMMAND if at least one value was detected and sanitized properly + if [ -n "\$THROTTLEUP" ] || [ -n "\$THROTTLEDOWN" ] || [ -n "\$THROTTLETIME" ] || [ -n "\$THROTTLELENGTH" ] || [ -n "\$THROTTLELATENCY" ]; then THROTTLINGCOMMAND="trickle -s \$THROTTLEDOWN \$THROTTLEUP \$THROTTLETIME \$THROTTLELENGTH \$THROTTLELATENCY" fi -# only set THROTTLINGCOMMAND if at least one value was detected and sanitized properly fi - eval \$THROTTLINGCOMMAND x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION 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 63a0773d850507b791b8932dfd98890ab8971dc1 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 15:22:32 2017 +0100 fixed missing escapes --- config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 3270046..e846424 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -187,8 +187,8 @@ if [ -n "\$THROTTLEVALUES" ]; then # look for all interfaces in state "up", then read their speed value from the file named speed # just ignore the output if there is none, then sort numeric, unique, and read last line=highest, # then sanitize - MAXSPEEDMBIT=$(grep -l "up" /sys/class/net/*/operstate | xargs -n1 dirname | xargs -n 1 -I XXX cat XXX/speed 2>/dev/null | sort -n -u | tail -1 | tr -dc '0-9.') - MAXSPEEDKBYTE=$((MAXSPEEDMBIT*128)) #Megabit * 1024 / 8 -> KiloByte + MAXSPEEDMBIT=\$(grep -l "up" /sys/class/net/*/operstate | xargs -n1 dirname | xargs -n 1 -I XXX cat XXX/speed 2>/dev/null | sort -n -u | tail -1 | tr -dc '0-9.') + MAXSPEEDKBYTE=\$((MAXSPEEDMBIT*128)) #Megabit * 1024 / 8 -> KiloByte THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.u]*\$/ && \$2 ~/^[0-9\.u]*\$/ && \$3 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) if [ -n "\${THROTTLEARR[0]}" ] && [ "\${THROTTLEARR[0]}" != "u" ]; then -- 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 41097bb2a479d62256698cc362b111bc73597c3e Author: Stefan Baur <kontakt@baur-itcs.de> Date: Mon Oct 30 14:08:54 2017 +0100 added comments explaining default values --- .../lib/live/config/2900-x2go-thinclientconfig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 65f1717..3270046 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -192,25 +192,25 @@ if [ -n "\$THROTTLEVALUES" ]; then THROTTLEARR=(\$(echo \$THROTTLEVALUES | awk -F ':' '\$1 ~/^[0-9\.u]*\$/ && \$2 ~/^[0-9\.u]*\$/ && \$3 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ && \$4 ~/^[0-9\.u]*\$/ { print \$1 " " \$2 " " \$3 " " \$4 " " \$5}')) if [ -n "\${THROTTLEARR[0]}" ] && [ "\${THROTTLEARR[0]}" != "u" ]; then - THROTTLEDOWN="-d \${THROTTLEARR[0]}" + THROTTLEDOWN="-d \${THROTTLEARR[0]}" # default 10, never used elif [ "\${THROTTLEARR[0]}" = "u" ]; then THROTTLEDOWN="-d \$MAXSPEEDKBYTE" fi if [ -n "\${THROTTLEARR[1]}" ] && [ "\${THROTTLEARR[1]}" != "u" ]; then - THROTTLEUP="-u \${THROTTLEARR[1]}" + THROTTLEUP="-u \${THROTTLEARR[1]}" # default 10, never used elif [ "\${THROTTLEARR[1]}" = "u" ]; then THROTTLEUP="-d \$MAXSPEEDKBYTE" elif [ -z "\${THROTTLEARR[1]}" ] ; then - THROTTLEUP="-d \${THROTTLEARR[0]}" + THROTTLEUP="-d \${THROTTLEARR[0]}" # set up=down if only 1 param fi if [ -n "\${THROTTLEARR[2]}" ] ; then - THROTTLETIME="-t \${THROTTLEARR[2]}" + THROTTLETIME="-t \${THROTTLEARR[2]}" # default 3.0 fi if [ -n "\${THROTTLEARR[3]}" ] ; then - THROTTLELENGTH="-l \${THROTTLEARR[3]}" + THROTTLELENGTH="-l \${THROTTLEARR[3]}" # default 20 fi if [ -n "\${THROTTLEARR[4]}" ] ; then - THROTTLELATENCY="-L \${THROTTLEARR[4]}" + THROTTLELATENCY="-L \${THROTTLEARR[4]}" # default 0 fi # only set THROTTLINGCOMMAND if at least one value was detected and sanitized properly if [ -n "\$THROTTLEUP" ] || [ -n "\$THROTTLEDOWN" ] || [ -n "\$THROTTLETIME" ] || [ -n "\$THROTTLELENGTH" ] || [ -n "\$THROTTLELATENCY" ]; then -- 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 17876c1a4db56bed9849825690fa9968fc58b5d7 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Thu Oct 26 00:33:18 2017 +0200 fixed overzealous filter --- config/includes.chroot/lib/live/config/2100-show-sysconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 7e7309a..4517e58 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -20,7 +20,7 @@ fi ( if grep -q findiso /proc/cmdline ; then - BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }' | tr -dc 'a-zA-Z0-9. _\-'))) + BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }')) | tr -dc 'a-zA-Z0-9. _\-') fi if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) -- 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 137174c51f8ca461f1c5dc87ec281b8b37c9155e Author: Stefan Baur <kontakt@baur-itcs.de> Date: Thu Oct 26 00:50:04 2017 +0200 syntaxfix --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index 00b05ad..ee4f324 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -41,7 +41,7 @@ show_versions () echo "--- BEGIN TIMESTAMPS ---" >/var/run/x2go-tce-timestamps for TIMESTAMPFILE in $LISTOFTIMESTAMPFILES; do echo "$(cat $TIMESTAMPFILE);$(basename $(dirname $TIMESTAMPFILE));" >>/var/run/x2go-tce-timestamps - echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(cat $TIMESTAMPFILE) - $(dirname $TIMESTAMPFILE)) - $(date --date=@$(cat $TIMESTAMPFILE))" + echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) - $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done sed -i "s/$RUNNINGSYSTEMNAME;$/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps -- 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 f5a3ba4ed2332558d61f16f9e8183ea6ccdad7bf Author: Stefan Baur <kontakt@baur-itcs.de> Date: Thu Oct 26 01:03:19 2017 +0200 quoting fixed --- config/includes.chroot/lib/live/config/2400-live-autoupdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2400-live-autoupdate b/config/includes.chroot/lib/live/config/2400-live-autoupdate index ee4f324..7e94258 100755 --- a/config/includes.chroot/lib/live/config/2400-live-autoupdate +++ b/config/includes.chroot/lib/live/config/2400-live-autoupdate @@ -43,7 +43,7 @@ show_versions () echo "$(cat $TIMESTAMPFILE);$(basename $(dirname $TIMESTAMPFILE));" >>/var/run/x2go-tce-timestamps echo -n "\n$(date +'%F | %T | ')'$0': $(basename $(dirname $TIMESTAMPFILE)) - $(cat $TIMESTAMPFILE) - $(date --date=@$(cat $TIMESTAMPFILE))" done - sed -i "s/$RUNNINGSYSTEMNAME;$/$RUNNINGSYSTEMNAME;X/i" /var/run/x2go-tce-timestamps + sed -i "s/"$RUNNINGSYSTEMNAME";$/"$RUNNINGSYSTEMNAME";X/i" /var/run/x2go-tce-timestamps echo "---- END TIMESTAMPS ----" >>/var/run/x2go-tce-timestamps 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 aea30bfd34cc700ff8913c70bd5e9639bce38222 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Thu Oct 26 02:25:15 2017 +0200 fix to display timestamp/version information regardless of squashfs file name --- config/includes.chroot/lib/live/config/2100-show-sysconf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2100-show-sysconf b/config/includes.chroot/lib/live/config/2100-show-sysconf index 4517e58..35b86c5 100755 --- a/config/includes.chroot/lib/live/config/2100-show-sysconf +++ b/config/includes.chroot/lib/live/config/2100-show-sysconf @@ -22,10 +22,10 @@ fi if grep -q findiso /proc/cmdline ; then BOOTEDENV=\$(basename \$(dirname \$(cat /proc/cmdline | sed -e 's/ \([^ ]*\)=/\n\1=/g' | awk -F'=' ' \$1 == "findiso" { print \$2 }')) | tr -dc 'a-zA-Z0-9. _\-') fi - if [ -d /lib/live/mount/rootfs/filesystem.squashfs/lib ] ; then - TIMESTAMP=\$(stat -c %Y /lib/live/mount/rootfs/filesystem.squashfs/lib) + for TIMESTAMPFILE in /lib/live/mount/rootfs/*/lib; do + TIMESTAMP=\$(stat -c %Y \$TIMESTAMPFILE) HUMANTIMESTAMP=\$(date --date="@\$TIMESTAMP") - fi + done # clear old entries sed -i '/^- /d' /etc/issue -- 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 8632333cc1e2222cf0300f7f05727962eeef5cfc Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 16:24:43 2017 +0100 fixed syntax error stemming from copypasta --- .../includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia | 6 ------ 1 file changed, 6 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index b2498fd..892892c 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -88,11 +88,5 @@ GetSSHClientKeysFromMedia () done } - - - - fi -} - GetSSHClientKeysFromMedia -- 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 802cb5e03f7a2693d75cfad33779f815d6747518 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 16:17:02 2017 +0100 make sure file permissions are correct, even when copying from vfat; make sure all keys are generated before storing on media --- config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 8050125..438957b 100644 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -21,9 +21,15 @@ GetSSHHostKeysFromMedia () # any keyfile in the config dir will be copied over to live system for KEYFILE in $1/config/sshdkeys/ssh_host*key* ; do [ -e "$KEYFILE" ] && cp $KEYFILE /etc/ssh/ && KEYFLAG=1 + if echo $(basename $KEYFILE) | grep -q '\.pub$' ; then + chmod 644 /etc/ssh/$(basename $KEYFILE) + else + chmod 600 /etc/ssh/$(basename $KEYFILE) + fi done # no keys present (as detected by flag not being set), but directory is there? Store keys. if [ -z "$KEYFLAG" ] ; then + ssh-keygen -A # make sure we have keyfiles for every key the server expects mount -oremount,rw $1 && cp /etc/ssh/ssh_host*key* $1/config/sshdkeys/ else # reload sshd config -- 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 aec4ae504a1619d0e47fbce8dff64db42050faf0 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 14:39:29 2017 +0100 renamed 2510-x2go-getopensshportableclientkey -> 2270-getsshclientkeysfrommedia as the contents have been changed to a more generic form - it is now no longer specific to X2Go --- .../lib/live/config/2270-getsshclientkeysfrommedia | 98 ++++++++++++++++++++++ .../config/2510-x2go-getopensshportableclientkey | 46 ---------- 2 files changed, 98 insertions(+), 46 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia new file mode 100755 index 0000000..b2498fd --- /dev/null +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -0,0 +1,98 @@ +#!/bin/sh + + +GetSSHClientKeysFromMedia () +{ + # Output startup message + # + echo -n " getsshclientkeysfrommedia" + + # This script is for using the iso-hybrid image along with the "second partition" patch + # or other suitable storage media. When used with the iso-hybrid image for X2Go in portable mode, + # it allows you to share ssh secret keys between X2GoClient for Windows in portable + # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions. + # It also allows you to use USB media with your key on it together with a net-booted Debian Live, for example. + + # Homedir of user account + # + USERHOME=$(getent passwd 1000 | awk -F':' '{ print $6 }') + + # nudge automounter, in case device was already plugged in at power-up + # + udevadm trigger --action=add + + # list devices (and mountpoints, if present) + # + X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') + + # support for legacy label value + # + PORTABLEAPPLABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="PORTABLEAPP" { print $2 " " $3}') + + # block device list, removable first (we want USB media to be able to override keys on fixed disks) + # + BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort -r | awk -F'/' '{print $4}') + + check_for_config (){ + if [ -d $1/config/ssh ] || [ -d $1/ssh ] || [ -d $1/.ssh ]; then + # create .ssh-Directory in case it doesn't exist + # + mkdir -p $(readlink -m "$USERHOME/.ssh/") + + # any keyfile in the config dir will be copied over to live system + # + for KEYFILE in $1/config/ssh/* $1/ssh $1/.ssh ; do + [ -s "$KEYFILE" ] || continue + KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" + touch "$KEYDESTPATH" + chown user:user \ + $KEYDESTPATH + chmod 600 $KEYDESTPATH + cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + + done + + # this is so the path name in the sessions file matches again + # (cannot use .ssh on FAT, for example) + # + ln -s $USERHOME/.ssh $USERHOME/ssh + + return 0 + else + return 1 + fi + } + + for BLOCKDEV in $BLOCKDEVS; do + NEXTDEVICE=$(echo -e "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") + if [ -n "$NEXTDEVICE" ] ; then + MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') + NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') + + if [ -n "$MNTPT" ] ; then + # echo "$NEXTDEVICE is mounted at: $MNTPT" + check_for_config $MNTPT && exit 0 + else + # echo "$NEXTDEVICE is not mounted" + if grep -q "^0$" /sys/block/*/removable ; then + # echo "Is fixed disk, mounting" + mkdir -p /media/fixeddisks/$NEXTDEVICE + mount /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE + check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + else + # echo "Is removable disk, not mounted by automounter -> don't touch" + : + fi + fi + fi + done +} + + + + + fi +} + +GetSSHClientKeysFromMedia + diff --git a/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey b/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey deleted file mode 100755 index 1f7b486..0000000 --- a/config/includes.chroot/lib/live/config/2510-x2go-getopensshportableclientkey +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - - -X2GoGetOpenSSHPortableClientKey () -{ - # Output startup message - # - echo -n " x2go-getopensshportableclientkey" - - # This script is for using the iso-hybrid image along with the "second partition" patch - # it allows you to share ssh secret keys between X2GoClient for Windows in portable - # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions - - # Homedir of client side X2Go ThinClient Account - # - X2GOHOME="/home/user/" - - # Homedir of Portable App Installation - # - HOME="/media/PORTABLEAPP/" - - if [ -d "$HOME" ] && [ -d "$X2GOHOME" ]; then - - # create .ssh-Directory in case it doesn't exist - # - mkdir -p $(readlink -m "$X2GOHOME/.ssh/") - - for KEYFILE in $HOME/ssh/* ; do - [ -s "$KEYFILE" ] || continue - KEYDESTPATH="$X2GOHOME/.ssh/$(basename "$KEYFILE")" - touch "$KEYDESTPATH" - chown user:user \ - $KEYDESTPATH - chmod 600 $KEYDESTPATH - cat $(readlink -m "$KEYFILE")>$KEYDESTPATH - - done - - # this is so the path name in the sessions file matches again - # (cannot use .ssh on FAT, for example) - ln -s $X2GOHOME/.ssh $X2GOHOME/ssh - fi -} - -X2GoGetOpenSSHPortableClientKey - -- 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 f1edd487f7e185d578ce30103a998146adcefa90 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 16:19:46 2017 +0100 executable bit was missing --- config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia old mode 100644 new mode 100755 -- 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 f2aa49c44cf6cf44084b376f9abb715d58dafdc3 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 14:04:47 2017 +0100 added script to add and store SSH host keys when proper media is present --- .../lib/live/config/2260-getsshhostkeysfrommedia | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia new file mode 100644 index 0000000..8050125 --- /dev/null +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -0,0 +1,63 @@ +#!/bin/sh + + +GetSSHHostKeysFromMedia () +{ + # Output startup message + # + echo -n " getsshhostkeysfrommedia" + + # nudge automounter, in case device was already plugged in at power-up + udevadm trigger --action=add + + # list devices (and mountpoints, if present) + X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') + + # block device list, non-removable first (for security - we don't want USB media to be able to override keys on fixed disks) + BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort | awk -F'/' '{print $4}') + + check_for_config (){ + if [ -d $1/config/sshdkeys ] ; then + # any keyfile in the config dir will be copied over to live system + for KEYFILE in $1/config/sshdkeys/ssh_host*key* ; do + [ -e "$KEYFILE" ] && cp $KEYFILE /etc/ssh/ && KEYFLAG=1 + done + # no keys present (as detected by flag not being set), but directory is there? Store keys. + if [ -z "$KEYFLAG" ] ; then + mount -oremount,rw $1 && cp /etc/ssh/ssh_host*key* $1/config/sshdkeys/ + else + # reload sshd config + service ssh reload + fi + return 0 + else + return 1 + fi + } + + for BLOCKDEV in $BLOCKDEVS; do + NEXTDEVICE=$(echo -e "$X2GOTCELIVELABELS" | grep "$BLOCKDEV") + if [ -n "$NEXTDEVICE" ] ; then + MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') + NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') + + if [ -n "$MNTPT" ] ; then + # echo "$NEXTDEVICE is mounted at: $MNTPT" + check_for_config $MNTPT && exit 0 + else + # echo "$NEXTDEVICE is not mounted" + if grep -q "^0$" /sys/block/*/removable ; then + # echo "Is fixed disk, mounting" + mkdir -p /media/fixeddisks/$NEXTDEVICE + mount /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE + check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + else + # echo "Is removable disk, not mounted by automounter -> don't touch" + : + fi + fi + fi + done +} + +GetSSHHostKeysFromMedia -- 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 1ee37c0c8261a982a7202e09160b91e9c49bdd02 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 21:01:23 2017 +0100 changed routine to be more like GetSSHHostKeysFromMedia, also, added check so it waits until GetSSHHostKeysFromMedia is done --- .../lib/live/config/2270-getsshclientkeysfrommedia | 162 ++++++++++++--------- 1 file changed, 92 insertions(+), 70 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index de07b01..e92a176 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -6,86 +6,108 @@ GetSSHClientKeysFromMedia () # Output startup message # echo -n " getsshclientkeysfrommedia" + ( - # This script is for using the iso-hybrid image along with the "second partition" patch - # or other suitable storage media. When used with the iso-hybrid image for X2Go in portable mode, - # it allows you to share ssh secret keys between X2GoClient for Windows in portable - # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions. - # It also allows you to use USB media with your key on it together with a net-booted Debian Live, for example. + # This script is for using the iso-hybrid image along with the "second partition" patch + # or other suitable storage media. When used with the iso-hybrid image for X2Go in portable mode, + # it allows you to share ssh secret keys between X2GoClient for Windows in portable + # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions. + # It also allows you to use USB media with your key on it together with a net-booted Debian Live, for example. - # Homedir of user account - # - USERHOME=$(getent passwd 1000 | awk -F':' '{ print $6 }') - - # nudge automounter, in case device was already plugged in at power-up - # - udevadm trigger --action=add - - # list devices (and mountpoints, if present) - # - X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') - - # support for legacy label value - # - PORTABLEAPPLABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="PORTABLEAPP" { print $2 " " $3}') - - # block device list, removable first (we want USB media to be able to override keys on fixed disks) - # - BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort -r | awk -F'/' '{print $4}') + while ! [ -c /dev/tty8 ] ; do + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." + sleep 2 + done - check_for_config (){ - if [ -d $1/config/ssh ] || [ -d $1/ssh ] || [ -d $1/.ssh ]; then - # create .ssh-Directory in case it doesn't exist - # - mkdir -p $(readlink -m "$USERHOME/.ssh/") + while ! [ -e /var/lib/live/config/opensshkeys ] ; do + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for getsshhostkeysfrommedia to finish." + sleep 2 + done - # any keyfile in the config dir will be copied over to live system + # Homedir of user account # - for KEYFILE in $1/config/ssh/* $1/ssh $1/.ssh ; do - [ -s "$KEYFILE" ] || continue - KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" - touch "$KEYDESTPATH" - chown user:user \ - $KEYDESTPATH - chmod 600 $KEYDESTPATH - cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + USERHOME=$(getent passwd 1000 | awk -F':' '{ print $6 }') - done + # nudge automounter, in case device was already plugged in at power-up + if udevadm trigger --action=add ; then + echo -n "\n$(date +'%F | %T | ')'$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 + else + echo -n "\n$(date +'%F | %T | ')'$0' Error while nudging udev-automounter." | tee -a /dev/tty8 + fi - # this is so the path name in the sessions file matches again - # (cannot use .ssh on FAT, for example) - # - ln -s $USERHOME/.ssh $USERHOME/ssh - - return 0 - else - return 1 - fi - } - - for BLOCKDEV in $BLOCKDEVS; do - NEXTDEVICE=$(echo "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") - if [ -n "$NEXTDEVICE" ] ; then - MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') - NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') - - if [ -n "$MNTPT" ] ; then - # echo "$NEXTDEVICE is mounted at: $MNTPT" - check_for_config $MNTPT && exit 0 - else - # echo "$NEXTDEVICE is not mounted" - if grep -q "^0$" /sys/block/*/removable ; then - # echo "Is fixed disk, mounting" - mkdir -p /media/fixeddisks/$NEXTDEVICE - mount /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE - check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + # list devices (and mountpoints, if present) + X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') + + # support for legacy label value + PORTABLEAPPLABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="PORTABLEAPP" { print $2 " " $3}') + + # block device list, removable first (we want USB media to be able to override keys on fixed disks) + BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort -r | awk -F'/' '{print $4}') + + check_for_config (){ + if [ -d $1/config/ssh ] || [ -d $1/ssh ] || [ -d $1/.ssh ]; then + echo -n "\n$(date +'%F | %T | ')'$0' Keyfile directory found at '$1/config/ssh', '$1//ssh', or '$1/./ssh'." | tee -a /dev/tty8 + # create .ssh-Directory in case it doesn't exist + # + mkdir -p $(readlink -m "$USERHOME/.ssh/") + + # any keyfile in the config dir will be copied over to live system + # + for KEYFILE in $1/config/ssh/* $1/ssh $1/.ssh ; do + [ -s "$KEYFILE" ] || continue + KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" + touch "$KEYDESTPATH" + chown user:user \ + $KEYDESTPATH + chmod 600 $KEYDESTPATH + cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + + done + + # this is so the path name in the sessions file matches again + # (cannot use .ssh on FAT, for example) + # + ln -s $USERHOME/.ssh $USERHOME/ssh + + return 0 + else + return 1 + fi + } + + for BLOCKDEV in $BLOCKDEVS; do + NEXTDEVICE=$(echo "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") + if [ -n "$NEXTDEVICE" ] ; then + MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') + NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') + + if [ -n "$MNTPT" ] ; then + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 + if check_for_config $MNTPT ; then + touch /var/lib/live/config/opensshclientkeys + exit 0 + fi else - # echo "Is removable disk, not mounted by automounter -> don't touch" - : + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 + if grep -q "^0$" /sys/block/*/removable ; then + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 + mkdir -p /media/fixeddisks/$NEXTDEVICE + mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE + if check_for_config /media/fixeddisks/$NEXTDEVICE ; then + umount /media/fixeddisks/$NEXTDEVICE + touch /var/lib/live/config/opensshclientkeys + exit 0 + fi + umount /media/fixeddisks/$NEXTDEVICE + else + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 + : + fi fi fi - fi - done + done + touch /var/lib/live/config/opensshclientkeys + ) & } GetSSHClientKeysFromMedia -- 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 c5ed5f68a47dd4c5416cdf9808ab8d621b342e1d Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 19:10:17 2017 +0100 backgrounded entire task, added error checks and log output --- .../lib/live/config/2260-getsshhostkeysfrommedia | 127 +++++++++++++-------- 1 file changed, 82 insertions(+), 45 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 78e4dd5..81bdf99 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -6,64 +6,101 @@ GetSSHHostKeysFromMedia () # Output startup message # echo -n " getsshhostkeysfrommedia" + ( + while ! [ -c /dev/tty8 ] ; do + echo -n "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + sleep 2 + done - # nudge automounter, in case device was already plugged in at power-up - udevadm trigger --action=add + # nudge automounter, in case device was already plugged in at power-up + if udevadm trigger --action=add ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Error while nudging udev-automounter." | tee -a /dev/tty8 + fi - # list devices (and mountpoints, if present) - X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') + # list devices (and mountpoints, if present) + X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') - # block device list, non-removable first (for security - we don't want USB media to be able to override keys on fixed disks) - BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort | awk -F'/' '{print $4}') + # block device list, non-removable first (for security - we don't want USB media to be able to override keys on fixed disks) + BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort | awk -F'/' '{print $4}') - check_for_config (){ - if [ -d $1/config/sshdkeys ] ; then - # any keyfile in the config dir will be copied over to live system - for KEYFILE in $1/config/sshdkeys/ssh_host*key* ; do - [ -e "$KEYFILE" ] && cp $KEYFILE /etc/ssh/ && KEYFLAG=1 - if echo $(basename $KEYFILE) | grep -q '\.pub$' ; then - chmod 644 /etc/ssh/$(basename $KEYFILE) + check_for_config (){ + if [ -d $1/config/sshdkeys ] ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Keyfile directory found at '$1/config/sshdkeys'." | tee -a /dev/tty8 + # any keyfile in the config dir will be copied over to live system + for KEYFILE in $1/config/sshdkeys/ssh_host*key* ; do + [ -e "$KEYFILE" ] && cp $KEYFILE /etc/ssh/ && KEYFLAG=1 + if echo $(basename $KEYFILE) | grep -q '\.pub$' ; then + chmod 644 /etc/ssh/$(basename $KEYFILE) + else + chmod 600 /etc/ssh/$(basename $KEYFILE) + fi + done + # no keys present (as detected by flag not being set), but directory is there? Store keys. + if [ -z "$KEYFLAG" ] ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' No keyfiles were found in the keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 + ssh-keygen -A # make sure we have keyfiles for every key the server expects + echo -n "\n\$(date +'%F | %T | ')'\$0' Attempting to copy current keyfiles to keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 + if awk '$2=="'$1'" {print $4 }' /proc/mounts | tr ',' '\n' | grep -q '^ro$' ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Attempting to remount '$1' with flags rw and sync." | tee -a /dev/tty8 + if mount -oremount,rw,sync $1 ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Successfully remounted '$1'." | tee -a /dev/tty8 + REMOUNT="rws" + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Error remounting '$1'." | tee -a /dev/tty8 + fi + fi + if ([ -z "$REMOUNT" ] || [ "$REMOUNT" = "rws" ]) && cp /etc/ssh/ssh_host*key* $1/config/sshdkeys/ ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Copying keyfiles succeeded." | tee -a /dev/tty8 + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Error copying keyfiles." | tee -a /dev/tty8 + fi + if [ -n "$REMOUNT" ] && mount -oremount,ro $1 ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Remounted '$1' read-only." | tee -a /dev/tty8 + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Error remounting '$1' read-only." | tee -a /dev/tty8 + fi + else - chmod 600 /etc/ssh/$(basename $KEYFILE) + # reload sshd config + echo -n "\n\$(date +'%F | %T | ')'\$0' Reloading sshd config to activate new keyfiles." | tee -a /dev/tty8 + if service ssh reload ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' New keyfiles activated." | tee -a /dev/tty8 + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Error activating new keyfiles." | tee -a /dev/tty8 + fi fi - done - # no keys present (as detected by flag not being set), but directory is there? Store keys. - if [ -z "$KEYFLAG" ] ; then - ssh-keygen -A # make sure we have keyfiles for every key the server expects - mount -oremount,rw $1 && cp /etc/ssh/ssh_host*key* $1/config/sshdkeys/ + return 0 else - # reload sshd config - service ssh reload + return 1 fi - return 0 - else - return 1 - fi - } + } - for BLOCKDEV in $BLOCKDEVS; do - NEXTDEVICE=$(echo "$X2GOTCELIVELABELS" | grep "$BLOCKDEV") - if [ -n "$NEXTDEVICE" ] ; then - MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') - NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') + for BLOCKDEV in $BLOCKDEVS; do + NEXTDEVICE=$(echo "$X2GOTCELIVELABELS" | grep "$BLOCKDEV") + if [ -n "$NEXTDEVICE" ] ; then + MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') + NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') - if [ -n "$MNTPT" ] ; then - # echo "$NEXTDEVICE is mounted at: $MNTPT" - check_for_config $MNTPT && exit 0 - else - # echo "$NEXTDEVICE is not mounted" - if grep -q "^0$" /sys/block/*/removable ; then - # echo "Is fixed disk, mounting" - mkdir -p /media/fixeddisks/$NEXTDEVICE - mount /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE - check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + if [ -n "$MNTPT" ] ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 + check_for_config $MNTPT && exit 0 else - # echo "Is removable disk, not mounted by automounter -> don't touch" - : + echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 + if grep -q "^0$" /sys/block/*/removable ; then + echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 + mkdir -p /media/fixeddisks/$NEXTDEVICE + mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE + check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + else + echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 + : + fi fi fi - fi - done + done + ) & } GetSSHHostKeysFromMedia -- 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 3b364321a8a339b53a620b18b55dda52a988a9a4 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 17:25:54 2017 +0100 dash's echo does not understand -e, thus removed --- config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia | 2 +- config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 438957b..78e4dd5 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -42,7 +42,7 @@ GetSSHHostKeysFromMedia () } for BLOCKDEV in $BLOCKDEVS; do - NEXTDEVICE=$(echo -e "$X2GOTCELIVELABELS" | grep "$BLOCKDEV") + NEXTDEVICE=$(echo "$X2GOTCELIVELABELS" | grep "$BLOCKDEV") if [ -n "$NEXTDEVICE" ] ; then MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index 892892c..de07b01 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -64,7 +64,7 @@ GetSSHClientKeysFromMedia () } for BLOCKDEV in $BLOCKDEVS; do - NEXTDEVICE=$(echo -e "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") + NEXTDEVICE=$(echo "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") if [ -n "$NEXTDEVICE" ] ; then MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') -- 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 c11e112f183545ff4be61a7543e5da86a87fe464 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 20:26:17 2017 +0100 added umount command for self-mounted devices --- config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 7ce7c8c..aad3b9d 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -92,7 +92,7 @@ GetSSHHostKeysFromMedia () echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 mkdir -p /media/fixeddisks/$NEXTDEVICE mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE - check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 + check_for_config /media/fixeddisks/$NEXTDEVICE && umount /media/fixeddisks/$NEXTDEVICE && exit 0 else echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 : -- 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 62d1ce1754180dc1a1d68bacc222d39b35ca52af Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 20:29:15 2017 +0100 separate umount added, for when the condition isn't matched --- config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia | 1 + 1 file changed, 1 insertion(+) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index aad3b9d..553ea3b 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -93,6 +93,7 @@ GetSSHHostKeysFromMedia () mkdir -p /media/fixeddisks/$NEXTDEVICE mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE check_for_config /media/fixeddisks/$NEXTDEVICE && umount /media/fixeddisks/$NEXTDEVICE && exit 0 + umount /media/fixeddisks/$NEXTDEVICE else echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 : -- 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 aca77b74651051a1c04efa54c7cb38ed43b06113 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 20:35:28 2017 +0100 added "finished" marker --- .../lib/live/config/2260-getsshhostkeysfrommedia | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 553ea3b..b96f0aa 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -85,14 +85,21 @@ GetSSHHostKeysFromMedia () if [ -n "$MNTPT" ] ; then echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 - check_for_config $MNTPT && exit 0 + if check_for_config $MNTPT ; then + touch /var/lib/live/config/opensshkeys + exit 0 + fi else echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 if grep -q "^0$" /sys/block/*/removable ; then echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 mkdir -p /media/fixeddisks/$NEXTDEVICE mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE - check_for_config /media/fixeddisks/$NEXTDEVICE && umount /media/fixeddisks/$NEXTDEVICE && exit 0 + if check_for_config /media/fixeddisks/$NEXTDEVICE ; then + umount /media/fixeddisks/$NEXTDEVICE + touch /var/lib/live/config/opensshkeys + exit 0 + fi umount /media/fixeddisks/$NEXTDEVICE else echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 @@ -101,6 +108,7 @@ GetSSHHostKeysFromMedia () fi fi done + touch /var/lib/live/config/opensshkeys ) & } -- 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 6b4d232fe973550a926aea63be0ab52cc1ce99fc Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 20:21:48 2017 +0100 removed unneccessary escapes --- .../lib/live/config/2260-getsshhostkeysfrommedia | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index 81bdf99..7ce7c8c 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -8,15 +8,15 @@ GetSSHHostKeysFromMedia () echo -n " getsshhostkeysfrommedia" ( while ! [ -c /dev/tty8 ] ; do - echo -n "\n\$(date +'%F | %T | ')'\$0' is waiting for tty8 to become available." + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." sleep 2 done # nudge automounter, in case device was already plugged in at power-up if udevadm trigger --action=add ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Error while nudging udev-automounter." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Error while nudging udev-automounter." | tee -a /dev/tty8 fi # list devices (and mountpoints, if present) @@ -27,7 +27,7 @@ GetSSHHostKeysFromMedia () check_for_config (){ if [ -d $1/config/sshdkeys ] ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Keyfile directory found at '$1/config/sshdkeys'." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Keyfile directory found at '$1/config/sshdkeys'." | tee -a /dev/tty8 # any keyfile in the config dir will be copied over to live system for KEYFILE in $1/config/sshdkeys/ssh_host*key* ; do [ -e "$KEYFILE" ] && cp $KEYFILE /etc/ssh/ && KEYFLAG=1 @@ -39,36 +39,36 @@ GetSSHHostKeysFromMedia () done # no keys present (as detected by flag not being set), but directory is there? Store keys. if [ -z "$KEYFLAG" ] ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' No keyfiles were found in the keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' No keyfiles were found in the keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 ssh-keygen -A # make sure we have keyfiles for every key the server expects - echo -n "\n\$(date +'%F | %T | ')'\$0' Attempting to copy current keyfiles to keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Attempting to copy current keyfiles to keyfile directory '$1/config/sshdkeys'." | tee -a /dev/tty8 if awk '$2=="'$1'" {print $4 }' /proc/mounts | tr ',' '\n' | grep -q '^ro$' ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Attempting to remount '$1' with flags rw and sync." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Attempting to remount '$1' with flags rw and sync." | tee -a /dev/tty8 if mount -oremount,rw,sync $1 ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Successfully remounted '$1'." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Successfully remounted '$1'." | tee -a /dev/tty8 REMOUNT="rws" else - echo -n "\n\$(date +'%F | %T | ')'\$0' Error remounting '$1'." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Error remounting '$1'." | tee -a /dev/tty8 fi fi if ([ -z "$REMOUNT" ] || [ "$REMOUNT" = "rws" ]) && cp /etc/ssh/ssh_host*key* $1/config/sshdkeys/ ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Copying keyfiles succeeded." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Copying keyfiles succeeded." | tee -a /dev/tty8 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Error copying keyfiles." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Error copying keyfiles." | tee -a /dev/tty8 fi if [ -n "$REMOUNT" ] && mount -oremount,ro $1 ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Remounted '$1' read-only." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Remounted '$1' read-only." | tee -a /dev/tty8 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Error remounting '$1' read-only." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Error remounting '$1' read-only." | tee -a /dev/tty8 fi else # reload sshd config - echo -n "\n\$(date +'%F | %T | ')'\$0' Reloading sshd config to activate new keyfiles." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Reloading sshd config to activate new keyfiles." | tee -a /dev/tty8 if service ssh reload ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' New keyfiles activated." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' New keyfiles activated." | tee -a /dev/tty8 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Error activating new keyfiles." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Error activating new keyfiles." | tee -a /dev/tty8 fi fi return 0 @@ -84,17 +84,17 @@ GetSSHHostKeysFromMedia () NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') if [ -n "$MNTPT" ] ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 check_for_config $MNTPT && exit 0 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 if grep -q "^0$" /sys/block/*/removable ; then - echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 mkdir -p /media/fixeddisks/$NEXTDEVICE mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE check_for_config /media/fixeddisks/$NEXTDEVICE && exit 0 else - echo -n "\n\$(date +'%F | %T | ')'\$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 : fi 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 f92593bad83b922e669e9f4557ce82188e380e77 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 20:41:28 2017 +0100 added check for already-running sshd --- .../lib/live/config/2260-getsshhostkeysfrommedia | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia index b96f0aa..96d56de 100755 --- a/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2260-getsshhostkeysfrommedia @@ -63,12 +63,16 @@ GetSSHHostKeysFromMedia () fi else - # reload sshd config - echo -n "\n$(date +'%F | %T | ')'$0' Reloading sshd config to activate new keyfiles." | tee -a /dev/tty8 - if service ssh reload ; then - echo -n "\n$(date +'%F | %T | ')'$0' New keyfiles activated." | tee -a /dev/tty8 + if ps -C sshd >/dev/null 2>&1 ; then + # reload sshd config + echo -n "\n$(date +'%F | %T | ')'$0' Reloading sshd config to activate new keyfiles." | tee -a /dev/tty8 + if service ssh reload ; then + echo -n "\n$(date +'%F | %T | ')'$0' New keyfiles activated." | tee -a /dev/tty8 + else + echo -n "\n$(date +'%F | %T | ')'$0' Error activating new keyfiles." | tee -a /dev/tty8 + fi else - echo -n "\n$(date +'%F | %T | ')'$0' Error activating new keyfiles." | tee -a /dev/tty8 + echo -n "\n$(date +'%F | %T | ')'$0' sshd not running (yet), so no reloading required." | tee -a /dev/tty8 fi fi return 0 -- 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 ba7168f3b46607ac171dd4674624e11039153f53 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Sat Nov 11 13:54:29 2017 +0100 added required dependencies for previously added package --- config/package-lists/x2go.list.chroot | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/package-lists/x2go.list.chroot b/config/package-lists/x2go.list.chroot index a8ed83d..81d39b3 100644 --- a/config/package-lists/x2go.list.chroot +++ b/config/package-lists/x2go.list.chroot @@ -1,5 +1,6 @@ cryptsetup freerdp-x11 +iso-codes libfile-path-expand-perl libfreerdp-cache1.1 libfreerdp-client1.1 @@ -13,6 +14,8 @@ libfreerdp-plugins-standard libfreerdp-primitives1.1 libfreerdp-rail1.1 libfreerdp-utils1.1 +libgstreamer0.10-0 +libgstreamer-plugins-base0.10-0 libjpeg62-turbo libssl1.0.0 libwinpr-crt0.1 -- 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 f345a56052f231b3794400fe94a6c12c86359a8d Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Nov 18 01:50:56 2017 +0100 config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig: fix VT switching on slow resource downloads. --- .../includes.chroot/lib/live/config/2900-x2go-thinclientconfig | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 841ff9a..0e124d2 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -111,9 +111,10 @@ LDAP2=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cm # Check for background and branding SVGs BRANDING='' +OLDCON='' if grep -q ' branding=' /proc/cmdline; then while ! [ -s /etc/x2go/branding.svg ]; do - OLDCON=\$(fgconsole) + [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" chvt 1 echo "'\$0' is waiting for a valid '/etc/x2go/branding.svg' file." sleep 2 @@ -122,9 +123,10 @@ if grep -q ' branding=' /proc/cmdline; then BRANDING='--branding=/etc/x2go/branding.svg' fi BACKGROUND='' +OLDCON='' if grep -q ' bg=' /proc/cmdline; then while ! [ -s /etc/x2go/bg.svg ]; do - OLDCON=\$(fgconsole) + [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" chvt 1 echo "'\$0' is waiting for a valid '/etc/x2go/bg.svg' file." sleep 2 @@ -141,8 +143,9 @@ if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" else SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" + OLDCON='' while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do - OLDCON=\$(fgconsole) + [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" chvt 1 echo "'\$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." sleep 2 -- 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 618e89af5eceefe74ecd2bd6419037b6e5af7ed3 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 21:48:37 2017 +0100 wildcards were missing for additional directories --- config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index e92a176..a8df481 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -53,7 +53,7 @@ GetSSHClientKeysFromMedia () # any keyfile in the config dir will be copied over to live system # - for KEYFILE in $1/config/ssh/* $1/ssh $1/.ssh ; do + for KEYFILE in $1/config/ssh/* $1/ssh/* $1/.ssh/* ; do [ -s "$KEYFILE" ] || continue KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" touch "$KEYDESTPATH" -- 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 c52187cb43ab48ff38ff246e73517816cd907aa2 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Thu Nov 9 09:17:06 2017 +0100 added '@' as allowed character in broker URL, sessionselect, and LDAP parameters --- .../lib/live/config/2900-x2go-thinclientconfig | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index e846424..841ff9a 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -91,22 +91,22 @@ xsetroot -solid "#246ed8" # Get X2GoConfig BROKERURL=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ awk -F'=' ' /^broker-url=/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:/?%_\-') + tr -dc 'a-zA-Z0-9.:/?%_\-@') SESSIONSELECT=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ awk -F'=' ' /^session=/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:/ _\-') + tr -dc 'a-zA-Z0-9.:/ _\-@') LDAP=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ sed 's/^ldap=/ldap#/' | \ awk -F'#' ' /^ldap#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') + tr -dc 'a-zA-Z0-9.:_\-@') LDAP1=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ sed 's/^ldap1=/ldap1#/' | \ awk -F'#' ' /^ldap1#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') + tr -dc 'a-zA-Z0-9.:_\-@') LDAP2=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cmdline | \ sed 's/^ldap2=/ldap2#/' | \ awk -F'#' ' /^ldap2#/ { print \$2 }' | \ - tr -dc 'a-zA-Z0-9.:_\-') + tr -dc 'a-zA-Z0-9.:_\-@') # Check for background and branding SVGs @@ -218,6 +218,14 @@ if [ -n "\$THROTTLEVALUES" ]; then fi fi +# workaround for NX "magic pixel" being active in --thinclient mode +while ! ps -C xdotool >/dev/null ; do + while [ \$(xdotool search --name . | wc -l) -lt 3 ] ; do + sleep 1 + done ; + xdotool search . behave %@ blur windowmap +done & + eval \$THROTTLINGCOMMAND x2goclient --thinclient --no-session-edit --no-menu --maximize --add-to-known-hosts --haltbt --read-exports-from=/home/user/export \$LDAPPARAMS \$SESSIONFROM \$BACKGROUND \$BRANDING \$STARTSESSION 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 a9f3c9e11a7ffa705459e94ce27e5b4acb288a39 Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 23:34:41 2017 +0100 added check so key copy routine only runs when "copysecring" boot parameter is set --- .../lib/live/config/2270-getsshclientkeysfrommedia | 190 +++++++++++---------- 1 file changed, 96 insertions(+), 94 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index 19ebfbe..3bbf516 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -6,110 +6,112 @@ GetSSHClientKeysFromMedia () # Output startup message # echo -n " getsshclientkeysfrommedia" - ( - - # This script is for using the iso-hybrid image along with the "second partition" patch - # or other suitable storage media. When used with the iso-hybrid image for X2Go in portable mode, - # it allows you to share ssh secret keys between X2GoClient for Windows in portable - # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions. - # It also allows you to use USB media with your key on it together with a net-booted Debian Live, for example. - - while ! [ -c /dev/tty8 ] ; do - echo -n "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." - sleep 2 - done - - while ! [ -e /var/lib/live/config/opensshkeys ] ; do - echo -n "\n$(date +'%F | %T | ')'$0' is waiting for getsshhostkeysfrommedia to finish." - sleep 2 - done - - # Homedir of user account - # - USERHOME=$(getent passwd 1000 | awk -F':' '{ print $6 }') - - # nudge automounter, in case device was already plugged in at power-up - if udevadm trigger --action=add ; then - echo -n "\n$(date +'%F | %T | ')'$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 - else - echo -n "\n$(date +'%F | %T | ')'$0' Error while nudging udev-automounter." | tee -a /dev/tty8 - fi - - # list devices (and mountpoints, if present) - X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') - - # support for legacy label value - PORTABLEAPPLABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="PORTABLEAPP" { print $2 " " $3}') - - # block device list, removable first (we want USB media to be able to override keys on fixed disks) - BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort -r | awk -F'/' '{print $4}') - - check_for_config (){ - if [ -d $1/config/ssh ] || [ -d $1/ssh ] || [ -d $1/.ssh ]; then - echo -n "\n$(date +'%F | %T | ')'$0' Keyfile directory found at '$1/config/ssh', '$1//ssh', or '$1/./ssh'." | tee -a /dev/tty8 - # create .ssh-Directory in case it doesn't exist - # - mkdir -p $(readlink -m "$USERHOME/.ssh/") - - # any keyfile in the config dir will be copied over to live system - # - for KEYFILE in $1/config/ssh/* $1/ssh/* $1/.ssh/* ; do - ([ -f "$KEYFILE" ] && [ -s "$KEYFILE" ]) || continue - egrep -q "BEGIN .*(PRIVATE|PUBLIC) KEY" "$KEYFILE" || continue - echo -n "\n$(date +'%F | %T | ')'$0' Keyfile '$KEYFILE' found, copying and adjusting ownership and permissions on destination." | tee -a /dev/tty8 - KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" - touch "$KEYDESTPATH" - chown user:user \ - $KEYDESTPATH - chmod 600 $KEYDESTPATH - cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + if grep -q "\W*copysecring\W*" /proc/cmdline ; then + ( + + # This script is for using the iso-hybrid image along with the "second partition" patch + # or other suitable storage media. When used with the iso-hybrid image for X2Go in portable mode, + # it allows you to share ssh secret keys between X2GoClient for Windows in portable + # mode and the X2Go-ThinClientEnvironment on the same USB media using different partitions. + # It also allows you to use USB media with your key on it together with a net-booted Debian Live, for example. + + while ! [ -c /dev/tty8 ] ; do + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for tty8 to become available." + sleep 2 + done + while ! [ -e /var/lib/live/config/opensshkeys ] ; do + echo -n "\n$(date +'%F | %T | ')'$0' is waiting for getsshhostkeysfrommedia to finish." + sleep 2 done - # this is so the path name in the sessions file matches again - # (cannot use .ssh on FAT, for example) + # Homedir of user account # - ln -s $USERHOME/.ssh $USERHOME/ssh - - return 0 - else - return 1 - fi - } - - for BLOCKDEV in $BLOCKDEVS; do - NEXTDEVICE=$(echo "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") - if [ -n "$NEXTDEVICE" ] ; then - MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') - NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') - - if [ -n "$MNTPT" ] ; then - echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 - if check_for_config $MNTPT ; then - touch /var/lib/live/config/opensshclientkeys - exit 0 - fi - else - echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 - if grep -q "^0$" /sys/block/*/removable ; then - echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 - mkdir -p /media/fixeddisks/$NEXTDEVICE - mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE - if check_for_config /media/fixeddisks/$NEXTDEVICE ; then - umount /media/fixeddisks/$NEXTDEVICE + USERHOME=$(getent passwd 1000 | awk -F':' '{ print $6 }') + + # nudge automounter, in case device was already plugged in at power-up + if udevadm trigger --action=add ; then + echo -n "\n$(date +'%F | %T | ')'$0' Successfully nudged udev-automounter." | tee -a /dev/tty8 + else + echo -n "\n$(date +'%F | %T | ')'$0' Error while nudging udev-automounter." | tee -a /dev/tty8 + fi + + # list devices (and mountpoints, if present) + X2GOTCELIVELABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="X2GO-TCE-LIVE" { print $2 " " $3}') + + # support for legacy label value + PORTABLEAPPLABELS=$(lsblk -oLABEL,NAME,MOUNTPOINT -l | awk '$3~/^[^\/]/ && $3="" ; $1=="PORTABLEAPP" { print $2 " " $3}') + + # block device list, removable first (we want USB media to be able to override keys on fixed disks) + BLOCKDEVS=$(grep -H '' /sys/block/*/removable | awk -F':' '{ print $2 ":" $1}' | sort -r | awk -F'/' '{print $4}') + + check_for_config (){ + if [ -d $1/config/ssh ] || [ -d $1/ssh ] || [ -d $1/.ssh ]; then + echo -n "\n$(date +'%F | %T | ')'$0' Keyfile directory found at '$1/config/ssh', '$1//ssh', or '$1/./ssh'." | tee -a /dev/tty8 + # create .ssh-Directory in case it doesn't exist + # + mkdir -p $(readlink -m "$USERHOME/.ssh/") + + # any keyfile in the config dir will be copied over to live system + # + for KEYFILE in $1/config/ssh/* $1/ssh/* $1/.ssh/* ; do + ([ -f "$KEYFILE" ] && [ -s "$KEYFILE" ]) || continue + egrep -q "BEGIN .*(PRIVATE|PUBLIC) KEY" "$KEYFILE" || continue + echo -n "\n$(date +'%F | %T | ')'$0' Keyfile '$KEYFILE' found, copying and adjusting ownership and permissions on destination." | tee -a /dev/tty8 + KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" + touch "$KEYDESTPATH" + chown user:user \ + $KEYDESTPATH + chmod 600 $KEYDESTPATH + cat $(readlink -m "$KEYFILE")>$KEYDESTPATH + + done + + # this is so the path name in the sessions file matches again + # (cannot use .ssh on FAT, for example) + # + ln -s $USERHOME/.ssh $USERHOME/ssh + + return 0 + else + return 1 + fi + } + + for BLOCKDEV in $BLOCKDEVS; do + NEXTDEVICE=$(echo "$X2GOTCELIVELABELS\n$PORTABLEAPPLABELS" | grep "$BLOCKDEV") + if [ -n "$NEXTDEVICE" ] ; then + MNTPT=$(echo $NEXTDEVICE | awk '{print $2}') + NEXTDEVICE=$(echo $NEXTDEVICE | awk '{print $1}') + + if [ -n "$MNTPT" ] ; then + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is mounted at: '$MNTPT'" | tee -a /dev/tty8 + if check_for_config $MNTPT ; then touch /var/lib/live/config/opensshclientkeys exit 0 fi - umount /media/fixeddisks/$NEXTDEVICE else - echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 - : + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is not mounted." | tee -a /dev/tty8 + if grep -q "^0$" /sys/block/*/removable ; then + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a fixed disk, mounting ..." | tee -a /dev/tty8 + mkdir -p /media/fixeddisks/$NEXTDEVICE + mount -o ro /dev/$NEXTDEVICE /media/fixeddisks/$NEXTDEVICE + if check_for_config /media/fixeddisks/$NEXTDEVICE ; then + umount /media/fixeddisks/$NEXTDEVICE + touch /var/lib/live/config/opensshclientkeys + exit 0 + fi + umount /media/fixeddisks/$NEXTDEVICE + else + echo -n "\n$(date +'%F | %T | ')'$0' Device '$NEXTDEVICE' is a removable disk, not mounted by automounter, skipping." | tee -a /dev/tty8 + : + fi fi fi - fi - done - touch /var/lib/live/config/opensshclientkeys - ) & + done + touch /var/lib/live/config/opensshclientkeys + ) & + fi } GetSSHClientKeysFromMedia -- 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 da56f85e6497cd6e6570dff08afedb60aa3de91e Author: Stefan Baur <kontakt@baur-itcs.de> Date: Tue Nov 7 23:25:29 2017 +0100 added checks so only keyfiles are copied --- config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia index a8df481..19ebfbe 100755 --- a/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia +++ b/config/includes.chroot/lib/live/config/2270-getsshclientkeysfrommedia @@ -54,7 +54,9 @@ GetSSHClientKeysFromMedia () # any keyfile in the config dir will be copied over to live system # for KEYFILE in $1/config/ssh/* $1/ssh/* $1/.ssh/* ; do - [ -s "$KEYFILE" ] || continue + ([ -f "$KEYFILE" ] && [ -s "$KEYFILE" ]) || continue + egrep -q "BEGIN .*(PRIVATE|PUBLIC) KEY" "$KEYFILE" || continue + echo -n "\n$(date +'%F | %T | ')'$0' Keyfile '$KEYFILE' found, copying and adjusting ownership and permissions on destination." | tee -a /dev/tty8 KEYDESTPATH="$USERHOME/.ssh/$(basename "$KEYFILE")" touch "$KEYDESTPATH" chown user:user \ -- 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 a774a3c006b99d067ccb2030cbee95bce02db1f2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Nov 18 01:51:58 2017 +0100 config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig: whitespace and quoting fixups. --- .../lib/live/config/2900-x2go-thinclientconfig | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig index 0e124d2..0609975 100755 --- a/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig +++ b/config/includes.chroot/lib/live/config/2900-x2go-thinclientconfig @@ -113,25 +113,25 @@ LDAP2=\$(sed -e 's/ \([^ ]*\)=/\n\1=/g' -e 's/\([^=]["'"'"']\) /\1\n/g' /proc/cm BRANDING='' OLDCON='' if grep -q ' branding=' /proc/cmdline; then - while ! [ -s /etc/x2go/branding.svg ]; do + while ! [ -s "/etc/x2go/branding.svg" ]; do [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" - chvt 1 - echo "'\$0' is waiting for a valid '/etc/x2go/branding.svg' file." - sleep 2 + chvt "1" + echo "'\$0' is waiting for a valid '/etc/x2go/branding.svg' file." + sleep "2" done - [ -n "\$OLDCON" ] && chvt \$OLDCON + [ -n "\$OLDCON" ] && chvt "\$OLDCON" BRANDING='--branding=/etc/x2go/branding.svg' fi BACKGROUND='' OLDCON='' if grep -q ' bg=' /proc/cmdline; then - while ! [ -s /etc/x2go/bg.svg ]; do + while ! [ -s "/etc/x2go/bg.svg" ]; do [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" - chvt 1 - echo "'\$0' is waiting for a valid '/etc/x2go/bg.svg' file." - sleep 2 + chvt "1" + echo "'\$0' is waiting for a valid '/etc/x2go/bg.svg' file." + sleep "2" done - [ -n "\$OLDCON" ] && chvt \$OLDCON + [ -n "\$OLDCON" ] && chvt "\$OLDCON" BACKGROUND='--background=/etc/x2go/bg.svg' fi @@ -141,16 +141,16 @@ if [ -n "\$SESSIONSELECT" ]; then fi if [ -n "\$BROKERURL" ]; then SESSIONFROM="--broker-url=\$BROKERURL" -else +else SESSIONFROM="--session-conf=/etc/x2go/x2gothinclient_sessions" OLDCON='' - while ! [ -s /etc/x2go/x2gothinclient_sessions ]; do + while ! [ -s "/etc/x2go/x2gothinclient_sessions" ]; do [ -z "\$OLDCON" ] && OLDCON="\$(fgconsole)" - chvt 1 - echo "'\$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." - sleep 2 + chvt "1" + echo "'\$0' is waiting for a valid '/etc/x2go/x2gothinclient_sessions' file." + sleep "2" done - [ -n "\$OLDCON" ] && chvt \$OLDCON + [ -n "\$OLDCON" ] && chvt "\$OLDCON" fi if [ -n "\$LDAP" ] ; then if [ -n "\$LDAP1" ] ; then -- 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 35a7952f7dda2549db418e8ff0e7e624268a337c Author: Stefan Baur <kontakt@baur-itcs.de> Date: Sat Nov 11 13:48:01 2017 +0100 added libfreerdp-plugins-standard so drive forwarding works with xfreerdp --- config/package-lists/x2go.list.chroot | 1 + 1 file changed, 1 insertion(+) diff --git a/config/package-lists/x2go.list.chroot b/config/package-lists/x2go.list.chroot index 06348e5..a8ed83d 100644 --- a/config/package-lists/x2go.list.chroot +++ b/config/package-lists/x2go.list.chroot @@ -9,6 +9,7 @@ libfreerdp-core1.1 libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1 +libfreerdp-plugins-standard libfreerdp-primitives1.1 libfreerdp-rail1.1 libfreerdp-utils1.1 -- 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