Commit graph

514 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
4531a206a1 * grub-core/fs/i386/pc/pxe.c (set_mac_env): Export variable.
(set_env_limn_ro): Likewise.
	(GRUB_MOD_INIT): Likewise.
	* grub-core/hook/datehook.c (GRUB_MOD_INIT): Likewise. Change to
	ARRAY_SIZE while on it.
	(GRUB_MOD_FINI): Change to ARRAY_SIZE.
	* grub-core/normal/context.c (grub_env_export): Move from here ...
	* grub-core/kern/env.c (grub_env_export): ... here.
	* grub-core/normal/context.c (grub_cmd_export): Skip exporting root and
	prefix.
	* grub-core/kern/main.c (grub_main): Export root and prefix.
	* include/grub/env.h (grub_env_export): Export.
	Reported by: Seth Goldberg.
2011-01-11 11:51:05 +01:00
Vladimir 'phcoder' Serbinenko
4514605726 * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_make_mbi):
Take into account space used by ELF sections and multiboot palette.
	Reported by: Grégoire Sutre.
2011-01-11 00:44:56 +01:00
Vladimir 'phcoder' Serbinenko
3395fe5230 Pass more appropriate video id to Linux.
* grub-core/loader/i386/linux.c (grub_linux_setup_video): Use
	grub_video_get_driver_id and variable gfxpayloadforcelfb to
	fill have_vga.
	(grub_linux_boot): Rely on grub_linux_setup_video to fill have_vga and
	shift params->lfb_size.
	* include/grub/i386/linux.h: Make an enume out of have_vga values.
2011-01-11 00:02:01 +01:00
Vladimir 'phcoder' Serbinenko
b3ff6ff056 * grub-core/fs/zfs/zfsinfo.c (grub_cmd_zfs_bootfs): Use comma as
separator and pass bootpath/devid even if only one of them is available.
	Reported by: Seth Goldberg.
2011-01-10 23:56:11 +01:00
Vladimir 'phcoder' Serbinenko
ae67942e78 Don't use post-4G memory on EFI even if 64-bit since some non-compliant
implementations bug on them.

	* grub-core/kern/efi/mm.c (grub_efi_allocate_pages): Skip post-4G
	memory.
	(filter_memory_map): Likewise.
2011-01-10 23:51:10 +01:00
Vladimir 'phcoder' Serbinenko
dcb883b162 Submenu default support.
* grub-core/normal/menu.c (grub_menu_execute_entry): New parameter
	auto_boot. All users updated.
	Declared static.
	Handle chosen and default with submenus.
	(grub_menu_execute_with_fallback): Declared static.
	Don't notify failure if autobooted. Upper level does it.
	(menuentry_eq): New function.
	(get_entry_number): Use menuentry_eq.
	(show_menu): New parameter "autobooted". All users updated.
	(grub_show_menu): Likewise.
	* include/grub/normal.h (grub_show_menu): Likewise.
	* include/grub/menu.h (grub_menu_execute_entry): Removed.
	(grub_menu_execute_with_fallback): Likewise.
2011-01-10 23:27:58 +01:00
Vladimir 'phcoder' Serbinenko
47a77af5e8 * grub-core/commands/legacycfg.c (legacy_file): Trim the line. 2011-01-10 19:25:00 +01:00
Vladimir 'phcoder' Serbinenko
db87be2aea * grub-core/kern/i386/pc/init.c (grub_get_conv_memsize): Removed.
(grub_machine_init): Don't check amount of low memory as reportedly
	INT 12h can be broken and if low memory is too low we wouldn't have
	gotten into grub_machine_init anyway.
2011-01-10 17:54:21 +01:00
Vladimir 'phcoder' Serbinenko
c49849cc63 * grub-core/kern/i386/pc/mmap.c (grub_get_conv_memsize): New function.
(grub_machine_mmap_iterate): Take low memory into account
2011-01-10 17:51:06 +01:00
Vladimir 'phcoder' Serbinenko
b1969b3049 * grub-core/fs/btrfs.c (grub_btrfs_mount): Transform out of range into
badfs.
	Reported by: TiCPU.
