From 183528ef44416c434c2da66ea236a6f2fa1d8b80 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 26 Feb 2002 20:09:25 +0000 Subject: - zips() now return devices ending with "4", raw_zips() is the old zips() - rdvd handling - add .conf for /etc/devfs/conf.d/ files --- perl-install/any.pm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'perl-install/any.pm') 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; -- cgit v1.2.1