summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/detect_devices.pm12
-rwxr-xr-xperl-install/standalone/harddrake24
2 files changed, 9 insertions, 7 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 91afd12e6..7e4ec4864 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -108,7 +108,8 @@ sub get_sys_cdrom_info {
my @drives_order;
foreach (cat_("/proc/sys/dev/cdrom/info")) {
my ($t, $l) = split ':';
- my @l = split ' ', $l;
+ my @l;
+ @l = split(' ', $l) if $l;
if ($t eq 'drive name') {
@drives_order = map {
s/^sr/scd/;
@@ -196,11 +197,11 @@ sub isDvdDrive {
sub isZipDrive { $_[0]{info} =~ /ZIP\s+\d+/ } #- accept ZIP 100, untested for bigger ZIP drive.
sub isJazzDrive { $_[0]{info} =~ /\bJAZZ?\b/i } #- accept "iomega jaz 1GB"
sub isLS120Drive { $_[0]{info} =~ /LS-?120|144MB/ }
-sub isRemovableUsb { index($_[0]{usb_media_type}, 'Mass Storage|') == 0 && usb2removable($_[0]) }
-sub isFloppyUsb { $_[0]{usb_driver} eq 'Removable:floppy' }
+sub isRemovableUsb { $_[0]{usb_media_type} && index($_[0]{usb_media_type}, 'Mass Storage|') == 0 && usb2removable($_[0]) }
+sub isFloppyUsb { $_[0]{usb_driver} && $_[0]{usb_driver} eq 'Removable:floppy' }
sub isRemovableDrive {
my ($e) = @_;
- isZipDrive($e) || isLS120Drive($e) || $e->{media_type} eq 'fd' || isRemovableUsb($e) || index($e->{usb_media_type}, 'Mass Storage|Floppy (UFI)') == 0;
+ isZipDrive($e) || isLS120Drive($e) || $e->{media_type} && $e->{media_type} eq 'fd' || isRemovableUsb($e) || $e->{usb_media_type} && index($e->{usb_media_type}, 'Mass Storage|Floppy (UFI)') == 0;
}
sub getSCSI() {
@@ -530,7 +531,8 @@ sub tryWrite($) {
sub syslog {
-r "/tmp/syslog" and return map { /<\d+>(.*)/ } cat_("/tmp/syslog");
- `$ENV{LD_LOADER} /bin/dmesg`;
+ my $LD_LOADER = $ENV{LD_LOADER} ? $ENV{LD_LOADER} : "";
+ `$LD_LOADER /bin/dmesg`;
}
sub get_mac_model() {
diff --git a/perl-install/standalone/harddrake2 b/perl-install/standalone/harddrake2
index 4437fa5e6..6a21721f9 100755
--- a/perl-install/standalone/harddrake2
+++ b/perl-install/standalone/harddrake2
@@ -251,7 +251,7 @@ foreach (@harddrake::data::tree) {
# Fill the graphic tree with a "tree leaf" widget per device
foreach (@devices) {
# we really should test for $title there:
- if ($_->{bus} eq "PCI") {
+ if ($_->{bus} && $_->{bus} eq "PCI") {
my $i = $_;
$_->{bus_id} = join ':', map { if_($i->{$_} ne "65535", sprintf("%lx", $i->{$_})) } qw(vendor id subvendor subid);
$_->{bus_location} = join ':', map { sprintf("%lx", $i->{$_}) } qw(pci_bus pci_device pci_function);
@@ -264,7 +264,7 @@ foreach (@harddrake::data::tree) {
($_->{Vendor}, $_->{description}) = split(/\|/, $val->{DESCRIPTION});
}
# EIDE detection incoherency:
- if ($_->{bus} eq 'ide') {
+ if ($_->{bus} && $_->{bus} eq 'ide') {
$_->{channel} = $_->{channel} ? N("secondary") : N("primary");
delete $_->{info};
} elsif ($_->{bus} && $_->{bus} !~ /USB|PCI/) {