All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: grub-devel@gnu.org
Subject: Re: [PATCH v2] Makefile: Allow to set file systems modules for default_payload.elf
Date: Thu, 7 Mar 2019 20:37:03 +0100	[thread overview]
Message-ID: <20190307193703.c654detlaccqxfyv@tomti.i.net-space.pl> (raw)
In-Reply-To: <c324b5cc-3bf0-21a5-c085-23cb8023708c@molgen.mpg.de>

On Thu, Mar 07, 2019 at 12:16:06PM +0100, Paul Menzel wrote:
> 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 <pmenzel@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

If you do that why not go further and drop...

> +	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

... ext2, fat...

> usbserial_usbdebug cbfs' --install-modules='ls linux search configfile

... and cbfs from here? Does anything depend on these filesystems?

> 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

Daniel


  reply	other threads:[~2019-03-07 19:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 11:16 [PATCH v2] Makefile: Allow to set file systems modules for default_payload.elf Paul Menzel
2019-03-07 19:37 ` Daniel Kiper [this message]
2019-03-08  1:34   ` Paul Menzel
2019-03-08 10:45     ` Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190307193703.c654detlaccqxfyv@tomti.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=pmenzel@molgen.mpg.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.