Script fixes
* include/grub/script_sh.h (grub_script_cmdline): remove cmdline
(grub_lexer_param): add tokenonhold
(grub_script_create_cmdline): remove cmdline. All callers updated
(grub_script_function_create): make functionname
grub_script_arg. All callers updated
(grub_script_execute_argument_to_string): new prototype
* kern/parser.c (state_transitions): reorder
(grub_parser_cmdline_state): fix a bug and make more compact
* script/sh/execute.c (grub_script_execute_argument_to_string):
make global
(grub_script_execute_cmdline): use new format
* script/sh/function.c (grub_script_function_create): make functionname
grub_script_arg. All callers updated
* script/sh/lexer.c (grub_script_lexer_init): initilaize tokenonhold
(grub_script_yylex): remove
(grub_script_yylex2): renamed to ...
(grub_script_yylex): ...renamed
parse the expressions like a${b}c
* script/sh/parser.y (GRUB_PARSER_TOKEN_ARG): new typed terminal
(GRUB_PARSER_TOKEN_VAR): remove
(GRUB_PARSER_TOKEN_NAME): likewise
("if"): declare as typeless
("while"): likewise
("function"): likewise
("else"): likewise
("then"): likewise
("fi"): likewise
(text): remove
(argument): likewise
(script): accept empty scripts and make exit on error
(arguments): use GRUB_PARSER_TOKEN_ARG
(function): likewise
(command): move error handling to script
(menuentry): move grub_script_lexer_ref before
* script/sh/script.c (grub_script_create_cmdline): remove cmdline
argument. All callers updated
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.
Simplify the code duplication in commands/search.c.
* commands/search.c (search_label, search_fs_uuid): Merge into ...
(search_fs): ... this. Update all users.
* Makefile.in: Don't use "cp -d", it doesn't work on FreeBSD.
Remove the original symlink explicitly.
* fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not
just one slash. That's how grub_fshelp_find_file() does it.
* disk/ata.c (grub_ata_wait_not_busy): Add debug output of status
register.
(grub_atapi_identify): Add wait after drive select.
(grub_ata_identify): Do more strict status register check before
calling grub_atapi_identify (). Suppress error message if status
register is 0x00 after command failure. Add status register
check after PIO read to avoid bogus identify due to stuck DRQ.
Thanks to Pavel Roskin for testing.
(grub_device_initialize): Remove unsafe status register check.
Thanks to 'phcoder' for problem report and patch.
Prevent sign extension in debug message.
Cleaned up `include/grub/normal.h'. Grouped prototypes by
definition file, and functions defined in `normal/menu.c' have had
their prototypes moved to `include/grub/menu.h' for consistency.
* include/grub/menu.h (grub_menu_execute_callback): Added; moved
from normal.h.
(grub_menu_get_entry): Likewise.
(grub_menu_get_timeout): Likewise.
(grub_menu_set_timeout): Likewise.
(grub_menu_execute_entry): Likewise.
(grub_menu_execute_with_fallback): Likewise.
(grub_menu_entry_run): Likewise.
* include/grub/normal.h: Re-ordered and grouped function
prototypes by file that the function is defined in.
(grub_menu_execute_callback): Removed; moved to menu.h.
(grub_menu_get_entry): Likewise.
(grub_menu_get_timeout): Likewise.
(grub_menu_set_timeout): Likewise.
(grub_menu_execute_entry): Likewise.
(grub_menu_execute_with_fallback): Likewise.
(grub_menu_entry_run): Likewise.
(grub_menu_addentry): Renamed from this ...
(grub_normal_add_menu_entry): ... to this.
* normal/main.c (grub_menu_addentry): Renamed from this ...
(grub_normal_add_menu_entry): ... to this.
* script/sh/execute.c (grub_script_execute_menuentry): Update
reference to renamed grub_menu_addentry function.
* aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove.
* configure.ac: Don't call grub_I386_CHECK_REGPARM_BUG. Define
NESTED_FUNC_ATTR using AH_BOTTOM. Use regparm(1) only when
compiling for the i386 targets, but not for the utilities.
Display error messages when parsing a Lua statement fails. Previously,
executing a syntactically invalid statement like ")foo" or "bar;" would
silently fail.
* script/lua/grub_main.c (handle_lua_error): New function.
(grub_lua_parse_line): Improved reporting of Lua parser and execution
errors.
Remove -Werror which causes build to fail on some systems
* conf/i386-pc.rmk (xnu_mod_CFLAGS): Remove -Werror -Wall
* conf/i386-efi.rmk (xnu_mod_CFLAGS): Likewise
* conf/x86_64-efi.rmk (xnu_mod_CFLAGS): Likewise
trampoline for linux on 64-bit platform
* conf/x86_64-efi.rmk (linux_mod_SOURCES): added
loader/i386/efi/linux_trampoline.S
* include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed
declration
* kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here
* loader/i386/linux_trampoline.S: moved here
* loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline
(jumpvector): removed
(grub_linux_trampoline_start): new declaration
(grub_linux_trampoline_end): likewise
(grub_linux_boot): use trampoline when on 64-bit platform
* loader/i386/linux.c: likewise
* script/lua/grub_lib.c (grub_lua_getenv): Make name and value
const to avoid a warning.
(grub_lua_setenv): Likewise.
* script/lua/grub_main.c (grub_lua_parse_line): Use size_t for
lmsg to fix a warning.
(setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS).
* conf/powerpc-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ...
(setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS).
* conf/sparc64-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ...
(setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS).
* 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.
* loader/i386/linux.c (allocate_pages): When assigning
real_mode_mem, cast through grub_size_t to fix a warning. The
code already makes sure that the value would fit a pointer.
(grub_linux_setup_video): Cast render_target->data to
grub_size_t to fix a warning.
* fs/cpio.c: Use the same name "struct head" for tar and cpio to
facilitate code reuse.
(grub_cpio_mount): Use "struct head", not a char buffer. This
fixes a warning reported by gcc 4.4.
* kernel/disk.c (grub_disk_read): Use void pointer for the
buffer.
(grub_disk_write): Use const void pointer for the buffer.
Adjust all callers. Remove unnecessary casts.
* disk/raid6_recover.c (grub_raid6_recover): Fix warnings about
uninitialized err[0] and err[1]. Rename them to bad1 and bad2.
Initialize them with -1. Add sanity check for bad1. Eliminate
nerr variable.