* grub-core/boot/mips/startup_raw.S: Use GRUB_DECOMPRESSOR_*
* include/grub/offsets.h: Rename decompressor fields from
GRUB_KERNEL_* to GRUB_DECOMPRESSOR_*.
* util/grub-mkimage.c (image_targets): Use new names.
by 88 bytes but improves compatibility and maintainability.
* grub-core/kern/i386/pc/startup.S (grub_console_putchar): Moved to ...
* grub-core/term/i386/pc/console.c (grub_console_putchar_real):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_console_getkey): Moved to ...
* grub-core/term/i386/pc/console.c (grub_console_getkey):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_console_getxy): Moved to ...
* grub-core/term/i386/pc/console.c (grub_console_getxy):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_console_gotoxy): Moved to ...
* grub-core/term/i386/pc/console.c (grub_console_gotoxy):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_console_cls): Moved to ...
* grub-core/term/i386/pc/console.c (grub_console_cls):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_console_setcursor): Moved to ..
* grub-core/term/i386/pc/console.c (grub_console_setcursor):
... here. Translated to C.
* grub-core/kern/i386/pc/startup.S (grub_get_rtc): Moved to ..
* grub-core/kern/i386/pc/init.c (grub_get_rtc): ... here.
Translated to C.
* grub-core/term/i386/pc/console.c (int10_9): New function.
(grub_console_putchar): Likewise.
* include/grub/i386/pc/console.h: Removed the not anymore shared
functions.
* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec): Restrict hash_id to
normal decoder.
(hashes): Use in embed decoder as well (for sizes).
(dec_stream_header): Fix embed decompressor logic.
(dec_stream_footer): Likewise.
memory corruption.
* grub-core/fs/iso9660.c (grub_fshelp_node): New field have_symlink.
Make symlink into an array.
(set_rockridge): Set have_symlink and alloc_dirents.
(grub_iso9660_read_symlink): Use new layout.
(grub_iso9660_iterate_dir): Fix memory corruption.
Use new layout.
(grub_iso9660_dir): Set have_symlink.
(grub_iso9660_open): Likewise.
* grub-core/fs/zfs/zfs.c (fill_vdev_info_real): New paramter inserted.
All users updated.
Free type on exit.
(fill_vdev_info): New parameter inserted. All users updated.
(check_pool_label): Likewise.
(scan_disk): Likewise.
(scan_devices): Close non-inserted disks.
(fzap_iterate): Free l.
(unmount_device): Free children descripto memory.
* grub-core/fs/affs.c (grub_affs_bblock): Replace flags with version.
(GRUB_AFFS_FLAG_FFS): Removed.
(GRUB_AFFS_SYMLINK_SIZE): Likewise.
(GRUB_AFFS_FILETYPE_DIR): Make positive and unsigned.
(GRUB_AFFS_FILETYPE_DIR), (GRUB_AFFS_FILETYPE_REG): Fix a mix-up.
(grub_fshelp_node): Make block 32-bit.
Add block_cache and last_block_cache.
(grub_affs_read_block): Fill and use block cache.
(grub_affs_read_file): Removed.
(grub_affs_mount): Zero-fill node. Fix version check. Don't reread
boot block.
(grub_affs_read_symlink): Fix symlink size. Add a \0 at the end for
safety.
(grub_affs_iterate_dir): Use more appropriate types. Zero-fill allocated
space.
(grub_affs_close): Free block cache.
(grub_affs_read): Use grub_fshelp_read_file directly.
* grub-core/kern/dl.c (grub_dl_load_segments) [__powerpc__]: Follow
__ia64__ path.
(grub_dl_load_segments): Set mod->sz.
(grub_dl_flush_cache): Flush whole space occupied by module, not just
segments.
* grub-core/kern/ia64/dl.c (nopm): Make const while on it.
(jump): Likewise.
* grub-core/kern/powerpc/dl.c (grub_arch_dl_get_tramp_got_size): New
function.
(trampoline): New struct.
(trampoline_template): New const.
(grub_arch_dl_relocate_symbols): Create trampolines on overflow.
* include/grub/dl.h (grub_dl): Add sz element.
[__powerpc__]: Follow __ia64__.
(GRUB_ARCH_DL_TRAMP_ALIGN): Define on ppc.
(GRUB_ARCH_DL_GOT_ALIGN): Likewise.
(GRUB_ARCH_DL_TRAMP_SIZE): Likewise.
(grub_arch_dl_get_tramp_got_size) [__powerpc__]: New proto.
* grub-core/fs/btrfs.c (grub_btrfs_embed) [GRUB_UTIL]: New function.
(grub_btrfs_fs) [GRUB_UTIL]: Set embed.
* include/grub/fs.h (grub_fs) [GRUB_UTIL]: New field embed.
* util/grub-setup.c (setup): Use fs embedding if available.
Add additional sanity check.
* grub-core/fs/zfs/zfs.c (recovery): Add Gauss for general case.
Return error on singularity. All users updated.
(read_device): Don't stop on 3rd failure on raidz3.
* grub-core/fs/zfs/zfs.c (mzap_lookup): New parameter case_insensitive.
All users updated.
(zap_hash): Likewise.
(name_cmp): New function.
(zap_leaf_array_equal): New parameter case_insensitive.
All users updated.
(zap_leaf_lookup): Likewise.
(fzap_lookup): Likewise.
(zap_lookup): Likewise.
(dnode_get_path): New parameter case_insensitive. Retrieve case
sensitiviness of a volume. All users updated.
(dnode_get_fullpath): New parameter case_insensitive.
All users updated.
(grub_zfs_dir): Set info.case_insensitiveness.
* grub-core/fs/zfs/zfs.c (powx): New array.
(powx_inv): Likewise.
(poly): New const.
(xor_out): New function.
(gf_mul): Likewise.
(recovery): Likewise.
(read_device): Use second redundancy strip.
to save space time and complexity.
* grub-core/disk/raid6_recover.c (raid6_table1): Removed.
(raid6_table2): Likewise.
(powx): New array.
(powx_inv): Likewise.
(poly): New const.
(grub_raid_block_mul): Replace with ...
(grub_raid_block_mulx): ...this.
(grub_raid6_init_table): Rewritten.
(grub_raid6_recover): Use power of generator representation.
* grub-core/fs/zfs/zfs.c (grub_zfs_device_desc): New member ashift.
(fill_vdev_info_real): Set ashift.
(read_device): Rewrite RAIDZ part based on reverse engineering.
* grub-core/fs/ufs.c (UFS_LOG_BLKSZ): New macro.
(grub_ufs_data): New field log2_blksz.
(grub_ufs_read_file): Use shifts.
(grub_ufs_mount): Check block size and logarithm it.
* grub-core/fs/cpio.c (ATTR_TYPE): New definition.
(ATTR_FILE): Likewise.
(ATTR_DIR): Likewise.
(ATTR_LNK): Likewise.
(grub_cpio_data) [MODE_USTAR]: New fields linkname and linkname_alloc.
(grub_cpio_find_file): Fill mode, handle linkname field as well as
L and K entries.
(grub_cpio_mount): Zero-fill data.
(handle_symlink): New function.
* grub-core/fs/iso9660.c (grub_iso9660_mount): Move rockridge detection
to ...
(set_rockridge): ... here.
(grub_iso9660_mount): Check rockridge on the primary label when
discovering. Ignore Joliet if Rockridge is present.
* grub-core/fs/minix.c (GRUB_MINIX_ZONESZ): Use log_block_size.
(GRUB_MINIX_ZONE2SECT): Likewise.
(grub_minix_data): Replace block_size with log_block_size.
(grub_minix_read_file): Use shifts.
(grub_minix_mount): Check block size and take a logarithm.
* grub-core/fs/afs.c (GRUB_AFS_BLOCKS_PER_DI_RUN): Replaced with...
(GRUB_AFS_LOG_BLOCKS_PER_DI_RUN): ... this.
(GRUB_AFS_BLOCKRUN_LOG_SIZE): New definition.
(grub_afs_read_inode): Use block_shift.
(RANGE_SHIFT): New definition.
(grub_afs_read_block): Account for RANGE_SHIFT, emit errors on
unexpected conditions, use shifts and appropriate types.
(GRUB_MOD_INIT): Check the value of GRUB_AFS_BLOCKRUN_LOG_SIZE.
* grub-core/fs/afs.c (grub_afs_inode): Make small_data zero-size.
(grub_afs_small_data_element_header): New struct.
(grub_afs_read_inode): Read complete inode. Fix ino type while on it.
(grub_afs_read_attribute) [MODE_BFS]: New function.
(grub_afs_iterate_dir): Allocate for complete inode.
(grub_afs_mount): Likewise.
(grub_afs_uuid) [MODE_BFS]: New function.
(grub_afs_fs) [MODE_BFS]: Add .uuid.
* grub-core/fs/ntfs.c (list_file): Set symlink type when appropriate.
(symlink_descriptor): New struct.
(grub_ntfs_read_symlink): New function.
(grub_ntfs_iterate_dir): Use grub_ntfs_read_symlink.
(grub_ntfs_open): Likewise.
* grub-core/fs/zfs/zfs.c (fzap_iterate): Fix handling of indexes
sharing the same block. Iterate over correct number of indices.
(dnode_get_path): Handle symlinks correctly.
* grub-core/fs/iso9660.c (grub_fshelp_node): Remove dir_off. Add symlink
All users updated.
(grub_iso9660_susp_iterate): Accept zero-size iterate.
(grub_iso9660_read_symlink): Moved most of code ...
(grub_iso9660_iterate_dir): ... here. Fill node->symlink.
* grub-core/fs/iso9660.c (grub_iso9660_data): Remove first_sector.
Add node.
(grub_fshelp_node): Revamp. All users updated.
(FLAG_*): New enum.
(read_node): New function.
(grub_iso9660_susp_iterate): Use read_node. Receive a node as argument.
All users updated.
(grub_iso9660_mount): Don't attempt to read sua when there is none.
(get_node_size): New function.
(grub_iso9660_iterate_dir): Use read_node. Agglomerate multi-extent
entries.
Fix memory leak on . and ..
(grub_iso9660_read): Use read_node.
(grub_iso9660_close): Free node.
* grub-core/fs/cpio.c (grub_cpio_data): Use grub_off_t for offsets.
(canonicalize): New function.
(grub_cpio_find_file): Use canonicalize. Store offs in
grub_disk_addr_t.
(grub_cpio_dir): Use grub_disk_addr_t.
(grub_cpio_open): Likewise.
* grub-core/fs/squash4.c (grub_squash_super): Add block_size. Remove
unused flags.
(grub_squash_inode): Add long_file and block_size.
(grub_squash_cache_inode): New struct.
(grub_squash_dirent): Make types into enum.
(SQUASH_TYPE_LONG_REGULAR): New type.
(grub_squash_frag_desc): Add field size.
(SQUASH_BLOCK_FLAGS): New enum.
(grub_squash_data): Use grub_squash_cache_inode.
(grub_fshelp_node): Make ino_chunk 64-bit.
(read_chunk): Minor argument change. All users updated.
(squash_mount): Use correct le_to_cpu.
(grub_squash_open): Handle LONG_REGULAR.
(direct_read): New function.
(grub_squash_read_data): Handle blocks correctly.
* grub-core/kern/i386/coreboot/init.c (grub_machine_init): Use
_edata and _start.
* grub-core/kern/i386/coreboot/startup.S: Move multiboot header after
the small code. It moves it only by few bytes but simplifies the code.
* grub-core/kern/i386/pc/init.c (grub_machine_init): Use _edata and
_start.
* grub-core/kern/i386/pc/startup.S: Use _edata and _start.
(grub_kernel_image_size): Removed.
* grub-core/kern/i386/qemu/startup.S: Use _edata and _start.
(grub_kernel_image_size): Removed.
[APPLE_CC]: Remove apple compiler support. i386-qemu port can't be
compiled with Apple toolchain.
* grub-core/kern/sparc64/ieee1275/crt0.S: Remove leftover fields.
* include/grub/i386/pc/kernel.h (grub_kernel_image_size): Removed.
* include/grub/i386/qemu/kernel.h (grub_kernel_image_size): Removed.
(grub_total_module_size): Likewise.
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE):
Removed.
(GRUB_KERNEL_I386_PC_COMPRESSED_SIZE): Put it lower.
(GRUB_KERNEL_I386_PC_INSTALL_DOS_PART): Likewise.
(GRUB_KERNEL_I386_PC_INSTALL_BSD_PART): Likewise.
(GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY): Likewise.
(GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE): Removed.
(GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE): Likewise.
(GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE): Likewise.
* include/grub/sparc64/ieee1275/kernel.h (grub_kernel_image_size):
Removed.
(grub_total_module_size): Removed.
* util/grub-mkimage.c (image_target_desc): Remove image_size.
(image_targets): Likewise.
Set .compressed_size to no field on sparc.
(generate_image): Remove kernel_image_size handling.
done with a dedicated section.
* grub-core/boot/sparc64/ieee1275/boot.S: Remove GRUB_BOOT_VERSION.
Ensure the correct position of boot_path.
* grub-core/kern/i386/efi/startup.S: Remove GRUB_BOOT_VERSION.
* grub-core/kern/i386/pc/startup.S: Likewise. Ensure correct position of
other fields.
* grub-core/kern/x86_64/efi/startup.S: Remove GRUB_BOOT_VERSION.
* include/grub/boot.h: Removed. All references removed.
* include/grub/sparc64/ieee1275/boot.h (GRUB_BOOT_MACHINE_VER_MAJ):
Removed.
(GRUB_BOOT_MACHINE_BOOT_DEVPATH): Make it lower.
* Makefile.util.def (libgrubmods.a): Add grub-core/fs/exfat.c.
* grub-core/Makefile.core.def (exfat): New module.
* grub-core/fs/exfat.c: New file.
* grub-core/fs/fat.c (GRUB_FAT_DIR_ENTRY_SIZE): Removed.
(GRUB_FAT_ATTR_*): Make into an enum.
(GRUB_FAT_ATTR_LONG_NAME) [MODE_EXFAT]: Removed.
(GRUB_FAT_ATTR_VALID) [MODE_EXFAT]: Remove GRUB_FAT_ATTR_VOLUME_ID.
(GRUB_FAT_ATTR_VOLUME_ID) [MODE_EXFAT]: Removed.
(GRUB_FAT_MAXFILE): Removed.
(grub_exfat_bpb) [MODE_EXFAT]: New struct.
(grub_current_fat_bpb_t): New type.
(grub_fat_dir_entry) [MODE_EXFAT]: New struct.
(grub_fat_dir_node) [MODE_EXFAT]: New struct.
(grub_fat_dir_node_t): New type.
(grub_fat_data) [MODE_EXFAT]: Remove root_sector and num_root_sectors.
(fat_log2) [MODE_EXFAT]: Removed.
(grub_fat_mount): Use grub_current_fat_bpb_t. Add some sanity checks.
(grub_fat_mount) [MODE_EXFAT]: Handle ExFAT.
(grub_fat_iterate_dir) [MODE_EXFAT]: New function.
(grub_fat_find_dir) [MODE_EXFAT]: Handle ExFAT.
(grub_fat_label) [MODE_EXFAT]: New function.
(grub_fat_fs) [MODE_EXFAT]: Set name to "exfat" and
reserved_first_sector to 0.
* grub-core/fs/affs.c (grub_affs_read_file): Use grub_off_t for offset.
* grub-core/fs/afs.c (grub_afs_read_file): Likewise.
* grub-core/fs/fshelp.c (grub_fshelp_find_file): Remove leftover
variable.
* grub-core/fs/hfs.c (grub_hfs_read_file): Use grub_off_t for offset
and connected types.
* grub-core/fs/nilfs2.c (grub_nilfs2_read_file): Use grub_off_t for
offset.
(grub_nilfs2_iterate_dir): Use grub_off_t for fpos.
* grub-core/fs/sfs.c (grub_sfs_read_file): Use grub_off_t for offset.
* grub-core/fs/ufs.c (grub_ufs_read_file): Use grub_off_t for offset
and connected types.
* include/grub/misc.h (grub_isxdigit): New function.
* grub-core/video/colors.c (my_isxdigit): Removed. All users
switched to grub_isxdigit.
* grub-core/term/serial.c (grub_serial_find): Fix in case of port
number starting with a letter.
define.
* grub-core/kern/mips/loongson/init.c (grub_machine_init): Check
that PRID matches the detected subplatform and reset the subplatform
if it doesn't.
* configure.ac: --enable-cache-stats added.
* config.h.in (DISK_CACHE_STATS): New define.
* grub-core/Makefile.core.def (cacheinfo): New command.
* include/grub/disk.h(grub_disk_cache_get_performance): New function.
* grub-core/commands/cacheinfo.c: New file.
* grub-core/commands/minicmd.c (grub_rescue_cmd_info): Updated and
moved to cacheinfo.c.
* grub-core/kern/disk.c: Use DISK_CACHE_STATS to disable disk cache
debug code.
* include/grub/disk.h: Likewise.
* Makefile.util.def (libgrubmods.a): Add minilzo.c and add required flags
to cflags in cppflags.
* Makefile.core.def (btrfs): Likewise.
* grub-core/fs/btrfs.c: Include minilzo.h.
(grub_btrfs_superblock): Add sectorsize, nodesize, leafsize, stripsize and
dummy5 field.
(GRUB_BTRFS_COMPRESSION_LZO): New define.
(grub_btrfs_extent_read): Add support for LZO compression type.
* include/grub/ata.h (grub_ata): New member log_sector_size.
* grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size.
(grub_ata_identify): Read sector size.
(grub_ata_readwrite): Use log_sector_size rather than hardcoded value.
* grub-core/video/video.c (grub_video_edid_checksum): New function.
(grub_video_edid_preferred_mode): Likewise. Try EDID followed by
the Flat Panel extension, in line with the X.org VESA driver.
* grub-core/video/i386/pc/vbe.c (grub_vbe_bios_get_flat_panel_info):
New function.
(grub_vbe_bios_get_ddc_capabilities): Likewise.
(grub_vbe_bios_read_edid): Likewise.
(grub_vbe_get_preferred_mode): Likewise.
(grub_video_vbe_setup): When the mode is "auto", try to get the
preferred mode from VBE, and use the largest mode that is no larger
than the preferred mode (some BIOSes expose a preferred mode that is
not in their mode list!). If this fails, fall back to 640x480 as a
safe conservative choice.
(grub_video_vbe_get_edid): New function.
(grub_video_vbe_adapter): Add get_edid.
* include/grub/video.h (struct grub_vbe_edid_info): New structure.
(struct grub_video_adapter): Add get_edid.
(grub_video_edid_checksum): Add prototype.
(grub_video_edid_preferred_mode): Likewise.
* include/grub/i386/pc/vbe.h (struct grub_vbe_flat_panel_info): New
structure.
* grub-core/commands/videoinfo.c (print_edid): New function.
(grub_cmd_videoinfo): Print EDID if available.
* util/grub.d/00_header.in (GRUB_GFXMODE): Default to "auto". This
is more appropriate on a wider range of platforms than 640x480.
* docs/grub.texi (Simple configuration): Update GRUB_GFXMODE
documentation.
* grub-core/Makefile.core.def (kernel): Remove kern/emu/getroot.c and
kern/emu/raid.c.
* grub-core/kern/emu/main.c (main): Don't try to guess root device. It's
useless.
* grub-core/kern/emu/misc.c (get_win32_path): Moved from here...
* util/getroot.c (get_win32_path): ... here.
* grub-core/kern/emu/misc.c (fini_libzfs): Moved from here...
* util/getroot.c (fini_libzfs): ... here.
* grub-core/kern/emu/misc.c (grub_get_libzfs_handle): Moved from here...
* util/getroot.c (grub_get_libzfs_handle): ... here.
* grub-core/kern/emu/misc.c (grub_find_zpool_from_dir):
Moved from here...
* util/getroot.c (grub_find_zpool_from_dir): ... here.
* grub-core/kern/emu/misc.c
(grub_make_system_path_relative_to_its_root): Moved from here...
* util/getroot.c (grub_make_system_path_relative_to_its_root): ... here.
* grub-core/kern/emu/getroot.c: Moved from here ...
* util/getroot.c: ... here. All users updated.
* grub-core/kern/emu/raid.c: Moved from here ...
* util/raid.c: ... here. All users updated.
* Makefile.util.def (libgrubkern.a): Add grub-core/kern/emu/raid.c.
(grub-setup): Remove util/raid.c.
* grub-core/Makefile.core.def (kernel): Add kern/emu/raid.c on emu.
* grub-core/disk/lvm.c (scan_depth): New variable.
(grub_lvm_iterate): Rescan if necessary.
(find_lv): New function based on grub_lvm_open.
(grub_lvm_open): Use find_lv. Rescan on error.
(is_node_readable): New function.
(is_lv_readable): Likewise.
(grub_lvm_scan_device): Skip already found disks.
(do_lvm_scan): New function. Move grub_lvm_scan_device inside of it.
Stop if searched device is found and readable.
* grub-core/disk/raid.c (inscnt): New variable.
(scan_depth): Likewise.
(scan_devices): New function based on grub_raid_register. Abort if
looked for device is found.
(grub_raid_iterate): Rescan if needed.
(find_array): NEw function based on -grub_raid_open.
(grub_raid_open): Use find_array and rescan.
(insert_array): Set became_readable_at.
* grub-core/kern/disk.c (grub_disk_dev_iterate): Iterate though "pull.
* grub-core/kern/emu/getroot.c (grub_util_open_dm) [HAVE_DEVICE_MAPPER]:
New function.
(grub_util_is_lvm) [HAVE_DEVICE_MAPPER]: Use grub_util_open_dm.
(grub_util_pull_device): New function.
(grub_util_get_grub_dev): Call grub_util_pull_device.
* util/raid.c: Moved to ..
* grub-core/kern/emu/raid.c: ... here.
(grub_util_raid_getmembers): New parameter "bootable".
All users updated. Support 1.x.
* include/grub/ata.h (grub_ata_dev): Change iterate prototype.
All users updated.
* include/grub/disk.h (grub_disk_pull_t): New enum.
(grub_disk_dev): Change iterate prototype.
All users updated.
* include/grub/emu/getroot.h (grub_util_raid_getmembers) [__linux__]:
New proto.
* include/grub/emu/hostdisk.h (grub_util_pull_device): Likewise.
* include/grub/lvm.h (grub_lvm_lv): New members fullname and compatname.
* include/grub/raid.h (grub_raid_array): New member became_readable_at.
* include/grub/scsi.h (grub_scsi_dev): Change iterate prototype.
All users updated.
* include/grub/util/raid.h: Removed.
* grub-core/Makefile.core.def (kernel): Use kern/ieee1275/init.c
instead of kern/sparc64/ieee1275/init.c.
* grub-core/kern/ieee1275/cmain.c (grub_ieee1275_find_options)
[__sparc__]: Set GRUB_IEEE1275_FLAG_NO_PARTITION_0.
* grub-core/kern/ieee1275/init.c [__sparc__]: Include
grub/machine/kernel.h.
(grub_ieee1275_original_stack) [__sparc__]: New variable.
(grub_claim_heap) [__sparc__]: Use sparc version.
(grub_machine_init): Moved args parsing to
(grub_parse_cmdline): ...this.
* grub-core/kern/sparc64/ieee1275/init.c: Removed.
* include/grub/offsets.h (GRUB_KERNEL_SPARC64_IEEE1275_MOD_GAP):
New definition.
(GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN): Likewise.
Move BOOTP to separate file.
* grub-core/Makefile.core.def (net): Add net/bootp.c.
* grub-core/net/net.c: Move all BOOTP functions to
* grub-core/net/bootp.c: ... here.
Use frame interface on PXE.
* grub-core/Makefile.core.def (pxecmd): Removed.
(pxe): Use net/drivers/i386/pc/pxe.c rather than net/i386/pc/pxe.c.
* grub-core/commands/i386/pc/pxecmd.c: Removed.
* grub-core/i386/pc/pxe.c: Moved from here ...
* grub-core/net/i386/pc/pxe.c: ... here. Rewritten.
* grub-core/net/net.c (grub_net_open_real): Handle old pxe syntax.
* include/grub/i386/pc/pxe.h (grub_pxe_unload): Removed.
EFI network support.
* grub-core/Makefile.core.def (efinet): New module.
* grub-core/disk/efi/efidisk.c (compare_device_paths): Moved from
here...
* grub-core/kern/efi/efi.c (grub_efi_compare_device_paths): ... here.
All users updated.
* grub-core/kern/efi/init.c (grub_efi_net_config): New variable.
(grub_machine_get_bootlocation): Call grub_efi_net_config if needed.
* grub-core/kern/x86_64/efi/callwrap.S (efi_wrap_7): New function.
* grub-core/net/drivers/efi/efinet.c: New file.
* include/grub/efi/efi.h (grub_efi_compare_device_paths): New proto.
(grub_efi_net_config): New extern var.
Various cleanups and bugfixes.
* grub-core/disk/efi/efidisk.c (grub_efidisk_open): Fix off-by-one
error.
(grub_efidisk_get_device_name): Unify similar codepaths. Accept whole
disk declared as partition.
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_open): Fix memory
leak on failure.
* grub-core/kern/dl.c (grub_dl_load_file): Fix memory leak.
* grub-core/kern/mm.c (grub_debug_malloc): Don't use unsupported %zx.
(grub_debug_zalloc): Likewise.
(grub_debug_realloc): Likewise.
(grub_debug_memalign): Likewise.
* grub-core/net/arp.c (grub_net_arp_receive): IPv4 is 4-byte wide.
Check that target is IPv4.
* grub-core/net/drivers/ieee1275/ofnet.c (grub_ofnet_findcards): Use
local-mac-address as fallback.
* grub-core/net/ethernet.c (grub_net_recv_ethernet_packet): Prevent
memory leak.
* grub-core/net/ip.c (ipchksum): Rename to ...
(grub_net_ip_chksum): ... this. All users updated.
(grub_net_recv_ip_packets): Special handling for DHCP.
* util/grub-mkimage.c (generate_image): Zero-out aout header.
Unify prefix handling
* grub-core/kern/efi/init.c (grub_efi_set_prefix): Revamped into ...
(grub_machine_get_bootlocation): ... this.
* grub-core/kern/emu/main.c (grub_machine_set_prefix): Revamped into ...
(grub_machine_get_bootlocation): ... this.
(grub_prefix): New variable.
(prefix): Removed.
(root_dev): New variable.
(dir): Likewise.
(main): Use new variables.
* grub-core/kern/i386/coreboot/init.c (grub_machine_set_prefix):
Revamped into ...
(grub_machine_get_bootlocation): ... this.
* grub-core/kern/i386/efi/init.c (grub_machine_set_prefix): Removed.
* grub-core/kern/i386/pc/init.c (make_install_device): Revamped into ...
(grub_machine_get_bootlocation): ... this.
(grub_machine_set_prefix): Removed.
* grub-core/kern/ia64/efi/init.c (grub_machine_set_prefix): Removed.
* grub-core/kern/ieee1275/init.c (grub_machine_set_prefix):
Revamped into ...
(grub_machine_get_bootlocation): ... this.
* grub-core/kern/main.c (grub_set_root_dev): Revamped into ...
(grub_set_prefix_and_root): ... this. All users updated.
* grub-core/kern/mips/init.c (grub_machine_set_prefix):
Revamped into ...
(grub_machine_get_bootlocation): ... this.
* include/grub/kernel.h (grub_machine_set_prefix): Removed.
(grub_machine_get_bootlocation): New proto.
* include/grub/i386/pc/kernel.h (grub_pc_net_config): New var.
Less intrusive and more reliable seek on network implementation.
* grub-core/kern/file.c (grub_file_net_seek): Removed.
(grub_file_seek): Don't call grub_file_net_seek.
* grub-core/net/net.c (grub_net_fs_read): Renamed to ...
(grub_net_fs_read_real): .. this.
(grub_net_seek_real): Use net->offset.
(grub_net_fs_read): Seek if necessary.
Unify IEEE1275 netwotk config with the other platforms.
* grub-core/kern/ieee1275/init.c (grub_ieee1275_net_config):
New variable.
(grub_machine_get_bootlocation): Support network.
* grub-core/kern/ieee1275/openfw.c (grub_ieee1275_parse_args):
Support type and device parsing.
(grub_ieee1275_get_device_type): New function.
* grub-core/net/drivers/ieee1275/ofnet.c (grub_getbootp_real): Revamped
into ...
(grub_ieee1275_net_config_real): ... this.
(grub_ofnet_probecards): Removed.
* grub-core/Makefile.am (KERNEL_HEADER_FILES): Remove ofnet.h.
* include/grub/ieee1275/ofnet.h: Removed.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_net_config): NEw
extern var.
(grub_ieee1275_get_device_type): New function.
Unify network device closing across platforms and make more robust.
* grub-core/kern/ieee1275/init.c (grub_machine_fini): Don't call
grub_grubnet_fini.
* grub-core/net/ethernet.c (send_ethernet_packet): Open card if it isn't
already.
* grub-core/net/net.c (grub_net_network_level_interface_register):
Update num_ifaces.
(grub_net_card_unregister): Close all interfaces.
(receive_packets): Don't poll if no iterfaces are registered.
Open if necessary.
(grub_net_fini_hw): New function.
(grub_net_restore_hw): Likewise.
(fini_hnd): New variable.
(GRUB_MOD_INIT): Register preboot hook.
(GRUB_MOD_FINI): Run and unregister preboot hook.
Poll network cards when idle.
* grub-core/kern/term.c (grub_net_poll_cards_idle): New variable.
(grub_checkkey): Call grub_net_poll_cards_idle if it's not NULL.
* grub-core/net/net.c (receive_packets): Save last poll time.
(grub_net_poll_cards_idle_real): New function.
(GRUB_MOD_INIT): Register grub_net_poll_cards_idle.
(GRUB_MOD_FINI): Unregister grub_net_poll_cards_idle.
* include/grub/kernel.h (grub_poll_cards_idle): New extern variable.
Rename ofnet interfaces.
* grub-core/net/drivers/ieee1275/ofnet.c (find_alias): New function.
(grub_ofnet_findcards): Use ofnet_%s names.
* util/grub-mknetdir.in: Support for EFI and IEEE1275.
Cleanup socket opening.
* grub-core/net/net.c (grub_net_fs_open): Rewritten.
(grub_net_fs_close): Likewise.
(grub_net_fs_read_real): Use eof member.
* include/grub/net/udp.h (+grub_net_udp_open): New proto.
(+grub_net_udp_close): New inline function.
* include/grub/net/tftp.h: Moved to the top of ...
* grub-core/net/tftp.c: ... here.
* include/grub/net/ip.h: Moved mostly to the top of ...
* grub-core/net/ip.c: ... here.
* include/grub/net/ethernet.h: Moved mostly to the top of ...
* grub-core/net/ethernet.c: ... here.
* grub-core/kern/device.c (grub_device_close): Free device->net->server.
* grub-core/commands/probe.c (grub_cmd_probe): Use protocol name for
FS name.
* include/grub/net/ip.h (ipv4_ini): Removed.
(ipv4_fini): Likewise.
* include/grub/net/ip.h (grub_net_recv_ip_packets): New proto.
(grub_net_send_ip_packets): Likewise.
default_bg_color rather than black.
(grub_gfxterm_fullscreen): Likewise.
(grub_gfxterm_background_color_cmd): Save new background color in
default_bg_color.