Commit graph

2886 commits

Author SHA1 Message Date
Vladimir Serbinenko
04f39f6df8 * grub-core/lib/relocator.c (grub_mm_check_real): Accept const char *
as file argument.
2013-11-18 02:45:25 +01:00
Vladimir Serbinenko
35d4761ce2 * grub-core/normal/cmdline.c (grub_cmdline_get): Plug memory leak. 2013-11-18 02:43:29 +01:00
Vladimir Serbinenko
33d02a42d6 * grub-core/kern/file.c (grub_file_open): Free file->name on failure.
(grub_file_close): Free file->name.
2013-11-18 02:41:42 +01:00
Vladimir Serbinenko
7bbb60cfbd * grub-core/commands/verify.c (free_pk): Plug memory leak.
(grub_load_public_key): Likewise.
	(grub_verify_signature_real): Likewise.
	(grub_cmd_verify_signature): Likewise.
2013-11-18 02:40:17 +01:00
Vladimir Serbinenko
da93d6753b * grub-core/commands/legacycfg.c (grub_legacy_check_md5_password): Plug
memory leak.
2013-11-18 02:37:46 +01:00
Vladimir Serbinenko
59c943ecf6 * grub-core/lib/powerpc/setjmp.S (grub_setjmp): Save r31.
(grub_longjmp): Restore r31.
	* include/grub/powerpc/setjmp.h (grub_jmp_buf): Reserve space for r31.
2013-11-18 02:35:32 +01:00
Ian Campbell
7d400406a7 * grub-core/disk/uboot/ubootdisk.c: Include SCSI disks. 2013-11-17 15:38:09 +01:00
Vladimir Serbinenko
0ab8e025c1 * grub-core/tests/cmdline_cat_test.c (cmdline_cat_test): Ignore errors
of loading gfxterm as gfxterm is embed in kernel on some platforms.
	* grub-core/tests/gfxterm_menu.c (gfxterm_menu): Likewise.
	Load gfxmenu.
2013-11-17 02:13:33 +01:00
Vladimir Serbinenko
cd46aa6cef Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir
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.
2013-11-16 20:21:16 +01:00
Vladimir Serbinenko
9ef81064a3 * grub-core/kern/arm/cache.S: Don't switch back to ARM mode when
compiling to thumb2.
	* grub-core/kern/arm/cache_armv7.S: Likewise.
	* grub-core/lib/arm/setjmp.S: Likewise.
2013-11-16 17:37:06 +01:00
Leif Lindholm
11a7793221 arm: delete superflouous save of r8 in grub_uboot_syscall 2013-11-16 15:56:09 +00:00
Vladimir Serbinenko
080603f0b0 Decrease stack usage in lexer.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/script/yylex.l (yyalloc), (yyfree), (yyrealloc): Declare
	as macros so that compiler would remove useless structure on stack.
	Better solution would be to fix flex not to put this structure on
	the stack but flex is external program.
2013-11-16 16:37:59 +01:00
Vladimir Serbinenko
4f84ae0ec8 Decrease stack usage in signature verification.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/commands/verify.c (grub_load_public_key): Allocate on heap
	rather than stack.
	(grub_verify_signature_real): Likewise.
2013-11-16 16:34:51 +01:00
Vladimir Serbinenko
e6a6182d95 Decrease stack usage in mdraid 0.9x.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Allocate on heap
	rather than stack.
2013-11-16 16:16:48 +01:00
Vladimir Serbinenko
1a454efe89 Decrease stack usage in BtrFS.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/fs/btrfs.c (grub_btrfs_lzo_decompress): Allocate on heap
	rather than stack.
2013-11-16 16:15:26 +01:00
Vladimir Serbinenko
7b5d51d837 Decrease stack usage in JFS.
We have only 92K of stack and using over 4K per frame is wasteful

	* grub-core/fs/jfs.c (getblk): Allocate on heap rather than on
	stack. Note: this function is recursive.
	(grub_jfs_read_inode): Read only part we care about.
