summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-06-06 04:53:41 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-06-06 04:53:41 +0000
commit809bc2de38d8c976014c92193c7c2b43c9c31849 (patch)
tree895ad7d39ce4b5bd1b746bcc9afea6fb20bdc424 /perl-install/bootloader.pm
parentdb79a4e945e42501525c8c8f7097e8e05323e0ba (diff)
downloaddrakx-809bc2de38d8c976014c92193c7c2b43c9c31849.tar
drakx-809bc2de38d8c976014c92193c7c2b43c9c31849.tar.gz
drakx-809bc2de38d8c976014c92193c7c2b43c9c31849.tar.bz2
drakx-809bc2de38d8c976014c92193c7c2b43c9c31849.tar.xz
drakx-809bc2de38d8c976014c92193c7c2b43c9c31849.zip
- put quotes if needed for root=xxx (quotes are needed for LABEL=...)
- use LABEL=... if preferred
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 24e8f9e79..1e93cd6ac 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -323,11 +323,11 @@ sub read_lilo() {
$_;
}
- foreach ('append', 'default') {
+ foreach ('append', 'root', 'default') {
$b{$_} = remove_quotes_and_spaces($b{$_}) if $b{$_};
}
foreach my $entry (@{$b{entries}}) {
- foreach ('append', 'label') {
+ foreach ('append', 'root', 'label') {
$entry->{$_} = remove_quotes_and_spaces($entry->{$_}) if $entry->{$_};
}
}
@@ -711,7 +711,7 @@ sub suggest {
my ($bootloader, $all_hds, %options) = @_;
my $fstab = [ fs::get::fstab($all_hds) ];
my $root_part = fs::get::root($fstab);
- my $root = '/dev/' . (isLoopback($root_part) ? 'loop7' : $root_part->{device});
+ my $root = isLoopback($root_part) ? '/dev/loop7' : fs::part2wild_device_name('', $root_part);
my $boot = fs::get::root($fstab, 'boot')->{device};
#- PPC xfs module requires enlarged initrd
my $xfsroot = $root_part->{fs_type} eq 'xfs';
@@ -1056,6 +1056,11 @@ sub write_lilo {
}
};
+ my $quotes_if_needed = sub {
+ my ($s) = @_;
+ $s =~ /[=\s]/ ? qq("$s") : $s;
+ };
+
my @sorted_hds = sort_hds_according_to_bios($bootloader, $all_hds);
if (is_empty_hash_ref($bootloader->{bios} ||= {}) && $all_hds->{hds}[0] != $sorted_hds[0]) {
@@ -1078,7 +1083,7 @@ sub write_lilo {
push @conf, "# File generated by DrakX/drakboot";
push @conf, "# WARNING: do not forget to run lilo after modifying this file\n";
push @conf, "default=" . make_label_lilo_compatible($bootloader->{default}) if $bootloader->{default};
- push @conf, map { "$_=$bootloader->{$_}" } grep { $bootloader->{$_} } qw(boot root map install vga keytable raid-extra-boot menu-scheme);
+ push @conf, map { $_ . '=' . $quotes_if_needed->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(boot root map install vga keytable raid-extra-boot menu-scheme);
push @conf, grep { $bootloader->{$_} } qw(linear geometric compact prompt nowarn restricted static-bios-codes);
push @conf, qq(append="$bootloader->{append}") if $bootloader->{append};
push @conf, "password=" . $bootloader->{password} if $bootloader->{password}; #- also done by msec
@@ -1097,7 +1102,7 @@ sub write_lilo {
push @entry_conf, "label=" . make_label_lilo_compatible($entry->{label}) if $entry->{label};
if ($entry->{type} eq "image") {
- push @entry_conf, "root=$entry->{root}" if $entry->{root};
+ push @entry_conf, 'root=' . $quotes_if_needed->($entry->{root}) if $entry->{root};
push @entry_conf, "initrd=" . $file2fullname->($entry->{initrd}) if $entry->{initrd};
push @entry_conf, qq(append="$entry->{append}") if $entry->{append};
push @entry_conf, "vga=$entry->{vga}" if $entry->{vga};