summaryrefslogtreecommitdiffstats
path: root/perl-install/any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-20 20:43:55 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-20 20:43:55 +0000
commited4c5d4ab52d1a5a3062392efc04a05a202b4ecc (patch)
tree52aa8641ef9f2a3fd84b11709910ee74b7382c43 /perl-install/any.pm
parent60a17f5e0f4d8df4a6603a5eab31613517768521 (diff)
downloaddrakx-ed4c5d4ab52d1a5a3062392efc04a05a202b4ecc.tar
drakx-ed4c5d4ab52d1a5a3062392efc04a05a202b4ecc.tar.gz
drakx-ed4c5d4ab52d1a5a3062392efc04a05a202b4ecc.tar.bz2
drakx-ed4c5d4ab52d1a5a3062392efc04a05a202b4ecc.tar.xz
drakx-ed4c5d4ab52d1a5a3062392efc04a05a202b4ecc.zip
try very hard to make rdvd work:
- if not using devfs, it worked so keeping things unchanged - if using devfs, using the new dynamic rawdevice.script script to bind a rawdevice on demand pb: can't have both a devfs and a non-devfs config, the /etc/sysconfig/rawdevices solution gives errors with devfs (since the dvd is not REGISTERed yet)
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r--perl-install/any.pm40
1 files changed, 30 insertions, 10 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index e78411e3c..e28084f4e 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -956,6 +956,19 @@ sub devfssymlinkf {
UNREGISTER ^$devfs_if\$ CFUNCTION GLOBAL unlink $of
");
}
+sub devfs_rawdevice {
+ my ($o_if, $of, $prefix) = @_;
+
+ my $devfs_if = $o_if->{devfs_device};
+ $devfs_if ||= devices::to_devfs($o_if->{device});
+ $devfs_if ||= $o_if->{device};
+
+ output_p("$prefix/etc/devfs/conf.d/$of.conf",
+"REGISTER ^$devfs_if\$ EXECUTE /etc/dynamic/scripts/rawdevice.script add /dev/$devfs_if /dev/$of
+UNREGISTER ^$devfs_if\$ EXECUTE /etc/dynamic/scripts/rawdevice.script del /dev/$of
+");
+}
+
sub fileshare_config {
my ($in, $type) = @_; #- $type is 'nfs', 'smb' or ''
@@ -1138,16 +1151,23 @@ sub alloc_raw_device {
}
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($_, 'dvd' . ($::i ? $::i + 1 : ''), $prefix);
- } @dvds;
- if (my $raw_dev = alloc_raw_device($prefix, 'dvd')) {
- devfssymlinkf({ device => $raw_dev }, 'rdvd', $prefix);
- }
+ my ($prefix, $have_devfsd) = @_;
+
+ #- can't have both a devfs and a non-devfs config
+ #- the /etc/sysconfig/rawdevices solution gives errors with devfs
+
+ my @dvds = grep { detect_devices::isDvdDrive($_) } detect_devices::cdroms__faking_ide_scsi() or return;
+
+ log::l("configuring DVD");
+ #- create /dev/dvd symlink
+ each_index {
+ devfssymlinkf($_, 'dvd' . ($::i ? $::i + 1 : ''), $prefix);
+ devfs_rawdevice($_, 'rdvd' . ($::i ? $::i + 1 : ''), $prefix) if $have_devfsd;
+ } @dvds;
+
+ if (!$have_devfsd) {
+ my $raw_dev = alloc_raw_device($prefix, 'dvd');
+ symlink($raw_dev, "$prefix/dev/rdvd");
}
}