2013-11-16 16:00:42 +01:00
Leif Lindholm
593865b907 arm: fix u-boot port syscall interface va_arg handling
Commit c9cd02c broke the u-boot syscall API for va_args that spill over
to the stack, causing the disk support to stop working. This patch
resolves the problem, while keeping the new, cleaner transition_space
handling.
2013-11-16 14:12:12 +00:00
Andrey Borzenkov
9e18dfe277 MIPS grub_machine_get_bootlocation arguments are used 2013-11-16 16:59:07 +04:00
Vladimir Serbinenko
6fcec43954 Replace libgcc version of ctz with our own.
On upcoming arm64 port libgcc ctz* are not usable in standalone
	environment. Since we need ctz* for this case and implementation is
	in C we may as well use it on all concerned platforms.
2013-11-15 03:28:34 +01:00
Vladimir Serbinenko
a9f25a0819 * configure.ac: Probe for linking format rather than guessing it based
on target_os.
2013-11-14 23:17:18 +01:00
Vladimir Serbinenko
c7995256e4 * grub-core/disk/xen/xendisk.c (grub_xendisk_fini): Set state to
"1" prior to handoff.

	Reported by: M A Young.
2013-11-14 22:42:54 +01:00
Vladimir Serbinenko
e1aa5b6620 * grub-core/kern/xen/init.c (grub_xenstore_write_file): Don't add
\0 to all files.

	Reported by: M A Young.
2013-11-14 22:40:50 +01:00
Vladimir Serbinenko
da5ed5cf6b * grub-core/osdep/bsd/hostdisk.c (grub_util_get_fd_size_os): Fix
compilation on NetBSD.
2013-11-14 22:38:36 +01:00
Andrey Borzenkov
a5986276ec add grub-core/tests/signatures.h to distfiles 2013-11-15 00:51:30 +04:00
Matthew Garrett
1fe26ab4a0 * grub-core/kern/main.c (grub_set_prefix_and_root): Set variable
cmdpath to firmware directory.
2013-11-14 15:53:32 +01:00
Vladimir Serbinenko
83e9c273e5 * grub-core/kern/efi/efi.c (grub_efi_get_filename): Reset the pointer
at the start of second iteration.
2013-11-14 15:50:43 +01:00
Vladimir Serbinenko
ec525c18e1 * grub-core/Makefile.am (efiemu64.o): Explicitly set link format. 2013-11-14 12:05:48 +01:00
Vladimir Serbinenko
1d912bd3c9 Merge branch 'master' of git.sv.gnu.org:/srv/git/grub
Conflicts:
	ChangeLog
2013-11-14 10:05:54 +01:00
Vladimir Serbinenko
57ffe93485 * grub-core/kern/arm/cache_armv6.S: Remove special handling for
clang (not necessarry with -no-integrated-as).
	* include/grub/symbol.h [__arm__]: Likewise.
2013-11-14 10:05:19 +01:00
Colin Watson
5da5517288 * grub-core/fs/ext2.c (grub_ext2_read_block): Factor out common code for indirect block handling.
Saves 185 bytes on compressed image.
2013-11-14 08:13:06 +00:00
Leif Lindholm
035a26c16a * grub-core/kern/arm/misc.S: Make thumb2-compatible. 2013-11-14 01:33:06 +01:00
Colin Watson
81a2e438dc * grub-core/kern/misc.c: Don't redirect divisions in the
GRUB_UTIL case.
* include/grub/misc.h: Likewise.
2013-11-13 14:47:23 +00:00
Colin Watson
9b45c0733e * grub-core/osdep/unix/emuconsole.c (put): Pacify the compiler on
systems that require checking the return value of write.
2013-11-13 13:34:57 +00:00
Vladimir Serbinenko
2bdd07195c * grub-core/kern/arm/cache.c (probe_caches): Move asm part to ...
* grub-core/kern/arm/cache_armv6.S: ... here. This allows this
	asm to stay in arm even if surrounding is thumb.
2013-11-13 09:58:52 +01:00
Vladimir Serbinenko
5e77d9cfc1 * grub-core/kern/arm/misc.S: Add __muldi3 and __aeabi_lmul. Those
helper functions are needed for thumb.
2013-11-13 09:52:33 +01:00
Vladimir Serbinenko
7d5116251d * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Make
level / 3 division explicitly unsigned. Saves few bytes.
2013-11-13 09:40:16 +01:00
Vladimir Serbinenko
81023dbdbd * grub-core/fs/zfs/zfs.c (ZAP_LEAF_NUMCHUNKS): Use unsigned arithmetics. 2013-11-13 09:27:36 +01:00
Vladimir Serbinenko
b2e9294fb9 * grub-core/normal/datetime.c (grub_get_weekday): Use if rather than
division.
2013-11-13 09:26:13 +01:00
Vladimir Serbinenko
16a22c3851 * grub-core/kern/uboot/init.c: Move grub_uboot_machine_type and
grub_uboot_boot_data to asm part.
2013-11-13 06:28:15 +01:00
Vladimir Serbinenko
c9cd02c965 * grub-core/kern/arm/uboot/startup.S: Remove = by replacing with
literal load.
	(grub_uboot_syscall): Save/restore r9 and align stack.
