Page 2 of 2

Re: Where will esp go in this linux-on-macbook attempt ?

Posted: Fri May 14, 2021 7:23 am
by bodge99
Hi,

A 200MB size for an EFI partition is fine.. You'll see why shortly. I use this size on some kit where I need space for use with "unusual booting" e.g. booting a system from unsupported hardware (examples here include SDcards or some USB 3 hardware that is **not** initialized by the Bios).

Standard EFI partition directory tree:

Code: Select all

   /EFI
    ├── BOOT
    │   ├── BOOTX64.EFI
    │   ├── fbx64.efi
    │   └── mmx64.efi
    └── ubuntu
        ├── BOOTX64.CSV
        ├── grub.cfg
        ├── grubx64.efi
        ├── mmx64.efi
        └── shimx64.efi
We're only interested in BOOTX64.EFI, grubx64.efi and grub.cfg here.
You'll notice the 'ubuntu' directory. If you install Artix Linux, you would then have an equivalent '/EFI/artix' directory as well. This directory will hold similar files to those that exist within the 'ubuntu' directory.
If you install more distro's, you'll get more subdirectories that duplicate functionality and use space.. hence the recommendation to have a slightly larger sized EFI partition when multibooting (I mean 'standard' style multibooting here.)

All of this is mandated by the UEFI spec. The computer's Bios and system tools use the presence of the 'ubuntu' and 'artix' directories (and the files contained here) to detect (and list) any installed systems. Some Bios' display this in a slightly confusing manner.. partitions and devices are often listed as well as any installed OS.

The 'ubuntu' directory contains it's own 'grub.cfg' here. This is slightly non-standard. This just sets a couple of Grub variables and passes control to the Ubuntu or Mint's local 'grub.cfg'... Sound familiar?? IMHO this is slightly more robust, as some UEFI Bios are not fully UEFI spec compliant. This **can** speed up booting (by a totally insignificant amount - literally milliseconds here) as this reduces the amount of searching that Grub has to perform.

How Does This Work??
In two ways:
If the installation is correctly "registered" with the Bios etc.. (I won't go into this, as this doesn't really affect my booting method).
then the Bios can run the "default" system's 'grubx64.efi' directly. This is the actual Grub bootloader.
Some "not fully compliant" UEFI Bios don't even do this properly.. they'll use the "fall through" method.

Here, the Bios runs 'BOOTX64.EFI' (this can be 'bootx64.efi', It depends exactly where this file came from).
This file then starts the "default" 'grubx64.efi'.
If this file was installed by Ubuntu/Mint then a hard coded path within this file points to the '/EFI/ubuntu' directory.
The Artix version of this file points to the 'artix' directory.. and so on.
This is part of what causes a system to have "lead Grub".
No Grub tools will allow you to alter this hard coded path.. It is embedded at the time the particular Grub package was compiled.
Yes, you can manually alter this with a hex editor if you want to.. it's actually an embedded text string (at 0x001A0EF0 for my current 'grubx64.efi')

My booting method removes the need for any extra 'artix' directories etc. with its duplicated content. A single set of files is used for everything.
Installing Grub here allows the first stage Grub start to be totally independent from everything else.
A manually configured 'grub.cfg' here has full initial control.

If you use this method on an external drive, you retain full independent boot control.. Here, you only need to use your boot override key to start the boot process on the external drive. This means that you can use this external drive on any system.. Specifics on how you prepare the external drive for **everything** is coming soon.

Bodge99

Re: Where will esp go in this linux-on-macbook attempt ?

Posted: Fri May 14, 2021 3:22 pm
by artgrandi
@ bodge99

thanks again ! really amazing!

I have just quickly read through today's posts but I need to sit down with them for a while. I had just finished a decent reading of an edited document with all your earlier posts and felt that I could prepare a lesson on it. But not sure if i could use my notes to teach it. I am sure I still can't make a fluent presentation without my notes.Still feels as progress.

I have noticed that you had already answered most of the questions I posted. I just was not aware of it. I had understood your approach from the beguining, but concatenating the details takes me time.

I must confess I am exhausted now, so i will leave eventual questions for next post. I will need a new reading of my edited notes in order to know what to ask. Right now I have no idea of what I need to ask. Perhaps I don't even have to ask anything, though I doubt it.

Your method seems to meet all expectations i have experienced since i started my multibooting journey.
I am looking forwards to start using it.

Re: Where will esp go in this linux-on-macbook attempt ?

Posted: Sun May 16, 2021 8:07 pm
by artgrandi
@ bodge99

Well for the first time in my life I have a feeling that I have a logical understanding of the booting of a multiboot device. Limited by assumptions about too many underlying concepts, but completely new feeling. And it feels good!

