diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-02-26 20:09:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-02-26 20:09:25 +0000 |
commit | 183528ef44416c434c2da66ea236a6f2fa1d8b80 (patch) | |
tree | 007ee054f9a05d3ce564207b76cf4d3a4872b80f | |
parent | e71135eea183d1acf14f45b9e526f4718f2ed210 (diff) | |
download | drakx-backup-do-not-use-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar drakx-backup-do-not-use-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.gz drakx-backup-do-not-use-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.bz2 drakx-backup-do-not-use-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.xz drakx-backup-do-not-use-183528ef44416c434c2da66ea236a6f2fa1d8b80.zip |
- zips() now return devices ending with "4", raw_zips() is the old zips()
- rdvd handling
- add .conf for /etc/devfs/conf.d/ files
-rw-r--r-- | perl-install/any.pm | 30 | ||||
-rw-r--r-- | perl-install/detect_devices.pm | 7 | ||||
-rw-r--r-- | perl-install/fs.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 7 |
4 files changed, 36 insertions, 10 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index cd08e5c80..00d53bec5 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -917,7 +917,7 @@ sub devfssymlinkf { my ($if, $of, $prefix) = @_; symlinkf($if, "$prefix/dev/$of"); - output_p("$prefix/etc/devfs/conf.d/$of", + output_p("$prefix/etc/devfs/conf.d/$of.conf", "REGISTER ^$if\$ CFUNCTION GLOBAL symlink $if $of UNREGISTER ^$if\$ CFUNCTION GLOBAL unlink $of "); @@ -1077,4 +1077,32 @@ sub get_secure_level { $ENV{SECURE_LEVEL}; } +sub alloc_raw_device { + my ($prefix, $device) = @_; + my $used = 0; + my $raw_dev; + substInFile { + $used = max($used, $1) if m|^\s*/dev/raw/raw(\d+)|; + if (eof) { + $raw_dev = "raw/raw" . ($used + 1); + $_ .= "/dev/$raw_dev /dev/$device\n"; + } + } "$prefix/etc/sysconfig/rawdevices"; + $raw_dev; +} + +sub config_dvd { + my ($prefix) = @_; + if (my @dvds = grep { detect_devices::isDvdDrive($_) } detect_devices::cdroms__faking_ide_scsi()) { + log::l("configuring DVD"); + #- create /dev/dvd symlink + each_index { + devfssymlinkf($_->{device}, 'dvd' . ($::i ? $::i + 1 : ''), $prefix); + } @dvds; + if (my $raw_dev = alloc_raw_device($prefix, 'dvd')) { + devfssymlinkf($raw_dev, 'rdvd', $prefix); + } + } +} + 1; diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 3dc9bdd39..6b172f8da 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -38,9 +38,10 @@ sub hds { grep { $_->{media_type} eq 'hd' && ($::isStandalone || !isRemo sub cdroms { grep { $_->{media_type} eq 'cdrom' } get() } sub burners { grep { isBurner($_) } cdroms() } sub dvdroms { grep { isDvdDrive($_) } cdroms() } -sub zips { grep { member($_->{media_type}, 'fd', 'hd') && isZipDrive($_) } get() } +sub raw_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 zips { map { $_->{device} .= 4; $_ } raw_zips() } sub cdroms__faking_ide_scsi { my @l = cdroms(); @@ -57,7 +58,7 @@ sub cdroms__faking_ide_scsi { @l; } sub zips__faking_ide_scsi { - my @l = zips(); + my @l = raw_zips(); return @l if $::isStandalone; if (my @l_ide = grep { $_->{interface_type} eq 'ide' } @l) { require modules; @@ -68,7 +69,7 @@ sub zips__faking_ide_scsi { $e->{device} = "sd" . chr(ord('a') + $nb++); } } - @l; + map { $_->{device} .= 4; $_ } @l; } sub floppies() { diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 047e3b88e..6ae9239fa 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -446,7 +446,7 @@ sub get_raw_hds { [ detect_devices::floppies(), detect_devices::cdroms__faking_ide_scsi(), - map { $_->{device} .= 4; $_ } detect_devices::zips__faking_ide_scsi(), + 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 9156f49e2..f0973f5e6 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -414,10 +414,7 @@ Consoles 1,3,4,7 may also contain interesting information"; #- for mandrake_firstime touch "$o->{prefix}/var/lock/TMP_1ST"; - #- create /dev/dvd symlink - each_index { - any::devfssymlinkf($_->{device}, 'dvd' . ($::i ? $::i + 1 : ''), $o->{prefix}); - } grep { detect_devices::isDvdDrive($_) } detect_devices::cdroms__faking_ide_scsi(); + any::config_dvd($o->{prefix}); any::writeandclean_ldsoconf($o->{prefix}); @@ -782,7 +779,7 @@ sub setupBootloaderBefore { my ($o) = @_; require bootloader; - if (my @l = (grep { $_->{interface_type} eq 'ide' } detect_devices::burners(), detect_devices::zips())) { + if (my @l = (grep { $_->{interface_type} eq 'ide' } detect_devices::burners(), detect_devices::raw_zips())) { bootloader::add_append($o->{bootloader}, $_->{device}, 'ide-scsi') foreach @l; } if ($o->{miscellaneous}{HDPARM}) { |