diff options
author | Colin Guthrie <colin@mageia.org> | 2013-04-18 20:24:55 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2013-04-18 20:24:55 +0000 |
commit | 85be01682a88405f5c6f9aa361eeb8271606e4f7 (patch) | |
tree | ac34966d63ddab8d9cb13c834e6143bdd69692ac /perl-install/fs | |
parent | 918f20f64f3800acf7152370211d30a176332db5 (diff) | |
download | drakx-85be01682a88405f5c6f9aa361eeb8271606e4f7.tar drakx-85be01682a88405f5c6f9aa361eeb8271606e4f7.tar.gz drakx-85be01682a88405f5c6f9aa361eeb8271606e4f7.tar.bz2 drakx-85be01682a88405f5c6f9aa361eeb8271606e4f7.tar.xz drakx-85be01682a88405f5c6f9aa361eeb8271606e4f7.zip |
Do not use /dev/inside prefix.
As /dev/ is bind mounted into the prefix, we should always refer to /dev/ directly.
In particular this is needed inside wild_device.pm which is often used before the
prefix is even ready (i.e. when configuring existing partitions).
A specific problem here was detecting the major/minor numbers of partitions
which failed because the device node was being searched for inside the prefix
but we'd not even unlocked the encrypted / partition yet to mount it... catch 22.
mga#5661
Diffstat (limited to 'perl-install/fs')
-rw-r--r-- | perl-install/fs/any.pm | 3 | ||||
-rw-r--r-- | perl-install/fs/wild_device.pm | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm index 5e7f34ec5..154e521ec 100644 --- a/perl-install/fs/any.pm +++ b/perl-install/fs/any.pm @@ -59,8 +59,7 @@ sub set_cdrom_symlink { my $alias = basename($_->{mntpoint}) or next; log::l("using alias $alias for $_->{device}"); $_->{device_alias} = $alias; - symlink($_->{device}, "/dev/$alias") if $::prefix; # do create the symlink to have it during install (otherwise fs::wild_device::from_part will give a non accessible device) - symlink($_->{device}, "$::prefix/dev/$alias"); + symlink($_->{device}, "/dev/$alias"); } } diff --git a/perl-install/fs/wild_device.pm b/perl-install/fs/wild_device.pm index fabf747c4..a886fc0dc 100644 --- a/perl-install/fs/wild_device.pm +++ b/perl-install/fs/wild_device.pm @@ -11,7 +11,7 @@ sub analyze { if ($dev =~ m!^/u?dev/(.*)!) { 'dev', $dev; - } elsif ($dev !~ m!^/! && (-e "/dev/$dev" || -e "$::prefix/dev/$dev")) { + } elsif ($dev !~ m!^/! && (-e "/dev/$dev" || -e "/dev/$dev")) { 'dev', "/dev/$dev"; } elsif ($dev =~ /^LABEL=(.*)/) { 'label', $1; @@ -40,11 +40,11 @@ sub to_subpart { $part->{device_UUID} = $val; } elsif ($kind eq 'dev') { my %part = (faked_device => 0); - if (my $rdev = (stat "$::prefix$dev")[6]) { + if (my $rdev = (stat "$dev")[6]) { ($part{major}, $part{minor}) = unmakedev($rdev); } - my $symlink = $dev !~ m!mapper/! ? readlink("$::prefix$dev") : undef; + my $symlink = $dev !~ m!mapper/! ? readlink("$dev") : undef; $dev =~ s!/u?dev/!!; if ($symlink && $symlink !~ m!^/!) { @@ -67,7 +67,7 @@ sub to_subpart { return \%part; } } else { - if ($dev =~ m!^/! && -f "$::prefix$dev") { + if ($dev =~ m!^/! && -f "$dev") { #- it must be a loopback file or directory to bind } else { log::l("part_from_wild_device_name: unknown device $dev"); |