Mageia Bugzilla – Attachment 3691 Details for
Bug 8717
On installing a new kernel on a system with root on LVM, root=/dev/VGname/LVname gets mangled to root=/dev/
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
fix
8717b.diff (text/plain), 1.28 KB, created by
Thierry Vignaud
on 2013-04-03 19:08:54 CEST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2013-04-03 19:08:54 CEST
Size:
1.28 KB
patch
obsolete
>diff --git /usr/lib/libDrakX/fs/get.pm /usr/lib/libDrakX/fs/get.pm >index 096402e..c9dcfb4 100644 >--- /usr/lib/libDrakX/fs/get.pm >+++ /usr/lib/libDrakX/fs/get.pm >@@ -119,6 +120,15 @@ sub has_mntpoint { > my ($mntpoint, $all_hds) = @_; > mntpoint2part($mntpoint, [ really_all_fstab($all_hds) ]); > } >+ >+sub root_from_mounted() { >+ foreach ('rootfs 1 1 1 1 /', `df -P`) { >+ next if m!^[^/]!; # ignore tootfs >+ my ($fs, undef, undef, undef, undef, $mntpnt) = split(/\s+/); >+ return $fs if $mntpnt eq '/'; >+ } >+} >+ > sub root_ { > my ($fstab, $o_boot) = @_; > $o_boot && mntpoint2part("/boot", $fstab) || mntpoint2part("/", $fstab); >diff --git /usr/sbin/bootloader-config /usr/sbin/bootloader-config >index b68cef0..1595d30 100755 >--- /usr/sbin/bootloader-config >+++ /usr/sbin/bootloader-config >@@ -153,7 +153,8 @@ sub add_kernel() { > return; > } > >- my $root_part = fs::get::root([ fs::get::fstab($all_hds) ]) or die "cannot find root partition\n"; >+ my $root_part = fs::get::root_([ fs::get::fstab($all_hds) ]) or warn "cannot find root partition in /etc/fstab\n"; >+ $root_part ||= fs::get::root_from_mounted() or die "cannot find root partition\n"; > my %opts = ( > root => fs::wild_device::from_part('', $root_part), > initrd_options => $initrd_options,
diff --git /usr/lib/libDrakX/fs/get.pm /usr/lib/libDrakX/fs/get.pm index 096402e..c9dcfb4 100644 --- /usr/lib/libDrakX/fs/get.pm +++ /usr/lib/libDrakX/fs/get.pm @@ -119,6 +120,15 @@ sub has_mntpoint { my ($mntpoint, $all_hds) = @_; mntpoint2part($mntpoint, [ really_all_fstab($all_hds) ]); } + +sub root_from_mounted() { + foreach ('rootfs 1 1 1 1 /', `df -P`) { + next if m!^[^/]!; # ignore tootfs + my ($fs, undef, undef, undef, undef, $mntpnt) = split(/\s+/); + return $fs if $mntpnt eq '/'; + } +} + sub root_ { my ($fstab, $o_boot) = @_; $o_boot && mntpoint2part("/boot", $fstab) || mntpoint2part("/", $fstab); diff --git /usr/sbin/bootloader-config /usr/sbin/bootloader-config index b68cef0..1595d30 100755 --- /usr/sbin/bootloader-config +++ /usr/sbin/bootloader-config @@ -153,7 +153,8 @@ sub add_kernel() { return; } - my $root_part = fs::get::root([ fs::get::fstab($all_hds) ]) or die "cannot find root partition\n"; + my $root_part = fs::get::root_([ fs::get::fstab($all_hds) ]) or warn "cannot find root partition in /etc/fstab\n"; + $root_part ||= fs::get::root_from_mounted() or die "cannot find root partition\n"; my %opts = ( root => fs::wild_device::from_part('', $root_part), initrd_options => $initrd_options,
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 8717
:
3684
|
3685
|
3686
|
3688
|
3689
| 3691