Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] MS Surface Book: UEFI/Grub issue
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Wed Dec 21, 2016 8:33 pm    Post subject: [SOLVED] MS Surface Book: UEFI/Grub issue Reply with quote

Dear all,

I'm trying to install Gentoo in dual boot on my brand new surface book.
I already did it with the Surface Pro 3 without issue but here I have a problem with the UEFI/Grub installation.

grub-install works properly and I see the "gentoo" entry into the EFI partition (also, in the surface book "bios"). It's selected as the first entry but it does not work.... and I don't know what to do honestly. When the computer starts, it first try to load the grub then use the next EFI entry (usb in my case).

Can somebody guide me to solve it please ? (I even do not know what information to provide you with so please don't hesitate to ask me more info)

Best,
Jerome


Last edited by jrevi on Tue Dec 27, 2016 2:25 pm; edited 3 times in total
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Wed Dec 21, 2016 8:52 pm    Post subject: Reply with quote

I forgot to specify that I of course disabled secure boot
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Thu Dec 22, 2016 3:19 am    Post subject: Reply with quote

Quote:
It's selected as the first entry but it does not work..
What exactly appears on screen when grub appears? presumably you click on the "first entry"? Then exactly what happens? Photos taken and posted at a photo site might help.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Thu Dec 22, 2016 10:07 am    Post subject: Reply with quote

In fact grub does not appear at all. When I say, first entry, I mean first UEFI boot entry.

efibootmgr list "gentoo" as the first entry, then "usb", the "Windows boot manager" etc...
When the surface book starts, the surface logo appears, then the screen "blink" (I think because it tries the gentoo EFI entry but it fails), the it boot on the usb (if the usb is not present then windows 10 start).

So the problem seems to be the gentoo EFI entry created by grub install isn't it ?

Best,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Thu Dec 22, 2016 2:36 pm    Post subject: Reply with quote

What are you using as install media?
Was the install media booted in UEFI mode when you ran grub-install?
What exact command did you run to install grub?
If you were following the handbook ( https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader ), it should have been grub-install --target=x86_64-efi --efi-directory=/boot with the boot partition formatted as FAT32(vfat) and mounted at /boot.
If you were following https://wiki.gentoo.org/wiki/GRUB2#UEFI_with_GPT , it should have been grub-install --efi-directory=/boot/efi (better, IMHO, grub-install --target=x86_64-efi --efi-directory=/boot/efi) with the efi partition formatted as FAT32(vfat) mounted at /boot/efi AND the boot partition(if existing) mounted at /boot.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Thu Dec 22, 2016 4:22 pm    Post subject: Reply with quote

I'm using systemRescueCD (gentoo based) as install media as usual.

and yes I use
Code:
grub-install --efi-directory=/boot/efi
( the target is already positioned in my make.conf)

As I said, even in the Surface "BIOS", I can see the "gentoo" UEFI entry... so the grub installation seems to work (as reported...).

I will try specifying the target just in case as you suggested.

Thanks for your help,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Thu Dec 22, 2016 7:25 pm    Post subject: Reply with quote

Please boot the sysresccd in uefi mode, mount the gentoo root partition at /mnt/gentoo.
If you use a separate boot partition, run ls /mnt/gentoo/boot (should show an empty directory, if not /mnt/gentoo/boot directory needs to be cleaned out).
Then mount the boot partition at /mnt/gentoo/boot.
If you use a separate efi partition, run ls /mnt/gentoo/boot/efi (should show an empty directory, if not /mnt/gentoo/boot/efi directory needs to be cleaned out).
Then mount the efi system partition at /mnt/gentoo/boot/efi.
Then run
Code:
ls -aR /mnt/gentoo/boot | wgetpaste -t
wgetpaste /mnt/gentoo/boot/grub/grub.cfg
and post the urls returned
Enter the chroot. Run
Code:
emerge wgetpaste
efibootmgr -v | wgetpaste -t
Post the urls returned.
Are there any complications such as lvm, raid, encryption, xfs, dual boot with windows, virtual machine, or ???
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Thu Dec 22, 2016 10:57 pm    Post subject: Reply with quote

Thanks a lot for your time. I finally found the problem: https://wiki.debian.org/GrubEFIReinstall - It seems that I was facing: "Problem1: Weak EFI implementation only recognizes the fallback bootloader".

Now I can see my grub !! .. but it does not boot yet ;-) My surface pro 3 kernel seems not compatible with the Surface book hardware. Do you know a place where I could find a valid .config file ?

Best,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Fri Dec 23, 2016 12:31 am    Post subject: Reply with quote

