summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-10-04 12:31:36 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-10-04 12:31:36 +0000
commit128f175c1c7ea98dd5fc7aaee1882c34f94054b3 (patch)
tree7950de47388b6607350140d5b6477586aca5f658 /perl-install
parent7f4d89069c1ba9a6a002d37c1ecc0a2c8213ac96 (diff)
downloaddrakx-128f175c1c7ea98dd5fc7aaee1882c34f94054b3.tar
drakx-128f175c1c7ea98dd5fc7aaee1882c34f94054b3.tar.gz
drakx-128f175c1c7ea98dd5fc7aaee1882c34f94054b3.tar.bz2
drakx-128f175c1c7ea98dd5fc7aaee1882c34f94054b3.tar.xz
drakx-128f175c1c7ea98dd5fc7aaee1882c34f94054b3.zip
- use /dev/cdrom in fstab, but do not write corresponding udev rule
(the rules will be generated at boot time otherwise it won't catch the hdX/srX switch) (ID_PATH is something like "pci-0000:00:1f.1-ide-1:0", so it can't catch the ide/scsi device name switch that occurs at first boot on a box with cdrom on pata and harddisk on sata)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/fs/any.pm23
-rw-r--r--perl-install/install/NEWS4
-rw-r--r--perl-install/install/steps.pm2
3 files changed, 8 insertions, 21 deletions
diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm
index 08886fde3..e84f572a1 100644
--- a/perl-install/fs/any.pm
+++ b/perl-install/fs/any.pm
@@ -50,29 +50,12 @@ sub write_hds {
@$fstab = fs::get::fstab($all_hds);
}
-sub set_cdrom_symlink_udev_rule {
+sub set_cdrom_symlink {
my ($raw_hds) = @_;
- my $cdrom_helper = '/lib/udev/cdrom_helper';
- -x "$::prefix$cdrom_helper" or return;
-
- my $udev_rule = "$::prefix/etc/udev/rules.d/61-block_config.rules";
- if (-e $udev_rule) {
- log::l("cleaning $udev_rule from previous cdrom symlink rules");
- substInFile { $_ = '' if /SYMLINK\+="cdrom/ } $udev_rule;
- }
-
foreach (grep { $_->{media_type} eq 'cdrom' } @$raw_hds) {
- my @env = (
- 'SUBSYSTEM=block',
- run_program::rooted_get_stdout($::prefix, '/lib/udev/path_id', "/block/$_->{device}"),
- run_program::rooted_get_stdout($::prefix, '/lib/udev/cdrom_id', "/dev/$_->{device}"),
- );
- local %ENV = (%ENV, map { if_(/(.*?)=(.*)/, $1 => $2) } @env);
-
- log::l("calling $cdrom_helper with ID_PATH=$ENV{ID_PATH}");
- my ($alias) = run_program::rooted_get_stdout($::prefix, $cdrom_helper) =~ /(\w+)/;
-
+ next if $_->{device_alias};
+ my $alias = basename($_->{mntpoint}) or next;
log::l("using alias $alias for $_->{device}");
$_->{device_alias} = $alias;
symlink($_->{device}, "$::prefix/dev/$alias");
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index bbe1d5c40..940945c9f 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,7 @@
+- use /dev/cdrom in fstab, but do not write corresponding udev rule
+ (the rules will be generated at boot time otherwise it won't catch the
+ hdX/srX switch)
+
Version 10.4.232 - 4 October 2007, by Olivier "blino" Blin
- add helper to get kernel module path (to be used in draklive)
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm
index 0d4b17558..f709928ed 100644
--- a/perl-install/install/steps.pm
+++ b/perl-install/install/steps.pm
@@ -460,7 +460,7 @@ Consoles 1,3,4,7 may also contain interesting information";
#- for mandrake_firstime
touch "$::prefix/var/lock/TMP_1ST";
- fs::any::set_cdrom_symlink_udev_rule($o->{all_hds}{raw_hds});
+ fs::any::set_cdrom_symlink($o->{all_hds}{raw_hds});
any::config_mtools($::prefix);
#- make sure wins is disabled in /etc/nsswitch.conf