* util/grub.d/40_custom.in: New file. Example on how to add custom
entries to /etc/grub.d.
* conf/common.rmk (%, update-grub_SCRIPTS, CLEANFILES): Install
40_custom (implicitly, by merging all the grub.d rules).
* term/i386/pc/serial.c (GRUB_SERIAL_PORT_NUM): New constant.
[!GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3.
(serial_hw_get_port): Check validity of the port number.
(grub_cmd_serial): Check return value of serial_hw_get_port().
* boot/i386/pc/diskboot.S (notification_string): Replace
"Loading kernel" with just "loading". This is shorter, less
confusing and saves a few bytes for possible future changes.
* kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to
grub_addr_t before casting it to the void pointer to fix a
warning. Non-addressable regions are discarded earlier.
(grub_arch_modules_addr): Cast _end to grub_addr_t.
* kern/i386/linuxbios/table.c: Include grub/misc.h.
(check_signature): Don't shadow table_header.
(grub_linuxbios_table_iterate): Cast numeric constants to
grub_linuxbios_table_header_t.
* include/grub/i386/linuxbios/init.h: Add noreturn attribute to
grub_stop().
This fixes a performance issue when pc & gpt partmap iterators
didn't abort iteration even after our hook found what it was
looking for (often causing expensive probes of non-existant drives).
Some callers relied on previous buggy behaviour, since they would
rise an error when their own hooks caused early abortion of its
iteration.
* kern/device.c (grub_device_open): Improve error message.
* disk/lvm.c (grub_lvm_open): Likewise.
* disk/raid.c (grub_raid_open): Likewise.
* partmap/pc.c (pc_partition_map_iterate): Abort parent iteration
when hook requests it, independently of grub_errno.
(pc_partition_map_probe): Do not fail when find_func() caused
early abortion of pc_partition_map_iterate().
* partmap/gpt.c (gpt_partition_map_iterate): Abort parent iteration
when hook requests it, independently of grub_errno.
(gpt_partition_map_probe): Do not fail when find_func() caused
early abortion of gpt_partition_map_iterate().
* kern/partition.c (grub_partition_iterate): Abort parent iteration
when hook requests it, independently of grub_errno. Do not fail when
part_map_iterate_hook() caused early abortion of p->iterate().
* util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Do not fail
when grub_partition_iterate() returned with non-zero.
* disk/ata.c (grub_ata_pio_write): Check status before writing,
like we do in grub_ata_pio_read().
(grub_ata_readwrite): Always write individual sectors. Fix the
sector count for the remainder.
(grub_ata_write): Enable writing to ATA devices. Correctly
report error for ATAPI devices.
* disk/ata.c (grub_ata_readwrite): Don't increment sector number
for every read sector, we already increment it for the whole
batch. This fixes reading more than 256 sectors at once.
* Makefile.in (MODULE_LDFLAGS): New variable.
* aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if
the linker accepts --build-id=none.
* configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute
MODULE_LDFLAGS.
* genmk.rb: Use MODULE_LDFLAGS when linking modules.
* fs/xfs.c (struct grub_xfs_dir_header): Use names similar to
those in Linux XFS code. Provide a way to access 64-bit parent
inode.
(grub_xfs_iterate_dir): Use the new names. Avoid reading past
the end of struct grub_xfs_dir_header.
* include/grub/ieee1275.h (grub_ieee1275_flag): New constant
GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM
and GRUB_IEEE1275_FLAG_NO_ANSI.
* kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set flag
GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM
and GRUB_IEEE1275_FLAG_NO_ANSI for Open Hackware.
* kern/ieee1275/ieee1275.c (grub_ieee1275_interpret): Return
immediately if GRUB_IEEE1275_FLAG_CANNOT_INTERPRET is set.
* kern/ieee1275/init.c (grub_claim_heap): Claim memory directly if
GRUB_IEEE1275_FLAG_FORCE_CLAIM is set.
* term/ieee1275/ofconsole.c (grub_ofconsole_writeesc): Don't output
esc sequence on non ANSI terminal.
(grub_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal.
* util/elf/grub-mkimage.c (add_segments): Move ELF header to the
beginning of file.
* disk/raid.c: Cast grub_dprintf() arguments to unsigned long
long if the format specifier expects it.
* partmap/gpt.c (gpt_partition_map_iterate): Likewise.
* partmap/pc.c (pc_partition_map_iterate): Likewise.
* fs/ntfs.c (grub_ntfs_uuid): Cast data->uuid to unsigned long
long to fix a warning.
* fs/reiserfs.c (grub_reiserfs_read): Change casts in
grub_dprintf() arguments to fix warnings.
* util/i386/pc/grub-setup.c (setup): Write install_dos_part and
install_bsd_part immediately before core.img is embedded or
modified on disk. This fixes core.img verification if core.img
cannot be embedded.
* fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro. Maps filesystem
block to disk block.
(grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result.
Patch from Niels B\303\266hm <bitbucket@arcor.de>
* util/update-grub_lib.in (font_path): Search for fonts in
/boot/grub first, which is more likely to be readable (we aren't
deciding where fonts live, just looking for them).
* util/grub.d/10_linux.in: Avoid passing UUIDs to Linux when either
"/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" does not exist, or when a
Linux image includes no initrd.
* util/grub.d/00_header.in: Move last prepare_grub_to_access_device()
call from here ...
* util/grub.d/10_hurd.in: ... to here ...
* util/grub.d/10_linux.in: ... and here.
* commands/search.c (search_label, search_fs_uuid, search_file): Print
search result when not saving to variable, not the other way around.
When saving to variable, abort iteration as soon as a match is found.
* util/update-grub_lib.in (prepare_grub_to_access_device): Remove
check for partition that provides /boot/grub. Its logic is flawed,
as it prevents prepare_grub_to_access_device() from being called
multiple times.