Page 1 of 1

(Kindofsolved) UEFI Grub won't load Iinitrd?

Posted: Tue Apr 01, 2014 0:07
by Lukensteinz
Hi all.
I've been trying to install Sabayon onto my shiny new MSI GS70 Stealth laptop.
But, I am encountering a few problems.
Legacy mode works fine, but I need to dualboot Win8 with UEFI.

The first problem I have is that I can get an UEFI usb key of Sabayon to boot, to grub menu only (With gfx etc), but If I try to load any of the options, I get stuck on "Please wait...."
It looks as if it never loads the kernel at all.

I then tried Ubuntu 14.01, and lo and behold, it boots to grub, boots to either install or live, and installs fine. Also boots the installed distro fine + Win8.

After doing this, I then decided to copy the EFI/* and Boot/grub/x86_64-efi/* to the Sabayon USB key.
It then booted fine after that, right to the desktop, and also installed.
Here's where I ran into my next 2 problems.

1: The installer just wouldn't accept my EFI pertition, no matter what, even though Ubuntu did.
The only way to get past this was to format it using the installer (After backup of course). (This is also being discussed in a separate thread)

2: Once installed, I then ran into the first problem I had with the USB EFI, it just wouldn't load the kernel.

So... How do Sabayon Grub and Ubuntu Grub differ?
How hard would it be to replace Sabayon version with the Ubuntu version?

It's been a while since I've had to worry about boot stuff, and UEFI is an entirely new concept for me, so please be gentle :)

Re: UEFI boot won't load kernel?

Posted: Thu Apr 03, 2014 8:14
by Lukensteinz
I got it loading. Kind of.
Grub boots to grub command line only... It's not reading the config file?
I modified my grub.cfg to;

Code: Select all

menuentry 'Sabayon GNU/Linux' --class sabayon --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-7d1b13e5-d9b9-4988-baf0-a1d8d3f58601' {
	insmod gzio
	insmod part_gpt
	insmod ext2
	set root='hd0,gpt6'
	echo	'Loading Linux x86_64-3.12.0-sabayon ...'
	linux	(hd0,gpt6)/boot/kernel-genkernel-x86_64-3.12.0-sabayon root=/dev/sda6 ro  
	echo	'Loading initial ramdisk ...'
	initrd	(hd0,gpt6)/boot/initramfs-genkernel-x86_64-3.12.0-sabayon
and then in grub commandline: configfile (hd0,gpt6)/boot/grub/grub.cfg

What gives? I'm very inexperienced in the new EFI stuff.

Re: UEFI boot won't load kernel?

Posted: Thu Apr 03, 2014 22:52
by Lukensteinz
I've still not had much luck.

So far I've booted using the grub commandline, which got me into Sabayon, and I've performed a system update.
Since then, I've reinstalled standard Sabayon EFI + Grub.

I get dumped to grub commandline still (Where does the efi look for the grub.cfg?)
I'm able to boot using the above config. Which basically I've just added

Code: Select all

And I can only boot from that by using

Code: Select all

configfile (hd0,gpt6)/boot/grub/grub.cfg
The above is if I use the Ubuntu bootx64.efi or generate a new custom one.

But however if I use standard Sabayon generated config files and EFI, I run into the problem of the initrd not loading.
This also applies to the custom generated efi.

I will try another standard Sabayon grub/efi install at lunch time.
It is starting to irk me though.

Standard everything = initrd won't load.

Re: UEFI boot won't load kernel?

Posted: Fri Apr 04, 2014 0:20
by Lukensteinz
A quick update.

Using a fresh "grub2-install" + "grub2-mkconfig -o /boot/grub/grub.cfg"
Works, gets me to grub splash menu....
I still can't boot/load from there. Even using a grub command line fails, and seems to only be failing on the ramdisk.

I can however, still boot Sabayon by using for example, an Ubuntu boot disk and the grub commandline.

Re: UEFI boot won't load kernel?

Posted: Fri Apr 04, 2014 10:29
by Lukensteinz
Solved. Sort of.
The computer is an MSI GS70 laptop.
Sabayon any version, won't boot from live cd/dvd/usb unless the boot/*efi files are replaced with those off of an U buntu iso.

Once that is done, the distro will boot, and also install, quite easily. There is a problem with the EFI partition, being that Sabayon/Anaconda won't detect it as EFI. So back up the files on that partition before install as you will have to format it.

Once the install is done, boot from your external media again, and get to a Grub command line.
Type in;

Code: Select all

 linux (hd0,gpt6)/boot/bzImage
uld The hd0,gpt6 being your disc number followed by partition number of which you installed root/boot to. (from 0 to *)

Code: Select all

initrd (hd0,gpt6)/boot/Initrd
Caps do matter btw.

Code: Select all

You should then be booted into Sabayon.

Now comes the tricky part. You'll need to uninstall Grub, and grab from the git source.
This means you'll also need to have gcc and automake installed as you'll be building it.
Uninstall grub, then open a console to enter;

Code: Select all

git clone git://

Code: Select all

cd grub

Code: Select all

Next is;

Code: Select all

./configure --with-platform=efi --target=x86_64 --program-prefix=""

Code: Select all


Code: Select all

sudo make install
So now we have an installed grub, from source.
Lets install grub first;

Code: Select all

sudo grub-install --target=x86_64-efi --bootloader-id=Sabayon --recheck --debug
Now we are going to create a shiny new bootx64.efi in the directory of /boot/efi/EFI/Sabayon

Code: Select all

cd grub-core
The next bit creates a portable bootx64.efi with

Code: Select all

-p ""

Code: Select all

sudo ../grub-mkimage -v -d . -o /boot/efi/EFI/Sabayon/bootx64.efi -O x86_64-efi -p "" `find *.mod | xargs | sed -e 's/\.mod//g'`
The find, bit, is an easy way to include every module into the *.efi.

You will also want to generate a config file;

Code: Select all

sudo grub-mkconfig -o /boot/efi/EFI/Sabayon/grub.cfg
So lets clarfy, we've just build a "portable" grub bootx64.efi, which will look for grub.cfg in the directory that bootx64.efi is run from.
By doing this I have eliminated all the problems I've had, namely the initrd problem. I still have not worked out what is causing that with the Sabayon Grub on this laptop.
Even building a portable bootx64.efi with Sabayon grub, using the commands above, has not helped.

My next step is to get the dual graphics (nvidia optimus, keyboard leds and... not sure what else, all working.
Overall it's pretty good once booted.
Except the trackpad, very sensitive, but also feels like it's trying to move on a low rez screen.

Please let me know if I left anything out. I really hope this helps any MSI GS70 Sabayon users.
---Tag for google: Install Linux on MSI gs70 install sabayon on gs70 msi gs70 linux install

Re: (Kindofsolved) UEFI Grub won't load Iinitrd?

Posted: Mon Jul 14, 2014 6:16
by TheOneLaw
Thanks, :D

this definitely helped on my tablet install ->

I stumbled on how to boot the squashfs but eventually got past that.