2013-11-13 06:27:03 +01:00
Vladimir Serbinenko
8149861554 * grub-core/kern/arm/cache.S: Replace = with explicit litteral load. 2013-11-13 06:23:32 +01:00
Vladimir Serbinenko
ea57de18f8 * include/grub/symbol.h (END) [__arm__]: New macros. Replace all .end
occurencies with END.
2013-11-13 05:19:30 +01:00
Josh Triplett
46d8a2033b * grub-core/normal/term.c (grub_set_more): Use bool logic rather than
increment/decrement.
2013-11-13 02:27:11 +01:00
Vladimir Serbinenko
c773faf05e Revert " * include/grub/symbol.h (ADDR): New macro. Replace all occurences of"
This reverts commit 286551b4eb.
2013-11-13 02:17:20 +01:00
Vladimir Serbinenko
513eeb61dd * grub-core/kern/arm/cache_armv6.S [__clang__]: Don't add .armv6 when
compiling with clang.
2013-11-13 01:08:47 +01:00
Vladimir Serbinenko
bc379c1aa1 * grub-core/kern/arm/uboot/startup.S: Use .org rather than assigning
".".
2013-11-13 01:06:30 +01:00
Vladimir Serbinenko
286551b4eb * include/grub/symbol.h (ADDR): New macro. Replace all occurences of
=x with ADDR(x) in arm assembly.
	(END): New macro. Replace all .end with END.
2013-11-13 01:04:56 +01:00
Vladimir Serbinenko
16057d6bbb Redirect all divisions to grub_divmod64. 2013-11-13 00:53:53 +01:00
Vladimir Serbinenko
f649a6a8fd * grub-core/term/tparm.c (tparam_internal): Use unsigned divisions. 2013-11-13 00:51:06 +01:00
Vladimir Serbinenko
ef28ee8bc1 Add missing includes of loader.h. 2013-11-13 00:43:03 +01:00
Vladimir Serbinenko
0c62a5b28e * grub-core/term/at_keyboard.c: Don't poll non-functional AT controller
until it becomes operational.
2013-11-12 19:30:46 +01:00
Vladimir Serbinenko
b0720b4988 * grub-core/Makefile.core.def (legacy_password_test): Disable
on platforms where no legacycfg is compiled.
	* grub-core/tests/lib/functional_test.c: Tolerate failure to
	load legacy_password_test.
2013-11-12 18:44:58 +01:00
Vladimir Serbinenko
d5bab2c0e1 * grub-core/loader/i386/bsd.c: Remove variable length arrays. 2013-11-12 16:14:33 +01:00
Vladimir Serbinenko
3ea0ccb319 * grub-core/efiemu/prepare.c: Remove variable length arrays. 2013-11-12 16:12:28 +01:00
Vladimir Serbinenko
08772054e9 * grub-core/osdep/windows/hostdisk.c (grub_util_fd_strerror): Silence
strict-aliasing warning.
	(fsync): Silence cast warning.