Still interested in the information requested in my Thu Dec 22, 2016 2:25 pm post.
Quote:
My surface pro 3 kernel seems not compatible with the Surface book hardware.
Kindly fill in the blanks: I saw ________ so I did ________ and then I saw ________. If you are getting a kernel panic; take a picture and post it on a free photo site then post the url here.
Quote:
Do you know a place where I could find a valid .config file ?
Yes, I do.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Fri Dec 23, 2016 9:07 pm    Post subject: Reply with quote

Code:
ls -aR /mnt/gentoo/boot | wgetpaste -t
-> http://bpaste.net/show/c0502fe538e6
Code:
wgetpaste /mnt/gentoo/boot/grub/grub.cfg
-> http://bpaste.net/show/671246cadc62
Quote:
efibootmgr -v | wgetpaste -t
-> https://paste.pound-python.org/show/OVtyYzLI8iAd5rMlCvvu/

There was no real complication... dual boot with windows but this should not be a complication from a linux point of view ;-)

Best,
Jerome
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Fri Dec 23, 2016 11:12 pm    Post subject: Reply with quote

Concerning my grub issue, I face the classic: “Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)”

I need to find the good controller ...

For information:

Code:

lspci:
        00:00.0 Host bridge: Intel Corporation Sky Lake Host Bridge/DRAM Registers (rev 08)
        00:02.0 VGA compatible controller: Intel Corporation Sky Lake Integrated Graphics (rev 07)
        00:05.0 Multimedia controller: Intel Corporation Sky Lake Imaging Unit (rev 01)
        00:08.0 System peripheral: Intel Corporation Sky Lake Gaussian Mixture Model
        00:14.0 USB controller: Intel Corporation Device 9d2f (rev 21)
        00:14.2 Signal processing controller: Intel Corporation Device 9d31 (rev 21)
        00:14.3 Multimedia controller: Intel Corporation Device 9d32 (rev 01)
        00:15.0 Signal processing controller: Intel Corporation Device 9d60 (rev 21)
        00:15.1 Signal processing controller: Intel Corporation Device 9d61 (rev 21)
        00:15.2 Signal processing controller: Intel Corporation Device 9d62 (rev 21)
        00:15.3 Signal processing controller: Intel Corporation Device 9d63 (rev 21)
        00:16.0 Communication controller: Intel Corporation Device 9d3a (rev 21)
        00:16.4 Communication controller: Intel Corporation Device 9d3e (rev 21)
        00:1c.0 PCI bridge: Intel Corporation Device 9d14 (rev f1)
        00:1d.0 PCI bridge: Intel Corporation Device 9d18 (rev f1)
        00:1d.3 PCI bridge: Intel Corporation Device 9d1b (rev f1)
        00:1f.0 ISA bridge: Intel Corporation Device 9d48 (rev 21)
        00:1f.2 Memory controller: Intel Corporation Device 9d21 (rev 21)
        00:1f.3 Audio device: Intel Corporation Device 9d70 (rev 21)
        00:1f.4 SMBus: Intel Corporation Device 9d23 (rev 21)
        02:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd Device a802 (rev 01)
        03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88W8897 [AVASTAR] 802.11ac Wireless



Best,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Sat Dec 24, 2016 2:49 am    Post subject: Reply with quote

Quote:
“Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)”
The kernel can't see your drive. Is it a rotating mechanical hard dive, a sata connected ssd, a sata pcie connected m2 ssd, an nvme pcie connected m2 ssd, a usb connected device, or ???.
An exact make and model number of your surface might be helpful.
There is at least a chance that you have an nvme ssd.
If that sounds reasonable your kernel menuconfig would need
Quote:
Device Drivers --->
<*> NVM Express block device
and maybe
Quote:
[*] SCSI emulation for NVMe device nodes

_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Sat Dec 24, 2016 10:34 am    Post subject: Reply with quote

Yep, I already tried to compile this without success. Still the same issue. I buit-in all the NVMe stuff.

For information, here is my .config file: https://bpaste.net/show/f7c6f5d46123

I have a MS Surface book (model: 1703, 1705): i7, 512G SSD, 16G RAM, Nvidia GeForce CPU

As you can see in the config file, I'm trying with kernel 4.8, not yet with 4.9 but for this specific problem I think that it will not make any difference.

Thanks,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Sat Dec 24, 2016 3:53 pm    Post subject: Reply with quote

