Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] UEFI-fails to boot

436 views
Skip to first unread message

Dan Johansson

unread,
Jan 25, 2018, 6:00:04 AM1/25/18
to
I have bought me a shiny new Supermicro X10DRi-T motherboard with two
Xenon-E5-2620-v3 CPUs for use as a server.

I have configured the MB for UEFI-mode only and my rescuecd-USB-key
boots find in UEFI-mode.

Following the Handbook and the "EFI System Partition" handbook I have
created the following GPT-disklayout:

root@sysresccd /root % parted /dev/sda print
Model: ATA ST1000DX002-2DV1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 3146kB 2097kB fat32 grub bios_grub
2 3146kB 137MB 134MB ext2 boot boot, esp
3 137MB 4429MB 4292MB linux-swap(v1) swap
4 4429MB 5503MB 1074MB root
5 5503MB 1000GB 995GB vg

Partition-1 was created like this: mkfs.fat -F 32 -n efi-boot /dev/sda1
Partition-2 was created like this: mkfs.ext2 -T small /dev/sda2

GRUB_PLATFORMS was set to "efi-64" in make.conf before emerging grub:2

/boot and /boot/efi is mounted like this
# mount | grep boot
/dev/sda2 on /boot type ext2 (rw,relatime,errors=continue,user_xattr,acl)
/dev/sda1 on /boot/efi type vfat
(rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

I had to remount /sys/firmware/efi/efivars in rw-mode, otherwise
grub-install would complain.

grub-install was run like this
"grub-install --target=x86_64-efi --efi-directory=/boot/efi"

And "grub-mkconfig -o /boot/grub/grub.cfg" has been run without any errors.

efibootmgr shows my gentoo as the first entry
# efibootmgr
Timeout: 1 seconds
BootOrder: 0000,0001,0002,0003
Boot0000 gentoo
Boot0001 Hard Drive
Boot0002 Network Card
Boot0003 UEFI: Built-in EFI Shell


But when I boot without the USB-key inserted I always "lands" in the
Built-in EFI Shell - NO sign of GRUB.

Any suggestions where I have gone wrong?

KR
--
Dan Johansson,
***************************************************
This message is printed on 100% recycled electrons!
***************************************************

Wols Lists

unread,
Jan 25, 2018, 6:10:03 AM1/25/18
to
On 25/01/18 10:54, Dan Johansson wrote:
> But when I boot without the USB-key inserted I always "lands" in the
> Built-in EFI Shell - NO sign of GRUB.
>
> Any suggestions where I have gone wrong?

Well, in your position I wouldn't be trying to load grub. I've got a new
mobo (with a Ryzen 3 :-) but that won't POST at the moment, so I'm going
to be in your position very soon building a new UEFI system.

But what I think you're supposed to do is use UEFI to load the linux
kernel directly ... not sure how you do that yet :-)

Cheers,
Wol

Mick

unread,
Jan 25, 2018, 6:40:04 AM1/25/18
to
On Thursday, 25 January 2018 10:54:28 GMT Dan Johansson wrote:
> I have bought me a shiny new Supermicro X10DRi-T motherboard with two
> Xenon-E5-2620-v3 CPUs for use as a server.
>
> I have configured the MB for UEFI-mode only and my rescuecd-USB-key
> boots find in UEFI-mode.
>
> Following the Handbook and the "EFI System Partition" handbook I have
> created the following GPT-disklayout:
>
> root@sysresccd /root % parted /dev/sda print
> Model: ATA ST1000DX002-2DV1 (scsi)
> Disk /dev/sda: 1000GB
> Sector size (logical/physical): 512B/4096B
> Partition Table: gpt
> Disk Flags:
>
> Number Start End Size File system Name Flags
> 1 1049kB 3146kB 2097kB fat32 grub bios_grub

The above implies an MBR partition table approach to booting your OS, which a
non-UEFI (BIOS only) MoBo will need. However you are meant to be using UEFI
*only* and GPT ...


> 2 3146kB 137MB 134MB ext2 boot boot, esp

and this partition is what should be used for an UEFI MoBo, but the fs is
wrong. Change it to fat32 and check with gdisk that its partition code is
EF00, which according to your 'boot, esp' flags it should be. This is your
EFI System Partition (ESP).


