summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
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;