diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-18 15:21:07 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-18 15:21:07 +0000 |
commit | 7cd16e1b1c1ddd916e09ff19c742dec1aa754389 (patch) | |
tree | 874a59e23c4932dd084d4c3d18333b0f62cb9ba1 /perl-install/bootloader.pm | |
parent | d4a5720db9e6fb3d446c9906271ea77bc0e24ab1 (diff) | |
download | drakx-backup-do-not-use-7cd16e1b1c1ddd916e09ff19c742dec1aa754389.tar drakx-backup-do-not-use-7cd16e1b1c1ddd916e09ff19c742dec1aa754389.tar.gz drakx-backup-do-not-use-7cd16e1b1c1ddd916e09ff19c742dec1aa754389.tar.bz2 drakx-backup-do-not-use-7cd16e1b1c1ddd916e09ff19c742dec1aa754389.tar.xz drakx-backup-do-not-use-7cd16e1b1c1ddd916e09ff19c742dec1aa754389.zip |
handle grub file names that do not correspond to a mounted filesystem (bugzilla #14410)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 5c29cbc96..6049b7ee0 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -1200,9 +1200,13 @@ sub grub2dev { sub grub2file { my ($grub_file, $grub2dev, $fstab) = @_; if (my ($device, $rel_file) = grub2dev_and_file($grub_file, $grub2dev)) { - my $part = fs::get::device2part($device, $fstab) or log::l("ERROR: unknown device $device (computed from $grub_file)"); - my $mntpoint = $part->{mntpoint} || ''; - ($mntpoint eq '/' ? '' : $mntpoint) . '/' . $rel_file; + if (my $part = fs::get::device2part($device, $fstab)) { + my $mntpoint = $part->{mntpoint} || ''; + ($mntpoint eq '/' ? '' : $mntpoint) . '/' . $rel_file; + } else { + log::l("ERROR: unknown device $device (computed from $grub_file)"); + $grub_file; + } } else { $grub_file; } @@ -1222,8 +1226,13 @@ sub write_grub { } my $file2grub = sub { - my ($part, $file) = fs::get::file2part($fstab, $_[0], 'keep_simple_symlinks'); - device2grub($part, \@sorted_hds) . $file; + my ($file) = @_; + if ($file =~ m!^\(.*\)/!) { + $file; #- it's already in grub format + } else { + my ($part, $rel_file) = fs::get::file2part($fstab, $_[0], 'keep_simple_symlinks'); + device2grub($part, \@sorted_hds) . $rel_file; + } }; { my @conf; |