summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-02-26 20:09:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-02-26 20:09:25 +0000
commit183528ef44416c434c2da66ea236a6f2fa1d8b80 (patch)
tree007ee054f9a05d3ce564207b76cf4d3a4872b80f /perl-install/any.pm
parente71135eea183d1acf14f45b9e526f4718f2ed210 (diff)
downloaddrakx-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar
drakx-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.gz
drakx-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.bz2
drakx-183528ef44416c434c2da66ea236a6f2fa1d8b80.tar.xz
drakx-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
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm30
1 files changed, 29 insertions, 1 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;