LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Problems booting Slackware 14.1 fresh install with UEFI (http://www.linuxquestions.org/questions/slackware-14/problems-booting-slackware-14-1-fresh-install-with-uefi-4175484843/)

spudgunner 11-16-2013 03:49 PM

Problems booting Slackware 14.1 fresh install with UEFI
 
So I managed to get an installed Slackware64 14.1 system installed today, but I have some problems wiht regards to UEFI that I'd like help resolving.

First off, I had to make a USB stick with the Slackware tree, using the included usbimg2disk.sh script available within the Slackware tree. However, I wasn't able to boot this install media using UEFI for some reason, but I booted it using the BIOS emulation on my motherboard (I think... the two options I had were "UEFI: Kingston..." and "USB: Kingston..."; the UEFI didn't work but the USB one did). So I got everything set up, the installer correctly detected and mounted my EFI system partition, and packages were installed. I made the USB boot disk as recommended. LILO comes up for installation, but there's nothing on it about "not being recommended" as is suggested in README_UEFI.TXT and I never got a menu prompt for ELILO or GRUB2 or anything after skiping the normal LILO install.

So, my install is completed and the USB boot disk does work using UEFI boot, so I can get into my Slackware install and as far as I can tell, everything works fine. So how go about installing GRUB2 or ELILO to the EFI system partition so I can dual boot Slackware and Windows? And is the usbimg2disk.sh actually intended to make a UEFI bootable USB disk?

Thanks.

Didier Spaier 11-16-2013 04:27 PM

The installer proposes to run ELILO only if it finds an EFI firmware. As that was not the case it proposed you to run LILO instead, even though you had an EFI partition. This is not caused by using usbimg2disk.sh as the installer it puts on the USB stick is exactly the same as if you make an USB stick with 'dd' or use an installer on CD/DVD . Only difference between CD/DVD and USB installation in case of EFI firmware is that GRUB is used to boot the installer if CD/DVD media is used, elilo if USB (unless you make an hybrid installer with the DVD ISO image, then grub will be used even if you burn the ISO image on an USB stick :-)

spudgunner 11-16-2013 10:03 PM

So I did a quick reinstall and it seems that the EFI firmware isn't there when I boot from USB, which I assumed is because I'm not booting the USB using UEFI (because the UEFI boot on it doesn't work for some reason). So I have to figure out what's wrong with my USB media, because the USB boot disk made during the install works fine in UEFI mode, and I have UEFI firmware when I boot my Slackware install from it.

Anyways, I did manage to get grub installed using the directions from Arch Linux. And I'm keeping all of my grub files within /boot/grub/ rather than on the EFI partition. I looked at this section to create a Windows entry, but I get an error saying that -hint-bios=hd1,gpt2 is not correct and /EFI/Microsoft/Boot/efibootmgfw.egi can't be found, which confuses me a little. hd1 = sdb, which is the disk I'm using for my install of both OS's, and gpt2 = sdb2 (second partition on disk) which is the EFI partition (though as I typing this, I'm wondering if the gpt numbering starts at 0 like the hd numbering... because if it does then I have to fix it).

As it's late where I am, I'm going to continue working on it tomorrow. I am going to attempt to install all of the grub files to the EFI partition instead of just /boot/grub/ and see if it makes a difference, along with that numbering change I mentioned earlier.

Didier Spaier 11-17-2013 11:16 AM

Well, I tried usbimg2disk.sh, no luck either to boot in a VM with an efi firmware.

I mounted the image and saw that the layout is as follow (only relevant part):
Code:

.
|-- slackware64-14.1/
|-- syslinux/
    |-- initrd
    |-- huge.s
    |-- EFI/
        |-- BOOT/
            |-- elilo.conf

We could have two problems here:
  1. IIRC, /EFI is expected to be at the root of the tree, not inside /syslinux
  2. In /syslinux/EFI/BOOT/elilo.conf paths of initrd and huge.s are indicated as /<filename>, instead of /syslinux/<filename>
I think that there is an easy fix: just write the EFI directory at the root of the tree, not in /syslinux.

IOW this layout should work:
Code:

.
|-- slackware64-14.1/
|-- syslinux/
|    |-- initrd
|    |-- huge.s
|-- EFI/
    |-- BOOT/
        |-- elilo.conf

At least that's what I did in slint when we shipped USB-only installers, and that works.

PS and change the paths in elilo.conf, or use hard links, e.g.
ln /syslinux/initrd /initrd

spudgunner 11-17-2013 01:20 PM

Ah, I will definitely keep this in mind in the future. I was a little curious that usbimg2disk.sh didn't write the EFI directory to the root of the drive because I thought it was nessecary... turns out I was right.

In the meantime, I deleted all the grub stuff I had in /boot and /boot/efi/EFI and did a grub-install to the EFI partition directly instead of /boot, and it worked! Slackware boots, Windows boots (it still complains that one of my hint lines are wrong, but at least it still boots Windows). Now I'm running into other problems though. When I boot Windows and restart, it automatically boots Windows again and it won't boot GRUB2 from the UEFI boot menu. The only way I can get back to GRUB is to entry to UEFI setup and change the boot order for GRUB to be first. Unless there's a known issue with Windows severely screwing with the UEFI setup when it does it's thing, I beleive it's my motherboard not implementing UEFI correctly (as I had this exact problem when using Arch Linux and EFISTUB).

Anyways, I'm going to try what you said to make a UEFI bootable USB stick and probably do a reinstall, encrpyting the partition this time. Thanks for the help!

jtsn 11-17-2013 05:29 PM

Quote:

Originally Posted by spudgunner (Post 5066225)
When I boot Windows and restart, it automatically boots Windows again and it won't boot GRUB2 from the UEFI boot menu.

You have to set the default {bootmgr} using BCDEDIT:

For examples see here (point 10): http://www.rodsbooks.com/refind/installing.html#windows

spudgunner 11-18-2013 07:12 AM

Quote:

Originally Posted by jtsn (Post 5066301)
You have to set the default {bootmgr} using BCDEDIT:

For examples see here (point 10): http://www.rodsbooks.com/refind/installing.html#windows

I'll be quite impressed if this works out for me. I killed a good chunk of a weekend a couple months back working on the exact same problem with Arch Linux and figured it was my motherboard being screwy.

spudgunner 11-18-2013 07:03 PM

Well guys, here's what I got:

@jtsn: It worked, and I couldn't be happier! I'll definitely be saving this in my box of tricks.

@Didier Spaier: Apparently you can't create symlinks on vfat filesystems. Editing lilo.conf also didn't work out for me. However, I figured if the directory struture was the same, except for it all being in /syslinux (since UEFI can't find the EFI folder in there), it would work. So I copied the entire contents of /syslinux to the root of the flash drive and the EFI boot now works properly! So thanks for pointing me in the right direction, I wouldn't have been able to figure it out otherwise.

Now that I'm confident that I have this whole EFI dual-boot-with-Windows thing figured out, time to reinstall to and encrpyted LVM. But I've done that before, so how bad can it be...

Didier Spaier 11-19-2013 02:48 PM

Quote:

Originally Posted by spudgunner (Post 5066932)
@Didier Spaier: Apparently you can't create symlinks on vfat filesystems.

That's right, sorry I forgot that. Meanwhile I could have pointed you on hybrid images available here.

spudgunner 11-20-2013 07:13 AM

No worries man. It all worked out for me and I learned something so it's all good.


All times are GMT -5. The time now is 10:43 PM.