summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--move/Makefile2
-rwxr-xr-xmove/tree/startkde_move42
-rwxr-xr-xmove/tree/wait4x21
3 files changed, 32 insertions, 33 deletions
diff --git a/move/Makefile b/move/Makefile
index 9b8e40f46..c4068b8ff 100644
--- a/move/Makefile
+++ b/move/Makefile
@@ -7,7 +7,7 @@ ISO = /BIG/mdkmove.iso
DATA_FILES = devices symlinks directories-to-create etcfiles all-etcfiles keyfiles \
BOOT-800-MOVE.jpg BOOT-1024-MOVE.jpg BOOT-1280-MOVE.jpg BOOT-1600-MOVE.jpg
-PROGRAM_FILES = etc-monitorer.pl tree/startkde_move
+PROGRAM_FILES = etc-monitorer.pl tree/startkde_move tree/wait4x
LANG_FILES = $(shell perl -ne 'print $$1 if /ALLOWED_LANGS = qw\((.*)\)/' move.pm)
STAGE1 = ../mdk-stage1
diff --git a/move/tree/startkde_move b/move/tree/startkde_move
index a9d1d53ce..9169add40 100755
--- a/move/tree/startkde_move
+++ b/move/tree/startkde_move
@@ -1,32 +1,10 @@
-#!/usr/bin/perl
-
-use MDK::Common;
-use lib qw(/usr/lib/libDrakX);
-use c;
-
-sub wait4x() {
- my $nb = 0;
- foreach (1..30) {
- sleep 1;
- print("no X server :("), exit 1 if !fuzzy_pidofs(qr/\bX_move\b/);
- $nb++ if c::Xtest(':0');
- if ($nb > 2) { #- one succeeded test is not enough :-(
- return;
- }
- }
- exit 1;
-}
-
-my ($kde_ok, $xwait);
-
-while (1) {
- wait4x();
- if (!($xwait = fork())) {
- exec 'xwait', '-permanent'; #- so that server doesn't blink when startkde finishes
- }
- my ($xdim) = `xdpyinfo` =~ /dimensions:\s*(\d+)/;
- system("qiv --root /image/move/BOOT-$xdim-MOVE.jpg");
- system('startkde');
- system('sudo killall X');
- waitpid $xwait, 0;
-}
+#!/bin/sh
+
+while true; do
+ wait4x || exit 1
+ xwait -permanent &
+ xdim=`xdpyinfo | perl -ne 'print $1 if /dimensions:\s*(\d+)/'`
+ qiv --root /image/move/BOOT-$xdim-MOVE.jpg
+ startkde
+ sudo killall X
+done
diff --git a/move/tree/wait4x b/move/tree/wait4x
new file mode 100755
index 000000000..e8c2cfaba
--- /dev/null
+++ b/move/tree/wait4x
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use MDK::Common;
+use lib qw(/usr/lib/libDrakX);
+use c;
+
+my $nb = 0;
+$| = 1;
+print "waiting for X";
+foreach (1..30) {
+ print ".";
+ sleep 1;
+ print("no X server :(\n"), exit 1 if !fuzzy_pidofs(qr/\b$_[0]\b/);
+ $nb++ if c::Xtest(':0');
+ if ($nb > 2) { #- one succeeded test is not enough :-(
+ print "found\n";
+ exit 0;
+ }
+}
+print "not found\n";
+exit 1;