Reminding me that M$ likes to keep secrets from their customers, even with model numbers their web site provides advertisements instead of technical data. Did they provide any documentation for the UEFI(bios) settings? At a quick look I see no problem in the .config.
I propose a harder look at the .config:
Boot the sysresccd in uefi mode, run (to gather comprehensive and massively redundant data)
Code:
lshw | grep -i driver | wgetpaste -t #1
lspci -k | wgetpaste -t #2
lspci -n | wgetpaste -t #3
lshw | wgetpaste -t #4
lsusb | wgetpaste -t #5
lsmod | wgetpaste -t #6
#1 is a summary of driver names, #2 pci driver names, #3 pciids which can be converted to driver names by pastiong them at http://kmuto.jp/debian/hcl/, #4 a comprehensive and very long hardware list, #5 another hardware list, #6 how modules interrelate. I will then try to produce a lighter weight manual kernel config.
I'll be working on a machine with lspci -k as shown at https://paste.pound-python.org/show/voRmxSQT4zGkctIQ4Go1/ .
BTW, there have been reports that grub has problems with nvme and uefi which may relate to those difficulties and some anomalies in your boot and EFI file systems.

edit to replace quote tags with code tags
_________________
Defund the FCC.


Last edited by DONAHUE on Sat Dec 24, 2016 4:19 pm; edited 1 time in total
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Sat Dec 24, 2016 4:07 pm    Post subject: Reply with quote

I will provide you with the need info, but I just wanted to say that i solved the UEFI boot issue using the latest efibootmgr version available in the tree (v30).
I saw this in another post of this forum into which you participate too: https://forums.gentoo.org/viewtopic-t-1056452.html
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Sat Dec 24, 2016 4:45 pm    Post subject: Reply with quote

Here it is:

#1 https://paste.pound-python.org/show/vENdSgYXPOnNs5SFbOlO/
#2 http://bpaste.net/show/ddb041160aba
#3 http://bpaste.net/show/6c8d752bb9f0
#4 https://paste.pound-python.org/show/6WU3YYWfm238WscX0AR9/
#5 http://bpaste.net/show/57223c13a60d
#6 http://bpaste.net/show/1008d25d652f

Thanks for your help.

Best,
Jerome
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2504
Location: Near Toronto

PostPosted: Sat Dec 24, 2016 4:51 pm    Post subject: Reply with quote

sorry to say I can't help but I want to ask about uefi/efi

WHY IS THIS SO HARD?

ubuntu, for example, installs for windows dual boot without
a hitch (in my experience) - in fact, I just install ubuntu in
a little partition then install gentoo and let ubuntu take
care of setting up grub
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Sat Dec 24, 2016 4:55 pm    Post subject: Reply with quote

albright wrote:
sorry to say I can't help but I want to ask about uefi/efi

WHY IS THIS SO HARD?

ubuntu, for example, installs for windows dual boot without
a hitch (in my experience) - in fact, I just install ubuntu in
a little partition then install gentoo and let ubuntu take
care of setting up grub


Well, this is not hard but buggy apparently. As I said the latest efibootmgr vresion solve the issue (grub-install use it).
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Sat Dec 24, 2016 6:06 pm    Post subject: Reply with quote

Shot from the hip, your surface pro 3 has a line in grub.cfg:
Quote:
initrd /initramfs-4.7.10-gentoo-surfacepro3.img
The new machine's entries have no initrd. The config has CONFIG_INTEL_MEI=m. While waiting, you might want to either create an initramfs and try to get grub.cfg to add it or edit menuconfig to include
Quote:
Device Drivers
Misc devices
<*> Intel Management Engine Interface
and recompile and reinstall the kernel. https://www.kernel.org/doc/Documentation/misc-devices/mei/mei.txt not easily readable. I vaguely recall some similar problem.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Mon Dec 26, 2016 12:46 pm    Post subject: Reply with quote

Thanks but unfortunately same issue with this compiles inside the kernel.

Best,
Jerome
Back to top
View user's profile Send private message
jrevi
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2005
Posts: 129

PostPosted: Tue Dec 27, 2016 2:25 pm    Post subject: Reply with quote

SOLVED.... but I don't know exatcly how.. or at least I don't know exactly what dracut is loading...

I create an initram using dracut, without any specific configuration and my kernel was able to boot!

In any case, I'm interested in a specific config file if you find time for this.

Thank a lot for you time and help!

Best,
Jerome
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7484
Location: Goose Creek SC

PostPosted: Tue Dec 27, 2016 2:38 pm    Post subject: Reply with quote

Good to hear!
I went on a tangent -- zcat /proc/config.gz > .config ; genkernel to get an initramfs and kernel ; boot failed, couldn't find the partuuid I was using for root partition ; noticed that virtually every kind of block device was loading or attempting to load except nvme. apparently genkernel is not up to the minute. So had just emerged dracut and resumed .config editing when I got your good news. Will continue editing. may play with dracut later. I generally avoid initramfs except for interesting problems.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum