* 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.
* fs/fshelp.c (grub_fshelp_read): New function. Implement
linear disk read with journal translation.
* fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read().
* include/grub/fshelp.h: Declare grub_fshelp_read().
Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the
rest of GRUB, and breakage doesn't happen if its value were modified.
* include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
Redefine as an offset from `GRUB_KERNEL_MACHINE_DATA_END' instead of
a constant (same value).
* kern/i386/pc/startup.S: Replace hardcoded `0x50' with
`GRUB_KERNEL_MACHINE_DATA_END' (same value).
* commands/search.c (options): Add --fs_uuid option.
(search_fs_uuid): New function.
(grub_cmd_search): Fix --set argument passing.
Use search_fs_uuid() when requested via --fs_uuid.
(grub_search_init): Update help message.
* fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid'
and redeclare it as an array of 16-bit words.
(grub_ext2_uuid): New function.
(grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member.
* include/grub/fs.h (struct grub_fs): Add `uuid' struct member.
* util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT)
(GRUB_DEVICE_BOOT_UUID): New variables.
(GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove.
* util/grub.d/00_header.in: Set root using `search --fs_uuid' command
whenever possible.
* util/grub.d/10_hurd.in: Avoid explicit use of root drive. Instead,
just assume `root' variable has the right value.
* util/grub.d/10_linux.in: Likewise.
* util/grub-probe.c (probe): Probe for filesystem UUID when requested
via PRINT_FS_UUID.
(main): Recognise `-t fs_uuid' argument.
* include/grub/script.h: Don't include grub_script.tab.h. It's
a generated file, which may only be included from the files with
DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE,
use union YYSTYPE, as the later allows forward declaration.
* normal/lexer.c: Don't use typedef YYSTYPE, use union YYSTYPE.
* fs/fshelp.c (grub_fshelp_map_block): New function.
(grub_fshelp_find_file): Use 64-bit type for pos and block address.
Use `>>' and `&' operator to avoid 64-bit divide and modulo.
* include/grub/fshelp.h (grub_fshelp_journal_type): New enum.
(GRUB_FSHELP_JOURNAL_UNUSED_MAPPING): New macro.
(grub_fshelp_journal): New structure.
(grub_fshelp_map_block): New function prototype.
(grub_fshelp_read_file): Use grub_disk_addr_t as block type.
(grub_fshelp_map_block): Likewise.
* fs/ext2.c (EXT3_FEATURE_COMPAT_HAS_JOURNAL): New macro.
(EXT3_JOURNAL_MAGIC_NUMBER): Likewise.
(EXT3_JOURNAL_DESCRIPTOR_BLOCK): Likewise.
(EXT3_JOURNAL_COMMIT_BLOCK): Likewise.
(EXT3_JOURNAL_SUPERBLOCK_V1): Likewise.
(EXT3_JOURNAL_SUPERBLOCK_V2): Likewise.
(EXT3_JOURNAL_REVOKE_BLOCK): Likewise.
(EXT3_JOURNAL_FLAG_ESCAPE): Likewise.
(EXT3_JOURNAL_FLAG_SAME_UUID): Likewise.
(EXT3_JOURNAL_FLAG_DELETED): Likewise.
(EXT3_JOURNAL_FLAG_LAST_TAG): Likewise.
(grub_ext2_sblock): New members for journal support.
(grub_ext3_journal_header): New structure.
(grub_ext3_journal_revoke_header): Likewise.
(grub_ext3_journal_block_tag): Likewise.
(grub_ext3_journal_sblock): Likewise.
(grub_fshelp_node): New members logfile and journal.
(grub_ext2_read_block): Change block type to grub_disk_addr_t. Use
grub_fshelp_map_block to get real block number.
(grub_ext2_blockgroup): Use grub_fshelp_map_block to get real block
number.
(grub_ext2_read_inode): Likewise.
(grub_ext3_get_journal): New function.
(grub_read_inode): Initialize journal using grub_ext3_get_journal.
(grub_ext2_close): Release memory used by journal.
* fs/reiserfs.c (REISERFS_MAGIC_STRING): Changed to "ReIsEr".
(REISERFS_MAGIC_DESC_BLOCK): New macro.
(grub_reiserfs_transaction_header): Renamed to
grub_reiserfs_description_block, replace field data with real_blocks.
(grub_reiserfs_commit_block): New structure.
(grub_reiserfs_data): New member journal.
(grub_reiserfs_get_item): Use grub_fshelp_map_block to get real block
number.
(grub_reiserfs_read_symlink): Likewise.
(grub_reiserfs_iterate_dir): Likewise.
(grub_reiserfs_open): Likewise.
(grub_reiserfs_read): Likewise.
(grub_reiserfs_get_journal): New function.
(grub_reiserfs_mount): Use "ReIsEr" as super block magic, as there are
three varieties ReIsErFs, ReIsEr2Fs and ReIsEr3Fs. Initialize journal
using grub_reiserfs_get_journal.
(grub_reiserfs_close): Release memory used by journal.
* fs/affs.c (grub_affs_read_block): Change block type to
grub_disk_addr_t. Use grub_divmod64 to do 64-bit division.
* fs/afs.c (grub_afs_read_block): Change block type to grub_disk_addr_t.
* fs/hfsplus.c (grub_hfsplus_read_block): Likewise.
* fs/ntfs.c (grub_ntfs_read_block): Likewise.
* fs/udf.c (grub_udf_read_block): Change block type to
grub_disk_addr_t. Use type cast to avoid warning.
* fs/xfs.c (grub_xfs_read_block): Likewise.
* Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and
i386-linuxbios.
* commands/hexdump.c (grub_cmd_hexdump): Support dumping of device,
change the buffer size to 4096 for cdrom device.
* conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod
and nand.mod.
(_linux_mod_SOURCES): New variable.
(_linux_mod_CFLAGS): Likewise.
(_linux_mod_LDFLAGS): Likewise.
(linux_mod_SOURCES): Likewise.
(linux_mod_CFLAGS): Likewise.
(linux_mod_LDFLAGS): Likewise.
(nand_mod_SOURCES): Likewise.
(nand_mod_CFLAGS): Likewise.
(nand_mod_LDFLAGS): Likewise.
* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return
GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device
type property. (nand device in olpc don't have this property)
* include/grub/disk.h (grub_disk_dev_id): New macro
GRUB_DISK_DEVICE_NAND_ID.
* include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New
function prototype.
(grub_rescue_cmd_initrd): Likewise.
* include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro.
(linux_kernel_params): Add new member ofw_signature, ofw_num_items,
ofw_cif_handler and ofw_idt, adjust padding number.
* include/grub/i386/pc/memory.h (grub_upper_mem): Export it if
GRUB_MACHINE_IEEE1275 is defined.
* include/grub/ieee1275/ieee1275.h (grub_available_iterate):
Use NESTED_FUNC_ATTR attribute on the hook parameter.
* kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR
on nested function heap_init.
(grub_upper_mem): New variable for i386-ieee1275.
(grub_get_extended_memory): New function for i386-ieee1275.
(grub_machine_init): Call grub_get_extended_memory for i386-ieee1275.
* kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use
NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type
property.
* loader/i386/ieee1275/linux.c: New file.
* loader/i386/ieee1275/linux_normal.c: New file.
* disk/ieee1275/nand.c: New file.
Restructures early code path on ieee1275 to unify grub_main() as
the first C function that is executed in every platform.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_init): New prototype.
* kern/i386/ieee1275/startup.S (_start): Jump to grub_main() instead of
cmain().
* kern/powerpc/ieee1275/crt0.S (_start): Likewise.
* kern/ieee1275/cmain.c (cmain): Rename to ...
* kern/ieee1275/cmain.c (grub_ieee1275_init): ... this.
* kern/ieee1275/init.c (grub_machine_init): Call grub_ieee1275_init()
at the beginning.
* video/reader/png.c (grub_png_data): New member is_16bit and
image_data.
(grub_png_decode_image_header): Detect 16 bit png image.
(grub_png_convert_image): New function to convert 16 bit image to 8 bit.
(grub_png_decode_png): Call grub_png_convert_image for 16 bit image.
(grub_video_reader_png): Release memory occupied by image_data.
* fs/ntfs.c (find_attr): Handle non-resident attribute list larger than
4096 bytes.
(grub_nfs_mount): Skip the test for sector per cluster.
* include/grub/ntfs.h (MAX_SPC): Removed.
* fs/udf.c (grub_udf_mount): Fix warning about a shadowing a
variable.
* include/grub/i386/loader.h: Change declaration of
grub_linux_boot() to match what grub_loader_set() expects.
* util/getroot.c (grub_guess_root_device): Return const char* to
fix a warning.
* util/grub-probe.c (probe): Fix a warning about uninitialized
abstraction_name variable.
* util/i386/get_disk_name.c (grub_util_get_disk_name): Mark
second argument as unused to fix a warning.
* include/grub/util/getroot.h (grub_util_check_block_device): Export new
function.
* util/getroot.c (grub_util_check_block_device): New function that
returns the given argument if it is a block device and returns NULL else.
* util/grub-probe.c (argument_is_device): New variable.
(probe): Promote device_name from a variable to an argument. Receive
device_name from grub_util_check_block_device() if path is NULL and from
grub_guess_root_device() else. Do not free() device_name anymore.
(options): Introduce new parameter '-d, --device'.
(main): Add description of the new parameter to the help screen.
Rename path variable to argument. Set argument_is_device if the '-d'
option is given. Pass argument to probe() depending on
argument_is_device.
* conf/i386-pc.rmk (pkglib_MODULES): Add aout.mod _bsd.mod and bsd.mod.
(aout_mod_SOURCES): New variable.
(aout_mod_CFLAGS): Likewise.
(aout_mod_LDFLAGS): Likewise.
(_bsd_mod_SOURCES): New variable.
(_bsd_mod_CFLAGS): Likewise.
(_bsd_mod_LDFLAGS): Likewise.
(bsd_mod_SOURCES): New variable.
(bsd_mod_CFLAGS): Likewise.
(bsd_mod_LDFLAGS): Likewise.
* include/grub/aout.h: New file.
* include/grub/i386/loader.h (grub_unix_real_boot): New function.
* include/grub/i386/bsd.h: New file.
* include/grub/i386/pc/init.h (grub_get_mmap_entry): Use EXPORT_FUNC
to make it public.
* kern/elf.c (grub_elf32_load): Get the physical address after the hook
function is called, so that it's possible to change it inside the hook.
(grub_elf64_load): Likewise.
(grub_elf_file): Don't close the file if elf header is not found.
(grub_elf_close): Close the file if grub_elf_file fails (The new
grub_elf_file won't close it).
(grub_elf32_size): Use NESTED_FUNC_ATTR for nested function calcsize.
(grub_elf64_size): Likewise.
* kern/i386/loader.S (grub_unix_real_boot): New function.
* loader/aout.c: New file.
* loader/i386/bsd.c: New file.
* loader/i386/bsd_normal.c: New file.
* loader/i386/pc/multiboot.c (grub_multiboot): Handle a.out format.
* loader/multiboot2.c (grub_multiboot2): Reset grub_errno so that it
can test othe formats.
* conf/i386-efi.rmk (grub_emu_SOURCES): Replace commands/i386/pc/halt.c and
reboot.c by commands/halt.c and reboot.c.
(grub_install_SOURCES): Add halt.mod and reboot.mod.
(halt_mod_SOURCES): New variable.
(halt_mod_CFLAGS): Likewise.
(halt_mod_LDFLAGS): Likewise.
(reboot_mod_SOURCES): Likewise.
(reboot_mod_CFLAGS): Likewise.
(reboot_mod_LDFLAGS): Likewise.
* conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace commands/ieee1275/halt.c
and reboot.c by commands/halt.c and reboot.c.
(halt_mod_SOURCES): Likewise.
(reboot_mod_SOURCES): Likewise.
* conf/i386-pc.rmk (grub_emu_SOURCES): Replace commands/i386/pc/reboot.c by
commands/reboot.c.
(reboot_mod_SOURCES): Likewise.
* commands/i386/pc/reboot.c: merge this file ...
* commands/ieee1275/reboot.c: ... and this file ...
* commands/reboot.c: ... to this file.
Add some precompiler directive to include the correct header for each
machine.
* commands/ieee1275/halt.c: move this file ...
* commands/halt.c: ... to here.
Add some precompiler directive to include the correct header for each
machine.
* include/grub/efi/efi.h (grub_reboot): New function declaration.
(grub_halt): Likewise.
* kern/efi/efi.c (grub_reboot): New function.
(grub_halt): Likewise.
* disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function. Construct
and return a grub_diskmemberlist_t composed of LVM physical volumes.
[GRUB_UTIL] (grub_lvm_dev): Add `memberlist' member.
* disk/raid.c [GRUB_UTIL] (grub_raid_memberlist): New function. Construct
and return a grub_diskmemberlist_t composed of physical array members.
[GRUB_UTIL] (grub_raid_dev): Add `memberlist' member.
* include/grub/disk.h [GRUB_UTIL] (grub_disk_memberlist): New struct
prototype.
[GRUB_UTIL] (struct grub_disk_dev): Add `memberlist' function pointer.
[GRUB_UTIL] (struct grub_disk_memberlist): New struct declaration.
[GRUB_UTIL] (grub_disk_memberlist_t): New typedef.
* util/grub-probe.c (probe): Move partmap probing code from here ...
(probe_partmap): ... to here.
(probe): Use probe_partmap() once for the disk we're probing, and
additionally, when such disk contains a memberlist() struct member,
once for each disk that is contained in the structure returned by
memberlist().
* include/grub/raid.h (struct grub_raid_array): Change type of `device'
to a grub_disk_t array.
* disk/raid.c (grub_raid_read): Replace `device[x].disk' accesses with
`device[x]'.
(grub_raid_scan_device): Replace `device[x].name' accesses with
`device[x]->name'. Simplify initialization of `array->device[x]'.
* include/grub/term.h (GRUB_TERM_LEFT, GRUB_TERM_RIGHT)
(GRUB_TERM_UP, GRUB_TERM_DOWN, GRUB_TERM_HOME, GRUB_TERM_END)
(GRUB_TERM_DC, GRUB_TERM_PPAGE, GRUB_TERM_NPAGE, GRUB_TERM_ESC)
(GRUB_TERM_TAB, GRUB_TERM_BACKSPACE): New macros.
* kern/i386/pc/startup.S: Include `<grub/term.h>'.
(translation_table): Replace hardcoded values with macros
provided by `<grub/term.h>'.
* term/i386/pc/at_keyboard.c: Include `<grub/term.h>'.
(keyboard_map): Correct/add a few values, with macros provided
by `<grub/term.h>'.
(keyboard_map_shift): Zero values that don't differ from their
`keyboard_map' equivalents.
(grub_console_checkkey): Optimize KEYBOARD_STATUS_CAPS_LOCK toggling.
Discard the second scan code that is always sent by Caps lock.
Only use `keyboard_map_shift' when it provides a non-zero value,
otherwise fallback to `keyboard_map'.
Add support for having a grub directory in a different drive. This
is still only the data handling part.
* kern/i386/pc/startup.S (multiboot_trampoline): Set %dh to 0xFF.
(codestart): Save %dh in GRUB_ROOT_DRIVE.
(grub_root_drive): New variable.
* kern/i386/pc/init.c (make_install_device): Use GRUB_ROOT_DRIVE
instead of GRUB_BOOT_DRIVE to construct a device name. Set
GRUB_ROOT_DRIVE to GRUB_BOOT_DRIVE if it is 0xFF, otherwise use it
as it was.
* include/grub/i386/pc/kernel.h (grub_root_drive): New prototype.
* include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_ROOT_DRIVE): New
macro.
(GRUB_BOOT_MACHINE_DRIVE_CHECK): Set to 0x4f.
* boot/i386/pc/pxeboot.S (_start): Set %dh to 0xFF. For now, this
is bogus, because PXE booting does not specify any drive
correctly.
* boot/i386/pc/lnxboot.S (reg_edx): Set the second byte to 0xFF. I
am not sure if this is really correct.
* boot/i386/pc/cdboot.S: Set %dh to 0xFF, because the root drive
is always identical to the boot drive when booting from a CD.
* boot/i386/pc/boot.S (MOV_MEM_TO_AL): Removed. Not needed any
longer.
(root_drive): New variable.
(real_start): Unconditionally set %dh to ROOT_DRIVE.
(setup_sectors): Push %dx right after popping it, because %dh will
be modified later.
(copy_buffer): Restore %dx.
* conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img.
(cdboot_img_SOURCES): New variable.
(cdboot_img_ASFLAGS): New variable.
(cdboot_img_LDFLAGS): New variable.
* boot/i386/pc/cdboot.S: New file.
* disk/i386/pc/biosdisk.c (cd_start): New variable.
(cd_count): Likewise.
(grub_biosdisk_get_drive): Add support for cd device.
(grub_biosdisk_call_hook): Likewise.
(grub_biosdisk_iterate): Likewise.
(grub_biosdisk_open): Likewise.
(GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro.
(grub_biosdisk_rw): Support reading from cd device.
(GRUB_MOD_INIT): Iterate cd devices.
* include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro.
(GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise.
(GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise.
* kern/i386/pc/init.c (make_install_device): Check for cd device.
to create a gap between _end and the modules added to the image
with grub-mkrescue. That fixes "CLAIM failed" on PowerMAC.
* kern/powerpc/ieee1275/init.c: Use GRUB_MOD_GAP.
* util/elf/grub-mkimage.c (add_segments): Likewise.
that hang if GRUB tries to setup colors.
* term/ieee1275/ofconsole.c (grub_ofconsole_init): Don't set
colors for firmwares that don't support it.
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag):
Recognize Open Hack'Ware, set flags to work around its
limitations.
* conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add `machine/loader.h'
and `machine/memory.h'.
(pkglib_MODULES): Add `multiboot.mod' and `_multiboot.mod'.
(_multiboot_mod_SOURCES): New variable.
(_multiboot_mod_CFLAGS): Likewise.
(_multiboot_mod_LDFLAGS): Likewise.
(multiboot_mod_SOURCES): Likewise.
(multiboot_mod_CFLAGS): Likewise.
(multiboot_mod_LDFLAGS): Likewise.
* include/grub/i386/ieee1275/loader.h: New file.
* include/grub/i386/ieee1275/machine.h: Likewise.
* include/grub/i386/ieee1275/memory.h: Likewise.
* include/grub/i386/pc/init.h (grub_os_area_addr): Remove (redundant)
variable declaration.
(grub_os_area_size): Likewise.
* kern/i386/ieee1275/init.c (grub_os_area_addr, grub_os_area_size)
(grub_lower_mem, grub_upper_mem): New variables.
(grub_stop_floppy): New function (just to make
grub_multiboot2_real_boot() happy).
* kern/i386/ieee1275/startup.S: Include `<grub/machine/memory.h>',
`<grub/cpu/linux.h>', `<multiboot.h>' and `<multiboot2.h>'.
(grub_stop): New function.
Include `"../realmode.S"' and `"../loader.S"'.
* loader/multiboot_loader.c: Include `<grub/machine/machine.h>'.
Replace `__i386__' #ifdefs with `GRUB_MACHINE_PCBIOS'.
* loader/powerpc/ieee1275/multiboot2.c (grub_mb2_arch_boot): On i386,
rely on grub_multiboot2_real_boot() for final boot.
* disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): When
`GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag is set, skip any
device that doesn't look like an SD card.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_flag): Add
`GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' flag.
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_set_flag): Detect
OLPC laptop, and set `GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY' when
found.
* conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): New variable.
(kernel_img_LDFLAGS): Use `GRUB_MEMORY_MACHINE_LINK_ADDR' as link
address.
(grub_mkimage_CFLAGS): Propagate `GRUB_MEMORY_MACHINE_LINK_ADDR' as
a C macro.
* include/grub/i386/pc/memory.h (GRUB_MEMORY_MACHINE_UPPER): New macro.
Indicates start of upper memory.
* util/i386/pc/grub-mkimage.c: Include `<grub/machine/memory.h>'.
(generate_image): Abort when image size is big enough to corrupt
upper memory.
* include/grub/i386/pc/vga.h: Include `<grub/machine/memory.h>'.
(GRUB_MEMORY_MACHINE_VGA_ADDR): Alias for `GRUB_MEMORY_MACHINE_UPPER'.
* term/i386/pc/vga.c (VGA_MEM): Use `GRUB_MEMORY_MACHINE_VGA_ADDR'
instead of hardcoding 0xA0000.
* video/i386/pc/vbe.c: Include `<grub/machine/vga.h>'.
(grub_vbe_set_video_mode): Use `GRUB_MEMORY_MACHINE_VGA_ADDR'
instead of hardcoding 0xA0000.
* include/grub/i386/pc/kernel.h: Include `<grub/symbol.h>'.
* include/grub/kernel.h (grub_arch_memdisk_addr,
grub_arch_memdisk_size): Moved from here ...
* include/grub/i386/pc/kernel.h (grub_arch_memdisk_addr,
grub_arch_memdisk_size): ... to here.
* conf/i386-pc.rmk (kernel_img_HEADERS): Add `machine/kernel.h'.
(pkglib_MODULES): Add `memdisk.mod'.
(memdisk_mod_SOURCES): New variable.
(memdisk_mod_CFLAGS): Likewise.
(memdisk_mod_LDFLAGS): Likewise.
* disk/memdisk.c: New file.
* include/grub/disk.h (grub_disk_dev_id): Add
`GRUB_DISK_DEVICE_MEMDISK_ID'.
* include/grub/i386/pc/kernel.h
(GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): New macro.
(GRUB_KERNEL_MACHINE_PREFIX): Increment by 4.
(grub_kernel_image_size): New variable declaration.
(grub_total_module_size): Likewise.
(grub_memdisk_image_size): Likewise.
* include/grub/i386/pc/memory.h
(GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR): New macro.
* include/grub/kernel.h: Include `<grub/symbol.h>'.
(grub_arch_memdisk_addr): New variable declaration.
(grub_arch_memdisk_size): Likewise.
* kern/i386/pc/init.c (grub_arch_memdisk_addr): New function.
(grub_arch_memdisk_size): Likewise.
* kern/i386/pc/startup.S (grub_memdisk_image_size): New variable.
(codestart): Replace hardcoded `0x100000' with
`GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR' macro.
* util/i386/pc/grub-mkimage.c: Include `<grub/misc.h>'.
(generate_image): Add `memdisk_path' parameter. When `memdisk_path' is
not NULL, append the contents of the file it refers to, at the end of
the compressed kernel image. Initialize `grub_memdisk_image_size'
variable (at `GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE' offset).
(options): Add "memdisk"|'m' option.
(main): Parse --memdisk|-m option, and pass user-provided path as
parameter to generate_image().
Fix detection of "real mode" when /options/real-mode? doesn't exist.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_mmu): New variable
declaration.
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_mmu): New variable.
(grub_ieee1275_find_options): If `grub_ieee1275_mmu' is 0, set
`GRUB_IEEE1275_FLAG_REAL_MODE'.
(cmain): Intialize `grub_ieee1275_mmu' (using /chosen/mmu integer
property).
* kern/powerpc/ieee1275/openfw.c (grub_map): Rely on pre-initialized
`grub_ieee1275_mmu' rather than obtaining a handler on every call.
Get rid of confusing function (superceeded by
`grub_ieee1275_get_integer_property')
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_decode_int_4): Remove
prototype.
* kern/ieee1275/ieee1275.c (grub_ieee1275_decode_int_4): Remove
function.
* term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid use of
grub_ieee1275_decode_int_4(), by obtaining integer properties directly
in native endianess from grub_ieee1275_get_integer_property().
* include/grub/i386/linuxbios/memory.h
(GRUB_MEMORY_MACHINE_LINUXBIOS_TABLE_ADDR): Remove macro.
* kern/i386/linuxbios/table.c (grub_linuxbios_table_iterate): Do not
receive `table_header' as argument. Instead, probe for it in the
known memory ranges where it can be present.
(grub_available_iterate): Do not pass a fixed `table_header' address
to grub_linuxbios_table_iterate().
* include/grub/ieee1275/ieee1275.h
(grub_ieee1275_get_integer_property): New function prototype.
* kern/ieee1275/ieee1275.c: Include `<grub/types.h>'.
(grub_ieee1275_get_integer_property): New function. Wraps around
grub_ieee1275_get_property() to handle endianess.
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Replace
grub_ieee1275_get_property() with grub_ieee1275_get_integer_property()
where appropiate.
* kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Likewise.
(grub_map): Likewise.
* kern/sparc64/ieee1275/openfw.c (grub_map): Likewise.