From e55184eed334811efc27b79948c2956a4b35f18b Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 20 Sep 2004 01:49:13 +0000 Subject: - don't use fs::get_info_from_fstab() in install_any::use_root_part() to be able to handle renamed devices - fs::get_info_from_fstab() doesn't take a prefix anymore - small perl_checker fix in install_any.pm --- perl-install/install_any.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'perl-install/install_any.pm') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 1e9893242..04c3204e5 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -213,7 +213,7 @@ sub getFile { $o_altroot ||= '/tmp/image'; $f2 = "$o_altroot/$rel" if $rel !~ m,^/, && (!$postinstall_rpms || !-e $f2); #- $f2 = "/$rel" if !$::o->{packages}{mediums}{$asked_medium}{rpmsdir} && !-e $f2; #- not a relative path, should not be necessary with new media layout - my $F; open($F, $f2) && $F or do { $f2 !~ /XXX/ and log::l("Can't open $f2: $!"); undef } + my $F; open($F, $f2) ? $F : do { $f2 !~ /XXX/ and log::l("Can't open $f2: $!"); undef } } } || errorOpeningFile($f); } @@ -1281,7 +1281,21 @@ sub use_root_part { my ($all_hds, $part, $prefix) = @_; { my $handle = any::inspect($part, $prefix) or die; - fs::get_info_from_fstab($all_hds, $handle->{dir}); + + my @l = fs::read_fstab($handle->{dir}, '/etc/fstab', 'keep_default'); + + my $root = fs::get::root_(\@l); + if (!fsedit::is_same_hd($root, $part)) { + log::l("warning: fstab says root partition is $root->{device}, whereas we were reading fstab from $part->{device}"); + my ($old, $new) = map { my $s = $_->{device}; $s =~ s/\d+$//; $s } ($root, $part); + if ($old && $new) { + log::l("replacing $old with $new"); + $_->{device} =~ s!^\Q$old!$new! foreach @l; + log::l("l contains: $_->{device} $_->{mntpoint}") foreach @l; + } + } + fs::add2all_hds($all_hds, @l); + log::l("fstab is now: $_->{device} $_->{mntpoint}") foreach fs::get::fstab($all_hds); } isSwap($_) and $_->{mntpoint} = 'swap' foreach fs::get::really_all_fstab($all_hds); #- use all available swap. } -- cgit v1.2.1