Bug 9730

Summary: Mageia 3 beta4 LiveDVD-KDE does not boot from pendrive in EFI environment
Product: Mageia Reporter: Michal Ostrowski <ateista.ufoman>
Component: Release (media or process)Assignee: Thomas Backlund <tmb>
Status: RESOLVED OLD QA Contact:
Severity: major    
Priority: Normal CC: davidwhodgins, mageia, ottoleipala1, sysadmin-bugs, thierry.vignaud, tmb
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: 3RC
Source RPM: dracut draklive CVE:
Status comment:
Attachments: sosreport.txt from dracut
compressed sosreport.txt after adding rdinitdebug
Patch to allow efi mounting of Mageia live isos
compressed sosreport.txt with rdinitdebug
Compressed sosreport from Sun Apr 21 00:45:00 CEST 2013 iso

Description Michal Ostrowski 2013-04-14 19:22:53 CEST
Created attachment 3741 [details]
sosreport.txt from dracut

Description of problem:
OS does not boot, due to /dev/disk/by-label/Mageia-3-KDE4-LiveDVD not found.
PC used is Lenovo IdeaPad Y500, firmware 1.03, running in UEFI mode.

How reproducible:
Boot from the pendrive under EFI environment (BIOS compatibility must be disabled).


Steps to Reproduce:
1. Format pendrive with filesystem recognizable by EFI (FAT16, FAT32)
2. Copy all files from ISO to the root of the pendrive
3. Attempt to boot from the pendrive, select either Install or Run option from the menu

Attached is sosreport.txt.
Comment 1 Thomas Backlund 2013-04-14 19:32:41 CEST
Known,


if you had read release notes:
https://wiki.mageia.org/en/Mageia_3_beta4#UEFI

it would have told you to read:
https://wiki.mageia.org/en/Mageia_3_Errata#Live

* UEFI bootable usb (experimental)

CC: (none) => tmb

Comment 2 Michal Ostrowski 2013-04-14 20:31:59 CEST
Shame on me ;_;
It boots now. No graphical mode though, probably because Nouveau is still kind of flaky on Kepler GPUs.
Comment 3 Thomas Backlund 2013-04-14 21:18:46 CEST
Ok, but the nvidia-current driver is on also available, and should be able to manage your hw.

Can you try to edit /loader/entries/mga-live.conf

and add nokmsboot on the options line

If that does not help, you can also try to remove the options: splash silent vga=788 

to see if any of them helps
Comment 4 Michal Ostrowski 2013-04-14 21:46:02 CEST
I've already managed to make it boot by adding xdriver=fbdev to kernel parameters.
Comment 5 Thomas Backlund 2013-04-14 21:51:25 CEST
and what does it do if you try to boot with: xdriver=nvidia ?
Comment 6 Michal Ostrowski 2013-04-14 22:19:42 CEST
Nouveau is still used then, and it subjectively appears a bit slower than fbdev.
Comment 7 Dave Hodgins 2013-04-15 02:46:26 CEST
Just made my first attempt using the files from
Mageia-3-RC-LiveDVD-KDE4-x86_64-DVD.iso

It fails with
[    4.868325] ISOFS: Unable to identify CD-ROM format.
[    4.873236] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    4.873368] bio too big device loop0 (2 > 0)
[    4.873369] SQUASHFS error: squashfs_read_data failed to read block 0x0
[    4.873370] SQUASHFS error: unable to read squashfs_super_block

The partition on the usb stick is fat32, with a label of MGA3LIVE. The
initrd is found and loaded, but it then fails when trying to mount the
root filesystem.

I tried overwriting the files on the flash drive with the ones from
http://mirrors.kernel.org/mageia/iso/cauldron/USB_UEFI_fix/Mga3b4_UEFI_x86_64.tar.xz
but then it still fails, and the keyboard doesn't work, so I can't
access the sosreport.txt from that one.

CC: (none) => davidwhodgins
Whiteboard: (none) => 3RC