I have finally gathered some questions and comments:
So I install Grub to the local EFI partition and use a manually created simple 'grub.cfg'.
Is this done as part of the installation of a system or independently from all systems?
Where does grub sit then within the EFI directory? Inside the directory of the system under which grub was installed – in the first case – or some other (specific?) subdirectory of /EFI?

Bodges99’s comment to AndyMH:
Yes, spot on, but you would have to mod the EFI partition on any machine if you were using an external device.
Would the modification consist of setting flags esp,boot off during installation of a new OS ?

With mine, you just need to use your machine "boot override"
Having never installed an OS under UEFI firmware, I had assumed the Boot Override was another of those Apple (EFI) peculiarities. It was nice to understand that I was wrong. I am assuming so far that the term Boot Override is restricted to UEFI systems and that the Bios choice of booting device (set-up menu?) is a close cousin, but not a twin brother.

This means that you **can** boot a legacy installation on a UEFI system **OR** boot a UEFI installation on a Legacy system **Given two provisos**.
That a Legacy machine can boot a UEFI installation was Big News to me. Cool !

configfile $prefix/grub.cfg
I had seen mentions to the variable configfile, but I had never realized how useful it could be.

Problems occur if you want to delete this particular installation.
Like loosing ancillaries? I suppose another false assumption of mine, based on my observations of linux booting on boot override on the macbook, was precisely that UEFI had no ”lead bootloader”. I was under the impression that the mac firmware (bootmanager?) could recognize the directories in FAT32 ( and in some cases HFS+) partitions and then present me with icons, for the available sytems in those diretories, on the startup menu (at least when I went ”boot override”) which would then start the booting of my choice.

If you happen to have a USB external drive (a great use for an old laptop HDD or SSD.. placed into a cheap caddy) then you could copy the **contents** of each Iso to a separate partition and boot each one simply.
That sounds great! I did it once with Knoppix, as the only way (for me) to boot it from a multiboot usb stick. But I never really considered using it as a general strategy. I will certainly try this. Thus that mean I would be doing frugals?

Here, you only need to use your boot override key to start the boot process on the external drive.
This was one of the key features of my ideal multiboot device project for the macbook: start by ”Boot Override” – i just did not know the name. Now it seems I may use it with other machines too. Thanks once more.

This means that you can use this external drive on any system.. Specifics on how you prepare the external drive for **everything** is coming soon.
Let me try to guess : I will have to care for some sort of ”protective” or otherwise sort of MBR in a gpt-partitioned disk? And for the bios boot partition?
Now a question arises: ”won’ t Apple’ s firmware complain?” I don’t think so, but I am often wrong and I don’t want to nuke my mac.

I am hoping to start work on the installation of Slackare from tomorrow.

Your support has been invaluable. Many thanks.

Re: Where will esp go in this linux-on-macbook attempt ?

Posted: Mon May 17, 2021 6:10 pm
by artgrandi
my paragraph:
This was one of the key features of my ideal multiboot device project for the macbook: start by ”Boot Override” – i just did not know the name. Now it seems I may use it with other machines too. Thanks once more.
EDIT:
This was one of the key ideal features of my multiboot device ambition for the macbook: start by ”Boot Override” – i just did not know the name or how to do it right. Now it seems I may use it with other machines too. Thanks once more.

Re: Where will esp go in this linux-on-macbook attempt ?

Posted: Thu May 20, 2021 11:38 am
by artgrandi
@ bodge99
So I install Grub to the local EFI partition and use a manually created simple 'grub.cfg'.

Is this done as part of the installation of a system or independently from all systems?
Where does grub sit then within the EFI directory? Inside the directory of the system under which grub was installed – in the first case – or some other (specific?) subdirectory of /EFI?
Well, too much reading, too many links, I guess.
I forgot you had already answered this at viewtopic.php?p=2008336

I feel ready to start installing Slackware now. Thank you.

Re: SOLVED - Where will esp go in this linux-on-macbook attempt ?

Posted: Mon May 31, 2021 8:10 pm
by artgrandi
@ bodge99
Thanks once again for sending me the link to your draft

unfortunately, for some reason Google replies with
" the file you requested does not exist. Be sure to use the right address and that the file exists"

my ssd is now booting Manjaro, Linux, Endeavour and Slackwre (finally) . I will now try to substitute Endeavour with Fedora and if that goes well I will proceed with post-installation in all of them

I still would very much like to read your article

Best regards

Re: SOLVED - Where will esp go in this linux-on-macbook attempt ?

Posted: Sun Jun 06, 2021 4:05 am
by offred
artgrandi: I have been asked to PM you some info. It would appear that I have to have at least one post here.

Re: SOLVED - Where will esp go in this linux-on-macbook attempt ?

Posted: Wed Jun 16, 2021 10:42 am
by artgrandi
@ bodge99 EDIT> I mean @ offred
Must i do something in order for you to be able to post ?