diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Makefile | 16 | ||||
-rw-r--r-- | perl-install/common.pm | 16 | ||||
-rw-r--r-- | perl-install/devices.pm | 4 | ||||
-rw-r--r-- | perl-install/fsedit.pm | 3 | ||||
-rw-r--r-- | perl-install/install2.pm | 21 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 4 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 27 | ||||
-rw-r--r-- | perl-install/modules.pm | 45 | ||||
-rw-r--r-- | perl-install/my_gtk.pm | 4 | ||||
-rw-r--r-- | perl-install/run_program.pm | 2 | ||||
-rw-r--r-- | perl-install/share/diskdrake.rc | 2 | ||||
-rw-r--r-- | perl-install/share/list | 1 |
12 files changed, 97 insertions, 48 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index cd103b0c2..71e122a49 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -1,3 +1,4 @@ +VERSION = 2.2.11-1mdkBOOT SO_FILES = c/blib/arch/auto/c/c.so PMS = *.pm c/*.pm resize_fat/*.pm po/*.pm pci_probing/*.pm commands install2 diskdrake ROOTDEST = /export @@ -92,7 +93,7 @@ get_needed_files: $(SO_FILES) # export PERL_INSTALL_TEST=1 ; strace -f -e trace=file -o '| grep -v "(No such file or directory)" | sed -e "s/[^\"]*\"//" -e "s/\".*//" | grep "^/" | grep -v -e "^/tmp" -e "^/home" -e "^/proc" -e "^/var" -e "^/dev" -e "^/etc" -e "^/usr/lib/rpm" > /tmp/list ' $(PERL) -d install2 < /dev/null cp -f list /tmp/list for i in c/blib/arch/auto/c/c.so $(LOCALFILES) `cat /tmp/list` ; do \ - ldd $$i 2>/dev/null | sed -e 's/.*=> //' -e 's/ .*//' | uniq | sort >> /tmp/list; \ + ldd $$i 2>/dev/null | grep -v "not a dynamic" | sed -e 's/.*=> //' -e 's/ .*//' | uniq | sort >> /tmp/list; \ done install -d $(DEST)/lib @@ -104,12 +105,12 @@ get_needed_files: $(SO_FILES) install -s $(LOCALFILES) $(DEST)/usr/bin for i in `cat /tmp/list`; do \ - if (echo $$i | grep "lib/[^/]*\.so"); then \ + if (echo $$i | grep -q "lib/[^/]*\.so"); then \ install -s $$i $(DEST)/lib; \ else \ d=`echo $(DEST)/$$i | sed 's/\/usr\/local\//\/usr\//'`; \ install -d `dirname $$d` && \ - if (echo $$i | grep "\.pm"); then \ + if (echo $$i | grep -q "\.pm"); then \ perl -pe '$$_ eq "__END__" and exit(0);' $$i > $$d; \ else \ cp -f $$i $$d; \ @@ -132,6 +133,11 @@ get_needed_files: $(SO_FILES) cp MonitorsDB $(DEST)/usr/share cp compss $(ROOTDEST)/Mandrake/base + install -d $(DEST)/lib/modules + (cd /lib/modules/$(VERSION) ; \ + cp `find -name "*.o"` $(DEST)/lib/modules ; \ + /sbin/depmod -m /boot/System.map-$(VERSION) -i -e *.o | grep ': ' | sed 's/\.o//g' > $(DEST)/lib/modules/modules.dep) + ln -s install2 $(DEST)/usr/bin/runinstall2 # echo -e "#!/bin/sh\n\nexec '/usr/bin/sh'" > $(DEST)/usr/bin/runinstall2 # chmod a+x $(DEST)/usr/bin/runinstall2 @@ -151,8 +157,8 @@ full_stage2: stage2: $(MAKE) install_pms - cd $(ROOTDEST) ; tar cfz /tmp/instimage-full.tgz Mandrake - cd $(ROOTDEST) ; tar cfz /tmp/instimage-light.tgz Mandrake/base/compss Mandrake/instimage/usr/[bl]* +# cd $(ROOTDEST) ; tar cfz /tmp/instimage-full.tgz Mandrake +# cd $(ROOTDEST) ; tar cfz /tmp/instimage-light.tgz Mandrake/base/compss Mandrake/instimage/usr/[bl]* @#rm -rf /mnt/initrd/* @#cp -a $(DEST)/* /mnt/initrd diff --git a/perl-install/common.pm b/perl-install/common.pm index 9a21b7b57..77567726a 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -6,7 +6,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int @ISA = qw(Exporter); %EXPORT_TAGS = ( - common => [ qw(__ min max sum sign product bool ikeys member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate) ], + common => [ qw(__ min max sum sign product bool ikeys member divide is_empty_array_ref add2hash set_new set_add round_up round_down first second top uniq translate untranslate warp_text) ], functional => [ qw(fold_left difference2) ], file => [ qw(dirname basename touch all glob_ cat_ chop_ mode) ], system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ crypt_ getVarsFromSh) ], @@ -129,6 +129,20 @@ sub untranslate($@) { die "untranslate failed"; } +sub warp_text($;$) { + my ($text, $width) = shift; + $width ||= 80; + + my ($t, @l); foreach (split /(\s+)/, $text) { + if (length "$t$_" > $width) { + push @l, $t; + $t = ''; + } + $t .= $_; + } + @l, $t; +} + sub getVarsFromSh($) { my %l; local *F; diff --git a/perl-install/devices.pm b/perl-install/devices.pm index 9346b687e..ac72bc3ed 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -47,10 +47,10 @@ sub make($) { -e $file and return $file; # assume nobody takes fun at creating files named as device - if (/^sd(.)(\d\d)/) { + if (/^sd(.)(\d{0,2})/) { $type = c::S_IFBLK(); $major = 8; - $minor = ord($1) - ord('a') + $2; + $minor = ord($1) - ord('a') + ($2 || 0); } elsif (/^hd(.)(\d{0,2})/) { $type = c::S_IFBLK(); ($major, $minor) = diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index 56bb59490..8edde60bc 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -22,13 +22,14 @@ my @suggestions = ( { mntpoint => "/tmp", minsize => 50 << 11, size => 100 << 11, type => 0x83 }, { mntpoint => "/mnt/iso", minsize => 700 << 11, size => 800 << 11, type => 0x83 }, ); +my @suggestions_mntpoints = qw(/mnt/dos); 1; sub suggestions_mntpoint($) { my ($hds) = @_; - grep { !/swap/ && !has_mntpoint($_, $hds) } map { $_->{mntpoint} } @suggestions; + @suggestions_mntpoints, grep { !/swap/ && !has_mntpoint($_, $hds) } map { $_->{mntpoint} } @suggestions; } sub hds($$) { diff --git a/perl-install/install2.pm b/perl-install/install2.pm index d951ec570..41b4e3a65 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -90,7 +90,7 @@ my @serverPartitioning = ( ); my $default = { -# display => "jaba:1", +# display => "192.168.1.9:0", user => { name => 'foo', password => 'foo', shell => '/bin/bash', realname => 'really, it is foo' }, rootPassword => 'toto', lang => 'fr', @@ -129,20 +129,12 @@ sub selectInstallClass { $::expert = $o->{installClass} eq "expert"; } -sub setupSCSI { - $o->{direction} < 0 && detect_devices::hasSCSI() and return; - - # If we have any scsi adapters configured from earlier, then don't bother asking again - while (my ($k, $v) = each %modules::loaded) { - $v->{type} eq 'scsi' and return; - } -# $o->setupSCSIInterfaces(0, \%modules::loaded, $o->{hints}->{flags}->{autoscsi}, $o->{direction}); -} +sub setupSCSI { $o->setupSCSI } sub partitionDisks { $o->{drives} = [ detect_devices::hds() ]; $o->{hds} = fsedit::hds($o->{drives}, $o->{default}->{partitionning}); - @{$o->{hds}} > 0 or die _"An error has occurred - no valid devices were found on which to create new filesystems. Please check your hardware for the cause of this problem"; + @{$o->{hds}} > 0 or die _("An error has occurred - no valid devices were found on which to create new filesystems. Please check your hardware for the cause of this problem"); unless ($o->{isUpgrade}) { $o->doPartitionDisks($o->{hds}); @@ -161,7 +153,7 @@ sub partitionDisks { $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}) ]; my $root_fs; map { $_->{mntpoint} eq '/' and $root_fs = $_ } @{$o->{fstab}}; - $root_fs or die _"partitionning failed: no root filesystem"; + $root_fs or die _("partitionning failed: no root filesystem"); } @@ -230,6 +222,7 @@ sub main { # if this fails, it's okay -- it might help with free space though unlink "/sbin/install"; + unlink "/sbin/insmod"; print STDERR "in second stage install\n"; log::openLog(($::testing || $o->{localInstall}) && 'debug.log'); @@ -257,7 +250,7 @@ sub main { $o->{intf} = net::readNetInterfaceConfig($file); } - modules::load_deps("/modules/modules.dep"); + modules::load_deps("/lib/modules/modules.dep"); modules::read_conf("/tmp/conf.modules"); for (my $step = $o->{steps}->{first}; $step ne 'done'; $step = getNextStep($step)) { @@ -265,7 +258,7 @@ sub main { eval { &{$install2::{$step}}(); }; - $o->errorInStep($@) if $@; + $o->errorInStep($@), redo if $@; $o->leavingStep($step); } killCardServices(); diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 22f75f715..64854e6e3 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -48,8 +48,8 @@ sub selectInstallOrUpgrade($) { sub selectInstallClass($@) { $o->{default}->{installClass} || $_[1]; } -sub setupSCSIInterfaces { - die "TODO"; +sub setupSCSI { + modules::load_thiskind('scsi'); } sub doPartitionDisks($$) { diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 106d56c96..e34a82d83 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -29,6 +29,7 @@ use vars qw(@ISA); use common qw(:common); use partition_table qw(:types); use install_steps; +use modules; use lang; use log; @@ -62,6 +63,23 @@ sub selectInstallClass($@) { [ @classes ]); } +sub setupSCSI { + my ($o) = @_; + my @l = modules::load_thiskind('scsi'); + while (1) { + @l ? + $o->ask_yesorno('', + [ _("Found ") . join(", ", map { $_->[0] } @l) . _(" scsi interfaces"), + _("Do you have another one?") ]) : + $o->ask_yesorno('', _("Do you have an scsi interface?")) or return; + + my $l = $o->ask_from_list('', _("What scsi card have you?"), [ modules::text_of_type('scsi') ]) or return; + my $m = modules::text2driver($l); + modules::load($m); + push @l, [ $l, $m ]; + } +} + sub rebootNeeded($) { my ($o) = @_; $o->ask_warn('', _("You need to reboot for the partition table modifications to take place")); @@ -82,18 +100,19 @@ sub choosePartitionsToFormat($$) { sub createBootdisk($) { my ($o) = @_; - $o->{default}->{mkbootdisk} = $o->ask_yesorno('', + if ($o->{default}->{mkbootdisk} = $o->ask_yesorno('', _("A custom bootdisk provides a way of booting into your Linux system without depending on the normal bootloader. This is useful if you don't want to install lilo on your system, or another operating system removes lilo, or lilo doesn't work with your hardware configuration. A custom bootdisk can also be used with the Mandrake rescue image, making it much easier to recover from severe system -failures. Would you like to create a bootdisk for your system?")); +failures. Would you like to create a bootdisk for your system?"))) { - $o->ask_warn('', + $o->ask_warn('', _("Insert a floppy in drive fd0 (aka A:)")); - $o->SUPER::createBootdisk; + $o->SUPER::createBootdisk; + } } sub setupBootloader($) { diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 6f6f5976e..8c59b3431 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -199,6 +199,21 @@ foreach (@drivers_by_category) { 1; +sub text_of_type($) { + my ($type) = @_; + + map { $_->[0] } grep { $_->[3] eq $type } values %drivers; +} + +sub text2driver($) { + my ($text) = @_; + while (my ($k, $v) = each %drivers) { + $v->[0] eq $text and return $k; + } + die "$text is not a valid module description"; +} + + sub load($;$$) { my ($name, $type, $minor) = @_; @@ -216,8 +231,11 @@ sub load_raw($$$@) { my ($name, $type, $minor, @options) = @_; # @options or @options = guiGetModuleOptions($name); + my $m = "/modules/$name.o"; + -r $m or $m = "/lib$m"; + -r $m or die "can't find module $name"; - run_program::run("insmod", "/modules/$name.o", @options) or die("insmod $name failed"); + run_program::run("insmod", $m, @options) or die("insmod $name failed"); # this is a hack to make plip go if ($name eq "parport_pc") { @@ -293,25 +311,20 @@ sub load_thiskind($) { my @devs; my $found; - log::l("in load_thiskind, type = $type"); - - unless ($type eq 'scsi' || $type eq 'net') { - log::l("pci probing for $type devices"); - @devs = pci::probe($type); - log::l("pci probe found " . scalar @devs . "$type devices"); + if ($type eq 'scsi' || $type eq 'net') { + @devs = pci_probing::main::probe($type); + log::l("pci probe found " . scalar @devs . " $type devices"); } my %devs; - foreach (@devs) { - my $m = $_->{module}; - $devs{$m}++ and log::l("multiple $m devices found"), next; - $drivers{$m} or log::l("module $m not in install table"), next; - log::l("found driver for $m"); - load($m); - $found = 1; + foreach (map { $_->[1] } @devs) { + $devs{$_}++ and log::l("multiple $_ devices found"), next; + $drivers{$_} or log::l("module $_ not in install table"), next; + log::l("found driver for $_"); + load($_); + $found = $_; } - pci::free(@devs); - $found; + @devs; } # This assumes only one of each driver type is loaded diff --git a/perl-install/my_gtk.pm b/perl-install/my_gtk.pm index 09feb7c19..2fdfdda19 100644 --- a/perl-install/my_gtk.pm +++ b/perl-install/my_gtk.pm @@ -175,8 +175,10 @@ sub create_okcancel($;$$) { sub create_box_with_title($@) { my $o = shift; + + @_ = map { warp_text($_) } @_; $o->{box} = gtkpack_(new Gtk::VBox(0,0), - map({ + map({ my $w = ref $_ ? $_ : new Gtk::Label($_); $w->set_name("Title"); 0, $w; diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm index 54887f882..15394a1be 100644 --- a/perl-install/run_program.pm +++ b/perl-install/run_program.pm @@ -9,7 +9,7 @@ use log; sub run($@) { rooted('', @_) } -sub rooted($$@) { +sub rooted { my ($root, $name, @args) = @_; log::l("running: $name @args" . ($root ? " with root $root" : "")); diff --git a/perl-install/share/diskdrake.rc b/perl-install/share/diskdrake.rc index 77ac9e890..6d315056e 100644 --- a/perl-install/share/diskdrake.rc +++ b/perl-install/share/diskdrake.rc @@ -24,6 +24,6 @@ style "white" = "font" } widget "*Linux*" style "red" -widget "GtkWindow.Gtk*Linux swap" style "green" +widget "*Linux swap" style "green" widget "*FAT*" style "blue" widget "*Empty*" style "white" diff --git a/perl-install/share/list b/perl-install/share/list index 2a5c7f5d3..301cbb4a7 100644 --- a/perl-install/share/list +++ b/perl-install/share/list @@ -1,4 +1,5 @@ /bin/ash +/sbin/insmod /sbin/mke2fs /usr/lib/rpm/rpmrc /usr/X11R6/bin/xmodmap |