Commit graph

299 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
3a37e3226b Use FOR_* macros instead of *_iterate whenever possible.
* commands/handler.c: Removed.
	* commands/help.c (grub_cmd_help): Use FOR_COMMANDS.
	* commands/minicmd.c (grub_mini_cmd_lsmod): Use FOR_DL_MODULES.
	* conf/any-emu.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/common.rmk (script/lexer.c_DEPENDENCIES): Add grub_script.yy.h.
	(grub_probe_SOURCES): Remove kern/parser.c.
	(util/grub-script-check.c_DEPENDENCIES): Removed.
	(grub_script_check_SOURCES): Remove kern/handler.c, kern/parser.c
	and grub_script_check_init.c.
	(grub_script_check_init.lst): Removed.
	(grub_script_check_init.h): Likewise.
	(grub_script_check_init.c): Likewise.
	(pkglib_MODULES): Remove handler.mod and sh.mod.
	(handler_mod_SOURCES): Removed.
	(handler_mod_CFLAGS): Likewise.
	(handler_mod_LDFLAGS): Likewise.
	(normal_mod_SOURCES): Remove normal/handler.c.
	Add script/main.c, script/script.c, script/execute.c,
	script/function.c, script/lexer.c, grub_script.tab.c
	and grub_script.yy.c.
	* conf/i386-coreboot.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/i386-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	* conf/i386-pc.rmk (kernel_img_SOURCES): Likewise.
	(grub_setup_SOURCES): Remove kern/parser.c.
	* conf/i386-qemu.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* conf/mips-qemu-mips.rmk (kernel_img_SOURCES): Likewise.
	* conf/mips-yeeloong.rmk (kernel_img_SOURCES): Likewise.
	* conf/powerpc-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	* conf/sparc64-ieee1275.rmk (kernel_img_SOURCES): Likewise.
	(grub_setup_SOURCES): Remove kern/parser.c.
	* conf/x86-efi.rmk (kernel_img_SOURCES): Remove kern/handler.c.
	* gettext/gettext.c (grub_gettext_delete_list): Don't use grub_list_pop.
	* include/grub/command.h (grub_command_iterate): Removed.
	(FOR_COMMANDS): New macro.
	* include/grub/dl.h (grub_dl): New member next.
	(grub_dl_iterate): Removed.
	(grub_dl_head): New variable declaration.
	(FOR_DL_MODULES): New macro.
	* include/grub/fs.h: Include list.h.
	(grub_fs): Make next first element.
	(grub_fs_list): New variable declaration.
	(grub_fs_register): Make inline.
	(grub_fs_unregister): Likewise.
	(grub_fs_iterate): Removed.
	(FOR_FILESYSTEMS): New macro.
	* include/grub/handler.h: Removed.
	* include/grub/list.h (grub_list_hook_t): Removed.
	(grub_list_test_t): Likewise.
	(grub_list_pop): Likewise.
	(grub_list_iterate): Likewise.
	(grub_list_insert): Likewise.
	(FOR_LIST_ELEMENTS): New macro.
	* include/grub/parser.h (grub_parser_class): Removed.
	(grub_parser_register): Likewise.
	(grub_parser_unregister): Likewise.
	(grub_parser_get_current): Likewise.
	(grub_parser_set_current): Likewise.
	(grub_register_rescue_parser): Likewise.
	(grub_rescue_parse_line): New function.
	* include/grub/partition.h (FOR_PARTITION_MAPS): Use FOR_LIST_ELEMENTS.
	* include/grub/script_sh.h (grub_script_function_list): New variable
	declaration.
	(FOR_SCRIPT_FUNCTIONS): New macro.
	(grub_script_function_iterate): Removed.
	(grub_normal_parse_line): New prototype.
	* include/grub/term.h (FOR_ACTIVE_TERM_INPUTS): Use FOR_LIST_ELEMENTS.
	(FOR_DISABLED_TERM_INPUTS): Likewise.
	(FOR_ACTIVE_TERM_OUTPUTS): Likewise.
	(FOR_DISABLED_TERM_OUTPUTS): Likewise.
	* include/grub/video.h (grub_video_adapter): Move 'next' to first
	element.
	(grub_video_register): Inline.
	(grub_video_unregister): Likewise.
	(grub_video_adapter_list): New variable declaration.
	(grub_video_iterate): Removed.
	(FOR_VIDEO_ADAPTERS): New macro.
	* kern/dl.c (grub_dl_list): Removed. All users updated.
	(grub_dl_iterate): Removed.
	* kern/fs.c (grub_fs_list): Make global.
	(grub_fs_register): Removed.
	(grub_fs_unregister): Likewise.
	(grub_fs_iterate): Likewise.
	* kern/handler.c: Removed.
	* kern/list.c (grub_list_pop): Removed.
	(grub_list_iterate): Likewise.
	(grub_list_insert): Likewise.
	(grub_named_list_find): Use FOR_LIST_ELEMENTS.
	(grub_prio_list_insert): Don't use grub_list_insert.
	* kern/main.c (grub_register_rescue_parser): Don't call
	grub_register_rescue_parser.
	* kern/parser.c (grub_parser_class): Removed.
	(grub_parser_execute): Use grub_rescue_parse_line.
	* kern/rescue_parser.c (grub_rescue_parse_line): Make global.
	(grub_rescue_parser): Removed.
	(grub_register_rescue_parser): Likewise.
	* kern/rescue_reader.c (grub_rescue_run): Use grub_rescue_parse_line.
	* normal/auth.c (is_authenticated): Use FOR_LIST_ELEMENTS.
	(grub_auth_check_authentication): Likewise.
	* normal/completion.c (iterate_command): Removed.
	(grub_normal_do_completion): Use FOR_COMMANDS.
	* normal/handler.c: Removed.
	* normal/main.c (read_config_file): Remove parser changing.
	(grub_normal_execute): Don't call read_handler_list.
	(grub_normal_read_line_real): Statically allocate prompt.
	(grub_cmdline_run): Use grub_normal_parse_line.
	(GRUB_MOD_FINI): Don't call free_handler_list.
	* normal/menu_entry.c (run): Likewise.
	* script/function.c (grub_script_function_list): Make global.
	(grub_script_function_iterate): Removed.
	* script/main.c (grub_normal_parse_line): Make global.
	(grub_sh_parser): Removed.
	(GRUB_MOD_INIT): Likewise.
	(GRUB_MOD_FINI): Likewise.
	* tests/lib/functional_test.c (grub_functional_test): Use
	FOR_LIST_ELEMENTS.
	* tests/lib/test.c (free_failures): Don't use grub_list_pop.
	(grub_test_run): Use FOR_LIST_ELEMENTS.
	* tests/lib/unit_test.c (main): Likewise.
	* util/deviceiter.c (grub_util_iterate_devices): Don't use
	grub_list_pop.
	* util/grub-fstest.c (grub_term_input_class): Removed.
	(grub_term_output_class): Likewise.
	* util/grub-probe.c: Likewise.
	* util/i386/pc/grub-setup.c: Likewise.
	* util/sparc64/ieee1275/grub-setup.c: Likewise.
	* util/grub-script-check.c (main): Don't call grub_init_all and
	grub_fini_all.
	* video/video.c (grub_video_adapter_list): Make global.
	(grub_video_register): Removed.
	(grub_video_unregister): Likewise.
	(grub_video_iterate): Likewise.
