* util/grub-mkconfig.in (GRUB_DISABLE_LINUX_RECOVERY): Export
variable.
* util/grub.d/10_linux.in: If GRUB_DISABLE_LINUX_RECOVERY is true,
don't write a menu entry for recovery mode.
* include/grub/i386/loader.h (grub_linux_prot_size)
(grub_linux_tmp_addr, grub_linux_real_addr)
(grub_linux_is_bzimage, grub_linux16_boot): Declare only on
GRUB_MACHINE_PCBIOS.
* util/i386/pc/grub-mkimage.c (compress_kernel): Move
common grub_util_info() call to ...
(generate_image): ... here.
Fix use of uninitialized memory, comparison of signed with
unsigned integers and memory leak.
Remove bogus module address message.
* util/elf/grub-mkimage.c (usage): Prefix each option line with two
spaces, for the benefit of help2man.
* util/i386/efi/grub-mkimage.c (usage): Likewise.
* boot/i386/pc/boot.S: Remove root_drive. Assert offset of
boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't
save %dx, we only need %dl and we never change it.
* boot/i386/pc/cdboot.S: Don't set the root drive.
* boot/i386/pc/pxeboot.S: Likewise.
* include/grub/i386/pc/boot.h: Remove
GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust
GRUB_BOOT_MACHINE_DRIVE_CHECK.
* include/grub/i386/pc/kernel.h: Remove grub_root_drive.
* kern/i386/pc/init.c (make_install_device): Remove references
to grub_root_drive.
* kern/i386/pc/startup.S: Likewise.
* util/i386/pc/grub-setup.c (setup): Don't set root_drive.
* util/grub.d/30_os-prober.in: Fix a comment. Source
${libdir}/grub/grub-mkconfig_lib. Use prepare_grub_to_access_device
to set the root device. Place drivemap command in the generated
chain entry.
Use grub-macho2img when compiling with Apple's CC for PCBIOS machine
* conf/common.rmk (bin_UTILITIES): add (on false on condition)
grub-macho2img
(CLEANFILES): add grub-macho2img
(grub_macho2img_SOURCES): new variable
* kern/i386/pc/startup.S (bss_start): new variable
(bss_end): likewise
* genmk.rb: use grub-macho2img for *.img when compiled with Apple's CC
* util/grub-macho2img.c: new file
Fix wrong assumptions with grub-mkimage on EFI
* i386/efi/grub-mkimage.c (read_kernel_module): don't write prefox here
(relocate_addresses): consider both r_addend and value at offset
(make_mods_section): zerofill modinfo and header
(convert_elf): write prefix here
gfxpayload support
* commands/videotest.c (grub_cmd_videotest): use grub_video_set_mode
* include/grub/video.h (GRUB_VIDEO_MODE_TYPE_PURE_TEXT): new definition
(grub_video_setup): remove
(grub_video_set_mode): new prototype
* loader/i386/linux.c (DEFAULT_VIDEO_MODE): new definition
(vid_mode): remove
(linux_vesafb_res): compile only on PCBIOS
(grub_linux_boot): support gfxpayload
* loader/i386/pc/xnu.c (video_hook): new function
(grub_xnu_set_video): support gfxpayload
* term/gfxterm.c (DEFAULT_VIDEO_WIDTH): removed
(DEFAULT_VIDEO_HEIGHT): likewise
(DEFAULT_VIDEO_FLAGS): likewise
(DEFAULT_VIDEO_MODE): new definition
(video_hook): new function
(grub_gfxterm_init): use grub_video_set_mode
* util/grub.d/30_os-prober.in: remove explicit modesetting before
loading xnu
* video/video.c (grub_video_setup): removed
(grub_video_set_mode): new function based on grub_gfxterm_init and
grub_video_setup
Prevent GRUB from probing floppies during boot.
* conf/common.rmk (search_mod_CFLAGS): Use `-Werror -Wall'.
* commands/search.c (options): Add --no-floppy.
(search_fs, search_file, grub_cmd_search): Support --no-floppy.
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Use
--no-floppy when searching for UUIDs.
* include/grub/kernel.h (grub_module_header_types): Add type
OBJ_TYPE_CONFIG.
* kern/main.c (grub_load_config): New function.
(grub_main): Call grub_load_config to read boot config.
* grub-mkimage (generate_image): New parameter config_path.
(options): New option --config.
(main): Parse --config option, and pass it to generate_image.
(grub_ofdisk_open): Use it to un-escape "," characters.
* kern/disk.c (find_part_sep): New.
(grub_disk_open): Use it to find the first non-escaped ','
character in the disk name.
* util/ieee1275/devicemap.c (escape_of_path): New.
(grub_util_emit_devicemap_entry): Use it.
* util/sparc64/ieee1275/grub-install.in: Update script to
strip partition specifiers properly by not triggering on
'\' escaped ',' characters.
* util/misc.c (grub_util_warn): New function. Emmits a warning
unconditionally.
* include/grub/util/misc.h (grub_util_warn): New declaration.
* util/i386/pc/grub-install.in: Understand --force and pass it down
to grub-setup.
* util/i386/pc/grub-setup.c (main): Understand --force and pass it
down to setup().
(setup): Improve error messages and add warnings when requested to
install in odd layouts. Refuse to install using blocklists unless
--force was set.
* conf/common.rmk (grub_script.tab.c): Change normal/parser.y to
script/sh/parser.y.
(pkglib_MODULES): Add normal.mod and sh.mod.
(normal_SOURCES): New variable.
(normal_mod_CFLAGS): Likewise.
(normal_mod_LDFLAGS): Likewise.
(sh_mod_SOURCES): Likewise.
(sh_mod_CFLAGS): Likewise.
(sh_mod_LDFLAGS): Likewise.
* conf/i386-pc.rmk (normal/lexer.c_DEPENDENCIES): Changed to
script/sh/lexer.c_DEPENDENCIES.
(kernel_img_SOURCES): Remove kern/rescue.c, and kern/reader.c,
kern/rescue_reader.c and kern/rescue_parser.c.
(kernel_img_HEADERS): Remove rescue.h, add reader.h.
(grub_emu_SOURCES): Change source files.
(pkglib_MODULES): Remove normal.mod.
(normal_SOURCES): Removed.
(normal_mod_CFLAGS): Likewise.
(normal_mod_LDFLAGS): Likewise.
* conf/i386-coreboot.rmk: Likewise.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1276.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* include/grub/command.h (grub_command_execute): New inline function.
* include/grub/menu.h (grub_menu_entry): Removed commands field.
* include/grub/normal.h: Remove <grub/setjmp.h>.
(grub_fs_module_list): Moved to normal/autofs.c.
(grub_exit_env): Removed.
(grub_command_execute): Likewise.
(grub_normal_menu_addentry): Renamed to grub_menu_addentry, removed
parameter script.
(read_command_list): New function declaration.
(read_fs_list): Likewise.
* include/parser.h: Include <grub/reader.h>.
(grub_parser_split_cmdline): Change type of getline parameter.
(grub_parser): New structure.
(grub_parser_class): New variable.
(grub_parser_execute): New function declaration.
(grub_register_rescue_parser): Likewise.
(grub_parser_register): New inline function.
(grub_parser_unregister): Likewise.
(grub_parser_get_current): Likewise.
(grub_parser_set_current): Likewise.
* include/grub/reader.h: New file.
* kern/reader.c: Likewise.
* kern/rescue_parser.c: Likewise.
* kern/rescue_reader.c: Likewise.
* normal/autofs.c: Likewise.
* normal/dyncmd.c: Likewise.
* include/grub/rescue.h: Removed.
* normal/command.h: Likewise.
* include/grub/script.h: Moved to ...
* include/grub/script_sh.h: ... Moved here.
* normal/execute.c: Moved to ...
* script/sh/execute.c: ... Moved here.
* normal/function.c: Moved to ...
* script/sh/function.c: ... Moved here.
* normal/lexer.c: Moved to ...
* script/sh/lexer.c: ... Moved here.
* normal/parser.y: Moved to ...
* script/sh/parser.y: ... Moved here.
* normal/script.c: Moved to ...
* script/sh/script.c: ... Moved here.
* normal/main.c: Remove <grub/rescue.h> and <grub/script.h>, include
<grub/reader.h>.
(grub_exit_env): Removed.
(fs_module_list): Moved to normal/autofs.c.
(grub_file_getline): Don't handle comment here.
(free_menu): Skip removed field entry->commands.
(grub_normal_menu_addentry): Removed as grub_menu_entry, removed
script parameter.
(read_config_file): Removed nested parameter, change getline function.
(grub_enter_normal_mode): Removed.
(grub_dyncmd_dispatcher): Moved to normal/dyncmd.c.
(read_command_list): Likewise.
(autoload_fs_module): Moved to normal/autofs.c.
(read_fs_list): Likewise.
(reader_nested): New variable.
(grub_normal_execute): Run parser.sh to switch to sh parser.
(grub_cmd_rescue): Removed.
(cmd_normal): Removed.
(grub_cmd_normal): Unregister itself at the beginning. Don't register
rescue command.
(grub_cmdline_run): New function.
(grub_normal_reader_init): Likewise.
(grub_normal_read_line): Likewise.
(grub_env_write_pager): Likewise.
(cmdline): New variable.
(grub_normal_reader): Likewise.
(GRUB_MOD_INIT): Register normal reader and set as current, register
pager hook, register normal command with grub_register_command_prio,
so that it won't show up in command.lst.
(GRUB_MOD_FINI): Unregister normal reader, unhook pager, clear
grub_fs_autoload_hook.
* normal/menu.c: Remove <grub/script.h>, add <grub/command.h>.
(grub_menu_execute_entry): Replace grub_script_execute with
grub_parser_execute, change parameter to grub_command_execute.
* normal/menu_text.c: Remove <grub/script.h>.
* normal/menu_entry.c: Remove <grub/script.h>, add <grub/command.h>
and <grub/parser.h>.
(run): Change editor_getline to use new parser interface. Change
parameter to grub_command_execute.
* kern/main.c: Remove <grub/rescue.h>, include <grub/command.h>,
<grub/reader.h> and <grub/parser.h>.
(grub_load_normal_mode): Execute normal command.
(grub_main): Call grub_register_core_commands,
grub_register_rescue_parser and grub_register_rescue_reader, use
grub_reader_loop to enter input loop.
* kern/parser.c (grub_parser_spli_cmdline): Change type of getline
parameter.
(grub_parser_class): New variable.
(grub_parser_execute): New function.
* loader/i386/multiboot.c: Remove <grub/rescue.h>.
* loader/multiboot2.c: Likewise.
* loader/sparc64/ieee1275/linux.c: Likewise.
* util/grub-emu.c (read_command_list): New dummy function.
* util/sparc64/ieee1275/grub-setup.c: New file.
* util/sparc64/ieee1275/grub-ofpathname.c: New file.
* util/sparc64/ieee1275/grub-mkimage.c: New file.
* util/sparc64/ieee1275/grub-install.in: New file.
* util/ieee1275/ofpath.c: New file.
* util/ieee1275/devicemap.c: New file.
* util/devicemap.c: New file.
* util/deviceiter.c: New file.
* kern/sparc64/ieee1275/init.c: New file.
* include/grub/util/ofpath.h: New file.
* include/grub/util/deviceiter.h: New file.
* util/grub-mkdevicemap.c: Include deviceiter.h.
Implement using grub_util_emit_devicemap_entry and
grub_util_iterate_devices.
* conf/i386-corebook.rmk: Build util/deviceiter.c and
util/devicemap.c into grub-mkdevicemap
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Add rules to build boot block
images and installation utilities. Build kernel as image
instead of as elf binary. Use common rules as much as possible.
* include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and
LONG_MAX to GRUB_LONG_MAX. Introduce GRUB_LONG_MIN. Update all
users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new
definitions.