summaryrefslogtreecommitdiffstats
path: root/move
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-26 13:01:01 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-26 13:01:01 +0000
commit11192b58aa0053df80faebe224e3cf7f83d822cb (patch)
treea4a1aadd3141692ec331f2f02dee8b7b2ab37948 /move
parenta97b85927a0405108abb72479240d76a8c3f5097 (diff)
downloaddrakx-11192b58aa0053df80faebe224e3cf7f83d822cb.tar
drakx-11192b58aa0053df80faebe224e3cf7f83d822cb.tar.gz
drakx-11192b58aa0053df80faebe224e3cf7f83d822cb.tar.bz2
drakx-11192b58aa0053df80faebe224e3cf7f83d822cb.tar.xz
drakx-11192b58aa0053df80faebe224e3cf7f83d822cb.zip
allow X to restart after dying through X_move script, startkde also through startkde_move script
Diffstat (limited to 'move')
-rw-r--r--move/Makefile3
-rw-r--r--move/move.pm2
-rwxr-xr-xmove/tree/X_move7
-rwxr-xr-xmove/tree/startkde_move32
4 files changed, 42 insertions, 2 deletions
diff --git a/move/Makefile b/move/Makefile
index 8ee16a0cf..9b8e40f46 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
+PROGRAM_FILES = etc-monitorer.pl tree/startkde_move
LANG_FILES = $(shell perl -ne 'print $$1 if /ALLOWED_LANGS = qw\((.*)\)/' move.pm)
STAGE1 = ../mdk-stage1
@@ -49,6 +49,7 @@ install: build
sudo cp -f *.pm $(DEST_STAGE2)
sudo cp -f $(addprefix $(INSTALL)/, $(INSTALL_FILES)) $(DEST_STAGE2)
sudo cp -f $(PROGRAM_FILES) $(DEST_LIVETREE)/usr/bin
+ sudo cp -f tree/X_move $(DEST_LIVETREE)/usr/X11R6/bin
sudo rm -rf $(DEST_LIVETREE)/usr/share/langs
sudo mkdir -p $(DEST_LIVETREE)/usr/share/langs
diff --git a/move/move.pm b/move/move.pm
index 19a1af58c..e2f10e2f7 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -514,7 +514,7 @@ sub install2::startMove {
$ENV{LOGNAME} = $ENV{USER} = $username;
$ENV{HOME} = $home;
$ENV{SHELL} = $shell;
- exec 'startkde';
+ exec 'startkde_move';
} else {
exec 'xwait' or c::_exit(0);
}
diff --git a/move/tree/X_move b/move/tree/X_move
new file mode 100755
index 000000000..df085fcd8
--- /dev/null
+++ b/move/tree/X_move
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+ok=0
+while [ "$ok" == 0 ]; do
+ X $@
+ ok=$?
+done
diff --git a/move/tree/startkde_move b/move/tree/startkde_move
new file mode 100755
index 000000000..a9d1d53ce
--- /dev/null
+++ b/move/tree/startkde_move
@@ -0,0 +1,32 @@
+#!/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;
+}