Bug 3856

Summary: Duplicate 'init' kernel parameter generated in menu.lst with the latest kernel update
Product: Mageia Reporter: Jaromír Cápík <tavvva>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: dmorganec, mageia, thierry.vignaud, tmb
Version: Cauldron   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: drakxtools CVE:
Status comment:
Attachments: bootloader-duplicate-init.patch

Description Jaromír Cápík 2011-12-22 22:10:03 CET
Description of problem:
I got the following lines generated with the latest kernel update:

title desktop 3.1.6-1.mga2
kernel (hd0,0)/vmlinuz-3.1.6-desktop-1.mga2 BOOT_IMAGE=desktop_3.1.6-1.mga2 root=UUID=d7514023-ccb9-41ab-9821-746ac455920a rdblacklist=nouveau nouveau.modeset=0 init=/bin/systemd init=/bin/systemd vga=791
initrd (hd0,0)/initrd-3.1.6-desktop-1.mga2.img

It seems that the previous 'init' presence was not detected for some reason and  a new one was generated.

Version-Release number of selected component (if applicable):
grub-0.97-32

How reproducible:
I'm unsure if it is systematically reproducible (it happened with the last kernel update)
Jaromír Cápík 2011-12-22 22:11:35 CET

Summary: Duplicate 'init' kernel parameter generated in menu.lst with the kernel update => Duplicate 'init' kernel parameter generated in menu.lst with the latest kernel update

Comment 1 Manuel Hiebel 2011-12-23 11:26:53 CET
Hi, thanks for reporting this bug.

As it's maybe more in the drakxtools or kernel conf, added also these maintainer.

(Please set the status to 'assigned' if you are working on it)

Keywords: (none) => Triaged
CC: (none) => thierry.vignaud, tmb

Comment 2 Jaromír Cápík 2011-12-23 12:11:32 CET
Yeah ... You're absolutely right. It has nothing to do with grub itself. I was a bit tired yesterday.

If You need any additional info, don't hesitate to ask.
Jaromír Cápík 2011-12-23 14:02:29 CET

Source RPM: grub-0.97-32.mga1.src.rpm => drakxtools-13.72.1-2.mga2.src.rpm

Comment 3 Jaromír Cápík 2011-12-23 14:28:49 CET
I just tested that by calling the bootloader-config script directly and the same happened again. I then booted the newly created entry with two 'init' parameters and called the script again, but there were still only two 'init' parameters generated in the new bootloader entry.
Comment 4 Manuel Hiebel 2011-12-23 15:01:30 CET
Indeed it's more that.

Guys, was init=/bin/systemd hard-coded somewhere ?

Keywords: Triaged => (none)
CC: (none) => dmorganec, mageia
Source RPM: drakxtools-13.72.1-2.mga2.src.rpm => bootloader-utils

Comment 5 Colin Guthrie 2011-12-23 15:39:09 CET
Yeah it used to be in some thing or other. I wasn't aware of it, but Blino kindly removed it recently.
Comment 6 Colin Guthrie 2011-12-23 15:41:14 CET
From what Blino said on the ML:

"Well, init=/bin/systemd is forced by drakxtools on each kernel install,
if /bin/systemd exists (which means always, since systemd is required by
basesystem). See /usr/lib/libDrakX/bootloader.pm"

So this has now been removed and now systemd-sysvinit is in the vendor prefer list such that it should get selected by default at install time.
Comment 7 Thomas Backlund 2011-12-23 16:30:07 CET
Maybe it wasn't removed cleanly, so it adds 2 init now?

I'll go check svn
Comment 8 Jaromír Cápík 2011-12-23 17:05:45 CET
Yes ... it adds 2 inits now.

The following part of the add_kernel subroutine adds just one ...

    if (-e "$::prefix/bin/systemd") {
       log::l("defaulting to systemd");
       #@$dict = grep { $_->[0] ne 'devfs' } @$dict;
       $v->{append} .= " init=/bin/systemd";
    }

... so, there must be a deeper magic. 

-OR-

I just got on my mind, that the upgrade from Mandriva was a bit painful (I had to repeat the process 20 times and solve many conflicts manually) ... moreover, there was a problem with the automatic repository selection and many packages were taken from the i586 repo instead of x86_64 ... so ... it might be caused by the current untrusted system state.

It would be nice if somebody's able to reproduce the issue.
Comment 9 Jaromír Cápík 2011-12-23 17:28:07 CET
I changed the code a bit:

       print $v->{append}."\n";
       $v->{append} .= " init=/bin/systemd";
       print $v->{append}."\n";

And the result is:

rdblacklist=nouveau nouveau.modeset=0 init=/bin/systemd
rdblacklist=nouveau nouveau.modeset=0 init=/bin/systemd init=/bin/systemd


So the first init comes in the add_kernel subroutine already filled-in.
Comment 10 Thomas Backlund 2011-12-23 17:38:46 CET
Ah, I see now...

We haven't pushed any new drakxtools to the mirrors since we removed that code, so it's still in use.

Thierry, do you have anything more you want to add to drakxtools before I push a new tarball ?
Comment 11 Jaromír Cápík 2011-12-23 17:50:38 CET
Created attachment 1285 [details]
bootloader-duplicate-init.patch

I was not sure if the code removal is the right solution and therefore I replaced that concatenation with check if the init= is present. The concatenation is done only if init= is missing ... 

But if You plan to change the whole init solution in the future releases, then there would be probably no need for specifying any init parameter.
Comment 12 Thomas Backlund 2011-12-23 18:04:37 CET
Thanks for the patch, but in this case it's not needed.

The correct way for sysvinit and systemd to coexist is to not force anything through drakx tools, but instead to install systemd-sysvinit wich we now do,
so that whole code has been removed as you can see here:

http://svnweb.mageia.org/soft/drakx/trunk/perl-install/bootloader.pm?r1=1962&r2=2419
Comment 13 Jaromír Cápík 2011-12-23 19:17:00 CET
Ok then :] I'll be happy to test the updated package ... 

Thanks.

BR, J.
Comment 14 Thomas Backlund 2011-12-24 00:46:18 CET
Fixed drakxtools-13.73-1.mga2 pushed to the mirrors

Status: NEW => RESOLVED
Resolution: (none) => FIXED
Source RPM: bootloader-utils => drakxtools