[coreboot] Coreboot with an UEFI payload to boot (Clover) an Thinkpad X230 Hackintosh

Zoran Stojsavljevic zoran.stojsavljevic at gmail.com
Mon Jan 1 19:02:54 CET 2018


>> Yes, I know that, whether I use Clover or Grub2, they both use a small fat32 EFI partition, which hold the same file /efi/boot/bootx64.efi in order to boot their OSes.

> Actually, I were wrong, each UEFI system seems to use its own location: http://www.uefi.org/registry

Hello Fred,

Let me go with my known proverb: "divide and conquer" (I am on my UEFI
Fedora 27, since I do some "homework" on Ansibe, YAML and Vagrant)!

Let us see what do I have on my UEFI + GRUB2 + F27!

[root at localhost boot]# pwd
/boot
[root at localhost boot]# uname -a
Linux localhost.localdomain 4.14.8-300.fc27.x86_64 #1 SMP Wed Dec 20
19:00:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root at localhost boot]# ls -al efi
\total 24
drwx------.  5 root root 4096 Jan  1  1970 .
dr-xr-xr-x.  7 root root 4096 Dec 31 12:07 ..
drwx------. 14 root root 4096 Dec 31 12:07 3c8fbce2324b4dd78c361ce8ba65908f
drwx------.  6 root root 4096 Sep 14 19:10 EFI
-rwx------.  1 root root   34 Aug  4 02:30 mach_kernel
drwx------.  3 root root 4096 Nov 15  2016 System
[root at localhost boot]# cd efi/EFI
[root at localhost EFI]# pwd
/boot/efi/EFI
[root at localhost EFI]# ls -al
total 24
drwx------. 6 root root 4096 Sep 14 19:10 .
drwx------. 5 root root 4096 Jan  1  1970 ..
drwx------. 2 root root 4096 Dec 31 11:18 Boot
drwx------. 4 root root 4096 Dec 31 12:07 fedora
drwx------. 4 root root 4096 Sep 14 19:10 HP
drwx------. 4 root root 4096 Dec 29  2016 Microsoft
[root at localhost EFI]# cd fedora
[root at localhost fedora]# pwd
/boot/efi/EFI/fedora
[root at localhost fedora]# ls -al
total 7184
drwx------. 4 root root    4096 Dec 31 12:07 .
drwx------. 6 root root    4096 Sep 14 19:10 ..
-rwx------. 1 root root     112 Oct  4 17:39 BOOT.CSV
-rwx------. 1 root root     110 Oct  4 17:39 BOOTX64.CSV
drwx------. 2 root root    4096 Dec 31 11:34 fonts
drwx------. 2 root root    4096 Sep 20 21:56 fw
-rwx------. 1 root root   64000 Sep 20 21:56 fwupia32.efi
-rwx------. 1 root root   76392 Sep 20 21:56 fwupx64.efi
-rwx------. 1 root root    8300 Dec 31 12:07 grub.cfg
-rwx------. 1 root root    6217 Jan 24  2017 grub.cfg_orig
-rwx------. 1 root root    1024 Dec 31 12:07 grubenv
-rwx------. 1 root root 1030472 Oct 24 19:02 grubx64.efi
-rwx------. 1 root root 1163208 Oct  4 17:39 mmx64.efi
-rwx------. 1 root root 1163208 Oct  4 17:39 MokManager.efi
-rwx------. 1 root root 1293304 Oct  4 17:39 shim.efi
-rwx------. 1 root root 1293304 Oct  4 17:39 shimx64.efi
-rwx------. 1 root root 1206896 Oct  4 17:39 shimx64-fedora.efi
[root at localhost fedora]#

Do you see it? It is grubx64.efi, and, believe me or not, I can
break/hack into my UEFI shell (which is NOT normally available to
users). So I see tjhere (on UEFI shell 2.40), the SAME directories (on
/boot/efi/). And I can start GRUB2 menu just issuing in UEFI shell (in
/boot/efi/EFI/fedora) grubx64.efi!

While doing Coreboot + Tiano Core (or UEFI) in flash & GRUB2 + Ubuntu
on drive, you should check and see if you see the same as me?! At
least using stock BIOS???
_______

> So I’ve tried to build a Grub2 EFI as payload for Coreboot, but without success.

Nope. You have GRUB2 on drive, already. You should build Coreboot +
Tiano Core in flash (then have drive GRUB2 + Ubuntu), but here
somebody from Coreboot-GOOGLE folks should give you a hand.

Should work, as my best understanding is.

Zoran
_______