2010-06-11 22:31:16 +02:00
Colin Watson
9121567e16 * commands/gptsync.c (grub_cmd_gptsync): Fix typos.
(GRUB_MOD_INIT): Fix capitalisation.
* docs/grub.texi (Command-line and menu entry commands): Document
gettext and gptsync commands.
2010-06-02 02:37:55 +01:00
Vladimir 'phcoder' Serbinenko
7620e7debd * commands/setpci.c (grub_setpci_iter): Fix an incorrect function check.
Reported by: Seth Goldberg.
2010-05-31 20:40:42 +02:00
Vladimir 'phcoder' Serbinenko
db4d5813e3 * commands/usbtest.c (grub_usb_get_string): Properly support UTF-16. 2010-05-23 14:37:28 +02:00
Vladimir 'phcoder' Serbinenko
c49abfdd24 merge mainline into cmostest 2010-05-22 20:28:09 +02:00
Vladimir 'phcoder' Serbinenko
265d68cd10 * commands/parttool.c (grub_cmd_parttool): Fix #if !GRUB_NO_MODULES
condition.
2010-05-03 13:17:12 +02:00
Vladimir 'phcoder' Serbinenko
f5f3ff9326 * commands/help.c (grub_cmd_help): Fix a typo.
Reported by: Seth Goldberg
2010-05-01 21:31:45 +02:00
Vladimir 'phcoder' Serbinenko
d8b5cd4011 * commands/hashsum.c (GRUB_MOD_INIT): Remove duplication of command
name and add N_.
	* commands/i386/pc/drivemap.c (GRUB_MOD_INIT): Likewise.
	* commands/iorw.c (GRUB_MOD_INIT): Likewise.
	* commands/password_pbkdf2.c (GRUB_MOD_INIT): Likewise.
	* commands/regexp.c (GRUB_MOD_INIT): Likewise.
	* commands/setpci.c (GRUB_MOD_INIT): Likewise.
	* commands/terminal.c (GRUB_MOD_INIT): Likewise.
	* efiemu/main.c (GRUB_MOD_INIT): Likewise.
	* font/font_cmd.c (GRUB_MOD_INIT): Likewise.
	* kern/corecmd.c (GRUB_MOD_INIT): Likewise.
	* mmap/mmap.c (GRUB_MOD_INIT): Likewise.
	* normal/context.c (GRUB_MOD_INIT): Likewise.
	* normal/main.c (GRUB_MOD_INIT): Likewise.
	* term/gfxterm.c (GRUB_MOD_INIT): Likewise.
	* term/serial.c (GRUB_MOD_INIT): Likewise.
	* term/terminfo.c (GRUB_MOD_INIT): Likewise.
