Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Dr. Tilmann Bubeck
I would like to propose a change to GRUB to allow embedding (fs_embed) of core.img for ext2/3/4 into the filesystem. This allows the installation of GRUB into ext2 without the need to use (unsafe) block lists. It will be realized using the ioctl(EXT4_IOC_SWAP_BOOT) introduced into Linux 3.10 i

Re: Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Mate Kukri
Hello, Do you have a proposed use-case for this in mind? On MBR disks there is usually enough space for core.img before the first partition. On GPT you can simply create a so-called "BIOS boot partition" to store core.img. But in either, BIOS is a legacy platform, so I doubt many new users of this

Re: Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Pascal Hambourg
On 13/03/2024 at 11:25, Mate Kukri wrote: Do you have a proposed use-case for this in mind? On MBR disks there is usually enough space for core.img before the first partition. On GPT you can simply create a so-called "BIOS boot partition" to store core.img. A use case could be when you do not

[PATCH 0/7] GRUB: Supporting Secure Boot of xen.gz

2024-03-13 Thread Ross Lagerwall via Grub-devel
This patch series implements support for loading and verifying a signed xen.gz binary. This would allow the same xen.gz binary to be used for BIOS boot, UEFI boot, and UEFI boot with Secure Boot verification. There is an accompanying Xen patch series. The first two patches update the multiboot2 sp

[PATCH 5/7] multiboot2: Add support for 64-bit entry addresses

2024-03-13 Thread Ross Lagerwall via Grub-devel
Add support for entry addresses that may be either 32 bits or 64 bits in size. This may be necessary if the binary is built with an entry address above 4G. Signed-off-by: Ross Lagerwall --- grub-core/loader/multiboot_mbi2.c | 10 -- include/multiboot2.h | 6 +- 2 files

[PATCH 6/7] efi: Allow loading multiboot modules without verification

2024-03-13 Thread Ross Lagerwall via Grub-devel
GRUB doesn't do anything with multiboot modules except loading them and passing a pointer to the multiboot kernel. Therefore GRUB itself doesn't need to verify the module. Multiboot modules may contain code that needs to be verified. If this is the case, the expectation is that the multiboot kernel

[PATCH 4/7] multiboot2: Add PE load support

2024-03-13 Thread Ross Lagerwall via Grub-devel
Add the ability to load multiboot binaries in PE format. This allows the binaries to be signed and verified. Signed-off-by: Ross Lagerwall --- grub-core/Makefile.core.def | 1 + grub-core/loader/multiboot_mbi2.c | 15 +- grub-core/loader/multiboot_pe.c | 694 ++

[PATCH 7/7] verifiers: Verify after decompression

2024-03-13 Thread Ross Lagerwall via Grub-devel
It is convenient and common to have binaries stored in gzip archives (e.g. xen.gz). Verification should be run after decompression rather than before so reorder the file filter list as appropriate. Signed-off-by: Ross Lagerwall --- include/grub/file.h | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 3/7] multiboot2: Add support for the load type header tag

2024-03-13 Thread Ross Lagerwall via Grub-devel
The binary may expose its type using the load type header tag. Implement it according to the specification. Signed-off-by: Ross Lagerwall --- grub-core/loader/multiboot_mbi2.c | 45 --- include/grub/multiboot2.h | 1 + include/multiboot2.h | 13 +

[PATCH 2/7] multiboot2: Allow 64-bit entry tags

2024-03-13 Thread Ross Lagerwall via Grub-devel
Binaries may be built with entry points above 4G. While bootloaders may relocate them below 4G, it should be possible for the binary to specify those entry points. Therefore, extend the multiboot2 protocol such that 64 bit addresses are allowed for entry points. The extension is done in a backwards

[PATCH 1/7] multiboot2: Add load type header and support for the PE binary type

2024-03-13 Thread Ross Lagerwall via Grub-devel
Currently, multiboot2-compatible bootloaders can load ELF binaries and a.out binaries. The presence of the address header tag determines how the bootloader tries to interpret the binary (a.out if the address tag is present else ELF). Add a new load type header tag that explicitly states the type o

Re: Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Dr. Tilmann Bubeck
Yes, thats exactly the use case: I always have multiple linux installations (ubuntu and fedora) in two seperate partitions. To stay compatible with their individual kernel and grub updates, I always install a second GRUB into the root parition of the specific linux installation. In MBR I have a

Re: Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Pascal Hambourg
On 13/03/2024 at 16:18, Dr. Tilmann Bubeck wrote: Yes, thats exactly the use case: I always have multiple linux installations (ubuntu and fedora) in two seperate partitions. To stay compatible with their individual kernel and grub updates, I always install a second GRUB into the root parition o

Re: Idea: Improve ext2 to allow for embedding

2024-03-13 Thread Dr. Tilmann Bubeck
Am 13.03.24 um 16:31 schrieb Pascal Hambourg: On 13/03/2024 at 16:18, Dr. Tilmann Bubeck wrote: Yes, thats exactly the use case: I always have multiple linux installations (ubuntu and fedora) in two seperate partitions. To stay compatible with their individual kernel and grub updates, I alwa