2013-11-12 16:09:42 +01:00
Vladimir Serbinenko
1dcb27157d * grub-core/commands/verify.c: Remove variable length arrays.
Load gcry_dsa/gcry_rsa automatically.
2013-11-12 16:07:30 +01:00
Vladimir Serbinenko
61c22fdf36 * grub-core/tests/signature_test.c: New test. 2013-11-12 16:05:57 +01:00
Vladimir Serbinenko
431e57a797 * grub-core/disk/cryptodisk.c (luks_script_get): Adapt to new procfs
API.
2013-11-12 16:01:19 +01:00
Vladimir Serbinenko
b521bb816d * grub-core/tests/legacy_password_test.c (vectors): Make static.
* grub-core/tests/pbkdf2_test.c (vectors): Likewise.
2013-11-12 15:59:58 +01:00
Vladimir Serbinenko
7d06b24eac * grub-core/tests/setjmp_test.c: Reset counter to 0 before starting. 2013-11-12 15:58:50 +01:00
Vladimir Serbinenko
3bbeade41d * grub-core/fs/proc.c: Allow \0 in proc files. 2013-11-12 15:57:09 +01:00
Vladimir Serbinenko
ba82db7a0d * grub-core/tests/xnu_uuid_test.c: Fix assert message. 2013-11-12 14:11:34 +01:00
Vladimir Serbinenko
801564c804 * grub-core/tests/xnu_uuid_test.c: Fix copyright year. 2013-11-12 14:07:34 +01:00
Vladimir Serbinenko
ac8cac1dac * grub-core/fs/ext2.c: Remove variable length arrays. 2013-11-12 03:04:19 +01:00
Vladimir Serbinenko
4b85f1228a * grub-core/lib/crypto.c (grub_crypto_cbc_decrypt): Remove variable
length arrays.
2013-11-12 02:49:17 +01:00
Vladimir Serbinenko
c35fcdc0b7 * grub-core/disk/AFSplitter.c: Remove variable length arrays.
* grub-core/disk/cryptodisk.c: Likewise.
	* grub-core/disk/geli.c: Likewise.
	* grub-core/disk/luks.c: Likewise.
2013-11-12 02:48:02 +01:00
Vladimir Serbinenko
15decd26cc * grub-core/tests/legacy_password_test.c: New test.
* grub-core/commands/legacycfg.c: Remove variable length arrays.
2013-11-12 02:38:33 +01:00
Vladimir Serbinenko
9c6482b8d6 * grub-core/lib/pbkdf2.c: Remove variable length arrays. 2013-11-12 01:52:55 +01:00
Vladimir Serbinenko
41f26e0ebc * grub-core/tests/pbkdf2_test.c: New test. 2013-11-12 01:51:36 +01:00
Vladimir Serbinenko
2def66169e * grub-core/lib/xzembed/xz_dec_stream.c: Remove variable length arrays. 2013-11-12 01:26:56 +01:00
Vladimir Serbinenko
9e34a34e44 * grub-core/io/lzopio.c: Remove variable length arrays. 2013-11-12 01:25:03 +01:00
Vladimir Serbinenko
44a387e0ea * grub-core/commands/xnu_uuid.c: Remove variable length arrays. 2013-11-12 01:19:34 +01:00
Vladimir Serbinenko
a388e25576 * grub-core/tests/xnu_uuid_test.c: New test. 2013-11-12 01:18:27 +01:00
Vladimir Serbinenko
a1ef7718c9 * grub-core/commands/hashsum.c: Remove unneeded memset (zalloc already
covers it).
2013-11-12 00:58:46 +01:00
Vladimir Serbinenko
65ddb30016 * grub-core/commands/hashsum.c: Remove variable length arrays. 2013-11-12 00:52:54 +01:00
Vladimir Serbinenko
31747dd521 * grub-core/tests/gfxterm_menu.c (gfxterm_menu): Handle out-of-memory
condition.
	* tests/grub_func_test.in: Increase memory allocation.
2013-11-12 00:44:00 +01:00
Vladimir Serbinenko
6a74c4dfff * grub-core/osdep/unix/getroot.c [HAVE_STRUCT_STATFS_F_FSTYPENAME
&& HAVE_STRUCT_STATFS_F_MNTFROMNAME]: Include sys/param.h and
	sys/mount.h.
2013-11-11 23:10:30 +01:00
Vladimir Serbinenko
394c3e0ac2 * grub-core/osdep/apple/hostdisk.c (grub_util_get_fd_size): Rename to ..
(grub_util_get_fd_size_os): ...this.
	(grub_hostdisk_flush_initial_buffer): New empty function.