2010-05-01 20:28:07 +02:00
Vladimir 'phcoder' Serbinenko
165134bcc1 * commands/iorw.c: New file.
* conf/i386.rmk (pkglib_MODULES): Add iorw.mod.
	(iorw_mod_SOURCES): New variable.
	(iorw_mod_CFLAGS): Likewise.
	(iorw_mod_LDFLAGS): Likewise.
2010-05-01 19:37:04 +02:00
Vladimir 'phcoder' Serbinenko
6f8aaf68be Merge handling of input and output terminals. Fix a hang.
* commands/terminal.c (abstract_terminal): New struct.
	(handle_command): New function. Based on grub_cmd_terminal_input.
	(grub_cmd_terminal_input): Use handle_command.
	(grub_cmd_terminal_output): Use handle_command.
2010-05-01 13:20:07 +02:00
Samuel Thibault
c76a18386f * commands/i386/pc/play.c (grub_cmd_play): Call 'grub_file_open' only
if argc is 1.
2010-04-28 23:18:16 +02:00
Vladimir 'phcoder' Serbinenko
4a55d631d7 Merge mainline into for_macros 2010-04-09 22:35:32 +02:00
Vladimir 'phcoder' Serbinenko
74f34747b1 Fix path to regex.h 2010-03-28 22:19:06 +02:00
Vladimir 'phcoder' Serbinenko
bbdb72a1f4 merged mainline into regexp 2010-03-28 18:31:40 +02:00
Vladimir 'phcoder' Serbinenko
fcaae9ec12 Remove grub_dl_iterate 2010-03-27 00:52:40 +01:00
Vladimir 'phcoder' Serbinenko
d56a6ac7f6 Remove handlers 2010-03-27 00:19:42 +01:00
Vladimir 'phcoder' Serbinenko
969d1c782d Simplify Apple CC support.
* commands/i386/pc/drivemap_int13h.S: Use LOCAL when possible.
	Add 0 byte at the end not to have a symbol with empty target.
	* mmap/i386/pc/mmap_helper.S: Likewise.
	* genmk.rb: Ignore errors 2030 and 2050.
	* kern/i386/pc/startup.S: Use LOCAL when possible.
