diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-09-20 01:49:13 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-09-20 01:49:13 +0000 |
commit | e55184eed334811efc27b79948c2956a4b35f18b (patch) | |
tree | 1c1f0ef3f006662976c5bfdb17c43f6ff5afffdb /perl-install/install_any.pm | |
parent | 1ea3578bfb4c6b4ef7b3854ce4561d8bc9afaef4 (diff) | |
download | drakx-e55184eed334811efc27b79948c2956a4b35f18b.tar drakx-e55184eed334811efc27b79948c2956a4b35f18b.tar.gz drakx-e55184eed334811efc27b79948c2956a4b35f18b.tar.bz2 drakx-e55184eed334811efc27b79948c2956a4b35f18b.tar.xz drakx-e55184eed334811efc27b79948c2956a4b35f18b.zip |
- 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
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 18 |
1 files changed, 16 insertions, 2 deletions
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. } |