summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-11-26 12:17:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-11-26 12:17:34 +0000
commit51c97621ccb1790cd125800af1add6a3c47c7869 (patch)
treea6b823ff76f5cb48e35fc04ecee768b21809be55 /perl-install/bootloader.pm
parentf229e10ccdb1aca5c9b0b5421a347b249b810073 (diff)
downloaddrakx-51c97621ccb1790cd125800af1add6a3c47c7869.tar
drakx-51c97621ccb1790cd125800af1add6a3c47c7869.tar.gz
drakx-51c97621ccb1790cd125800af1add6a3c47c7869.tar.bz2
drakx-51c97621ccb1790cd125800af1add6a3c47c7869.tar.xz
drakx-51c97621ccb1790cd125800af1add6a3c47c7869.zip
- bootloader:
o handle "alien" grub entries that will be kept verbatim (#23591)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index b6f8a8938..fee1d22e1 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -239,6 +239,7 @@ sub read_grub_menu_lst {
-e $menu_lst_file or return;
foreach (cat_($menu_lst_file)) {
+ my $verbatim = $_;
chomp;
s/^\s*//; s/\s*$//;
next if /^#/ || /^$/;
@@ -273,6 +274,7 @@ sub read_grub_menu_lst {
$e->{$keyword} = $v eq '' ? 1 : $v;
}
}
+ $e and $e->{verbatim} .= $verbatim;
}
#- sanitize
@@ -288,6 +290,7 @@ sub read_grub_menu_lst {
$e->{append} = join(' ', grep { !/^BOOT_IMAGE=/ } split(' ', $e->{append}));
$e->{root} = $1 if $e->{append} =~ s/root=(\S*)\s*//;
$e->{kernel_or_dev} = grub2file($kernel, $grub2dev, $fstab, $e);
+ $e->{keep_verbatim} = 1 if dirname($e->{kernel_or_dev}) ne '/boot';
}
my ($vga, $other) = partition { /^vga=/ } split(' ', $e->{append});
if (@$vga) {
@@ -433,7 +436,7 @@ sub cleanup_entries {
#- cleanup bad entries (in case file is corrupted)
@{$bootloader->{entries}} =
grep {
- my $pb = $_->{type} eq 'image' && dirname($_->{kernel_or_dev}) eq '/boot' && ! -e "$::prefix$_->{kernel_or_dev}";
+ my $pb = $_->{type} eq 'image' && !$_->{keep_verbatim} && ! -e "$::prefix$_->{kernel_or_dev}";
log::l("dropping bootloader entry $_->{label} since $_->{kernel_or_dev} doesn't exist") if $pb;
!$pb;
} @{$bootloader->{entries}};
@@ -1600,7 +1603,9 @@ sub write_grub {
foreach my $entry (@{$bootloader->{entries}}) {
my $title = "\ntitle $entry->{label}";
- if ($entry->{type} eq "image") {
+ if ($entry->{keep_verbatim}) {
+ push @conf, '', $entry->{verbatim};
+ } elsif ($entry->{type} eq "image") {
push @conf, $title;
push @conf, grep { $entry->{$_} } 'lock';
push @conf, join(' ', 'kernel', $file2grub->($entry->{xen}), $entry->{xen_append}) if $entry->{xen};