> 3 137MB 4429MB 4292MB linux-swap(v1) swap
> 4 4429MB 5503MB 1074MB root
> 5 5503MB 1000GB 995GB vg
>
> Partition-1 was created like this: mkfs.fat -F 32 -n efi-boot /dev/sda1
> Partition-2 was created like this: mkfs.ext2 -T small /dev/sda2
>
> GRUB_PLATFORMS was set to "efi-64" in make.conf before emerging grub:2
>
> /boot and /boot/efi is mounted like this
> # mount | grep boot
> /dev/sda2 on /boot type ext2 (rw,relatime,errors=continue,user_xattr,acl)
> /dev/sda1 on /boot/efi type vfat
> (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mi
> xed,errors=remount-ro)
>
> I had to remount /sys/firmware/efi/efivars in rw-mode, otherwise
> grub-install would complain.

Yes, this has been the case for some time now. You will always need to
remount it as rw before you change the contents of the ESP boot partition. It
is also mentioned here:

https://wiki.gentoo.org/wiki/GRUB2


> grub-install was run like this
> "grub-install --target=x86_64-efi --efi-directory=/boot/efi"

But ... /boot/efi is not your ESP.


> And "grub-mkconfig -o /boot/grub/grub.cfg" has been run without any errors.
>
> efibootmgr shows my gentoo as the first entry
> # efibootmgr
> Timeout: 1 seconds
> BootOrder: 0000,0001,0002,0003
> Boot0000 gentoo
> Boot0001 Hard Drive
> Boot0002 Network Card
> Boot0003 UEFI: Built-in EFI Shell

Use 'efibootmgr -v' to check the path of the .efi image it tries to boot and
check the path is correct without any typos. What you show above is only a
label.


> But when I boot without the USB-key inserted I always "lands" in the
> Built-in EFI Shell - NO sign of GRUB.
>
> Any suggestions where I have gone wrong?
>
> KR

The ESP needs to be formatted as vfat and the GRUB boot image grubx64.efi
should be installed there.

HTH.
--
Regards,
Mick
signature.asc

Mick

unread,
Jan 25, 2018, 6:50:03 AM1/25/18
to
On Thursday, 25 January 2018 11:07:40 GMT Wols Lists wrote:

> But what I think you're supposed to do is use UEFI to load the linux
> kernel directly ... not sure how you do that yet :-)
>
> Cheers,
> Wol

If you do not need/want to use a boot loader like GRUB you can use the
efibootmgr to set the kernel image to boot directly. For example:

efibootmgr --create --disk /dev/sda --part 1 --label "gentoo-4.14.14_20-Jan"
--loader "\EFI\BOOT\bootx64-4.14.14-gentoo.efi"

Where \EFI\BOOT\bootx64-4.14.14-gentoo.efi is found under:

# tree /boot
/boot
├── EFI
└── BOOT
├── System.map-4.14.12-gentoo
├── System.map-4.14.14-gentoo
├── System.map-4.14.8-gentoo-r1
├── bootx64-4.14.12-gentoo.efi
├── bootx64-4.14.14-gentoo.efi
├── bootx64-4.14.8-gentoo-r1.efi
├── config-4.14.12-gentoo
├── config-4.14.14-gentoo
└── config-4.14.8-gentoo-r1

You should also set CONFIG_EFI_STUB=y in your kernel.
--
Regards,
Mick
signature.asc

Dan Johansson

unread,
Jan 25, 2018, 8:20:03 AM1/25/18
to
Thanks for the advice, now grub starts and I get the menu (now I just
have to figure out why the kernel hangs after being loaded).
And just for reference, my partition-table now looks like this:

Number Start End Size File system Name Flags
1 1049kB 137MB 136MB fat32 boot boot, esp
3 137MB 4429MB 4292MB linux-swap(v1) swap
4 4429MB 5503MB 1074MB root
5 5503MB 1000GB 995GB vg


KR

--
Dan Johansson

Mick

unread,
Jan 25, 2018, 10:30:03 AM1/25/18
to
On Thursday, 25 January 2018 13:18:13 GMT Dan Johansson wrote:
> Thanks for the advice, now grub starts and I get the menu (now I just
> have to figure out why the kernel hangs after being loaded).

Glad you got it loading.

Check at what stage the kernel oops - this would point at what in the kernel
configuration has gone awry. You must build the chipset and filesystem
drivers in the kernel (not as loadable modules), which may even drop you in a
command prompt to troubleshoot from there.
--
Regards,
Mick
signature.asc

Dan Johansson

unread,
Jan 25, 2018, 11:30:04 AM1/25/18
to
The kernel did not oops, there were just the messages
Booting 'Gentoo GNU/Linux'
Loading Linux x86_64-4.9.76-gentoo-r1
and here it was just hanging.

