Bug 18112

Summary: Unable to enter boot password after update of memtest86
Product: Mageia Reporter: Nikita Krupenko <krnekit>
Component: RPM PackagesAssignee: Thierry Vignaud <thierry.vignaud>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: High CC: fri, ita84, marja11, thierry.vignaud, zen25000
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: drakxtools-17.28-1.mga6, memtest86+-5.01-9.mga6.src.rpm CVE:
Status comment:
Attachments: changes after update of memtest
do not overwrite GRUB_CMDLINE_LINUX_DEFAULT once it has been set
a better fix
a better fix?

Description Nikita Krupenko 2016-04-02 21:09:51 CEST
Description of problem:
I use EFI boot and my system is installed into partition in encrypted LVM.

After update of memtest86+ my system cannot boot. After I select entry in
GRUB, I don't see usual graphical boot password prompt, only console
one. When I enter single symbol in that, it immediately used as
password (I didn't pressed Enter key, just single letter). So It's
just impossible to enter boot password!

I rolled back earlier snapshot and installed update of memtest86+ - same problem.

Version-Release number of selected component (if applicable):
5.01-9.mga6

How reproducible: Always


Steps to Reproduce:
1. Install MGA6 to encrypted LVM.
2. Update memtest86+
Comment 1 Marja Van Waes 2016-04-04 12:29:14 CEST
Assigning to all packagers collectively, since there is no maintainer for this package.

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs

Comment 2 Barry Jackson 2016-04-04 18:52:35 CEST
I really cannot understand this as the only difference between memtest86+-5.01-8 and memtest86+-5.01-9 is two extra Conflicts: against old grub2 and grub2-efi versions that are in Mageia 5, to enable a smooth upgrade to Mageia 6.

The package is otherwise unchanged.

Were any other packages added or removed by the update transaction, and can you confirm that the versions involved are as above?

CC: (none) => zen25000

Comment 3 Thierry Vignaud 2016-04-04 18:54:22 CEST
What boot loader are you using?
grub legacy or grub2?
Can you save the bootloader config before & after the upgrade (w/o rebooting of course)?
For grub, copy /boot/grub/menu.lst
For grub2, copy /boot/grub2/grub.cfg

Obviously, if there's a password in, replace it with sg like XYZ

Keywords: (none) => NEEDINFO
CC: (none) => thierry.vignaud

Comment 4 Nikita Krupenko 2016-04-04 22:25:06 CEST
Created attachment 7626 [details]
changes after update of memtest

It use EFI boot, so it's grub2-efi. The password is on LVM, that contains root partition.

I attached diff of snapshots before and after package update. I removed from diff some data, that is not related (urpmi changes, logs, etc).
Comment 5 Thierry Vignaud 2016-04-04 23:33:36 CEST
Comment on attachment 7626 [details]
changes after update of memtest

So the issue is that GRUB_CMDLINE_LINUX_DEFAULT disappeared in /etc/default/grub
Comment 6 Thierry Vignaud 2016-04-04 23:40:43 CEST
Created attachment 7627 [details]
do not overwrite GRUB_CMDLINE_LINUX_DEFAULT once it has been set

Can you confirm this is an initial install, aka there was no kernel update before?

Does this patch helps?
You can try it by running the followings commands as root:
cd /usr/lib/libDrakX
patch -p2 < /where/it/was/downloaded/18112.diff
Comment 7 Thierry Vignaud 2016-04-05 00:02:59 CEST
For the record we cannot apply this patch as is b/c grub2-common default to a value for this field, but that would pinpoint the issue.
Comment 8 Thierry Vignaud 2016-04-05 00:04:07 CEST
Created attachment 7628 [details]
a better fix

Once you've tested the first patch & reverted, could you test this one?
Thx
Comment 9 Thierry Vignaud 2016-04-05 00:05:31 CEST
Created attachment 7629 [details]
a better fix?

real patch...

Attachment 7628 is obsolete: 0 => 1

Comment 10 Nikita Krupenko 2016-04-05 00:08:42 CEST
After updating memtest there was no kernel updates. After system install there was many kernel updates and no such problem.

I'll try your patches.
Comment 11 Nikita Krupenko 2016-04-06 14:44:05 CEST
I tested - both patches works.
Comment 12 Thierry Vignaud 2016-04-06 16:38:32 CEST
OK, we'll need to do a install with 2nd patch in order it doesn't break initial install

Keywords: NEEDINFO => PATCH
Status: NEW => ASSIGNED

Comment 13 Nikita Krupenko 2016-05-01 12:44:24 CEST
After recent updates this problem happened again.
Comment 14 Marja Van Waes 2016-05-01 18:25:21 CEST
(In reply to Nikita Krupenko from comment #13)
> After recent updates this problem happened again.

Yeah, sorry, that was to be expected, the recent drakxtools update reverted the patch you added to /usr/lib/libDrakX/bootloader.pm 

I understand the patch couldn't be pushed, yet, because it first needs to be tested in installer.

Line numbers have changed since Thierry created the patch in attachment 7629 [details]

Assignee: pkg-bugs => thierry.vignaud
Source RPM: memtest86+-5.01-9.mga6.src.rpm => drakxtools-17.28-1.mga6, memtest86+-5.01-9.mga6.src.rpm

Comment 15 Nikita Krupenko 2016-05-01 20:57:48 CEST
Ok, good to know, that it's known issue.

So I should update drakxtools, apply patch and then update other packages?
Comment 16 Marja Van Waes 2016-05-01 21:16:27 CEST
(In reply to Nikita Krupenko from comment #15)
> Ok, good to know, that it's known issue.
> 
> So I should update drakxtools, apply patch and then update other packages?

You have already updated the drakxtools, that's what caused the issue to reoccur. You'll now have a new
/usr/lib/libDrakX/bootloader.pm from ± 5 days ago without the patch.

However, despite the changed line numbers, the patch applies cleanly, so I think you can safely use 
https://bugs.mageia.org/attachment.cgi?id=7628&action=diff&context=patch&collapsed=&headers=1&format=raw again
Comment 17 Marja Van Waes 2016-05-01 21:18:23 CEST
(In reply to Marja van Waes from comment #16)

> https://bugs.mageia.org/attachment.
> cgi?id=7628&action=diff&context=patch&collapsed=&headers=1&format=raw again

that one has the wrong number, I meant this one 
https://bugs.mageia.org/attachment.cgi?id=7629&action=diff&context=patch&collapsed=&headers=1&format=raw
Comment 18 Nikita Krupenko 2016-05-01 21:36:33 CEST
No, I've done rollback of my root system to earlier snapshot, so I update drakxtools and than patch it again.
Comment 19 Marja Van Waes 2016-05-01 21:51:06 CEST
(In reply to Nikita Krupenko from comment #18)
> No, I've done rollback of my root system to earlier snapshot, so I update
> drakxtools and than patch it again.

Ah, of course... you couldn't enter the boot password.
Comment 20 Nikita Krupenko 2016-05-24 20:33:19 CEST
*** Bug 18495 has been marked as a duplicate of this bug. ***

CC: (none) => fri

Comment 21 Thierry Vignaud 2016-05-25 11:40:57 CEST
Yep, I still didn't find time to test a grub2 initial installation then updates with that patch.
Thierry Vignaud 2016-05-31 14:31:35 CEST

Priority: Normal => High

Comment 22 Mageia Robot 2016-06-06 10:36:13 CEST
commit da8422ff1d6448480f80f582eaae625c72bd4c26
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Tue May 31 19:21:11 2016 +0200

    only overwrite GRUB_CMDLINE_LINUX_DEFAULT on first install (mga#18112)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=da8422ff1d6448480f80f582eaae625c72bd4c26
Comment 23 Thierry Vignaud 2016-06-06 10:46:51 CEST
Fixed in git

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

Comment 24 Morgan Leijström 2016-06-09 06:18:06 CEST
Um, for us affected on a production system, what to do to make it work?
I think i should have read the notes on changed files after that update but i did not... and where are they now?
Comment 25 Thierry Vignaud 2016-06-09 09:37:04 CEST
compare /etc/grub/default with /etc/grub/default.old, restore your GRUB_CMDLINE_LINUX_DEFAULT, run update-grub2
Comment 26 Morgan Leijström 2016-06-10 02:48:09 CEST
Thank you Thierry for the quick reply

However this system do not have an /etc/grub folder...

It use grub, not grub2.

It was upgraded from a mga5 system.
Comment 27 Thierry Vignaud 2016-06-27 09:07:38 CEST
*** Bug 18745 has been marked as a duplicate of this bug. ***

CC: (none) => ita84