2010-03-27 00:04:14 +01:00
Vladimir 'phcoder' Serbinenko
fda282327f Complete eradication of grub_list_iterate 2010-03-26 19:44:18 +01:00
Vladimir 'phcoder' Serbinenko
d85da27cc0 Remove grub_commands_iterate 2010-03-26 19:14:24 +01:00
Vladimir 'phcoder' Serbinenko
c9ea504d25 merge mainline into nestpart 2010-03-26 15:44:13 +01:00
Vladimir 'phcoder' Serbinenko
016a671b51 Merge mainline into cleanbuild 2010-03-14 16:01:31 +01:00
Vladimir 'phcoder' Serbinenko
5382b1e4a8 2010-03-01 Vladimir Serbinenko <phcoder@gmail.com>
* commands/cat.c (grub_cmd_cat): Propagate grub_gzfile_open error.
2010-03-01 20:24:34 +01:00
Vladimir 'phcoder' Serbinenko
c140a18037 2010-02-25 Vladimir Serbinenko <phcoder@gmail.com>
Don't compile video modules on yeeloong since video subsystem is part
	of kernel.

	* conf/common.rmk (pkglib_MODULES) [yeeloong]: Remove video.mod,
	video_fb.mod, bitmap.mod, font.mod, gfxterm.mod and bufio.mod
	* conf/mips-yeeloong.rmk (kernel_img_HEADERS): Add bitmap.h,
	video.h, gfxterm.h, font.h, bitmap_scale.h and bufio.h.
	* conf/mips.rmk (kernel_img_HEADERS): Add values instead of overwriting.
	* include/grub/bitmap.h: Add EXPORT_FUNC and EXPORT_VAR.
	* include/grub/bitmap_scale.h: Likewise.
	* include/grub/bufio.h: Likewise.
	* include/grub/font.h: Likewise.
	* include/grub/gfxterm.h: Likewise.
	* include/grub/video.h: Likewise.
	* include/grub/vbe.h: Don't include video_fb.h.
	* video/i386/pc/vbe.c: Include video_fb.h.
	* commands/i386/pc/vbetest.c: Include video.h.
2010-02-25 15:10:18 +01:00
Vladimir 'phcoder' Serbinenko
d9f31a41ca 2010-02-16 Vladimir Serbinenko <phcoder@gmail.com>
Remove any reference to non-free fonts.

	* commands/videotest.c (grub_cmd_videotest): Use unifont by default.
	* docs/gfxmenu-theme-example.txt: Removed. It's both outdated and
	uses non-free components.
	* font/font.c (grub_font_get_name): Remove example name.
	* gfxmenu/gui_label.c (grub_gui_label_new): Use unifont by default.
	* gfxmenu/gui_list.c (grub_gui_list_new): Likewise.
	* gfxmenu/gui_progress_bar.c (grub_gui_progress_bar_new): Likewise.
	* gfxmenu/view.c (grub_gfxmenu_view_new): Likewise.
2010-02-16 13:23:08 +01:00
Samuel Thibault
6fa7cfce65 2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (GRUB_MOD_INIT(play)): Fix help.
	* docs/grub.texi (Command-line and menu entry commands): Document play
	command.
2010-02-14 18:36:26 +01:00
Samuel Thibault
37c8483b97 2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (grub_cmd_play): If grub_file_open fails,
	parse arguments as inline tempo and notes.  Move code for playing notes
	to...
	(play): ... new function.
2010-02-14 18:14:16 +01:00
Samuel Thibault
14da0fb7e8 2010-02-14 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (T_REST, T_FINE, struct note, beep_on): Use
	grub_uint16_t instead of short.
	(grub_cmd_play): Use grub_uint32_t instead of int, convert data from
	disk from little endian to cpu endianness.
2010-02-14 17:25:52 +01:00
Samuel Thibault
04459e70a3 2010-02-07 Samuel Thibault <samuel.thibault@ens-lyon.org>
* commands/i386/pc/play.c (BASE_TEMPO): Set to 60 *
	GRUB_TICKS_PER_SECOND instead of 120.