I normally do not like to have an initramfs but to com further I
installed genkernel and let it build the kernel.
The genkernel generated kernel does boot and everything, except on thing
(at the moment), works - I can ssh into the box and continue configuration.

The one thing that is not working is that I do not see ANY boot-messages
on the console (it just says Loading Linux and Loading initial ramdisk
...), and I do not get a login-prompt and can not switch VT.

But as I said, I can login with ssh and can now continue with the setup,
the "Console" has to wait.

Neil Bothwick

unread,
Jan 25, 2018, 2:30:03 PM1/25/18
to
On Thu, 25 Jan 2018 17:28:49 +0100, Dan Johansson wrote:

> The one thing that is not working is that I do not see ANY boot-messages
> on the console (it just says Loading Linux and Loading initial ramdisk
> ...), and I do not get a login-prompt and can not switch VT.
>
> But as I said, I can login with ssh and can now continue with the setup,
> the "Console" has to wait.

Does /dev/console exist on your root filesystem?


--
Neil Bothwick

Angular Momentum Makes The World Go 'Round

Johnson Steward

unread,
Jan 25, 2018, 8:30:04 PM1/25/18
to
Well, check if you have CONFIG_FB_EFI enabled in your config.

> H30/01/26 0:28、Dan Johansson <d...@dmj.nu>のメール:

Dan Johansson

unread,
Jan 26, 2018, 4:00:03 AM1/26/18
to
On 25.01.2018 20:21, Neil Bothwick wrote:
> On Thu, 25 Jan 2018 17:28:49 +0100, Dan Johansson wrote:
>
>> The one thing that is not working is that I do not see ANY boot-messages
>> on the console (it just says Loading Linux and Loading initial ramdisk
>> ...), and I do not get a login-prompt and can not switch VT.
>>
>> But as I said, I can login with ssh and can now continue with the setup,
>> the "Console" has to wait.
>
> Does /dev/console exist on your root filesystem?

Yes.

# mount --bind / /mnt/x
# ll /mnt/x/dev/console
crw------- 1 root root 5, 1 Jan 17 03:14 /mnt/x/dev/console

Dan Johansson

unread,
Jan 26, 2018, 5:10:04 AM1/26/18
to
On 26.01.2018 02:25, Johnson Steward wrote:
> Well, check if you have CONFIG_FB_EFI enabled in your config.

Good idea, but sadly, nope, that was not it.

Corbin Bird

unread,
Jan 26, 2018, 10:30:04 AM1/26/18
to
On 01/26/2018 04:00 AM, Dan Johansson wrote:
> On 26.01.2018 02:25, Johnson Steward wrote:
>> Well, check if you have CONFIG_FB_EFI enabled in your config.
> Good idea, but sadly, nope, that was not it.
>
> KR
.
Questions that may sound strange ...
What version of Windows does your motherboard support?
Do you use any add on ( PCI / PCIe ) cards that do not support UEFI and
load a BIOS?
Have you configured a specific type of video card in the kernel?
.
The reasons why I ask this :
The UEFI driver for video changes type & version between Win 7 & Win 8.
An LSI 9211-4i ( Raid Controller / SAS  ) loads only a BIOS ... and
interferes with the Win 8 UEFI Video driver.
( It interferes enough with the Win 8 UEFI Video driver, that Win 7 will
work with it. )
It also means no console video until init is ( almost ) completed.
That is when the chosen specific video card frame buffer takes over.
.
Corbin

Dan Johansson

unread,
Jan 27, 2018, 11:10:03 AM1/27/18
to
According to the supermicro homepage The following Windows versions are
supported: 7 SP1, 8 Enterprise, 8.1 Enterprise, 10, Server 2008 R2 SP1,
Server 2012 and Server 2012 R2.

No PCI/PCIe cards installed (yet).
No special Video driver in the kernel except CONFIG_FB_EFI=y as
suggested by Johnson Steward.
The MB has a integrated VGA output.

Corbin Bird

unread,
Jan 27, 2018, 6:20:03 PM1/27/18
to
On 01/27/2018 10:06 AM, Dan Johansson wrote:
According to the supermicro homepage The following Windows versions are
supported: 7 SP1, 8 Enterprise, 8.1 Enterprise, 10, Server 2008 R2 SP1,
Server 2012 and Server 2012 R2.

No PCI/PCIe cards installed (yet).
No special Video driver in the kernel except CONFIG_FB_EFI=y as
suggested by Johnson Steward.
The MB has a integrated VGA output.

