diff options
-rw-r--r-- | mdk-stage1/Makefile | 7 | ||||
-rw-r--r-- | mdk-stage1/Makefile.common | 4 | ||||
-rw-r--r-- | perl-install/any.pm | 5 | ||||
-rw-r--r-- | perl-install/bootloader.pm | 44 | ||||
-rw-r--r-- | perl-install/detect_devices.pm | 34 | ||||
-rw-r--r-- | perl-install/fs/mount_point.pm | 1 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 2 | ||||
-rwxr-xr-x | perl-install/standalone/bootloader-config | 9 | ||||
-rwxr-xr-x | perl-install/standalone/harddrake2 | 3 |
9 files changed, 100 insertions, 9 deletions
diff --git a/mdk-stage1/Makefile b/mdk-stage1/Makefile index 71a0332e4..38e059b8e 100644 --- a/mdk-stage1/Makefile +++ b/mdk-stage1/Makefile @@ -132,6 +132,9 @@ endif ifeq (x86_64, $(ARCH)) DIRS += pcmcia pcmcia-resource sysfs endif +ifeq (mips, $(ARCH)) +DIRS += sysfs +endif ifeq (i386,$(ARCH)) @@ -142,7 +145,9 @@ ifeq (x86_64,$(ARCH)) PCMCIA_LIB = pcmcia/libpcmcia.a sysfs/libsysfs.a PCMCIA_DEFS = -DENABLE_PCMCIA endif - +ifeq (mips,$(ARCH)) +PCMCIA_LIB = sysfs/libsysfs.a +endif USB_DEFS_GEN = -DENABLE_USB USB_DEFS = -DENABLE_USB -DDISABLE_PCIADAPTERS diff --git a/mdk-stage1/Makefile.common b/mdk-stage1/Makefile.common index fc4372851..95bc6d3cb 100644 --- a/mdk-stage1/Makefile.common +++ b/mdk-stage1/Makefile.common @@ -26,7 +26,11 @@ else F = NEWT endif +# diet libc syscalls are broken +ifneq (mips, $(ARCH)) DIET = $(shell test -x /usr/bin/diet && echo diet) +endif + ifeq ($(DIET), diet) #- default lib is dietlibc (honoured by main Makefile whenever possible) diff --git a/perl-install/any.pm b/perl-install/any.pm index fb73df348..3f300de90 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -205,6 +205,7 @@ sub setupBootloaderBefore { quiet => $quiet); $bootloader->{keytable} ||= keyboard::keyboard2kmap($keyboard); + log::l("setupBootloaderBefore end"); } sub setupBootloader { @@ -239,6 +240,10 @@ sub setupBootloaderUntilInstalled { sub installBootloader { my ($in, $b, $all_hds) = @_; return if detect_devices::is_xbox(); + + if (arch() =~ /mips/) { + return 1; + } install_bootloader_pkgs($in->do_pkgs, $b); eval { run_program::rooted($::prefix, 'echo | lilo -u') } if $::isInstall && !$::o->{isUpgrade} && -e "$::prefix/etc/lilo.conf" && glob("$::prefix/boot/boot.*"); diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index e1e107db8..bd85f8446 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -22,7 +22,7 @@ use modules; #-##################################################################################### #- Functions #-##################################################################################### -my $vmlinuz_regexp = 'vmlinuz|win4lin'; +my $vmlinuz_regexp = 'vmlinu[xz]|win4lin'; my $decompose_vmlinuz_name = qr/((?:$vmlinuz_regexp).*?)-(\d+\.\d+.*)/; sub expand_vmlinuz_symlink { @@ -57,7 +57,7 @@ sub kernel_str2short_name { sub basename2initrd_basename { my ($basename) = @_; - $basename =~ s!vmlinuz-?!!; #- here we do not use $vmlinuz_regexp since we explictly want to keep all that is not "vmlinuz" + $basename =~ s!vmlinu[zx]-?!!; #- here we do not use $vmlinuz_regexp since we explictly want to keep all that is not "vmlinuz" 'initrd' . ($basename ? "-$basename" : ''); } sub kernel_str2vmlinuz_long { @@ -188,7 +188,7 @@ sub read { if (m!/fd\d+$!) { warn "not checking the method on floppy, assuming $main_method is right\n"; $main_method; - } elsif (member($main_method, qw(yaboot cromwell silo))) { + } elsif (member($main_method, qw(yaboot cromwell silo pmon2000))) { #- not checking, there's only one bootloader anyway :) $main_method; } elsif (my $type = partition_table::raw::typeOfMBR($_)) { @@ -409,6 +409,11 @@ sub read_silo() { $bootloader->{method} = 'silo'; $bootloader; } +sub read_pmon2000() { + my %b; + $b{method} = 'pmon2000'; + \%b; +} sub read_cromwell() { my %b; $b{method} = 'cromwell'; @@ -724,6 +729,7 @@ sub add_kernel { #- new versions of yaboot do not handle symlinks $b_nolink ||= arch() =~ /ppc/; + $b_no_initrd //= arch() =~ /mips/ && !detect_devices::is_mips_gdium(); $b_nolink ||= $kernel_str->{use_long_name}; @@ -742,11 +748,25 @@ sub add_kernel { if (!$b_nolink) { $v->{kernel_or_dev} = '/boot/' . kernel_str2vmlinuz_short($kernel_str); - _do_the_symlink($bootloader, $v->{kernel_or_dev}, $vmlinuz_long); + if (arch() =~ /mips/) { + log::l("link $::prefix/boot/$vmlinuz_long -> $::prefix$v->{kernel_or_dev}"); + linkf("$::prefix/boot/$vmlinuz_long", $::prefix . $v->{kernel_or_dev}); + linkf("$::prefix/boot/$vmlinuz_long", $::prefix . $v->{kernel_or_dev} . ".32"); + } else { + _do_the_symlink($bootloader, $v->{kernel_or_dev}, $vmlinuz_long); + } if ($v->{initrd}) { $v->{initrd} = '/boot/' . kernel_str2initrd_short($kernel_str); - _do_the_symlink($bootloader, $v->{initrd}, $initrd_long); + if (arch() =~ /mips/) { + log::l("link $::prefix/boot/$initrd_long -> $::prefix$v->{initrd}"); + linkf("$::prefix/boot/$initrd_long", $::prefix . $v->{initrd}); + if ($v->{initrd} =~ s/.img$/.gz/) { + linkf("$::prefix/boot/$initrd_long", $::prefix . $v->{initrd}); + } + } else { + _do_the_symlink($bootloader, $v->{initrd}, $initrd_long); + } } } @@ -1157,6 +1177,7 @@ sub method_choices_raw { arch() =~ /ppc/ ? 'yaboot' : arch() =~ /ia64/ ? 'lilo' : arch() =~ /sparc/ ? 'silo' : + arch() =~ /mips/ ? 'pmon2000' : ( if_(!$b_prefix_mounted || whereis_binary('grub', $::prefix), 'grub-graphic', 'grub-menu'), @@ -1320,6 +1341,19 @@ sub when_config_changed_yaboot { run_program::rooted($::prefix, "/usr/sbin/ybin", "2>", \$error) or die "ybin failed: $error"; } +sub install_pmon2000 { + my ($_bootloader, $_all_hds) = @_; + log::l("Mips/pmon2000 - nothing to install..."); +} +sub write_pmon2000 { + my ($_bootloader, $_all_hds) = @_; + log::l("Mips/pmon2000 - nothing to write..."); +} +sub when_config_changed_pmon2000 { + my ($_bootloader) = @_; + log::l("Mips/pmon2000 - nothing to do..."); +} + sub install_cromwell { my ($_bootloader, $_all_hds) = @_; log::l("XBox/Cromwell - nothing to install..."); diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 40a1b8236..c8995ea82 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -54,6 +54,9 @@ sub floppies { require modules; state @fds; state $legacy_already_detected; + if (arch =~ /mips/) { + $o_not_detect_legacy_floppies = 1; + } if (!$o_not_detect_legacy_floppies && !$legacy_already_detected) { $legacy_already_detected = 1; eval { modules::load("floppy") if $::isInstall }; @@ -574,7 +577,14 @@ sub getSerialModem { my ($modules_conf, $o_mouse) = @_; my $mouse = $o_mouse || {}; $mouse->{device} = readlink "/dev/mouse"; - my $serdev = arch() =~ /ppc/ ? "macserial" : "serial"; + my $serdev; + if (arch() =~ /ppc/) { + $serdev = "macserial"; + } elsif (arch() =~ /mips/) { + $serdev = "8250"; + } else { + $serdev = "serial"; + } eval { modules::load($serdev) }; my @modems; @@ -1145,11 +1155,30 @@ sub BIGMEM() { sub is_i586() { my $cpuinfo = cat_('/proc/cpuinfo'); + if (arch() !~ /86/) { + return 0; + } $cpuinfo =~ /^cpu family\s*:\s*(\d+)/m && $1 < 6 || $cpuinfo =~ /^model name\s*:\s*Transmeta.* TM5800/m || # mdvbz#37866 !has_cpu_flag('cmov'); } +sub is_mips_lemote() { + to_bool(cat_('/proc/cpuinfo') =~ /lemote/); +} + +sub is_mips_ict() { + to_bool(cat_('/proc/cpuinfo') =~ /ict/); +} + +sub is_mips_gdium() { + to_bool(cat_('/proc/cpuinfo') =~ /gdium/); +} + +sub is_mips_st_ls2f() { + to_bool(cat_('/proc/cpuinfo') =~ /st-ls2f/); +} + sub is_xbox() { any { $_->{vendor} == 0x10de && $_->{id} == 0x02a5 } pci_probe(); } @@ -1183,6 +1212,9 @@ sub has_cpu_flag { sub matching_types() { +{ + mips_lemote => is_mips_lemote(), + mips_ict => is_mips_ict(), + mips_st_ls2f => is_mips_st_ls2f(), laptop => isLaptop(), 'touchpad' => hasTouchpad(), '64bit' => to_bool(arch() =~ /64/), diff --git a/perl-install/fs/mount_point.pm b/perl-install/fs/mount_point.pm index 5854d4ebe..4a73c197f 100644 --- a/perl-install/fs/mount_point.pm +++ b/perl-install/fs/mount_point.pm @@ -13,6 +13,7 @@ sub guess_mount_point { my %l = ( '/' => 'etc/fstab', '/boot' => 'vmlinuz', + '/boot' => 'vmlinux', '/tmp' => '.X11-unix', '/usr' => 'src', '/var' => 'spool', diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index fabd19edb..68749a435 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -36,7 +36,7 @@ sub read_rpmsrate_raw { my ($t, $flag, @l2); while ($data =~ /^(( - [1-5] + [1-6] | (?: (?: !\s*)? [0-9A-Z_]+(?:".*?")?) (?: \s*\|\|\s* (?: !\s*)? [0-9A-Z_]+(?:".*?")?)* diff --git a/perl-install/standalone/bootloader-config b/perl-install/standalone/bootloader-config index 1eea36be8..4306a5e44 100755 --- a/perl-install/standalone/bootloader-config +++ b/perl-install/standalone/bootloader-config @@ -54,7 +54,14 @@ if ($image) { } $image = "/boot/$image" if $image !~ m!^/!; } elsif ($kernel_version) { - $image = "/boot/vmlinuz-$kernel_version"; + # FIXME : test for vmlinux or vmlinuz existence and choose + # instead of using arch() + if (arch() =~ /mips/) { + $image = "/boot/vmlinux-$kernel_version"; + } + else { + $image = "/boot/vmlinuz-$kernel_version"; + } } diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2 index f9905e232..e1a4e99bb 100755 --- a/perl-install/standalone/harddrake2 +++ b/perl-install/standalone/harddrake2 @@ -69,6 +69,8 @@ my %fields = }, CPU => { + "system type" => [ "Sytem Type", "Name of the system" ], + "BogoMIPS" => [ N("Bogomips"), N("the GNU/Linux kernel needs to run a calculation loop at boot time to initialize a timer counter. Its result is stored as bogomips as a way to \"benchmark\" the cpu.") ], "bogomips" => [ N("Bogomips"), N("the GNU/Linux kernel needs to run a calculation loop at boot time to initialize a timer counter. Its result is stored as bogomips as a way to \"benchmark\" the cpu.") ], "cache size" => [ N("Cache size"), N("size of the (second level) cpu cache") ], "cpu family" => [ N("Cpuid family"), N("family of the cpu (eg: 6 for i686 class)") ], @@ -83,6 +85,7 @@ my %fields = "level" => [ N("Level"), N("sub generation of the cpu") ], "model" => [ N("Model"), N("generation of the cpu (eg: 8 for Pentium III, ...)") ], "model name" => [ N("Model name"), N("official vendor name of the cpu") ], + "cpu model" => [ N("Model name"), N("official vendor name of the cpu") ], "name" => [ N("Name"), N("the name of the CPU") ], "processor" => [ N("Processor ID"), N("the number of the processor") ], "stepping" => [ N("Model stepping"), N("stepping of the cpu (sub model (generation) number)") ], |