Comment 8 Dave Hodgins 2013-04-15 03:21:58 CEST
Created attachment 3743 [details]
compressed sosreport.txt after adding rdinitdebug
Dave Hodgins 2013-04-15 05:20:11 CEST

CC: (none) => mageia

Comment 9 Dave Hodgins 2013-04-15 05:22:16 CEST
Created attachment 3744 [details]
Patch to allow efi mounting of Mageia live isos

I've successfully booting into live mode using efi, afer
creating a new initrd with the attached patch applied.
Dave Hodgins 2013-04-15 05:22:31 CEST

Keywords: (none) => PATCH

Comment 10 Colin Guthrie 2013-04-15 10:34:53 CEST
Looks sensible to me but I didn't write that module so Thomas' view is the one that matters :)
Comment 11 Thomas Backlund 2013-04-15 10:58:52 CEST
Yeah, it was something like that I had in mind ...

I used draklive file replacement to do a "hack" on beta4 to get it to work,
but forgot to update / activate it for RC

I will verify tonight that I'm not breaking any of the ways to boot before committing it and pushing a new dracut.
Thierry Vignaud 2013-04-16 18:16:57 CEST

CC: (none) => thierry.vignaud
Assignee: bugsquad => tmb
Source RPM: (none) => dracut

Comment 12 Dave Hodgins 2013-04-18 05:32:39 CEST
With todays live cd, trying to boot in uefi mode fails with
Error loading \boot\vmlinuz: Unsupported
Comment 13 Dave Hodgins 2013-04-18 06:27:30 CEST
As I reported on the mailing list, it's also failing as an iso
copied to a usb stick.  The errors are
/sbin/mgalive-root: 24: /sbin/mgalive-root: get_fs_env: not found
/sbin/mgalive-root: 25: [: unexpected operator

Then it's failing to mount the root file system.

So it's the patch I submitted that's causing the problem, but
I don't see what's wrong, and did test it before submitting it.
Comment 14 Dave Hodgins 2013-04-18 06:54:54 CEST
Created attachment 3760 [details]
compressed sosreport.txt with rdinitdebug

When I was testing the change, I extracted the files from the initrd,
modified the mgalive-root, then recreated the initrd from the files.

For creating the patch, I compared my working version to the original,
and then applied the same changes to the one in the
/usr/lib/dracut/modules.d/, for generating the patch.

I still don't see what I did wrong though.

Attachment 3743 is obsolete: 0 => 1

Comment 15 Dave Hodgins 2013-04-18 07:16:37 CEST
Now I don't understand how I was able to boot before.

The function get_fs_env is in /usr/lib/dracut/dracut-functions.sh,
which appears to only be available when dracut is run, not when
the initrd is processed.

I guess the easiest fix is to copy that function into
/usr/lib/dracut/modules.d/90mgalive/mgalive-root.sh
since it using used by any of the other hooks so shouldn't
be in /usr/lib/dracut/modules.d/99base/dracut-lib.sh
Comment 16 Colin Guthrie 2013-04-18 11:09:47 CEST
Or you could just do a quick udevadm call to extract it like in modules.d/90btrfs/btrfs_finished.sh:

    _rootinfo=$(udevadm info --query=env "--name=$_dev" 2>/dev/null)
    if strstr "$_rootinfo" "ID_FS_TYPE=iso9660"; then
Comment 17 Dave Hodgins 2013-04-21 04:38:00 CEST
Created attachment 3779 [details]
Compressed sosreport from Sun Apr 21 00:45:00 CEST 2013 iso

Attached is the sosreport.txt from my latest attempt,
with rd.debug as a kernel option.  I haven't looked through
it yet.
Comment 18 Dave Hodgins 2013-04-21 22:38:14 CEST
In mgalive-root.sh, the line
if [ -d "/dev/disk/by-label/MGA3LIVE" ]; then
needs to be changed to
if [ -h "/dev/disk/by-label/MGA3LIVE" ]; then
for this to work as it is a symlink, not a directory.

However I can see this approach leading to problems, if booting a regular
live iso, while still having an efi usb boot drive plugged in.

I've tested that with -h, the usb stick will boot in efi mode. I have
not tested to see if it still boots ok in with a regular mode, but
don't see why it wouldn't, as long as the efi drive is not plugged in.

At the end of the install, in the bootloader installation screen, it does
not provide the option to install grub2-efi.
Thierry Vignaud 2013-04-21 22:38:49 CEST

Source RPM: dracut => dracut draklive

Comment 19 Thomas Backlund 2013-04-22 01:57:49 CEST
(In reply to Dave Hodgins from comment #18)
> In mgalive-root.sh, the line
> if [ -d "/dev/disk/by-label/MGA3LIVE" ]; then
> needs to be changed to
> if [ -h "/dev/disk/by-label/MGA3LIVE" ]; then
> for this to work as it is a symlink, not a directory.
> 

Yep, that's what I had on my local test, but forgot to update rabbit config :/

> However I can see this approach leading to problems, if booting a regular
> live iso, while still having an efi usb boot drive plugged in.
> 

Well, then you will be screwed anyway, as /loader/entries/*.conf are looking for:

root=mgalive:LABEL=MGA3LIVE

> I've tested that with -h, the usb stick will boot in efi mode. I have
> not tested to see if it still boots ok in with a regular mode, but
> don't see why it wouldn't, as long as the efi drive is not plugged in.
> 

Anyway I decided to not use that check anyway, as it makes the media name "static"...

So I ended up adding the word "UEFI" to boot command line, and check for that
to know how to proceed. it works booting from iso, booting from a dd image to usb, and from a fat32 formatted usb stick.

> At the end of the install, in the bootloader installation screen, it does
> not provide the option to install grub2-efi.

Hm, I need to check this still
Comment 20 Dave Hodgins 2013-04-23 01:16:59 CEST
Doesn't show grub2-efi as an option, but when grub2 is selected, it does
install grub2-efi.

I've booted the kde x86_64 live dvd in both uefi and syslinux modes,
and everything looks good.

The grub2-efi package is affected by the same scriptlet problem as grub2.
Workaround by manually chroot /mnt/install, urpmi grub2-efi works.

The only problem I'm having, is that my bios still won't boot from
the installed system in uefi mode.

For a usb stick, simply having a fat partition on the stick will cause
the system's boot select to add an option to boot from the drive in
usb mode.

For my hard drive, it doesn't yet show such an option.
sda1 is a 1GB partition, type ef  EFI (FAT-12/16/32), formatted as fat32.
(I tried type 0b as well).

During install, sda1 is mounted as /boot/efi, after install it's contents
are
./EFI
./EFI/mageia
./EFI/mageia/grubx64.efi

Any suggestions?

The problem this bug report was opened for is fixed.

Should I open a new bug report for getting the installed uefi boot working, or
keep this one open for now?

Note that getting the live image to boot in uefi mode is the first time I've
ever had a uefi boot on this system, so I won't be surprised if I've overlooked
something simple.
Comment 21 Dave Hodgins 2013-04-23 01:54:39 CEST
After checking the motherboard manual, I copied grubx64.efi to shellx64.efi,
and just to be on the safe side, copied that into the EFI directory and the
root directory of the sda1 filesystem.

As I'd manually run the chroot /mnt/install and urpmi grub2-efi, I had to
manuall add nokmsboot to the grub boot entry.

With this motherboard (ASUS SABERTOOTH 990FX), the only way to select a uefi
mode boot, seems to be to enter the bios setup, select exit, then select
the "load efi shell" option.

With the above, I've now done a uefi boot from the hard drive, for the first
time.  Yeah!
Comment 22 Otto Leipälä 2013-05-02 15:55:58 CEST
Can somebody please tell me how to turn acpi off and xdriver to vesa.When i add to that file mga-boot.conf end of line acpi=off and xdriver=vesa i get dracut errors it cannot mount filesystem and it don't boot it to live mode.

CC: (none) => ozkyster

Comment 23 Manuel Hiebel 2015-01-20 20:30:25 CET
old one and we have some already new with efi..

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