From d6aec113996a094aa72403abeb260312dabf1489 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 16 Oct 2003 15:41:48 +0000 Subject: add xwait and use it --- move/.cvsignore | 2 ++ move/Makefile | 21 +++++++++++++++++++-- move/move.pm | 10 ++++++---- move/xwait.c | 18 ++++++++++++++++++ 4 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 move/xwait.c (limited to 'move') 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 +#include + +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); +} -- cgit v1.2.1