2010-02-14 17:07:34 +01:00
Vladimir 'phcoder' Serbinenko
ec0be08d40 Clean building system 2010-02-07 23:49:49 +01:00
Vladimir 'phcoder' Serbinenko
2083672af1 Remove -DGRUB_UTIL when compiling grub-emu 2010-02-07 04:23:44 +01:00
Vladimir 'phcoder' Serbinenko
19a9fb834b merge mainline into emu-mod 2010-02-07 03:06:33 +01:00
Vladimir 'phcoder' Serbinenko
909301af11 First try at generating grub-emu from modules 2010-02-07 02:07:35 +01:00
Vladimir 'phcoder' Serbinenko
35b86ff407 Merge mainline into nestpart 2010-02-06 21:03:32 +01:00
Vladimir 'phcoder' Serbinenko
6846cec5f7 2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* commands/ls.c (grub_ls_list_files): Free pathname on exit.
2010-02-06 20:52:11 +01:00
Vladimir 'phcoder' Serbinenko
bc6fcf0931 merge mainline into nestpart 2010-02-06 18:47:17 +01:00
Vladimir 'phcoder' Serbinenko
15cb7d433f Reimport nestpart 2010-02-06 18:43:37 +01:00
Vladimir 'phcoder' Serbinenko
1f534b6908 Merge mainline into gfxmenu 2010-02-03 01:24:07 +01:00
Vladimir 'phcoder' Serbinenko
e709ebe2ef 2010-01-27 Vladimir Serbinenko <phcoder@gmail.com>
* commands/hashsum.c (hash_file): Avoid possible stack overflow by
	having a 4KiB and not 32KiB buffer size.
2010-01-27 16:29:21 +01:00
Vladimir 'phcoder' Serbinenko
baccdb23a7 Use grub_snprintf in commands/setpci.c 2010-01-20 20:54:58 +01:00
Vladimir 'phcoder' Serbinenko
5b47ee8044 merge mainline into setpci 2010-01-20 20:51:00 +01:00
Vladimir 'phcoder' Serbinenko
f7fcb23c76 merge mainline into pciclean 2010-01-20 20:40:30 +01:00
Vladimir 'phcoder' Serbinenko
61c8e880e4 Add comments to loadbios.c 2010-01-20 20:33:01 +01:00
Vladimir 'phcoder' Serbinenko
61eb45eee7 Rename asprint into xasprintf and avsprintf into xvasprintf 2010-01-20 09:12:47 +01:00
Vladimir 'phcoder' Serbinenko
2d49abe9e7 merge mainline into asprintf 2010-01-20 07:36:17 +01:00
Robert Millan
c893cc87fc 2009-12-20 Robert Millan <rmh.grub@aybabtu.com>
* commands/loadenv.c (check_blocklists): Use `grub_err_t' as
	return value (and revert all return statements).  Update users.
2010-01-20 02:43:19 +00:00
Robert Millan
9444b678a1 2010-01-18 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/term.h (grub_term_register_input,
	grub_term_register_output): Check return of terminal init()
	routines, and abort if errors are raised.
	
	* commands/terminal.c: Update copyright year.
2010-01-18 19:43:39 +00:00
Robert Millan
cba98e8dbc 2010-01-18 Robert Millan <rmh.grub@aybabtu.com>
* commands/terminal.c (grub_cmd_terminal_input)
	(grub_cmd_terminal_output): Check return of terminal init()
	routines, and abort if errors are raised.
2010-01-18 19:31:10 +00:00
Vladimir 'phcoder' Serbinenko
b0b139075e 2010-01-17 Vladimir Serbinenko <phcoder@gmail.com>
Use flag-based instead of hook-based video mode selection and "auto"
	keyword.

	* include/grub/video.h (grub_video_adapter): Changed 'setup' member.
	(grub_video_set_mode): Changed prototype. All users updated.
	(grub_video_check_mode_flag): New inline function.
	* video/video.c (parse_modespec): New function.
	(grub_video_set_mode): Parse flags and keywords.
2010-01-17 17:52:01 +01:00
Vladimir 'phcoder' Serbinenko
fc054c9cb8 Various cleanups 2010-01-07 22:18:59 +01:00
Robert Millan
c1d2f1d81b Merge from trunk 2010-01-07 00:58:54 +00:00