summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-19 09:04:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-19 09:04:38 +0000
commitb8a58b962211e6daa9fb5d3633083e6c6b205ba6 (patch)
tree7931adfccdfbd39060f03d4bd06818052ca00d2b
parent0db11b4ea9c99d8eaff16d9d608c146da46e8948 (diff)
downloaddrakx-b8a58b962211e6daa9fb5d3633083e6c6b205ba6.tar
drakx-b8a58b962211e6daa9fb5d3633083e6c6b205ba6.tar.gz
drakx-b8a58b962211e6daa9fb5d3633083e6c6b205ba6.tar.bz2
drakx-b8a58b962211e6daa9fb5d3633083e6c6b205ba6.tar.xz
drakx-b8a58b962211e6daa9fb5d3633083e6c6b205ba6.zip
add a warning telling to run lilo after modifying the lilo.conf (bugzilla #6924)
-rw-r--r--perl-install/bootloader.pm51
1 files changed, 26 insertions, 25 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index f40f5610c..4935c6d17 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -948,46 +948,47 @@ sub write_lilo_conf {
local $\ = "\n";
my $f = arch() =~ /ia64/ ? "$::prefix/boot/efi/elilo.conf" : "$::prefix/etc/lilo.conf";
- local *F;
- open F, ">$f" or die "cannot create lilo config file: $f";
+ open(my $F, ">$f") or die "cannot create lilo config file: $f";
log::l("writing lilo config to $f");
chmod 0600, $f if $bootloader->{password};
#- normalize: RESTRICTED is only valid if PASSWORD is set
delete $bootloader->{restricted} if !$bootloader->{password};
-
+
local $bootloader->{default} = make_label_lilo_compatible($bootloader->{default});
- $bootloader->{$_} and print F "$_=$bootloader->{$_}" foreach qw(boot map install vga default keytable);
- $bootloader->{$_} and print F $_ foreach qw(linear geometric compact prompt nowarn restricted);
- print F qq(append="$bootloader->{append}") if $bootloader->{append};
- print F "password=", $bootloader->{password} if $bootloader->{password}; #- also done by msec
- print F "timeout=", round(10 * $bootloader->{timeout}) if $bootloader->{timeout};
- print F "serial=", $1 if get_append($bootloader, 'console') =~ /ttyS(.*)/;
+ print $F "# File generated by DrakX/drakboot";
+ print $F "# WARNING: do not forget to run lilo after modifying this file\n";
+ $bootloader->{$_} and print $F "$_=$bootloader->{$_}" foreach qw(boot map install vga default keytable);
+ $bootloader->{$_} and print $F $_ foreach qw(linear geometric compact prompt nowarn restricted);
+ print $F qq(append="$bootloader->{append}") if $bootloader->{append};
+ print $F "password=", $bootloader->{password} if $bootloader->{password}; #- also done by msec
+ print $F "timeout=", round(10 * $bootloader->{timeout}) if $bootloader->{timeout};
+ print $F "serial=", $1 if get_append($bootloader, 'console') =~ /ttyS(.*)/;
- print F "message=/boot/message" if arch() !~ /ia64/;
- print F "menu-scheme=wb:bw:wb:bw" if arch() !~ /ia64/;
+ print $F "message=/boot/message" if arch() !~ /ia64/;
+ print $F "menu-scheme=wb:bw:wb:bw" if arch() !~ /ia64/;
- print F "ignore-table" if any { $_->{unsafe} && $_->{table} } @{$bootloader->{entries}};
+ print $F "ignore-table" if any { $_->{unsafe} && $_->{table} } @{$bootloader->{entries}};
while (my ($dev, $bios) = each %{$bootloader->{bios}}) {
- print F "disk=$dev bios=$bios";
+ print $F "disk=$dev bios=$bios";
}
foreach (@{$bootloader->{entries}}) {
- print F "$_->{type}=", $file2fullname->($_->{kernel_or_dev});
- print F "\tlabel=", make_label_lilo_compatible($_->{label});
+ print $F "$_->{type}=", $file2fullname->($_->{kernel_or_dev});
+ print $F "\tlabel=", make_label_lilo_compatible($_->{label});
if ($_->{type} eq "image") {
- print F "\troot=$_->{root}" if $_->{root};
- print F "\tinitrd=", $file2fullname->($_->{initrd}) if $_->{initrd};
- print F qq(\tappend="$_->{append}") if $_->{append};
- print F "\tvga=$_->{vga}" if $_->{vga};
- print F "\tread-write" if $_->{'read-write'};
- print F "\tread-only" if !$_->{'read-write'};
+ print $F "\troot=$_->{root}" if $_->{root};
+ print $F "\tinitrd=", $file2fullname->($_->{initrd}) if $_->{initrd};
+ print $F qq(\tappend="$_->{append}") if $_->{append};
+ print $F "\tvga=$_->{vga}" if $_->{vga};
+ print $F "\tread-write" if $_->{'read-write'};
+ print $F "\tread-only" if !$_->{'read-write'};
} else {
- print F "\ttable=$_->{table}" if $_->{table};
- print F "\tunsafe" if $_->{unsafe} && !$_->{table};
+ print $F "\ttable=$_->{table}" if $_->{table};
+ print $F "\tunsafe" if $_->{unsafe} && !$_->{table};
if (my ($dev) = $_->{table} =~ m|/dev/(.*)|) {
if ($dev2bios{$dev}) {
@@ -997,8 +998,8 @@ sub write_lilo_conf {
}
}
while (my ($from, $to) = each %{$_->{mapdrive} || {}}) {
- print F "\tmap-drive=$from";
- print F "\t to=$to";
+ print $F "\tmap-drive=$from";
+ print $F "\t to=$to";
}
}
}