Bug 14478

Summary: bootloader-config removes max-partitions= from lilo.conf
Product: Mageia Reporter: Christiaan Welvaart <cjw>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal Keywords: NEEDINFO, PATCH
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: drakxtools-16.44-1.mga5.src.rpm CVE:
Status comment:
Attachments: keep max-partition option

Description Christiaan Welvaart 2014-11-07 00:16:31 CET
In qemu(kvm) virtual machines using a virtio boot disk, /etc/lilo.conf needs the line:
    disk=/dev/vda bios=0x80 max-partitions=7
but bootloader-config does not recognize max-partitions and removes it.

Version-Release number of selected component (if applicable):
drakxtools 16.44-1

Steps to Reproduce:
1. configure lilo as bootloader
2. add the disk= line shown above to /etc/lilo.conf
3. install a new kernel package

"max-partitions=7" will not appear in the new /etc/lilo.conf.

I guess the installer should add such a line if it can detect a virtio disk, see also bug #13558 .


The code is in bootloader.pm:

if ($cmd eq 'disk' && $v =~ /(\S+)\s+bios\s*=\s*(\S+)/) {

where max-partitions is ignored.

Reproducible: 

Steps to Reproduce:
Comment 1 Christiaan Welvaart 2014-11-20 03:02:34 CET
--- bootloader.pm.bak	2014-10-23 01:54:23.000000000 +0200
+++ bootloader.pm	2014-11-20 02:51:43.024000000 +0100
@@ -1432,7 +1432,7 @@
 
     push @conf, "ignore-table" if any { $_->{unsafe} && $_->{table} } @{$bootloader->{entries}};
 
-    push @conf, map_each { "disk=$::a bios=$::b" } %{$bootloader->{bios}};
+    push @conf, map_each { "disk=$::a bios=$::b max-partitions=7" } %{$bootloader->{bios}};
 
     foreach my $entry (@{$bootloader->{entries}}) {
 	my $mbootpack_file = get_mbootpack_filename($entry);


With this simple change, bootloader-config works in the VM but it may break other configurations.
Comment 2 Thierry Vignaud 2015-05-19 10:20:37 CEST
Created attachment 6576 [details]
keep max-partition option

Can you try this patch?
Thierry Vignaud 2015-05-19 10:21:59 CEST

Keywords: (none) => NEEDINFO, PATCH

Comment 3 Christiaan Welvaart 2015-05-19 20:12:28 CEST
Tested, it does not work. See e.g. the line:

push @conf, map_each { "disk=$::a bios=$::b" } %{$bootloader->{bios}};

AFAICT support for max-partitions needs to be added there somehow: a disk entry can have both bios and max-partitions attributes.
Comment 4 Christiaan Welvaart 2016-04-05 09:10:09 CEST
Fixed for cauldron with lilo 24.2-2 .

Status: NEW => RESOLVED
Resolution: (none) => FIXED