Date: Wed Mar 6 08:14:28 2019 +0100

By default all file system modules are added to the GRUB coreboot
payload `default_payload.elf`. This makes the image quite big,
especially as often not all modules are needed.

Introduce the variable `FS_PAYLOAD_MODULES`, which can be used to
explicitly set file systems modules to be added.

    $ make default_payload.elf
    test -f default_payload.elf && rm default_payload.elf || true
    pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O 
i386-coreboot -o default_payload.elf --modules='ahci pata ehci uhci ohci 
usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug 
cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw 
iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi 
chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu affs 
afs bfs btrfs cbfs cpio cpio_be exfat ext2 f2fs fat hfs hfsplus iso9660 jfs 
minix minix2 minix2_be minix3 minix3_be minix_be newc nilfs2 ntfs odc procfs 
reiserfs romfs sfs squash4 tar udf ufs1 ufs1_be ufs2 xfs zfs password_pbkdf2 ' 
--fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=./coreboot.cfg
    $ ls -l default_payload.elf
    -rw-rw---- 1 joey joey 1199568 Mar  6 13:58 default_payload.elf

    $ make default_payload.elf FS_PAYLOAD_MODULES="" # ext2 already in 
`--modules`
    test -f default_payload.elf && rm default_payload.elf || true
    pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O 
i386-coreboot -o default_payload.elf --modules='ahci pata ehci uhci ohci 
usb_keyboard usbms part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug 
cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw 
iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi 
chain test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu  
password_pbkdf2 ' --fonts= --themes= --locales= -d grub-core/ 
/boot/grub/grub.cfg=./coreboot.cfg
    $ ls -l default_payload.elf 
    -rw-rw---- 1 joey joey 832976 Mar  7 12:13 default_payload.elf

So, the resulting payload size is around 370 kB smaller. (Adding it to
the CBFS, it will be compressed, so the effective size difference will
be smaller.)

Signed-off-by: Paul Menzel <pmen...@molgen.mpg.de>
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 94296a37e..1f4bb9b8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -422,9 +422,10 @@ BOOTCHECK_TIMEOUT=180
 bootcheck: $(BOOTCHECKS)
 
 if COND_i386_coreboot
+FS_PAYLOAD_MODULES ?= $(shell cat grub-core/fs.lst)
 default_payload.elf: grub-mkstandalone grub-mkimage FORCE
        test -f $@ && rm $@ || true
-       pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O 
i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms 
part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' 
--install-modules='ls linux search configfile normal cbtime cbls memrw iorw 
minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain 
test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu $(shell cat 
grub-core/fs.lst) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= --themes= 
--locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg
+       pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O 
i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms 
part_msdos ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' 
--install-modules='ls linux search configfile normal cbtime cbls memrw iorw 
minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain 
test serial multiboot cbmemc linux16 gzio echo help syslinuxcfg xnu 
$(FS_PAYLOAD_MODULES) password_pbkdf2 $(EXTRA_PAYLOAD_MODULES)' --fonts= 
--themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg
 endif
 
 endif
-- 
2.21.0

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to