2011-01-10 17:35:32 +01:00
Vladimir 'phcoder' Serbinenko
cf0eaf13a1 * grub-core/disk/raid.c (insert_array): Display RAID name in duplicate
members errors.
2011-01-10 17:28:29 +01:00
Vladimir 'phcoder' Serbinenko
e7121b6932 * grub-core/fs/zfs/zfs.c (dmu_read): Use void * for some pointers to
avoid aliasing.
	(fzap_lookup): Likewise.
	(dnode_get): Likewise.
	(make_mdn): Likewise.
	(zfs_mount): Likewise.
	(fzap_iterate): Use temporary pointer to avoid aliasing.
	(grub_zfs_read): Likewise.
	* grub-core/loader/i386/xnu.c (grub_xnu_boot): Likewise.
	* grub-core/loader/xnu.c (grub_cmd_xnu_kernel): Use void * for some
	pointers to avoid aliasing.
	(grub_cmd_xnu_kernel64): Likewise.
	(grub_xnu_load_driver): Likewise.
2011-01-08 01:56:09 +01:00
Vladimir 'phcoder' Serbinenko
fc836af9a5 * grub-core/commands/terminal.c (grub_cmd_terminal_input): Silence
aliasing warning.
	(grub_cmd_terminal_output): Likewise.
	Reported and tested by: Grégoire Sutre.
2011-01-08 01:50:06 +01:00
Vladimir 'phcoder' Serbinenko
f9f376488b * grub-core/term/at_keyboard.c (grub_keyboard_getkey): Silence spurious
warning.
	Reported and tested by: Grégoire Sutre.
2011-01-08 01:45:57 +01:00
Vladimir 'phcoder' Serbinenko
9462775a2d * grub-core/Makefile.am (rs_decoder.S): Force compilation with -Os.
Reported and tested by: Alain Greppin.
2011-01-08 00:39:12 +01:00
Vladimir 'phcoder' Serbinenko
0fd48e357f Satisfy some bison versions need for inttypes.h.
* grub-core/lib/posix_wrap/inttypes.h: New file.
	* grub-core/lib/posix_wrap/sys/types.h (int8_t): New type.
	(int16_t): Likewise.
	(int32_t): Likewise.
	(int64_t): Likewise.
	Reported and tested by: Alain Greppin.
2011-01-08 00:34:23 +01:00
Vladimir 'phcoder' Serbinenko
43f1bc8369 * grub-core/loader/i386/bsdXX.c (grub_netbsd_load_elf_meta):
Silence spurious warning.
	Reported and tested by: Alain Greppin.
2011-01-08 00:27:38 +01:00
Szymon Janc
25953e1055 Improve loaders' kernel command line handling.
* grub-core/lib/cmdline.c: New file.
	* include/grub/lib/cmdline.h: Likewise.
	* grub-core/loader/i386/linux.c (grub_cmd_linux): Use
	grub_create_loader_cmdline to create kernel command line.
	* grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise.
	* grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_linux): Likewise.
	* grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_linux): Likewise.
	* grub-core/Makefile.core.def (linux16): Add lib/cmdline.c on i386_pc.
	(linux): Add lib/cmdline.c on common.
2011-01-07 17:09:39 +01:00
Vladimir 'phcoder' Serbinenko
e72d259fe1 * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Take into account that
inopos might be unaligned.
2011-01-07 17:06:42 +01:00
Vladimir 'phcoder' Serbinenko
c0cf26da6b * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Add missing
endian transformations.
	* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise.
	Based on report by: Doug Nazar.
2011-01-07 16:17:24 +01:00
Doug Nazar
0ca09e6c52 * grub-core/disk/raid5_recover.c (grub_raid5_recover): Add missing
array->members[i].start_sector.
	* grub-core/disk/raid6_recover.c (grub_raid6_recover): Likewise.
2011-01-07 14:41:44 +01:00
Colin Watson
71b6a2b7a2 * grub-core/kern/emu/getroot.c (find_root_device_from_mountinfo):
Fix prefix check to handle the case where dir ends with a slash
(most significantly, "/" itself).
Reported by: Michael Vogt.
2011-01-06 11:09:17 +00:00
Vladimir 'phcoder' Serbinenko
b3f8d28ad0 Run terminfo_cls on initing terminfo output to clear the screen and
move the cursor to (0,0).

	* grub-core/term/ieee1275/ofconsole.c (grub_ofconsole_init_output):
	Call grub_terminfo_output_init.
	* grub-core/term/serial.c (grub_serial_term_output): Set .init.
	* grub-core/term/terminfo.c (grub_terminfo_output_init): New function.
	* include/grub/terminfo.h (grub_terminfo_output_init): New declaration.
