LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware and Grub2 - getting a UEFI mb running (https://www.linuxquestions.org/questions/slackware-14/slackware-and-grub2-getting-a-uefi-mb-running-4175419283/)

linuxbird 07-29-2012 11:31 PM

Slackware and Grub2 - getting a UEFI mb running
 
I need some pointers for getting a system running.

I have run gpartd on a system with a UEFI mb, and have partitions laid out the way I would like them.

A kernel was built with UEFI support, particularly EFI frame buffer support.

I have the Slackware 32 bit current downloaded, and can boot from an install DVD.

Since grub2 appears to be the choice for booting, I'd like to install that, but it appears that there are several issues:
1. grub2 is not part of the Slackware suite (there is legacy grub, but grub2 is different)
2. lilo (part of Slackware) will not work
3. I'm not working on a virtual machine, so it's tough to wave my hand and move a disc from one machine to another.

Added: Oh, I also tried using ubuntu install cd to install grub2, but apparently there is not EFI frame buffer support on the boot cd.

So my question is: Can I install grub2, from a live CD, before I install Slackware. Then after installing Slackware, I can run grub2 again, and configure it to boot the Slackware kernel?

ReaperX7 07-30-2012 01:02 AM

You have to install Slackware first, then grab Grub2 off SlackBuilds.org and install it's and it's dependencies.

The Slackware Install DVD should be able to boot just about any system as a rescue disk. If you can at least boot to the system you can grab Grub2 build it, install it, and get it working.

I am going to go out and say that LILO is getting near it's limit on support vectors.

File systems like BtrFS can be booted using Grub2 without a separate ext2/3/4 /boot partition if you use Grub2 and because more and more motherboards are implementing UEFI bioses which LILO can not boot to.

Learning Grub isn't hard as far as it's naming schemes. It's actually more inclined to the same naming scheme used by SCSI, SAS, and SATA drives. If you have HD 0,0 in Grub, it's basically translating to disk "A" partition "1", or basically sda1.

Plus you don't have to worry about reinstalling when you update your kernel or change a setting. You just need to edit the menu.lst and save it. It's very simple.

linuxbird 07-30-2012 07:06 AM

Quote:

Originally Posted by ReaperX7 (Post 4741023)
You have to install Slackware first, then grab Grub2 off SlackBuilds.org and install it's and it's dependencies.

The Slackware Install DVD should be able to boot just about any system as a rescue disk. If you can at least boot to the system you can grab Grub2 build it, install it, and get it working.



Plus you don't have to worry about reinstalling when you update your kernel or change a setting. You just need to edit the menu.lst and save it. It's very simple.

I have not been successful in booting an installed Slackware. I built a kernel which has UEFI support, including UEFI frame buffer, but when using the install DVD, to boot from a SATA or a USB (flash) drive, the kernel panics loading.

Also, with grub2, there is no menu.lst. However there is /boot/grub/grub.cfg

I also tried installing Slackware, without lilo, and then trying to setup grub2, using a Ubuntu 12.04 live/install disk. No joy. It ends up loading for quite some time, and then there is periodic disc activity, but no video. My theory is that it does not have UEFI frame buffer support compiled in, but I do not know that for sure. The graphics work during the selection of the boot, and then while installing the screen goes dead. (fbcon may not be compiled in)

AlleyTrotter 07-30-2012 07:35 AM

help maybe
 
I have never used this but it may be of some help
http://freedesktop.org/wiki/Software/gummiboot

john

linuxbird 07-30-2012 08:43 AM

Quote:

Originally Posted by AlleyTrotter (Post 4741252)
I have never used this but it may be of some help
http://freedesktop.org/wiki/Software/gummiboot

john

If I understand gummiboot, it manages boot loaders. Since grub2 is a boot loader, I thought I would stick to that, since it appears to have the functionality needed.

I can't believe more people haven't run into this...many of the new mb are UEFI. Different UEFI implementations have various "backward" compatibility modes, but the days of reading in a kernel and go, as in using the MBR, are over. Even from removable media such as flash drives.

NyteOwl 07-30-2012 11:53 AM

There is also eLilo for UEFI, grub2 isn't the only option.

ReaperX7 07-30-2012 02:38 PM

Here's a wiki page off ArchLinux's website. It may help you find out what is in the kernel and other system parameters, even with Slackware, to get your system bootable. Though Arch and Slack are different distributions both follow a similar structure and settings should transfer smoothly between both distributions.

https://wiki.archlinux.org/index.php...ware_Interface

linuxbird 07-31-2012 05:06 AM

Quote:

Originally Posted by NyteOwl (Post 4741462)
There is also eLilo for UEFI, grub2 isn't the only option.

True, but it appears that going to grub2 there will be more compatibility should other OS ever be installed. Also, I can find live distributions with grub2, and haven't found any with elilo.

linuxbird 07-31-2012 05:09 AM

Quote:

Originally Posted by ReaperX7 (Post 4741566)
Here's a wiki page off ArchLinux's website. It may help you find out what is in the kernel and other system parameters, even with Slackware, to get your system bootable. Though Arch and Slack are different distributions both follow a similar structure and settings should transfer smoothly between both distributions.

https://wiki.archlinux.org/index.php...ware_Interface

also,

https://help.ubuntu.com/community/UEFIBooting

folkenfanel 12-10-2012 06:18 PM

I am in such a box
 
Hello

I am in one of those new Lenovos (Z480), with a GPT disk and UEFI. I will be installing 32-bit Slackware (I know there is an x86_64 port. I just want to install good old x86 Slackware).

I successfully installed Slackware. Compiled kernel 3.6.9 from source (with everything efi compiled in i.e. efivars, stub, framebuffer and i made it relocatable), the kernel as a kernel is good so far. The problem is that I need to boot from the Slackware install CD every time. I tried using the efi stub first: the x64 firmware shell won't boot an x86 kernel. I tried elilo next. Complained about my kernel not being relocatable. So i built a relocatable kernel and then it loads the kernel and immediately reboots without loading Linux. (I have been testing everything using refind)

So i'm testing grub2. Downloaded and built it as per sbo slackbuilds. I took a look at the package before installing it, and I can't see the grub64.efi anywhere (I suspect it wasn't even built this arch being x86).

Next I will try dissecting a precompiled grub2 package so i can test if mine was built correctly.

folkenfanel 12-10-2012 06:21 PM

Before someone asks that, i added noefi to the boot options to make sure i won't be getting a kernel panic

folkenfanel 12-10-2012 10:04 PM

Some hours after
 
I obtained a precompiled x64 grub loader that actually works (or at least "boots" and shows a menu and correctly reads grub.cfg).

My entries are as follows:

Code:

menuentry "Slackware Linux" --class gnu-linux --class gnu --class os {
        insmod part_gpt
        insmod reiserfs
        set root='hd0,gpt6'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  83edd055-3005-4707-a9f4-feacf095d4df
        else
          search --no-floppy --fs-uuid --set=root 83edd055-3005-4707-a9f4-feacf095d4df
        fi
        linux vmlinuz.efi root=UUID=83edd055-3005-4707-a9f4-feacf095d4df ro noefi
}

menuentry "Windows 8" --class windows --class os $menuentry_id_option 'osprober-chain-DE8415DB8415B6CD' {
        insmod part_gpt
        insmod ntfs
        set root='hd0,gpt4'
        insmod search_fs_uuid
        insmod chain
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  DE8415DB8415B6CD
        else
          search --no-floppy --fs-uuid --set=root DE8415DB8415B6CD
        fi
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}

None of them actually loads the OS.

I suspect I might have to specify hd0,gpt1 somewhere, as that is the EFI system partition.

By the way, GRUB mentions that it can't find either vmlinuz.efi or bootmgfw.efi. As they both are inside the EFI system partition, i wonder if there is a better way to specify their paths (vmlinuz.efi is in the same folder as grubx64.efi).

folkenfanel 12-10-2012 11:21 PM

I won (almost)
 
I managed to get grub2 working i.e. actually loading both Slackware and Windows 8.

My grub2 entries are as follows: (I couldn't resist to trim some options i felt i didn't need - the simplest option should have been the right one)
Code:

menuentry "Slackware Linux" --class gnu-linux --class gnu --class os {
        insmod part_gpt
        insmod reiserfs
        set root='hd0,gpt1'
        linux /EFI/slackware/vmlinuz.efi root=/dev/sda6 ro noefi
}

menuentry "Windows 8" --class windows --class os {
        insmod part_gpt
        insmod ntfs
        set root='hd0,gpt1'
        insmod search_fs_uuid
        insmod chain
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Now all I have left is to announce GRUB to the EFI. I have been loading it with a refind live CD, which also says when loading the shell, that just loading the startup.nsh script on the partition itself should work, as it did when i chose to start the EFI shell and load the startup.nsh.

As I'm using an x86 kernel i can not directly access the EFI vars. So I am forced to use the shell (using Windows to access the EFI is the last option). I tried to use bcfg but the shell (Tiano? 2.31 it says) does not have bcfg. I suspect the firmware is 2.31 but somehow the shell specification is 1.0. I tried to download an EFI shell, to load from the refind live CD, but as of now the Tiano sourceforge site is offline. (and all of sourceforge).

I might just replace bootx64.efi with GRUB. But that somehow doesn't feel right.

arubin 12-11-2012 04:13 AM

Isn't there some confusion between two different things:

Grub2 which works using the MBR
grub.efi which uses uefi

I would check out these pages:

http://docs.slackware.com/howtos:sla..._uefi_hardware
http://docs.slackware.com/howtos:sla...based_hardware

AlleyTrotter 12-11-2012 08:45 AM

You need to download and run efibootmgr. You don't have to even install it just run the binary. This will place a boot option in the NVRAM for linux.
The efibootmgr is available at-- https://linux.dell.com/efibootmgr/
The default run will place a Linux elilo boot option in EFI NVRAM for /dev/sda called Linux which will appear in the UEFI boot page. You will need to set the -l option grub if you wish to use grub as your boot loader.
This is the one thing missing from the slackdocs page that was needed to get my AsRock z77 board working.
I use elilo as my boot loader, for me its simpler than grub
Hope this help
John
PS you must be booted under UEFI to alter the NVRAM. Kind of a chicken and egg thing. But since you are already booting under EFI you should have no problem.

folkenfanel 12-12-2012 11:27 AM

[SOLVED] The devil is in the details
 
Hi fellow Slackers

GRUB2 (aka 2.00), as opposed to GRUB (aka GRUB Legacy or 0.97), supports UEFI out of the box. grub.efi (or grubx64.efi) are the EFI binaries which can be generated either by GRUB2 or GRUB legacy.

efibootmgr works by accessing the efi_vars. I can not access them, since I'm on 32 bit Slackware. (the chicken and egg thing: even having booted with EFI it's like i booted from the install CD). That is also the reason I'm not using ELILO, since the 32 bit ELILO EFI binary can not load a 32 bit kernel. GRUB can, as a matter of fact I'm writing this from such a box.

Being unable to "normally" make the firmware aware of my bootloaders (cd: /sys/firmware/efi/vars/: No such file or directory), I have 3 options, the third one being too immoral to discuss (involves using the dark side of the Force).

1. (aka the correct one): Manually adding the entry using bcfg. The problem is, this Tianocore-based EFI seems to have shell 1.0, which does not have bcfg.

2. (aka the practical one): copy grubx64.efi to \EFI\bootx64.efi (overwriting anything there) which is what i finally did.

Next things to do with this laptop: enable Bumblebee (I compiled everything but the modded Mesa: it loads some games saying it loads the nvidia driver, but crashes sometimes) and the touchpad (sadly, xinput --list-props 14 | grep Capabilities reports "Synaptics Capabilities (314): 1, 0, 0, 1, 1, 1, 1", which means I do not have a physical right button). If you own such a Lenovo Z480, do not attempt to use the NVIDIA drivers without bumblebee: you will get a black screen and a nice inverted screen when returning to open source drivers.

GRUB2 works very well, it's skinnable, and it is possible to manually configure it. I'll test the firmware shell (which I just downloaded) later.

In short, if you want to install x86 32-bit Slackware to a new x86_64 capable laptop with EFI and a GPT disk, use GRUB2.

If you are using x86_64 64 bit Slackware, just have a relocatable EFI enabled 3.6 or later kernel and overwrite bootx64.efi with it (assuming you're using only Slackware). Or use ELILO. (do have in mind that ELILO can only boot Linux, but having access to efi_vars you might also be able to run efibootmgr to properly set it up together with other bootloaders).

AlleyTrotter 12-13-2012 08:40 AM

One small point
elilo will boot both 32 and 64 bit kernels
actually 2 small points
if you can't access the 'efivars' you are in a legacy boot.
Most EFI/UEFI/WINDOWSBOOT systems simply fall thru to legacy if there is a problem in their setup.
try modprobe efivars
They are available at /sys/firmware/efi/vars/
whenever you are booted thru efi or uefi even in 3.2.29. In legacy (MBR) they are not created
John

PS I initially got booted in efi by building a stub kernel. Then ran efibootmgr to add a slot.


All times are GMT -5. The time now is 02:57 PM.