KR

.
Thank you for that info.
.
What kind of integrated VGA?
( example Intel i915, i965, etc. )
.
The reason I ask is that the EFI framebuffer you have enabled should be built into a specific video driver.
My system has an "amdgpu" video card.
The EFI framebuffer driver for the console is enabled.
The specific video driver called "amdgpu" is also enabled.
The EFI framebuffer is built as a sub-component of the specific video driver "amdgpu".
.
Sample dmesg output :
[    6.223405] [drm] amdgpu kernel modesetting enabled.
[    6.223573] [drm] initializing kernel modesetting (POLARIS10 0x1002:0x67DF 0x1682:0x9480 0xC7)
[    6.882691] Console: switching to colour frame buffer device 240x67
[    6.900623] amdgpu 0000:01:00.0: fb0: amdgpudrmfb frame buffer device
.
If you haven't already run this command, please do so :  lspci | grep -i VGA
.
If the video device is a 'Aspeed ASTxxxx', the version number of the kernel you are using makes a big difference.

ASPEED's AST2500 Display To Be Supported By Linux 4.11's DRM

https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/x-org-drm/935002-aspeed-s-ast2500-display-to-be-supported-by-linux-4-11-s-drm
.
For Intel video devices, this wiki may help :
https://wiki.gentoo.org/wiki/Intel
.
Corbin

Dan Johansson

unread,
Jan 28, 2018, 5:40:03 AM1/28/18
to
On 28.01.2018 00:13, Corbin Bird wrote:

Thanks for your feedback.

> .
> Thank you for that info.
> .
> What kind of integrated VGA?
> ( example Intel i915, i965, etc. )
According to the MB docu is it a "ASPEED AST2400 BMC" Video controller.

> .
> The reason I ask is that the EFI framebuffer you have enabled should be
> built into a specific video driver.
> My system has an "amdgpu" video card.
> The EFI framebuffer driver for the console is enabled.
> The specific video driver called "amdgpu" is also enabled.
> The EFI framebuffer is built as a sub-component of the specific video
> driver "amdgpu".
> .
> Sample dmesg output :
>> [    6.223405] [drm] amdgpu kernel modesetting enabled.
>> [    6.223573] [drm] initializing kernel modesetting (POLARIS10
>> 0x1002:0x67DF 0x1682:0x9480 0xC7)
>> [    6.882691] Console: switching to colour frame buffer device 240x67
>> [    6.900623] amdgpu 0000:01:00.0: fb0: amdgpudrmfb frame buffer device
> .
> If you haven't already run this command, please do so :  lspci | grep -i VGA

# lspci | grep VGA
06:00.0 VGA compatible controller: ASPEED Technology, Inc. ASPEED
Graphics Family (rev 30)

> If the video device is a 'Aspeed ASTxxxx', the version number of the
> kernel you are using makes a big difference.
>>
# uname -r
4.9.76-gentoo-r1
Thanks for that link, I will have to look into that.
Although I will not be using X on this box, as it is a server, it looks
like I need to configure DRM.

Corbin Bird

unread,
Jan 29, 2018, 6:10:03 PM1/29/18
to
On 01/28/2018 04:35 AM, Dan Johansson wrote:
>>> ASPEED's AST2500 Display To Be Supported By Linux 4.11's DRM
>>>
>>> https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/x-org-drm/935002-aspeed-s-ast2500-display-to-be-supported-by-linux-4-11-s-drm
> Thanks for that link, I will have to look into that.
> Although I will not be using X on this box, as it is a server, it looks
> like I need to configure DRM.
>
> KR
>
.
This will give you some idea of what version of kernel to aim for :
> index : ~airlied/linux
> https://cgit.freedesktop.org/~airlied/linux/log/?qt=grep&q=AST2400&showmsg=1
.
This link forced VESA / frame buffer without 'drm'.
> Xorg support for Aspeed AST2400 VGA controller [solved]
> http://forums.system-rescue-cd.org/viewtopic.php?t=5351
.
Corbin

J. Roeleveld

unread,
Jan 31, 2018, 8:40:03 AM1/31/18
to
On a system with the same mainboard:

zcat /proc/config.gz | grep -i drm
# CONFIG_DRM is not set


Eg, DRM is not necessary.

I don't reboot often enough to find it necessary to "fix" the UEFI boot. Mine
still goes into the EFI-shell and from there I start xen.

--
Joost
0 new messages