summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-10-16 15:41:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-10-16 15:41:48 +0000
commitd6aec113996a094aa72403abeb260312dabf1489 (patch)
treec1a7ebb64f6ac6c4d3e675e404fd743f6f0461e0
parent4d89878fec3fb80ed273f478745cb78052bad69c (diff)
downloaddrakx-backup-do-not-use-d6aec113996a094aa72403abeb260312dabf1489.tar
drakx-backup-do-not-use-d6aec113996a094aa72403abeb260312dabf1489.tar.gz
drakx-backup-do-not-use-d6aec113996a094aa72403abeb260312dabf1489.tar.bz2
drakx-backup-do-not-use-d6aec113996a094aa72403abeb260312dabf1489.tar.xz
drakx-backup-do-not-use-d6aec113996a094aa72403abeb260312dabf1489.zip
add xwait and use it
-rw-r--r--move/.cvsignore2
-rw-r--r--move/Makefile21
-rw-r--r--move/move.pm10
-rw-r--r--move/xwait.c18
4 files changed, 45 insertions, 6 deletions
diff --git a/move/.cvsignore b/move/.cvsignore
index 7e027ccbc..3e5b5c985 100644
--- a/move/.cvsignore
+++ b/move/.cvsignore
@@ -1 +1,3 @@
*.rdz
+xwait
+.perl_checker.cache
diff --git a/move/Makefile b/move/Makefile
index d558d6b42..d006b4561 100644
--- a/move/Makefile
+++ b/move/Makefile
@@ -10,9 +10,17 @@ INSTALL = ../perl-install
INSTALL_FILES = install2.pm install_steps.pm install_any.pm install_interactive.pm install_steps_gtk.pm install_steps_interactive.pm install_messages.pm install_gtk.pm help.pm
+ARCH := $(shell arch | egrep "(x86_64|sparc64|s390x)")
+ifneq ("x$(ARCH)", "x")
+LIB_NAME = lib64
+else
+LIB_NAME = lib
+endif
+
+
all: install
-build:
+build: xwait
cd $(STAGE1) && ADDITIONAL_DEFS="-DMANDRAKE_MOVE" make init stage1-network stage1-cdrom init-move
install: build
@@ -21,7 +29,7 @@ install: build
#- todo: make_boot_img alike to create boot volume from ../mdk-stage1/stage1-cdrom (isolinux mandatory since stock kernel is so big)
sudo cp -f $(STAGE1)/init-move $(DEST_LIVETREE)/sbin/init
- sudo cp -f runstage2 $(DEST_LIVETREE)/usr/bin
+ sudo cp -f runstage2 xwait $(DEST_LIVETREE)/usr/bin
sudo rm -rf $(DEST_STAGE2)
sudo mkdir -p $(DEST_STAGE2)
sudo cp -f *.pm $(DEST_STAGE2)
@@ -46,3 +54,12 @@ install: build
grep ChangeLog $(INSTALL)/CVS/Entries > /tmp/version
sudo cp -f /tmp/version $(DEST_LIVETREE)/usr/share/VERSION
sudo rm -f $(DEST_LIVETREE)/lock
+
+
+xwait: %: %.c
+ $(CC) $(CFLAGS) $< -L/usr/X11R6/$(LIB_NAME) -lX11 -o $@
+
+clean:
+ rm -f xwait
+
+# mkisofs -D -U -r $(DEST_LIVETREE) | create_compressed_fs - 65536 $(DEST_LIVETREE).clp 2000 2>/dev/null
diff --git a/move/move.pm b/move/move.pm
index 39d4cd278..de99597ac 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -59,10 +59,12 @@ sub install2::startMove {
output('/var/run/console/mdk', 1);
run_program::run('pam_console_apply');
- fork() or exec 'gmessage', '...' or c::_exit(0);
-
- sleep 1;
- exec 'su', 'mdk', 'startkde';
+ if (fork()) {
+ sleep 1;
+ exec 'su', 'mdk', 'startkde';
+ } else {
+ exec 'xwait' or c::_exit(0);
+ }
}
sub automatic_xconf {
diff --git a/move/xwait.c b/move/xwait.c
new file mode 100644
index 000000000..a199b790e
--- /dev/null
+++ b/move/xwait.c
@@ -0,0 +1,18 @@
+#include <stdlib.h>
+#include <X11/Xlib.h>
+
+int main() {
+ Display *display = XOpenDisplay(NULL);
+
+ if (display) {
+ XEvent event;
+
+ XSelectInput(display, DefaultRootWindow(display), SubstructureNotifyMask);
+ do {
+ XNextEvent(display, &event);
+ } while (event.type != CreateNotify);
+ XCloseDisplay(display);
+ }
+
+ exit(display == NULL);
+}