diff options
author | Erwan Velu <erwan@mandriva.org> | 2002-10-30 17:22:17 +0000 |
---|---|---|
committer | Erwan Velu <erwan@mandriva.org> | 2002-10-30 17:22:17 +0000 |
commit | 8785f12640289bff4b9c34e11c5fd961afdd0adc (patch) | |
tree | 7b95218c56e6b60307160cabd0ff626a30868f41 /mdk-stage1 | |
parent | 74fc81889d7fc79c35db551056299cc322269fbc (diff) | |
download | drakx-8785f12640289bff4b9c34e11c5fd961afdd0adc.tar drakx-8785f12640289bff4b9c34e11c5fd961afdd0adc.tar.gz drakx-8785f12640289bff4b9c34e11c5fd961afdd0adc.tar.bz2 drakx-8785f12640289bff4b9c34e11c5fd961afdd0adc.tar.xz drakx-8785f12640289bff4b9c34e11c5fd961afdd0adc.zip |
Applying patch from 8.2, ka.img is working fine in old mode
Diffstat (limited to 'mdk-stage1')
-rw-r--r-- | mdk-stage1/network.c | 23 | ||||
-rw-r--r-- | mdk-stage1/network.h | 2 | ||||
-rw-r--r-- | mdk-stage1/stage1.c | 43 | ||||
-rw-r--r-- | mdk-stage1/stage1.h | 2 |
4 files changed, 51 insertions, 19 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index ef9dd2814..d4517883d 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -46,6 +46,7 @@ #include "network.h" +int kadeploy=0; static void error_message_net(void) /* reduce code size */ { @@ -187,6 +188,7 @@ char * domain = NULL; struct in_addr gateway = { 0 }; struct in_addr dns_server = { 0 }; struct in_addr dns_server2 = { 0 }; +struct in_addr next_server = { 0 }; static int add_default_route(void) { @@ -823,7 +825,7 @@ enum return_type http_prepare(void) return RETURN_ERROR; method_name = strdup("http"); - sprintf(location_full, "http://%s%s", answers[0], answers[1]); + sprintf(location_full, "http://%s/%s", answers[0], answers[1]); add_to_env("URLPREFIX", location_full); } while (results == RETURN_BACK); @@ -831,3 +833,22 @@ enum return_type http_prepare(void) return RETURN_OK; } + +enum return_type ka_prepare(void) +{ + kadeploy=1; /* We are in a ka deploy mode*/ + enum return_type results = intf_select_and_up(); + + FILE *f = fopen ("/ka/tftpserver","w"); + if (f != NULL) + { fprintf(f,"%s\n",inet_ntoa(next_server)); + fclose(f); + } + + if (results != RETURN_OK) + return results; + + method_name = strdup("ka"); + return RETURN_OK; +} + diff --git a/mdk-stage1/network.h b/mdk-stage1/network.h index 02eea45b6..5932c58f1 100644 --- a/mdk-stage1/network.h +++ b/mdk-stage1/network.h @@ -30,7 +30,7 @@ enum return_type nfs_prepare(void); enum return_type ftp_prepare(void); enum return_type http_prepare(void); - +enum return_type ka_prepare(void); enum boot_proto_type { BOOTPROTO_STATIC, BOOTPROTO_DHCP, BOOTPROTO_ADSL_PPPOE }; diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index 44ed25155..d47cdf316 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -323,6 +323,7 @@ static enum return_type method_select_and_prepare(void) char * network_nfs_install = "NFS server"; char * network_nfs_install_auto = "nfs"; char * network_ftp_install = "FTP server"; char * network_ftp_install_auto = "ftp"; char * network_http_install = "HTTP server"; char * network_http_install_auto = "http"; + char * network_ka_install = "KA installation"; char * network_ka_install_auto = "ka"; #endif i = 0; @@ -330,6 +331,7 @@ static enum return_type method_select_and_prepare(void) means[i] = network_nfs_install; means_auto[i++] = network_nfs_install_auto; means[i] = network_ftp_install; means_auto[i++] = network_ftp_install_auto; means[i] = network_http_install; means_auto[i++] = network_http_install_auto; + means[i] = network_ka_install; means_auto[i++] = network_ka_install_auto; #endif #ifndef DISABLE_CDROM means[i] = cdrom_install; means_auto[i++] = cdrom_install_auto; @@ -365,6 +367,9 @@ static enum return_type method_select_and_prepare(void) if (!strcmp(choice, network_http_install)) results = http_prepare(); + + if (!strcmp(choice, network_ka_install)) + results = ka_prepare(); #endif if (results != RETURN_OK) @@ -439,23 +444,29 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)) return 66; if (IS_TESTING) return 0; - + argptr = stage2_args; - *argptr++ = "/usr/bin/runinstall2"; - *argptr++ = "--method"; - *argptr++ = method_name; -#ifdef ENABLE_PCMCIA - if (pcmcia_adapter) { - *argptr++ = "--pcmcia"; - *argptr++ = pcmcia_adapter; - } -#endif - if (disable_modules) - *argptr++ = "--blank"; - if (stage2_kickstart) { - *argptr++ = "--kickstart"; - *argptr++ = stage2_kickstart; - } + if ( kadeploy == 0) { + *argptr++ = "/usr/bin/runinstall2"; + *argptr++ = "--method"; + *argptr++ = method_name; + #ifdef ENABLE_PCMCIA + if (pcmcia_adapter) { + *argptr++ = "--pcmcia"; + *argptr++ = pcmcia_adapter; + } + #endif + if (disable_modules) + *argptr++ = "--blank"; + if (stage2_kickstart) { + *argptr++ = "--kickstart"; + *argptr++ = stage2_kickstart; + } + } +else { + *argptr++ = "/etc/rc.sysinit"; +} + *argptr++ = NULL; execve(stage2_args[0], stage2_args, grab_env()); diff --git a/mdk-stage1/stage1.h b/mdk-stage1/stage1.h index 8b26fd947..6cda65bf6 100644 --- a/mdk-stage1/stage1.h +++ b/mdk-stage1/stage1.h @@ -31,7 +31,7 @@ extern char * method_name; extern char * interactive_fifo; extern char * stage2_kickstart; - +int kadeploy; #define MODE_TESTING (1 << 0) #define MODE_EXPERT (1 << 1) #define MODE_RESCUE (1 << 3) |