Commit graph

5767 commits

Author SHA1 Message Date
Vladimir Serbinenko
e3046431da * conf/Makefile.common (CFLAGS_GNULIB): Remove -Wno-old-style-definition
as it's no longer necessarry.
2013-12-04 14:32:04 +01:00
Vladimir Serbinenko
bdb6090d83 * configure.ac: Allow compilation with older GCC for ARM. 2013-12-04 12:42:09 +01:00
Vladimir Serbinenko
b73b70ebca * configure.ac: Add -no-integrated-as if {addme|ame} isn't supported.
* INSTALL: Note that GRUBwas successfully compiled with clang 3.2 for
	ppc.
2013-12-04 12:20:56 +01:00
Vladimir Serbinenko
8a3f0a24b5 * grub-core/kern/emu/main.c: Ignore missing prototype for main. 2013-12-04 10:28:23 +01:00
Vladimir Serbinenko
6f07c4e407 Pass font config to config.h and not by TARGET_CFLAGS as adding
arguments doesn't work if TARGET_CFLAGS is specified on command
	line.
2013-12-04 10:25:53 +01:00
Vladimir Serbinenko
60d5e9cbd9 * configure.ac: Add -Wvla if compiler supports it. 2013-12-04 10:08:57 +01:00
Vladimir Serbinenko
cd15c394cc * grub-core/osdep/windows/emuconsole.c (grub_console_putchar):
Remove variable length arrays.
	* grub-core/term/efi/console.c (grub_console_putchar): Likewise.
2013-12-04 10:05:33 +01:00
Vladimir Serbinenko
bb6e299ccb * grub-core/kern/i386/qemu/init.c: Remove variable length arrays. 2013-12-04 09:48:36 +01:00
Vladimir Serbinenko
85eb579ad9 * include/grub/types.h: Declare all byteswaps as inline functions
except compile-time ones.

	Solves variable shadowing in constructions like
	cpu_to_le (le_to_cpu(x) + 1).
2013-12-04 08:42:35 +01:00
Vladimir Serbinenko
47f88cc94e * grub-core/kern/efi/efi.c: Remove variable length arrays. 2013-12-04 08:39:22 +01:00
Vladimir Serbinenko
40b5739ff9 * grub-core/kern/uboot/init.c (uboot_timer_ms): Fix overflow after 71
minutes.
2013-12-04 08:26:39 +01:00
Vladimir Serbinenko
234d93464a * grub-core/disk/ieee1275/ofdisk.c: Remove variable length arrays.
* grub-core/net/drivers/ieee1275/ofnet.c: Likewise.
2013-12-04 08:10:01 +01:00
Colin Watson
0c0eab527f * grub-core/Makefile.core.def (setjmp): Distribute
lib/arm64/setjmp.S.
2013-12-03 18:11:18 +00:00
Colin Watson
44d4884779 Merge branch 'cjwatson/timeout-style' 2013-12-03 16:15:45 +00:00
Colin Watson
10955cda06 Credit and bug reference. 2013-12-03 16:14:01 +00:00
Vladimir Serbinenko
9e4e6ddfbf * util/config.c: Add missing pointer adjustment.
Reported by: qwertial
2013-12-02 06:51:13 +01:00
Andrey Borzenkov
5037aa9a7b fix libgrub.pp build post arm64 merge
grub-core/kern/arm64/dl_helper.c:26:28: fatal error: grub/cpu/reloc.h: No such file or directory
2013-11-30 22:36:10 +04:00
Vladimir Serbinenko
8a952d20d1 Missing ChangeLog entry 2013-11-30 16:51:35 +01:00
Andrey Borzenkov
be0d45555e document sleep command exit codes 2013-11-30 14:57:11 +04:00
Vladimir Serbinenko
d74b9a1d1a Ensure that -mno-unaligned-access or some equivalent option is used. 2013-11-30 11:31:14 +01:00
Vladimir Serbinenko
35de6d4bac * grub-core/lib/libgcrypt/mpi/longlong.h: Fix compilation error with
-march=armv3.
2013-11-30 11:19:06 +01:00
Vladimir Serbinenko
ce55ed0389 Remove leftover GRUB_IA64_DL_TRAMP_SIZE. 2013-11-30 11:14:30 +01:00
Colin Watson
8ddf84bfb8 Fix "make -C docs dvi"
* docs/grub-dev.texi (Font Metrics): Exclude @image command from DVI
builds, since we don't have an EPS version of font_char_metrics.png.
Add leading dot to image extension per the Texinfo documentation.
2013-11-29 13:48:23 +00:00
Colin Watson
fd0df6d098 Fix build with FreeType 2.5.1
* util/grub-gen-asciih.c: Include FT_SYNTHESIS_H rather than
<freetype/ftsynth.h>, fixing build with FreeType 2.5.1.
* util/grub-gen-widthspec.c: Likewise.
* util/grub-mkfont.c: Likewise.
2013-11-29 12:19:36 +00:00
Andrey Borzenkov
69ca97c820 fix using grub device name as install device
Shell version of grub-install called grub-setup which resolved
install device name and called main setup routine. C version of
grub-install calls main setup routine directly, which leads
to the error:

grub2-install: info: grub-bios-setup  --verbose  --force  --skip-fs-probe --directory='/boot/grub2/i386-pc' --device-map='/boot/grub2/device.map' '(hd2)'.
grub2-install: info: reading /boot/grub2/i386-pc/boot.img.
grub2-install: info: reading /boot/grub2/i386-pc/core.img.
grub2-install: info: root is `(null)', dest is `(hd2)'.
grub2-install: info: Opening dest.
grub2-install: info: drive = -1.
grub2-install: error: disk `(hd2)' not found.

Move resolving of destination device name into main setup routine
so it is done consistently in both cases.
2013-11-29 11:32:34 +04:00
Vladimir Serbinenko
eec893ae49 * grub-core/kern/emu/hostfs.c (is_dir): Remove variable length arrays. 2013-11-29 05:52:20 +01:00
Vladimir Serbinenko
621e167fd6 * util/grub-fstest.c: Remove variable length arrays. 2013-11-29 05:50:32 +01:00
Vladimir Serbinenko
d54f647a4a * grub-core/osdep/linux/ofpath.c: Check return value of read. 2013-11-29 05:46:19 +01:00
Vladimir Serbinenko
c8a0f1b229 * util/mkimage.c (grub_install_generate_image): Use grub_crypto_hash for
computing crc32 rather than handling with md fundtions directly.
2013-11-29 04:14:26 +01:00
Vladimir Serbinenko
726409a513 * util/mkimage.c (grub_install_generate_image): Use grub_crypto_hash for
checking fwstart.img rather than md fundtions directly.
2013-11-29 04:05:44 +01:00
Vladimir Serbinenko
422e6e886c * util/grub-mkrescue.c (main): Check that fread succeeded. 2013-11-29 03:54:21 +01:00
Vladimir Serbinenko
af1faca3f8 * conf/Makefile.common: Remove -mexplicit-relocs and -DUSE_ASCII_FALLBACK on yeeloong.
-DUSE_ASCII_FALLBACK is already added by font snippets.
	-mexplicit-relocs isn't needed is compiler/assemblera are
	configured properly.
	If they're not we shouldn't attempt to fix it by ourselves.
	Binary compare between before and after shows no difference.
2013-11-29 03:45:50 +01:00
Vladimir Serbinenko
469021b4b3 Remove libgnulib.a and use its sources in dependencies directly.
This was the only instance of "library" in core config. A bug was
	reported that -fno-stack-protector wasn't passed to it. Instead of
	figuring out why it failed just remove this construction used
	needlessly.
2013-11-29 03:36:50 +01:00
Vladimir Serbinenko
83c256ba42 * grub-core/osdep/unix/password.c (grub_password_get): Check that
fgets succeeded.
2013-11-29 03:32:57 +01:00
Francesco Lavra
b67422d33d Fix command description in case of a device name passed as argument. 2013-11-28 17:25:52 +04:00
Colin Watson
8f236c1419 Revamp hidden timeout handling
Add a new timeout_style environment variable and a corresponding
GRUB_TIMEOUT_STYLE configuration key for grub-mkconfig.  This
controls hidden-timeout handling more simply than the previous
arrangements, and pressing any hotkeys associated with menu entries
during the hidden timeout will now boot the corresponding menu entry
immediately.

GRUB_HIDDEN_TIMEOUT=<non-empty> + GRUB_TIMEOUT=<non-zero> now
generates a warning, and if it shows the menu it will do so as if
the second timeout were not present.  Other combinations are
translated into reasonable equivalents.
2013-11-28 02:29:15 +00:00
Vladimir Serbinenko
2d76b4d81e Eliminate variable length arrays in grub_vsnprintf_real.
A bit tricky because this function has to continue to work without
	heap for short strings. Fixing prealloc to 32 arguments is reasonable
	but make all stack references use 32-bit offset rather than 8-bit one.
	So split va_args preparsing to separate function and put the prealloc
	into the caller.
2013-11-27 15:16:09 +01:00
Vladimir Serbinenko
4f9541226c Introduce grub_util_file_sync and use it instead of fsync(fileno(f)).
Fixes build for windows.
2013-11-27 14:13:50 +01:00
Vladimir Serbinenko
b1f742c103 * gentpl.py: Don't generate platform-dependent conditionals for
platform-independent targets.
2013-11-27 14:10:04 +01:00
Colin Watson
16ef26fd3a * grub-core/osdep/unix/exec.c (grub_util_exec_redirect): Remove
references to mdadm from otherwise generic code.
(grub_util_exec_pipe): Likewise.
(grub_util_exec_pipe_stderr): Likewise.
* grub-core/osdep/unix/getroot.c (grub_util_pull_lvm_by_command):
This function calls vgs, not mdadm; adjust variable names
accordingly.
2013-11-27 11:22:31 +00:00
Colin Watson
cf8c80ff77 Merge branch 'new-autogen' 2013-11-27 10:57:27 +00:00
Colin Watson
5c7206e45e Speed up test suite by avoiding fsync
Add grub_util_disable_fd_syncs call to turn grub_util_fd_sync calls into
no-ops, and use it in programs that copy files but do not need to take
special care to sync writes (grub-mknetdir, grub-rescue,
grub-mkstandalone).

On my laptop, this reduces partmap_test's runtime from 1236 seconds to
204 seconds.
2013-11-27 10:10:22 +00:00
Colin Watson
fc3f2b72cd * tests/util/grub-fs-tester.in: Execute xorriso from $PATH rather
than hardcoding /usr/local/bin/xorriso.
2013-11-26 23:51:48 +00:00
Colin Watson
ab4f15013a Generate Makefile.*.am directly from gentpl.py, eliminating the use of Autogen. The Autogen definitions files remain intact as they offer a useful abstraction. 2013-11-26 17:13:01 +00:00
Vladimir Serbinenko
1e4b358720 Add PCI command activation to all PCI drivers as required for coreboot
and maybe some other firmwares.
2013-11-26 14:21:11 +01:00
Vladimir Serbinenko
9208367d3f * grub-core/Makefile.am: Reduce gratuituous differences between Apple
and non-Apple variants of efiemu compile.
2013-11-26 11:38:12 +01:00
Andrey Borzenkov
67b9b7afd7 Add ChangeLog entry for previous commit 2013-11-25 23:14:04 +04:00
Vladimir Serbinenko
bee1b5ce3f * util/grub-mknetdir.c: Look for platform directories under pkglibdir
and not pkgdatadir.
2013-11-25 19:16:05 +01:00
Colin Watson
07e3b04742 Add a --locale-directory option to grub-install and related tools.
* include/grub/util/install.h (GRUB_INSTALL_OPTIONS): Add
--locale-directory option.
(enum grub_install_options): Add
GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY.
* util/grub-install-common.c (grub_install_help_filter): Handle
GRUB_INSTALL_OPTIONS_LOCALE_DIRECTORY.
(grub_install_parse): Likewise.
(get_localedir): New function to check for a user-provided option
before trying grub_util_get_localedir.
(copy_locales): Use get_localedir rather than
grub_util_get_localedir.  Handle differing locale directory layouts.
(grub_install_copy_files): Likewise.
2013-11-25 18:04:50 +00:00
Vladimir Serbinenko
61e1b9a49d * grub-core/osdep/unix/platform.c (get_ofpathname): Trim ending newline.
Don't rely on PATH_MAX.
2013-11-25 07:34:49 +01:00
Vladimir Serbinenko
c98dd165b0 * grub-core/genmoddep.awk: Use more portable && rather than and. 2013-11-25 07:32:51 +01:00
Vladimir Serbinenko
ff1c277ef8 * grub-core/kern/i386/pc/startup.S [__APPLE__]: Create _edata by placing
an object after data. While it doesn't seem right solution, it
	works well enough and OSX isn't main compilation platform.
2013-11-25 05:55:33 +01:00
Vladimir Serbinenko
c8f7614b98 * gentpl.py: Add -ed2016 in order to make objconv accept our binary.
While it doesn't seem right solution, it works well enough and
	OSX isn't main compilation platform.
2013-11-25 05:53:20 +01:00
Vladimir Serbinenko
246a434f61 * configure.ac: Add -static to LDFLAGS when using apple linker to
prevent it from pulling in dynamic linker.
2013-11-25 05:47:20 +01:00
Vladimir Serbinenko
5c066a81c2 Apple assembly doesn't handle symbol arithmetic well. So define an
offset symbol in boot.S and use it.
2013-11-24 07:12:12 +01:00
Vladimir Serbinenko
78f961efe9 Apple assembly doesn't handle symbol arithmetic well. So instead
of getting addres of kernel_sector + 4 define kernel_sector_high.
	It also makes code more readable.
2013-11-24 07:11:00 +01:00
Vladimir Serbinenko
09bc0a577d With Apple assembly in .macro environvemnt you have to use $$ instead
of $. So introduce new preprocessor macro MACRO_DOLLAR(x) which expands
	to $$x on Apple and to $x on everything else.
2013-11-24 07:08:18 +01:00
Vladimir Serbinenko
b700a427d2 * grub-core/Makefile.am: Use correct TARGET_OBJCONV rather than
OBJCONV.
2013-11-24 05:27:20 +01:00
Vladimir Serbinenko
4480b95dcd * grub-core/gdb/i386/machdep.S: Use xorl %eax, %eax on both Apple
and non-Apple. This instruction is shorter and faster,
	so no reason not to use it on both.
2013-11-24 05:17:24 +01:00
Vladimir Serbinenko
e77c81f6f8 * grub-core/lib/reed_solomon.c: Use section _text, _text rather than
.text when compiling for Apple.
2013-11-24 05:14:11 +01:00
Vladimir Serbinenko
971dbee521 * grub-core/term/arc/console.c: Add missing cast to silence warning. 2013-11-24 05:05:34 +01:00
Vladimir Serbinenko
6f2e82be3a * grub-core/boot/i386/pc/boot.S: Fix floppy probe. Due to missing
%dx restore the probe worked on non-existant drive. Reorganize the
	code a little bit to free 2 bytes necessary for push/pop.
2013-11-24 05:05:33 +01:00
Vladimir Serbinenko
9eec9699b9 * grub-core/kern/mips/arc/init.c (grub_machine_get_bootlocation):
Add missing cast to silence warning.
2013-11-23 15:35:01 +01:00
Keshav Padram Amburay
5ae5c54c7e * util/grub-install.c (update_nvram): Support --no-nvram flag
for EFI targets.
2013-11-23 13:02:12 +01:00
Vladimir Serbinenko
7b04fe6c9e * INSTALL: Add note about sparc64/ia64 with clang (unsupported). 2013-11-23 12:49:41 +01:00
Vladimir Serbinenko
e67566ce0a * util/garbage-gen.c: Add missing include of sys/time.h. 2013-11-23 12:42:30 +01:00
Vladimir Serbinenko
f93ddcfd1c Don't add -mflush-func if it's not supported by compiler. 2013-11-23 12:40:44 +01:00
Vladimir Serbinenko
1bba40f578 Move common BIOS/coreboot memory map declarations to
include/grub/i386/memory_raw.h and eliminate duplicate declarations.
2013-11-23 12:39:21 +01:00
Andrey Borzenkov
f65e14dc3a add util/garbage-gen.c to EXTRA_DIST 2013-11-23 14:39:35 +04:00
Vladimir Serbinenko
14a94bba6f * INSTALL: Document why older clang versions aren't appropriate. 2013-11-23 01:16:47 +01:00
Vladimir Serbinenko
8109c5d4e2 * INSTALL: Document about clang for mips. 2013-11-23 00:41:32 +01:00
Vladimir Serbinenko
a92b5cb8d8 * grub-core/lib/libgcrypt/mpi/longlong.h: Use C version with mips
clang.
2013-11-23 00:36:13 +01:00
Vladimir Serbinenko
4a23e2fe29 Add *-xen to the list of grub-install-common platforms. 2013-11-22 14:21:16 +01:00
Vladimir Serbinenko
a3ba74104e * configure.ac: Do not enforce -mcmodel=large. It's not necessarry with
3 last commits.
2013-11-22 13:07:51 +01:00
Vladimir Serbinenko
e1c22419ac * grub-core/kern/xen/init.c: Do not map more pages than we can address. 2013-11-22 13:04:29 +01:00
Vladimir Serbinenko
189090cee9 * grub-core/kern/efi/mm.c: Limit allocations to 2GiB when not compiling
with -mcmodel=large.
2013-11-22 13:03:19 +01:00
Vladimir Serbinenko
1a5b7b404f * grub-core/kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Add
range-checking for 32-bit quantities.
2013-11-22 13:01:14 +01:00
Vladimir Serbinenko
9cf12b20af * configure.ac: Compile with -fPIC when compiling with clang on
mips.
2013-11-22 12:50:41 +01:00
Vladimir Serbinenko
63a45330cb * configure.ac: Add -no-integrated-as on mips(el) to TARGET_CCASFLAGS
when compiling with clang.
2013-11-22 12:48:32 +01:00
Vladimir Serbinenko
4a0aaad022 clang emits calls to abort () under some unknown conditions.
Export abort () when compiling with clang.
2013-11-22 12:42:58 +01:00
Vladimir Serbinenko
095bb1bfa5 * docs/grub-dev.texi: Document stack and heap sizes. 2013-11-22 12:03:44 +01:00
Vladimir Serbinenko
3937bd962b * include/grub/i386/pc/memory.h: Decrease
GRUB_MEMORY_MACHINE_SCRATCH_SIZE and increase
	GRUB_MEMORY_MACHINE_PROT_STACK_SIZE.
	The binary doesn't change (checked). It's more to better reflect actual
	usage.
2013-11-22 12:02:00 +01:00
Vladimir Serbinenko
ddb3efc906 * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Ensure
at compile time that enough of scratch size is available.
2013-11-22 12:00:10 +01:00
Vladimir Serbinenko
4e42521d8c * grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment.
Previously we misaligned stack by 8 in startup.S and compensated
	for it in callwrap.S. According to ABI docs (EFI and sysv amd64)
	right behaviour is to align stack in startup.S and keep it aligned
	in callwrap.S. startup.S part was committed few commits before. This
	takes care of callwrap.S.
	Reported by: Gary Lin.
2013-11-22 05:40:32 +01:00
Vladimir Serbinenko
054efe541f * grub-core/boot/mips/startup_raw.S: Handle the case of gap between
.data and .bss. May happen if compiler and assembly use different
	alignment.
2013-11-22 05:07:32 +01:00
Vladimir Serbinenko
a0e1befb57 On MIPS handle got16 relocations to local symbols in an ABI-compliant
way.
2013-11-22 05:03:17 +01:00
Vladimir Serbinenko
c36c73f681 Add support for a new magic symbol _gp_disp on mips to handle PIC
binaries.
2013-11-22 04:56:10 +01:00
Vladimir Serbinenko
6f4a19f59f Use $t9 for indirect calls from asm to C as PIC ABI requires. 2013-11-22 04:45:05 +01:00
Vladimir Serbinenko
0d8f04cd83 Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem
when rest of GRUB is compiled for hisher stepping. Instead use
	.set mips3/.set mips1 around cache and sync opcodes.
2013-11-22 04:36:53 +01:00
Vladimir Serbinenko
4906052019 Unify GOT/trampoline handling between PPC, MIPS and IA64 as they
do essentially the same thing, do it in similar way.
2013-11-21 21:54:33 +01:00
Colin Watson
c6a823e267 * util/grub-mkrescue.c (main): If a source directory is not
specified, read platform-specific files from subdirectories of
pkglibdir, not pkgdatadir.
2013-11-21 17:36:45 +00:00
Colin Watson
b7f9aedfac * grub-core/normal/progress.c: Remove unused file. 2013-11-21 15:37:57 +00:00
Vladimir Serbinenko
7dd0a30361 * grub-core/lib/crypto.c (grub_crypto_hash): Remove variable length
array.
2013-11-20 20:09:18 +01:00
Vladimir Serbinenko
ca120e31f2 * util/grub-mkconfig.in: Say explicit "grub configuration" rather
than grub.cfg.
2013-11-20 10:18:19 +01:00
Vladimir Serbinenko
48eb35cd78 * coreboot.cfg: Add missing file. 2013-11-20 00:52:23 +01:00
Vladimir Serbinenko
7f20dbbcd2 * Makefile.am: Allow STRIP to be empty when creating windowszip. 2013-11-19 23:48:46 +01:00
Axel Kellermann
55e706c918 * util/grub.d/30_os-prober.in: Add GRUB_OS_PROBER_SKIP_LIST to
selectively skipping systems.
2013-11-19 23:39:51 +01:00
Colin Watson
4e7d433dfb * Makefile.util.def (grub-mkimage): Add
grub-core/osdep/aros/config.c to extra_dist.
* conf/Makefile.extra-dist (EXTRA_DIST): Add docs/autoiso.cfg,
docs/osdetect.cfg, grub-core/gnulib-fix-null-deref.diff,
grub-core/gnulib-fix-width.diff, grub-core/gnulib-no-abort.diff, and
grub-core/gnulib-no-gets.diff.
2013-11-19 20:39:16 +00:00
Vladimir Serbinenko
7d44ff7de6 Add automated filesystem checking based on scripts I've used now for
quite some time locally. Most of the test require root so they are
	skipped when run without necessarry privelegies.
2013-11-19 21:05:59 +01:00
Colin Watson
a8c3e5e3c7 * util/grub-install.c (main): Adjust info messages to match
installed paths of grub-bios-setup and grub-sparc64-setup.
2013-11-19 18:43:05 +00:00