diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-08 19:26:57 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2000-12-08 19:26:57 +0000 |
commit | 2c34d1a1a491861b68b76d6dbb449771d1cf114c (patch) | |
tree | bd06ff016d5417ef10ca6c67432622dd7ee8afc3 /mdk-stage1/stage1.c | |
parent | 28b12d4a72442d2a13b42460f93eb64d8856ae41 (diff) | |
download | drakx-2c34d1a1a491861b68b76d6dbb449771d1cf114c.tar drakx-2c34d1a1a491861b68b76d6dbb449771d1cf114c.tar.gz drakx-2c34d1a1a491861b68b76d6dbb449771d1cf114c.tar.bz2 drakx-2c34d1a1a491861b68b76d6dbb449771d1cf114c.tar.xz drakx-2c34d1a1a491861b68b76d6dbb449771d1cf114c.zip |
mdk-stage1 can now run the Install from CDROM
Diffstat (limited to 'mdk-stage1/stage1.c')
-rw-r--r-- | mdk-stage1/stage1.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index 16d896f3b..f984b3058 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -46,8 +46,9 @@ /* globals */ -int stage1_mode = 0; struct cmdline_elem params[500]; +int stage1_mode = 0; +char * method_name; void fatal_error(char *msg) @@ -200,11 +201,14 @@ enum return_type method_select_and_prepare(void) int main(int argc, char **argv) { enum return_type ret; + char ** argptr; + char * stage2_args[30]; + if (getpid() > 50) stage1_mode |= MODE_TESTING; - open_log(IS_TESTING); + open_log(); log_message("welcome to the Linux-Mandrake install (stage1, version " VERSION " built " __DATE__ " " __TIME__")"); @@ -224,10 +228,27 @@ int main(int argc, char **argv) ret = method_select_and_prepare(); finish_frontend(); - close_log(); if (ret == RETURN_ERROR) fatal_error("could not select an installation method"); - return 0; + if (!IS_LIVE) { + if (symlink("/tmp/image/Mandrake/mdkinst", "/tmp/stage2") != 0) + fatal_error("symlink to /tmp/stage2 failed"); + } + + close_log(); + + argptr = stage2_args; + *argptr++ = "/usr/bin/runinstall2"; + *argptr++ = "--method"; + *argptr++ = method_name; + *argptr++ = NULL; + + execv(stage2_args[0], stage2_args); + + printf("error in exec of stage2 :-("); + fatal_error(strerror(errno)); + + return 0; /* shut up compiler (we can't get here) */ } |