diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-02-25 22:57:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-02-25 22:57:02 +0000 |
commit | 72773c093a93d451093804f28b28325d3ee9ce54 (patch) | |
tree | 66e79b6a515ccdfda314e84274a74e20416fefc0 | |
parent | 53281b366d1d93da8963590a0c9e65bd496eb4aa (diff) | |
download | drakx-72773c093a93d451093804f28b28325d3ee9ce54.tar drakx-72773c093a93d451093804f28b28325d3ee9ce54.tar.gz drakx-72773c093a93d451093804f28b28325d3ee9ce54.tar.bz2 drakx-72773c093a93d451093804f28b28325d3ee9ce54.tar.xz drakx-72773c093a93d451093804f28b28325d3ee9ce54.zip |
use ide-scsi for ide zips
-rw-r--r-- | perl-install/detect_devices.pm | 89 | ||||
-rw-r--r-- | perl-install/fs.pm | 5 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 4 | ||||
-rw-r--r-- | perl-install/modules.pm | 1 |
4 files changed, 56 insertions, 43 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 0ea650e1f..2470d7aae 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -21,6 +21,9 @@ my %serialprobe = (); #-###################################################################################### #- Functions #-###################################################################################### +sub dev_is_devfs { -e "/dev/.devfsd" } + + sub get { #- Detect the default BIOS boot harddrive is kind of tricky. We may have IDE, #- SCSI and RAID devices on the same machine. From what I see so far, the default @@ -31,51 +34,43 @@ sub get { getIDE(), getSCSI(), getDAC960(), getCompaqSmartArray(), getATARAID(); } -sub hds() { grep { $_->{media_type} eq 'hd' && ($::isStandalone || !isRemovableDrive($_)) } get(); } -sub zips() { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } get(); } -sub ide_zips() { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } getIDE(); } -#-sub jazzs() { grep { member($_->{media_type}, 'fd', 'hd') && isJazDrive($_) } get(); } -sub ls120s() { grep { member($_->{media_type}, 'fd', 'hd') && isLS120Drive($_) } get(); } -sub cdroms() { - my @l = grep { $_->{media_type} eq 'cdrom' } get(); - if (my @l2 = IDEburners()) { +sub hds { grep { $_->{media_type} eq 'hd' && ($::isStandalone || !isRemovableDrive($_)) } get() } +sub cdroms { grep { $_->{media_type} eq 'cdrom' } get() } +sub burners { grep { $_->{media_type} eq 'cdrom' && isBurner($_) } get() } +sub dvdroms { grep { $_->{media_type} eq 'cdrom' && isDvdDrive($_) } get() } +sub zips { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } get() } +#-sub jazzs { grep { member($_->{media_type}, 'fd', 'hd') && isJazDrive($_) } get() } +sub ls120s { grep { member($_->{media_type}, 'fd', 'hd') && isLS120Drive($_) } get() } + +sub cdroms__faking_ide_scsi { + my @l = cdroms(); + return @l if $::isStandalone; + if (my @l_ide = grep { $_->{interface_type} eq 'ide' && isBurner($_) } @l) { require modules; modules::add_alias('scsi_hostadapter', 'ide-scsi'); my $nb = 1 + max(-1, map { $_->{device} =~ /scd(\d+)/ } @l); - foreach my $i (@l2) { - log::l("IDEBurner: $i->{device}"); - my ($e) = grep { $_->{device} eq $i->{device} } @l; + foreach my $e (@l_ide) { + log::l("IDEBurner: $e->{device}"); $e->{device} = "scd" . $nb++; } } @l; } -sub burners { grep { $_->{media_type} eq 'cdrom' && isBurner($_) } get() } -sub IDEburners { grep { $_->{media_type} eq 'cdrom' && isBurner($_) } getIDE() } -sub dvdroms { grep { $_->{media_type} eq 'cdrom' && isDvdDrive($_) } get() } - -sub get_mac_model() { - my $mac_model = cat_("/proc/device-tree/model") || die "Can't open /proc/device-tree/model"; - log::l("Mac model: $mac_model"); - $mac_model; -} - -sub get_mac_generation() { - my $generation = cat_("/proc/cpuinfo") || die "Can't open /proc/cpuinfo"; - my @genarray = split(/\n/, $generation); - my $count = 0; - while ($count <= @genarray) { - if ($genarray[$count] =~ /pmac-generation/) { - @genarray = split(/:/, $genarray[$count]); - return $genarray[1]; +sub zips__faking_ide_scsi { + my @l = zips(); + return @l if $::isStandalone; + if (my @l_ide = grep { $_->{interface_type} eq 'ide' } @l) { + require modules; + modules::add_alias('scsi_hostadapter', 'ide-scsi'); + my $nb = 1 + max(-1, map { if_($_->{device} =~ /sd(\s+)/, ord($1) - ord('a')) } getSCSI()); + foreach my $e (@l_ide) { + log::l("IDE Zip: $e->{device}"); + $e->{device} = "sd" . chr(ord('a') + $nb++); } - $count++; } - return "Unknown Generation"; + @l; } -sub dev_is_devfs { -e "/dev/.devfsd" } - sub floppies() { require modules; eval { modules::load("floppy") }; @@ -194,7 +189,7 @@ sub getIDE() { my $info = chomp_(cat_("$d/model")) || "(none)"; my $num = ord (($d =~ /(.)$/)[0]) - ord 'a'; - push @idi, { media_type => $type, device => basename($d), info => $info, bus => $num/2, id => $num%2 }; + push @idi, { media_type => $type, device => basename($d), info => $info, bus => $num/2, id => $num%2, interface_type => 'ide' }; } get_sys_cdrom_info(@idi); @idi; @@ -211,7 +206,7 @@ sub getCompaqSmartArray() { for (my $i = 0; -r ($f = "${prefix}$i"); $i++) { foreach (cat_($f)) { if (m|^\s*($name/.*?):|) { - push @idi, { device => $1, info => "Compaq RAID logical disk", media_type => 'hd' }; + push @idi, { device => $1, info => "Compaq RAID logical disk", media_type => 'hd', interface_type => 'ida' }; } } } @@ -226,7 +221,7 @@ sub getDAC960() { #- /dev/rd/c0d0: RAID-7, Online, 17928192 blocks, Write Thru0123456790123456789012 foreach (syslog()) { my ($device, $info) = m|/dev/(rd/.*?): (.*?),| or next; - $idi{$device} = { info => $info, media_type => 'hd', device => $device }; + $idi{$device} = { info => $info, media_type => 'hd', device => $device, interface_type => 'dac960' }; } values %idi; } @@ -235,7 +230,7 @@ sub getATARAID { my %l; foreach (syslog()) { my ($device) = m|^\s*(ataraid/d\d+):| or next; - $l{$device} = { info => 'ATARAID block device', media_type => 'hd', device => $device }; + $l{$device} = { info => 'ATARAID block device', media_type => 'hd', device => $device, interface_type => 'ataraid' }; log::l("ATARAID: $device"); } values %l; @@ -367,6 +362,26 @@ sub syslog { `$ENV{LD_LOADER} /bin/dmesg`; } +sub get_mac_model() { + my $mac_model = cat_("/proc/device-tree/model") || die "Can't open /proc/device-tree/model"; + log::l("Mac model: $mac_model"); + $mac_model; +} + +sub get_mac_generation() { + my $generation = cat_("/proc/cpuinfo") || die "Can't open /proc/cpuinfo"; + my @genarray = split(/\n/, $generation); + my $count = 0; + while ($count <= @genarray) { + if ($genarray[$count] =~ /pmac-generation/) { + @genarray = split(/:/, $genarray[$count]); + return $genarray[1]; + } + $count++; + } + return "Unknown Generation"; +} + sub hasSMP { c::detectSMP() } sub hasPCMCIA { $::o->{pcmcia} } #- because /proc/pcmcia seems not to be present on 2.4 at least (or use /var/run/stab) diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 0fc606b8a..047e3b88e 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -444,8 +444,9 @@ sub get_raw_hds { $all_hds->{raw_hds} = [ - detect_devices::floppies(), detect_devices::cdroms(), - (map { $_->{device} .= '4'; $_ } detect_devices::zips()) + detect_devices::floppies(), + detect_devices::cdroms__faking_ide_scsi(), + map { $_->{device} .= 4; $_ } detect_devices::zips__faking_ide_scsi(), ]; get_major_minor(@{$all_hds->{raw_hds}}); diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 155900821..d110055ad 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -777,10 +777,8 @@ sub setupBootloaderBefore { my ($o) = @_; require bootloader; - if (my @l = detect_devices::IDEburners()) { + if (my @l = (grep { $_->{interface_type} eq 'ide' } detect_devices::burners(), detect_devices::zips())) { bootloader::add_append($o->{bootloader}, $_->{device}, 'ide-scsi') foreach @l; - #- in that case, also add ide-floppy otherwise ide-scsi will be used! - bootloader::add_append($o->{bootloader}, $_->{device}, 'ide-floppy') foreach detect_devices::ide_zips(); } if ($o->{miscellaneous}{HDPARM}) { bootloader::add_append($o->{bootloader}, $_, 'autotune') foreach grep { /ide.*/ } all("/proc/ide"); diff --git a/perl-install/modules.pm b/perl-install/modules.pm index 12e38f825..79a279dcf 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -729,7 +729,6 @@ sub write_conf { } my @l = (); push @l, 'scsi_hostadapter' if !is_empty_array_ref($conf{scsi_hostadapter}{probeall}); - push @l, 'ide-floppy' if detect_devices::ide_zips(); push @l, 'bttv' if grep { $_->{driver} eq 'bttv' } detect_devices::probeall(); my $l = join '|', map { '^\s*'.$_.'\s*$' } @l; log::l("to put in modules ", join(", ", @l)); |