Mageia Bugzilla – Attachment 3759 Details for
Bug 5661
Can not unlock encrypted /home on my LVM to use it (need to write /etc/crypttab)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Use correct path to /dev (don't look in the $::prefix before it's even mounted!)
0001-Do-not-use-dev-inside-prefix.patch (text/plain), 3.79 KB, created by
Colin Guthrie
on 2013-04-18 03:55:20 CEST
(
hide
)
Description:
Use correct path to /dev (don't look in the $::prefix before it's even mounted!)
Filename:
MIME Type:
Creator:
Colin Guthrie
Created:
2013-04-18 03:55:20 CEST
Size:
3.79 KB
patch
obsolete
>From 18186b485484e331ad34fc2e344376178ee3811b Mon Sep 17 00:00:00 2001 >From: Colin Guthrie <colin@mageia.org> >Date: Thu, 18 Apr 2013 02:52:02 +0100 >Subject: [PATCH] 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 >--- > >Only really the changes in wild_device have been tested by me as fixing a real >issue. The others seem sensible these days tho'. >--- > perl-install/devices.pm | 2 +- > perl-install/fs/any.pm | 3 +-- > perl-install/fs/wild_device.pm | 8 ++++---- > perl-install/scanner.pm | 2 +- > 4 files changed, 7 insertions(+), 8 deletions(-) > >diff --git a/perl-install/devices.pm b/perl-install/devices.pm >index e4db66e..01e6662 100644 >--- a/perl-install/devices.pm >+++ b/perl-install/devices.pm >@@ -241,7 +241,7 @@ sub symlink_now_and_register { > #- eg, ttySL0 is a symlink created by a daemon > symlinkf($if, "$::prefix/lib/udev/devices/$of"); > >- symlinkf($if, "$::prefix/dev/$of"); >+ symlinkf($if, "/dev/$of"); > } > > >diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm >index 5e7f34e..154e521 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 a1bf98c..d809ec5 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"); >diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm >index 12958dd..0b3bc67 100644 >--- a/perl-install/scanner.pm >+++ b/perl-install/scanner.pm >@@ -35,7 +35,7 @@ our $scannerDB = readScannerDB("$scannerDBdir/ScannerDB"); > > sub confScanner { > my ($model, $port, $vendor, $product, $firmware) = @_; >- $port ||= "$::prefix/dev/scanner"; >+ $port ||= "/dev/scanner"; > my $a = $scannerDB->{$model}{server}; > #print "file:[$a]\t[$model]\t[$port]\n| ", (join "\n| ", @{$scannerDB->{$model}{lines}}),"\n"; > my @driverconf = cat_("$sanedir/$a.conf"); >-- >1.8.1.5 >
From 18186b485484e331ad34fc2e344376178ee3811b Mon Sep 17 00:00:00 2001 From: Colin Guthrie <colin@mageia.org> Date: Thu, 18 Apr 2013 02:52:02 +0100 Subject: [PATCH] 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 --- Only really the changes in wild_device have been tested by me as fixing a real issue. The others seem sensible these days tho'. --- perl-install/devices.pm | 2 +- perl-install/fs/any.pm | 3 +-- perl-install/fs/wild_device.pm | 8 ++++---- perl-install/scanner.pm | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/perl-install/devices.pm b/perl-install/devices.pm index e4db66e..01e6662 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -241,7 +241,7 @@ sub symlink_now_and_register { #- eg, ttySL0 is a symlink created by a daemon symlinkf($if, "$::prefix/lib/udev/devices/$of"); - symlinkf($if, "$::prefix/dev/$of"); + symlinkf($if, "/dev/$of"); } diff --git a/perl-install/fs/any.pm b/perl-install/fs/any.pm index 5e7f34e..154e521 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 a1bf98c..d809ec5 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"); diff --git a/perl-install/scanner.pm b/perl-install/scanner.pm index 12958dd..0b3bc67 100644 --- a/perl-install/scanner.pm +++ b/perl-install/scanner.pm @@ -35,7 +35,7 @@ our $scannerDB = readScannerDB("$scannerDBdir/ScannerDB"); sub confScanner { my ($model, $port, $vendor, $product, $firmware) = @_; - $port ||= "$::prefix/dev/scanner"; + $port ||= "/dev/scanner"; my $a = $scannerDB->{$model}{server}; #print "file:[$a]\t[$model]\t[$port]\n| ", (join "\n| ", @{$scannerDB->{$model}{lines}}),"\n"; my @driverconf = cat_("$sanedir/$a.conf"); -- 1.8.1.5
View Attachment As Raw
Actions:
View
Attachments on
bug 5661
:
3597
|
3626
|
3644
|
3757
|
3758
| 3759 |
3761
|
3762
|
3763
|
3765
|
3766
|
3767
|
3811
|
3812