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 | |
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
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | kernel/modules.pl | 1 | ||||
-rwxr-xr-x | kernel/update_kernel | 2 | ||||
-rwxr-xr-x | make_boot_img | 17 | ||||
-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 |
8 files changed, 67 insertions, 25 deletions
@@ -7,7 +7,7 @@ ARCH := $(patsubst i%86,i386,$(shell uname -m)) ARCH := $(patsubst sparc%,sparc,$(ARCH)) ifeq (i386,$(ARCH)) - BOOT_IMG = cdrom.img hd.img network.img usb.img blank.img pcmcia.img other.img + BOOT_IMG = cdrom.img hd.img network.img usb.img blank.img pcmcia.img other.img ka.img endif ifeq (sparc,$(ARCH)) BOOT_IMG = cdrom.img hd.img network.img live.img tftp.img tftprd.img diff --git a/kernel/modules.pl b/kernel/modules.pl index 6e8f04307..7413809ab 100644 --- a/kernel/modules.pl +++ b/kernel/modules.pl @@ -43,6 +43,7 @@ my @skip_modules_on_stage1 = ( ); my %images = ( + ka => 'fs/network network/raw bus/pcmcia network/main', network => 'fs/network network/raw bus/pcmcia network/main', hd => 'disk/raw fs/local|loopback disk/scsi|hardware_raid', other => 'disk/scsi|hardware_raid network/main ONLY_BIG fs/cdrom disk/cdrom|raw fs/network network/raw', diff --git a/kernel/update_kernel b/kernel/update_kernel index 9cea09e7d..8ab1d2e5d 100755 --- a/kernel/update_kernel +++ b/kernel/update_kernel @@ -29,7 +29,7 @@ function create_modules() { ls *.o | packdrake -b9s "modules.cz" 400000 echo "done" mv modules.cz ../modules.cz-$kern - for i in network cdrom hd usb other pcmcia all; do + for i in network cdrom hd usb other pcmcia all ka; do modules_var="${i}_modules" eval "create_marfile ${i}_modules.mar \$$modules_var" done diff --git a/make_boot_img b/make_boot_img index 269be0e5a..ca1c4a004 100755 --- a/make_boot_img +++ b/make_boot_img @@ -1,6 +1,6 @@ #!/usr/bin/perl -@ARGV >= 2 or die "usage: $0 <image> all|other|cdrom|hd|network|usb|blank|pcmcia|live|tftp|tftprd\n"; +@ARGV >= 2 or die "usage: $0 <image> all|other|cdrom|hd|network|usb|blank|pcmcia|live|tftp|tftprd|ka\n"; use Config; use MDK::Common; @@ -41,6 +41,7 @@ $install = $ {{ tftprd => "stage1-full", pcmcia => "stage1-full", network => "stage1-network", + ka => "stage1-network", usb => "stage1-usb", cdrom => "stage1-cdrom", hd => "stage1-disk", @@ -94,10 +95,17 @@ sub initrd { my ($mnt, $img) = @_; my ($ltype, $I) = $type =~ /(.*?)(64)/; $ltype ||= $type; my $tmp = "$ENV{HOME}/tmp/initrd"; - my $tar = "$instdir/stage1-data/stage1.tar.bz2"; + my $tar = ""; + if ($type eq "ka") { + $tar = "$instdir/stage1-data/stage1-with-kadeploy.tar.bz2"; + $mke2fs = $mke2fs . " -N 700"; + } + else { + $tar = "$instdir/stage1-data/stage1.tar.bz2"; + } __ "$sudo umount $tmp $mnt 2>/dev/null"; - _ "dd if=/dev/zero of=$tmp bs=1k count=" . ($arch =~ /ia64/ ? ($type eq "all" ? 16386 : 16384) : ($type eq "all" ? 4000 : 2000)); + _ "dd if=/dev/zero of=$tmp bs=1k count=" . ($arch =~ /ia64/ ? ($type eq "all" ? 16386 : 16384) : ($type eq "ka" ? 2400 : ($type eq "all" ? 4000 : 2000))); _ "$mke2fs $tmp"; _ "$sudo mount -t ext2 $tmp $mnt -o loop"; @@ -123,6 +131,7 @@ sub initrd { $modz = "kernel/all.modules$I/$ext"; _ "$sudo cp -f $modz/${ltype}_modules.mar $mnt/modules/modules$I.mar" if $type !~ /blank/; _ "$sudo cp -f $modz/modules.dep $mnt/modules/"; + _ "$sudo cp -f $modz/ext3.o $modz/jbd.o $mnt/modules" if $type eq "ka"; _ "$sudo umount $mnt"; @@ -168,7 +177,7 @@ sub boot_img_i386 { if ($type eq "hd") { _ "bunzip2 -c $instdir/init-data/msgboot.img.bz2 > $img"; - } elsif ($type eq "all") { + } elsif ($type eq "all" || $type eq "ka") { _ "bunzip2 -c $instdir/init-data/msgboot-graphicallogo-2880.img.bz2 > $img"; } elsif ($type eq "blank") { _ "bunzip2 -c $instdir/init-data/msgboot-blank.img.bz2 > $img"; 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) |