2013-11-11 23:08:51 +01:00
Vladimir Serbinenko
60d31116c2 * grub-core/gensyminfo.sh.in: Handle the case of portable output
without --defined-only.
2013-11-11 23:05:53 +01:00
Vladimir Serbinenko
8445b0115f * grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use
rip-relative addressing in prologue.
2013-11-11 23:02:51 +01:00
Vladimir Serbinenko
8506a64149 * include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64.
* grub-core/kern/misc.c (__bzero) [__APPLE__]: New function.
2013-11-11 22:53:30 +01:00
Vladimir Serbinenko
631187be8c Add missing includes of loader.h. 2013-11-11 02:30:09 +01:00
Vladimir Serbinenko
87d62d7d29 * grub-core/loader/i386/coreboot/chainloader.c (load_segment): Use
right buffer for temporary load.
2013-11-11 00:06:52 +01:00
Vladimir Serbinenko
5460cfeba8 * grub-core/loader/i386/coreboot/chainloader.c: Support tianocore. 2013-11-10 23:26:25 +01:00
Vladimir Serbinenko
8997730612 * grub-core/loader/i386/coreboot/chainloader.c: Support lzma-compressed
payload.
2013-11-10 20:53:27 +01:00
Vladimir Serbinenko
3617c59bab * include/grub/lib/LzmaDec.h: Fix to include LzmaTypes.h and
not Types.h.
	* grub-core/lib/LzmaDec.c: Fix prologue to make it compileable in GRUB
	environment.
	(LzmaDec_InitDicAndState): Make static.
2013-11-10 20:37:01 +01:00
Vladimir Serbinenko
2024ade285 * grub-core/term/ieee1275/escc.c (GRUB_MOD_INIT): Fix order of channels.
Reported by: Aaro Koskinen <aaro.koskinen@iki.fi>
2013-11-10 17:53:11 +01:00
Vladimir Serbinenko
33690255c5 Fix grub_machine_fini bitrot.
Reported by: Glenn Washburn.
2013-11-10 13:33:26 +01:00
Vladimir Serbinenko
54da019fdb * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and
-DELF.
	* grub-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__
	instead of ELF*.
2013-11-10 13:13:41 +01:00
Vladimir Serbinenko
9612ebc00e Add new ports: i386-xen and x86_64-xen. This allows running GRUB in
XEN PV environment and load kernels.
2013-11-09 21:29:11 +01:00
Vladimir Serbinenko
1a46a3a4b3 * grub-core/loader/i386/multiboot_mbi.c: Handle space in command line.
* grub-core/loader/multiboot_mbi2.c: Likewise.
2013-11-09 17:32:37 +01:00
Vladimir Serbinenko
2df1255117 * grub-core/lib/cmdline.c (grub_loader_cmdline_size): Fix empty cmdline
handling.
2013-11-09 17:31:21 +01:00
Vladimir Serbinenko
3c98038174 * grub-core/commands/i386/cmostest.c: Add new command "cmosset".
Tested by: Denis 'GNUtoo' Carikli.
2013-11-09 17:27:49 +01:00
Vladimir Serbinenko
800f63d38f * grub-core/normal/datetime.c (grub_get_weekday): Use unsigned types. 2013-11-08 19:14:03 +01:00
Vladimir Serbinenko
5620eb5332 * grub-core/gfxmenu/gui_circular_progress.c (parse_angle):
Use to get rounded angle rather than truncated.
2013-11-08 19:13:15 +01:00
Vladimir Serbinenko
9f8acdaa5d * grub-core/term/serial.c: Add option for enabling/disabling
RTS/CTS flow control.
2013-11-08 18:20:20 +01:00
Vladimir Serbinenko
2dc1eb6cbf * grub-core/lib/libgcrypt/cipher/idea.c (mul_inv): Remove signed
divisions.
2013-11-08 18:10:07 +01:00
Vladimir Serbinenko
b9563c9451 * grub-core/lib/libgcrypt/mpi/mpih-div.c (_gcry_mpih_divrem):
Use grub_fatal rather than divide by zero.
	* grub-core/lib/libgcrypt/mpi/mpi-pow.c (gcry_mpi_powm): Likewise.
2013-11-08 16:33:48 +01:00
Vladimir Serbinenko
d6d8e9a93e * include/grub/gui.h (grub_fixed_sfs_divide): Round rather than
truncate.
	(grub_fixed_fsf_divide): Likewise.
2013-11-08 16:17:29 +01:00
Vladimir Serbinenko
d06de6c871 * grub-core/gfxmenu/gui_list.c (draw_scrollbar): Avoid
division by-zero and senseless negative divisions.
2013-11-08 15:44:39 +01:00