2011-01-05 12:23:06 +01:00
Vladimir 'phcoder' Serbinenko
488f71f116 * grub-core/term/terminfo.c (grub_terminfo_readkey): Handle keys with
CTRL.
2011-01-05 01:25:01 +01:00
Vladimir 'phcoder' Serbinenko
18a38098ad The E820 type 5 is BADRAM, not EXEC_CODE.
* grub-core/loader/i386/bsd.c (GRUB_E820_EXEC_CODE): Removed.
	(GRUB_E820_BADRAM): New define.
	* grub-core/loader/i386/linux.c (grub_linux_boot): Translate code
	into reserved. Propagate BADRAM.
	* grub-core/loader/i386/bsd.c (GRUB_E820_EXEC_CODE): Removed.
	(GRUB_E820_BADRAM): New define.
2011-01-05 01:14:32 +01:00
Vladimir 'phcoder' Serbinenko
9eae2084f4 * grub-core/lib/efi/relocator.c (grub_relocator_firmware_fill_events):
Ignore the memory post-4G.
	(grub_relocator_firmware_alloc_region): Additional debug statement.
2011-01-04 19:08:03 +01:00
Vladimir 'phcoder' Serbinenko
ebc71d284c * grub-core/kern/emu/getroot.c (grub_util_get_grub_dev): Check md/%s
names.
	Reported by: David Pravec.
2011-01-04 18:15:27 +01:00
Vladimir 'phcoder' Serbinenko
446fa40081 * grub-core/disk/i386/pc/biosdisk.c (GRUB_MOD_INIT): Workaround buggy
BIOSes.
2011-01-04 15:42:47 +01:00
Vladimir 'phcoder' Serbinenko
a0159f370d * grub-core/lib/reed_solomon.c (grub_reed_solomon_add_redundancy):
Prevent overflow.
	(grub_reed_solomon_recover): Likewise.
2011-01-04 15:39:59 +01:00
Vladimir 'phcoder' Serbinenko
e5146ca18b * grub-core/lib/reed_solomon.c (main) [TEST]: Reactivate normal test. 2011-01-04 15:37:10 +01:00
Vladimir 'phcoder' Serbinenko
956384994b * grub-core/lib/reed_solomon.c (scratch) [! STANDALONE]: Remove leftover
variable.
2011-01-04 15:35:10 +01:00
Colin Watson
5b1bdf1231 * grub-core/commands/legacycfg.c (GRUB_MOD_INIT): Fix typo in
descriptions of extract_legacy_entries_source and
extract_legacy_entries_configfile.
Reported by: Seung Soo, Ha.
2011-01-04 13:05:19 +00:00
Colin Watson
99d925aad4 * grub-core/bus/pci.c (grub_pci_iterate): Skip remaining functions
on devices that do not implement function 0.
2011-01-03 23:56:45 +00:00
Dave Vasilevsky
4af0504b72 * grub-core/fs/hfsplus.c: Make parent unsigned.
(grub_hfsplus_cmp_catkey): Don't compare using subtraction, it
	overflows.
	(grub_hfsplus_cmp_extkey): Likewise
2011-01-03 15:30:41 +01:00
Vladimir 'phcoder' Serbinenko
275bff5f00 * grub-core/partmap/amiga.c (GRUB_AMIGA_PART_MAGIC): New define.
(amiga_partition_map_iterate): Check "PART" magic to avoid a very long
	loop in case of incorrect amiga partmap.
2010-12-31 15:00:45 +01:00
Vladimir 'phcoder' Serbinenko
307806cb53 * grub-core/partmap/amiga.c (GRUB_AMIGA_RDSK_MAGIC): New define.
(amiga_partition_map_iterate): Use grub_memcmp instead of grub_strcmp.
	Reported by:EHeM.
2010-12-31 14:55:55 +01:00
Vladimir 'phcoder' Serbinenko
b12b923e63 * grub-core/loader/i386/bsdXX.c (grub_openbsd_find_ramdisk): Silence
spurious warning.
	Reported by: crocket
