fun UEFI boot

Post Reply
fvolk
Posts: 226
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 0
Contact:

fun UEFI boot

Unread post by fvolk » Wed Jan 16, 2019 7:21 am

So I finally obtained a M2 screw for my NVME and can install my H2.
Unfortunately none of my other systems so far boots via UEFI, so I have to use a live-USB system for all the installing - very annoying to configure keyboard/mounts etc. after every try :-(

I made some nice partitions:

Code: Select all

gdisk -l /dev/nvme0n1
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/nvme0n1: 488397168 sectors, 232.9 GiB
Model: Samsung SSD 960 EVO 250GB               
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): xxxxxxxxxxxxxxx
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI System
   2          206848       488397134   232.8 GiB   8300  Linux filesystem
The boot order is fine:

Code: Select all

efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0000,0001,0002
Boot0000* mylinux        HD(1,GPT,xxxxxxxxxxxxx,0x800,0x32000)/File(\EFI\mylinux\grubx64.efi)
and looking into the EFI partition, Grub is there:

Code: Select all

ls -la /mnt/EFI/*
-rwxr-xr-x 1 root root    185 Jan 15 21:46 /mnt/EFI/mylinux/grub.cfg
-rwxr-xr-x 1 root root 221184 Jan 15 19:41 /mnt/EFI/mylinux/grubx64.efi
with a nice grub.cfg config (don't know whether this is really needed):

Code: Select all

search.fs_uuid xxxxxxxxxx root hd0,gpt2
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Unfortunately, the board hangs immediately at boot. My intuition would be there should be at least a "hello" message from Grub once grubx64.efi is loaded and Grub searches for the root partition, but it isn't.

Reading up on what may go wrong, there's plenty in UEFI land.
32/64 bit UEFI - I think this platform is 64bit only.
EFI system partition: some say size does not matter, some say 100Mb, some say 200Mb, some say 500Mb...?

...so I'm curious, what is your configuration that is working?
You boot via MBR or GPT partitioned disk?
Your system partition is size? Does the H2 have a minimum size?
Just like me via grubx64.efi - or other way?
...

Probably I'll just do a Ubuntu default install and then replace the root filesystem.... :-/

User avatar
n2qcn
Posts: 25
Joined: Sat Dec 01, 2018 12:38 pm
languages_spoken: english
ODROIDs: H2
Has thanked: 0
Been thanked: 0
Contact:

Re: fun UEFI boot

Unread post by n2qcn » Fri Jan 18, 2019 2:55 am

why not copy the working grubx64.efi from the liveCD to the the disk's ESP partition? just remember it contains an embedded grub.cfg with paths you can't edit, so you need to move your grub.cfg its hard coded path.

fvolk
Posts: 226
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 0
Contact:

Re: fun UEFI boot

Unread post by fvolk » Fri Jan 18, 2019 4:13 am

Yes, meanwhile I know my own Grub image is/was somehow bad,
manually copying one from Ubuntu (one of them works, there are multiple...) I land at the Grub prompt (so only the config/modules are wrong).
Still debugging...

I learned a lot the last days and see that UEFI is capable of more, but I'm not surely that the significant complexity is/was worth it...

User avatar
n2qcn
Posts: 25
Joined: Sat Dec 01, 2018 12:38 pm
languages_spoken: english
ODROIDs: H2
Has thanked: 0
Been thanked: 0
Contact:

Re: fun UEFI boot

Unread post by n2qcn » Fri Jan 18, 2019 11:31 am

poke around with:

Code: Select all

ls
ls (hd0,gpt2)/
ls (hd0,gpt1)/
configfile (hd0,gpt2)/boot/grub/grub.cfg
but I bet if you put the "correct" grub.cfg for your OS in (hd0,gpt1)/efi/ubuntu/grub.cfg it will boot perfectly.

Another trick is to copy efi/ubuntu/grubx64.efi to efi/boot/bootx64.efi as the bios will automatically make a boot option for it.

fvolk
Posts: 226
Joined: Sun Jun 05, 2016 11:04 pm
languages_spoken: english
ODROIDs: C2, HC1, H2
Has thanked: 0
Been thanked: 0
Contact:

Re: fun UEFI boot

Unread post by fvolk » Wed Apr 17, 2019 6:14 pm

So after repeated attempts over the last ~3 months and lots of wasted time :-(, and my H2 gathering dust, finally today manual assembly and boot of a system image worked.
Why? I upgraded to Grub 2.04 RC1 https://www.phoronix.com/scan.php?page= ... -Candidate

With 2.04 everything just works[tm] as advertised - I guess popular distributions carry some patches that fix issues that are now included in 2.04 by default, and the H2 being a very new box needs one...

HTH!

Post Reply

Return to “Other OS”

Who is online

Users browsing this forum: No registered users and 0 guests