On Mon, Jan 1, 2018 at 11:07 AM, my First name is Test And my last
Name is iPation <testipation at live.com> wrote:
>
>
> On 29 Dec 2017, at 21:02, my First name is Test And my last Name is iPation
> <testipation at live.com> wrote:
>
> Yes, I know that, whether I use Clover or Grub2, they both use a small fat32
> EFI partition, which hold the same file /efi/boot/bootx64.efi in order to
> boot their OSes.
>
>
> Actually, I were wrong, each UEFI system seems to use its own location:
> http://www.uefi.org/registry
>
>
> I think my first attempt Coreboot+TianoCore + macOS failed because of macOS
> lastest filesystem (APFS), which is for now a bit "exotic".
> So, yes, I'll follow your hint, and first try Coreboot/TianoCore (on chip) +
> Grub2(EFI)/Ubuntu (on disk).
> And if it works, I will try it with the traditional EFI/HFS (on disk) macOS
> way (without APFS).
>
>
> So I’ve tried Coreboot/TianoCore (on chip) + Grub2(EFI)/Ubuntu (on disk),
> and it did’t worked. I have a black screen with a blinking cursor (top left
> screen).
> I’ve tried with Clover/macOS instead of Ubuntu, same result.
>
> In the mean time, I’ve tried the stock UEFI Bios (on chip) +
> Grub2(EFI)/Ubuntu (on 1st disk, 1st to boot) + Clover(EFI)/macOS (on 2nd
> disk), well, Grub(EFI) can boot Clover (which boot macOS).
> So I’ve tried to build a Grub2 EFI as payload for Coreboot, but without
> success. When building Grub2, there is the "—with-plaform=" option, and it’s
> either —with-plaform=coreboot or —with-plaform=efi. It doesn’t seem to be
> possible to select both. And of course Grub2 build —with-plaform=coreboot
> cannot boot Clover (nor macOS).
>
> So for now, I’m stuck.. Maybe I’ll try Coreboot/Seabios/Duet(Tianocore)
>
>
> Thanks Zoran.
>
>
>
> ________________________________
> From: Zoran Stojsavljevic <zoran.stojsavljevic at gmail.com>
> Sent: Friday, December 29, 2017 8:37 PM
> To: my First name is Test And my last Name is iPation
> Cc: coreboot at coreboot.org; ron minnich
> Subject: Re: [coreboot] Coreboot with an UEFI payload to boot (Clover) an
> Thinkpad X230 Hackintosh
>
> Hello Fred,
>
>> > So in such a case you would replace/overwrite (in flash) UEFI BIOS
>> > with Coreboot + payload Tiano Core, which will boot GRUB 2.0 from
>> > drive, them show GRUB 2.0 boot menu with MacOS as one of the entries).
>>
>> It's a good idea, I'll work on it. Thank you very much.
>
> This is 100% duable: Coreboot + payload Tiano Core (flash), which will
> boot GRUB 2.0 from drive, then show GRUB 2.0 boot menu with original
> MacOS (if you can overwrite Clover with GRUB 2.0, not affecting
> MacOS).
>
> I'll give you here the hint: you should see, using stock UEFI BIOS,
> /boot/efi directory, which is FAT32 formatted (if you can enter BIOS
> UEFI shell), where you can see either Clover executable (cloverx64.efi
> or similar name), either grubx64.efi, if you correctly have
> overwritten Clover with GRUB 2.0.
>
> If you do not have ability to enter UEFI shell on stock UEFI BIOS, you
> can, using original MacOS probably see /boot. and find there efi/
> directory, And inspect it yourself (maybe you can from MacOS overwrite
> Clover with GRUB 2.0, and do inspection at the spot).
>
> As the addendum, you should take your Ubuntu HDD/SSD, installed with
> SeaBIOS as payload, then using Coreboot + payload Tiano Core in flash,
> reinstall from scratch Ubuntu (making it UEFI compatible).
>
> In such a case, your SINGLE Coreboot + Tiano Core flash FW will
> satisfy all your needs, since you will use x230 with various UEFI
> compatible OSes. Either as multiboot OS system on large HDD/SSD,
> either swapping drives with UEFI compatible OSes. Your choice. :-)
>
> Zoran
>
> On Fri, Dec 29, 2017 at 7:58 PM, my First name is Test And my last
> Name is iPation <testipation at live.com> wrote:
>>
>>
>>
>>
>>
>> From: Zoran Stojsavljevic <zoran.stojsavljevic at gmail.com>
>> Sent: Friday, December 29, 2017 7:16 PM
>> To: my First name is Test And my last Name is iPation
>> Cc: coreboot at coreboot.org; ron minnich
>> Subject: Re: [coreboot] Coreboot with an UEFI payload to boot (Clover) an
>> Thinkpad X230 Hackintosh
>>
>>
>>> Hi, I have a Thinkpad X230 with stock Bios,booting
>>> macOS High Sierra, using Clover EFI boot loader.
>>> And it's working great! Then I've went through the
>>> process of installing Coreboot/Seabios + Ubuntu on
>>> another disk, and it works like a charm too! However,
>>> I would like to use Coreboot+payload instead of the
>>> stock Bios, in order to boot Clover/macOS.
>>
>> Let me try to decipher this spaghetti mess... First/Last name + The
>> Coreboot list!
>>
>> Sorry for the weird name.
>>
>>
>> You have a Thinkpad X230 with Stock BIOS on your flash. This one
>> worked well with your HDD/SSD, on which you have Clover EFI boot
>> loader, booting MacOS.
>>
>> Yes.
>>
>>
>> You recently made Coreboot + SeaBIOS, and programmed it to your flash,
>> erasing/overwriting stock BIOS. Then you install on other HDD/SSD
>> Ubuntu using Coreboot + SeaBIOS flash, and it worked like a charm.
>>
>> Yes.
>>
>>
>> Now, when you return back your initial HDD/SSD with Clover EFI boot
>> loader and MacOS, it does not boot. It does NOT. You are using
>> (SeaBIOS) Legacy bootloader which could NOT boot UEFI (UEFI installed)
>> based OS (in this case MacOS).
>>
>> No, I didn't returned back to my initial disk with macOS, because I know
>> it
>> wouldn't work.
>>
>>
>>
>>> I know there is TianoCore to boot UEFI systems.
>>> Has anyone Tried something similar ?
>>
>> In order to make attempt to make your initial HDD/SSD (Clover EFI boot
>> loader, booting MacOS) to work, you need to use Coreboot with Tiano
>> Core payload. The problem here is how to pass Tiano Core thread of
>> execution to Clover EFI boot loader (I have no slightest idea about
>> that, and about Clover EFI bootloader).
>>
>> In the mean time, I've just tried Coreboot+TianoCore payload, in order to
>> boot my Clover+macOS disk, it didn't work, just a black screen. But I
>> didn't
>> got my hopes up, I were just trying.
>>
>>
>>
>> My best guess it is similar to the problem if you had UEFI BIOS
>> (programmed on flash) with GRUB 2.0 booting MacOS (I have no idea if
>> this combination exists, I assume it does).
>>
>> Yes it does, with Grub compiled --with-platform=efi
>>
>>
>>
>> So in such a case you would replace/overwrite (in flash) UEFI BIOS
>> with Coreboot + payload Tiano Core, which will boot GRUB 2.0 from
>> drive, them show GRUB 2.0 boot menu with MacOS as one of the entries).
>>
>> It's a good idea, I'll work on it. Thank you very much.
>>
>> Fred
>>
>>
>> I hope this helps... .. . I really do.
>>
>> Zoran
>> _______
>>
>> On Fri, Dec 29, 2017 at 6:13 PM, my First name is Test And my last
>> Name is iPation <testipation at live.com> wrote:
>>> Hi, I have a Thinkpad X230 with stock Bios, booting macOS High Sierra,
>>> using
>>> Clover EFI boot loader. And it's working great!
>>>
>>> Then I've went through the process of installing Coreboot/Seabios +
>>> Ubuntu
>>> on another disk, and it works like a charm too!
>>>
>>> However, I would like to use Coreboot+payload instead of the stock Bios,
>>> in
>>> order to boot Clover/macOS.
>>>
>>> I know there is TianoCore to boot UEFI systems. Has anyone Tried
>>> something
>>> similar ?
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> coreboot mailing list: coreboot at coreboot.org
>>> https://mail.coreboot.org/mailman/listinfo/coreboot
> coreboot Info Page
> mail.coreboot.org
> coreboot project mailing list. To see the collection of prior postings to
> the list, visit the coreboot Archives. Using coreboot
>
>>
>>
>> coreboot Info Page
>> mail.coreboot.org
>> coreboot project mailing list. To see the collection of prior postings to
>> the list, visit the coreboot Archives. Using coreboot
>>
> --
> coreboot mailing list: coreboot at coreboot.org
> https://mail.coreboot.org/mailman/listinfo/coreboot
>
>



More information about the coreboot mailing list