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>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Upgrade Gnulib files to 20190105.
It's much easier to maintain GRUB's use of portability support files
from Gnulib when the process is automatic and driven by a single
configuration file, rather than by maintainers occasionally running
gnulib-tool and committing the result. Removing these
automatically-copied files from revision control also removes the
temptation to hack the output in ways that are difficult for future
maintainers to follow. Gnulib includes a "bootstrap" program which is
designed for this.
The canonical way to bootstrap GRUB from revision control is now
"./bootstrap", but "./autogen.sh" is still useful if you just want to
generate the GRUB-specific parts of the build system.
GRUB now requires Autoconf >= 2.63 and Automake >= 1.11, in line with
Gnulib.
Gnulib source code is now placed in grub-core/lib/gnulib/ (which should
not be edited directly), and GRUB's patches are in
grub-core/lib/gnulib-patches/. I've added a few notes to the developer
manual on how to maintain this.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
syslinux_parse simplifies some filenames by removing things like ".."
segments, but the tests assumed that @abs_top_srcdir@ would be
untouched, which is not true in the case of out-of-tree builds where
@abs_top_srcdir@ may contain ".." segments.
Performing the substitution requires some awkwardness in Makefile.am due
to details of how config.status works.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Using FREETYPE_CFLAGS and FREETYPE_LIBS is more in line with the naming
scheme used by pkg-config macros.
Signed-off-by: Colin Watson <cjwatson@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
We need -static as otherwise linker will set interpreter field and ld.so
is not available on our initrd's.
Strip all sections we don't need on binary tests.
coreboot has ACPI while 2 others don't. *BSD need ACPI and have trouble
without it. Don't even attempt to boot *BSD on multiboot or qemu targets.
On coreboot boot all *BSD except 32-bit NetBSD which apparently does some
early BIOS calls.
When making dist from a git snapshot without repo available make dist would
fail to find ChangeLog. Generate empty ChangeLog if no ChangeLog is already
present and repo is not available.
Reported by: Andrei Borzenkov <arvidjaar@gmail.com>
Old ChangeLog is moved to ChangeLog-2015. For all changes starting from
this one ChangeLog will be generated from gitlog only on explicit make
invocation and make dist.
This makes it possible to build generally-useful utilities such as
grub-mount even if the rest of GRUB has not been ported to the target
CPU.
* configure.ac: Add "none" platform. Default to it for unsupported
CPUs rather than stopping with a fatal error. Don't downgrade
x86_64-none to i386. Define COND_real_platform Automake conditional
if the platform is anything other than "none". Don't do any include
directory linking for "none".
* Makefile.am: Skip building grub-core and all bootcheck targets if
!COND_real_platform.
* include/grub/time.h: Don't include <grub/cpu/time.h> if GRUB_UTIL
is defined.
Not all toolkits provide static libraries. This patch enables creation of self
contained distribution that does not require pre-existing runtime libraries.
Intended usage is
export GRUB_WINDOWS_EXTRA_DIST="/path/to/liblzma.dll /path/to/libintl.dll"
make
make windowszip
As those libraries and locations are dependent on toolchain in use, trying
to autodetect them is likely impossible. So just provide a simple way to
package everything in one step.
Also remove $(windowsdir) after ZIP was created same as other "make dist"
targets.
This allows providing separate LDFLAGS for build and host environments, which
are not necessary the same for cross-compile case. In particular, it allows
building host programs statically to not depend on presence of libraries at
run-time (e.g. MinGW DLLs on Windows) while continue to use default dynamic
linking at build time.
Also fix obsolete comments in confgure.ac - we do use different environment
for build and host now.
* Makefile.am (platform_HEADERS): Move to ...
(nodist_platform_HEADERS): ... here. Fixes gettext_strings_test
failure when building from a distributed tarball.
the function of these files exceeds what can be sanely handled in shell
in posix-comaptible way. Also writing it in C extends the functionality
to non-UNIX-like OS and minimal environments.
* Makefile.am (build-grub-mkfont): Don't include gnulib.
(build-grub-gen-asciih): Likewise.
(build-grub-gen-widthspec): Likewise.
* Makefile.util.def (grub-pe2elf): Remove.
* config.h.in [GRUB_BUILD]: Use build rather than host constants.
* configure.ac: Separate tests for build.
Move ./build-grub-pe2elf to grub-core.
Fix typo.
* grub-core/Makefile.am (build-grub-pe2elf): New target.
* grub-core/kern/emu/misc.c (xasprintf): Don't compile if GRUB_BUILD is
defined.
* include/grub/types.h [GRUB_BUILD]: Use build rather than host
constants.
* util/grub-mkfont.c [GRUB_BUILD]: Simplify not to rely on argp.
* util/grub-pe2elf.c: Simplify not to rely on getopt.
* util/misc.c (program_name) [GRUB_BUILD]: Define to static string.
required for checkouts from bzr, but it may be useful for users or
distributors wishing to update translations against a tarball
distribution, and it can be helpful for the tarball to be a superset
of what's in bzr.
* tests/util/grub-shell.in: Handle loongson.
* tests/partmap_test.in: Add loongson to the list of platform using ATA
drivers.
* grub-core/tests/boot/linux.init-mips.S (SHUTDOWN_MAGIC3) [REBOOT]:
Reboot instead of shutdown if REBOOT is defined.