2010-12-31 12:37:35 +01:00
Vladimir 'phcoder' Serbinenko
14b48a19c2 * grub-core/loader/xnu.c (grub_cmd_xnu_kernel) [! GRUB_MACHINE_EFI]:
Preload EFIemu.
	(grub_cmd_xnu_kernel64) [! GRUB_MACHINE_EFI]: Likewise.
2010-12-27 07:19:51 +01:00
Vladimir 'phcoder' Serbinenko
693db2df56 * grub-core/loader/xnu.c (grub_cmd_xnu_kext): Abort if no kernel
is loaded
	(grub_cmd_xnu_kextdir): Likewise.
	(grub_cmd_xnu_splash): Likewise.
2010-12-27 07:18:24 +01:00
Vladimir 'phcoder' Serbinenko
c76386454e Avoid using Reed-Solomon with 0 redundancy.
* grub-core/kern/i386/pc/startup.S: Remove 0-data check.
	* grub-core/lib/reed_solomon.c (decode_block): Do not proceed on 0 data
	or 0 redundancy.
	(grub_reed_solomon_add_redundancy): Do not proceed with 0 redundancy.
	(grub_reed_solomon_recover): Likewise.
2010-12-27 07:09:43 +01:00
Vladimir 'phcoder' Serbinenko
25dd47804d Don't use disk subsystem in freebsd_boot.
* grub-core/loader/i386/bsd.c (freebsd_bootdev): New variable.
	(freebsd_biosdev): Likewise.
	(grub_freebsd_boot): Use freebsd_bootdev and freebsd_biosdev.
	(grub_cmd_freebsd): Set freebsd_bootdev and freebsd_biosdev.
2010-12-27 07:06:41 +01:00
Vladimir 'phcoder' Serbinenko
0b2db94300 Handling of files of unknown size is currently limited. They can't be
used e.g. for initrd or modules. Moreover gzip handling of not
	easily seekable files is buggy. Disable unknown file size for now. May
	be inefficient but works.

	* grub-core/io/gzio.c (test_header): Always retrieve the file size.
	* grub-core/io/xzio.c (grub_xzio_open): Likewise.
2010-12-26 21:15:31 +01:00
Mirko Parthey
5c408d0f50 * grub-core/boot/i386/pc/boot.S: Fix %es:%bx pointing to nowhere on
floppy probe.
2010-12-26 20:49:08 +01:00
Jeroen Dekkers
190a011a8b * grub-core/disk/raid.c (insert_array): Don't add spurious members. 2010-12-25 22:32:54 +01:00
Shea Levy
022d01b807 * grub-core/genmod.sh.in: Use @OBJCOPY@ rather than objcopy. 2010-12-25 18:21:46 +01:00
Vladimir 'phcoder' Serbinenko
0354b8672c * grub-core/commands/acpihalt.c (grub_acpi_halt): Sleep for 1.5 before
writing an error message because of async power management.
	* grub-core/kern/mips/yeeloong/init.c (grub_halt): Likewise.
	(grub_reboot): Likewise.
2010-12-25 14:09:36 +01:00
Colin Watson
20641b6baa * grub-core/lib/reed_solomon.c (gauss_solve): Fix size of standalone
scratch area.  Make sure to initialise chosen in standalone mode as
well as non-standalone.
Reported by: Robert Hooker and Andy Whitcroft.
Tested by: Andy Whitcroft.
2010-12-21 16:51:08 +00:00
Colin Watson
d060ad60ee * grub-core/commands/echo.c (grub_cmd_echo): Make UTF-8-clean by
constructing a new unescaped string and passing it to grub_xputs in
one go, rather than passing characters to grub_printf one at a time.
2010-12-21 13:52:07 +00:00
Colin Watson
b889cfadf9 * grub-core/fs/udf.c (read_string): Pacify GCC warning by
initialising utf16.
2010-12-21 13:00:10 +00:00
Vladimir 'phcoder' Serbinenko
5318fe9804 * grub-core/loader/i386/multiboot_mbi.c (grub_multiboot_add_module):
Avoid next pointing to nowhere.
2010-12-20 16:13:01 +01:00