Commit graph

907 commits

Author SHA1 Message Date
Colin Watson
4321c64aff * util/grub-mkconfig.in: Capitalise and export GRUB_PREFIX. Stop
setting GRUB_VIDEO_BACKEND.  Make it available as a user override
	instead.  Replace the gfxterm backend check with a check that
	${GRUB_PREFIX}/video.lst is non-empty.
	* util/grub.d/00_header.in: Use GRUB_PREFIX rather than computing it
	again.
	(load_video): New generated function.  Call it before loading
	gfxterm rather than loading ${GRUB_VIDEO_BACKEND}.
	* util/grub.d/10_linux.in (linux_entry): Call load_video.
	* util/grub.d/30_os-prober.in (osx_entry): Likewise.
	* docs/grub.texi (Simple configuration): Document
	GRUB_VIDEO_BACKEND.

	Use video functions in linux and xnu loaders.

	* conf/i386-pc.rmk (xnu_mod_SOURCES): Remove loader/i386/pc/xnu.c.
	* conf/x86-efi.rmk (xnu_mod_SOURCES): Remove loader/i386/efi/xnu.c.
	* include/grub/i386/xnu.h (grub_xnu_set_video): Removed.
	* loader/i386/efi/linux.c (grub_linux_setup_video): Copied from
	loader/i386/pc/linux.c.
	(grub_linux_boot): Resynced with loader/i386/pc/linux.c.
	(find_line_len): Removed.
	(find_framebuf): Likewise.
	(grub_cmd_linux): Declare grub_linux_boot as possibly returning.
	* loader/i386/efi/xnu.c: Removed.
	* loader/i386/pc/xnu.c: Moved from here...
	* loader/i386/xnu.c: ...here.

	Enable priorities in video drivers.

	* include/grub/video.h (grub_video_adapter_prio_t): New type.
	(grub_video_adapter): New field prio.
	(grub_video_register): Respect prio when inserting.
	* video/efi_gop.c (grub_video_gop_adapter): Add prio.
	* video/efi_uga.c (grub_video_uga_adapter): Likewise.
	* video/emu/sdl.c (grub_video_sdl_adapter): Likewise.
	* video/i386/pc/vbe.c (grub_video_vbe_adapter): Likewise.
	* video/i386/pc/vga.c (grub_video_vga_adapter): Likewise.
	* video/ieee1275.c (grub_video_ieee1275_adapter): Likewise.
	* video/sm712.c (grub_video_sm712_adapter): Likewise.

	Fix SDL driver ID.

	* include/grub/video.h (grub_video_driver_id_t): New value
	GRUB_VIDEO_DRIVER_SDL.
	* video/emu/sdl.c (grub_video_sdl_adapter): Add id.

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-06-20 13:37:18 +02:00
Colin Watson
7d24e434c5 * util/i386/pc/grub-setup.c (usage): Pass an extra `program_name'
argument to printf.
* util/sparc64/ieee1275/grub-setup.c (usage): Likewise.
2010-06-17 21:54:04 +01:00
Colin Watson
c88a83f644 * util/i386/pc/grub-setup.c (usage): Fix syntax error.
* util/sparc64/ieee1275/grub-setup.c (usage): Likewise.
2010-06-17 21:49:50 +01:00
Colin Watson
094dfb699e * util/i386/pc/grub-setup.c (usage): Warn against running grub-setup
directly, and recommend grub-install instead.
* util/sparc64/ieee1275/grub-setup.c (usage): Likewise.
2010-06-17 21:20:43 +01:00
Colin Watson
e803a2b793 merge mainline 2010-06-17 16:14:08 +01:00
Colin Watson
e4311a9f0f * util/grub-mkconfig.in: Stop setting GRUB_VIDEO_BACKEND. Make it
available as a user override instead.  Replace the gfxterm backend
check with a check that ${GRUB_PREFIX}/video.lst is non-empty.
* util/grub.d/00_header.in (load_video): New generated function.
Call it before loading gfxterm rather than loading
${GRUB_VIDEO_BACKEND}.
* util/grub.d/10_linux.in (linux_entry): Call load_video.
* util/grub.d/30_os-prober.in (osx_entry): Likewise.
* docs/grub.texi (Simple configuration): Document
GRUB_VIDEO_BACKEND.
2010-06-17 16:01:17 +01:00
Colin Watson
2164da6b25 Fix i386-pc prefix handling with nested partitions (Debian bug
#585068).  Note that the case where the core image is booted using
multiboot and relocated from its original location still requires
more work.
* kern/i386/pc/init.c (make_install_device): If the prefix starts
with "(,", fill the boot drive in between those two characters, but
expect that a full partition specification including partition map
names will follow.
* util/i386/pc/grub-setup.c (setup): Unless an explicit prefix was
specified, write a prefix without the drive name but including a
full partition specification.
2010-06-17 12:15:37 +01:00
Colin Watson
044e2e60be * util/grub-mkconfig.in: Ignore non-option arguments, for
compatibility with older versions (before 2010-06-12) which did the
same.  In particular, this makes it easier to ship an update-grub
wrapper which is compatible with that used with GRUB Legacy (Debian
bug #586056).
2010-06-16 12:51:26 +01:00
Colin Watson
8d70754eed * util/grub-mkconfig.in: Remove vestige of old argument parsing that
left this script non-functional.
2010-06-14 15:34:47 +01:00
Grégoire Sutre
fcb2d09011 New partition naming style in grub-probe for Linux and NetBSD. 2010-06-13 02:36:39 +02:00
BVK Chaitanya
b2ffba9c08 merge with mainline 2010-06-12 20:25:26 +05:30
Colin Watson
601c84fd16 * util/grub-mkconfig.in: Capitalise and export GRUB_PREFIX.
* util/grub.d/00_header.in: Use GRUB_PREFIX rather than computing it
again.
* util/grub.d/10_linux.in (linux_entry): Load all video drivers,
which may be needed to allow the loader to program modes for the
kernel.
2010-06-12 15:06:53 +01:00
Thomas Schmitt
ce08a9fb28 * util/grub-mkrescue.in: Pass unrecognized options to xorriso. 2010-06-12 16:03:34 +02:00
Thomas Schmitt
a608597318 * util/grub-mkrescue.in: Support --xorriso argument. 2010-06-12 13:54:35 +02:00
Vladimir 'phcoder' Serbinenko
25c56d2928 * util/grub-mkrescue.in: Use -graft-points instead of -pathspecs.
Suggested by: Thomas Schmitt.
2010-06-12 13:47:08 +02:00
Vladimir 'phcoder' Serbinenko
e03e4b24ca * util/grub-mkrescue.in: Add --sort-weight arguments to xorriso.
Suggested by: Thomas Schmitt.
2010-06-12 13:44:01 +02:00
Vladimir 'phcoder' Serbinenko
57711df6ad custom.cfg support.
* conf/common.rmk (grub-mkconfig_SCRIPTS): Add 41_custom.
	* util/grub.d/41_custom.in: New file.
2010-06-12 13:20:21 +02:00
Colin Watson
ee62c427e5 * util/grub-mkrescue.in (make_image): Remove sh module, which has
been merged back into normal.
2010-06-12 12:02:38 +01:00
BVK Chaitanya
d6d0c209d9 merge with mainline 2010-06-12 16:21:10 +05:30
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
Robert Millan
9146024736 2010-06-09 Robert Millan <rmh@gnu.org>
* util/grub.d/10_linux.in: Prefer compressed images over non-compressed
	ones, when both are available.
2010-06-09 20:43:25 +02:00
Grégoire Sutre
0ea7c4f93c Make --version uniform and avoid hard-coded program name. 2010-06-08 12:52:42 +02:00
Grégoire Sutre
e8a6f3b6a5 Use absolute offsets for start of embedding area. 2010-06-08 12:23:30 +02:00
Colin Watson
e0f4c43882 * kern/emu/misc.c (device_mapper_null_log): New function.
(grub_device_mapper_supported): New function.
* include/grub/emu/misc.h (grub_device_mapper_supported): Add
prototype.
* kern/emu/hostdisk.c (find_partition_start): Check whether
device-mapper is supported before trying to use it.
* util/deviceiter.c (grub_util_iterate_devices): Likewise.
2010-06-07 22:41:55 +01:00
Colin Watson
e1cbcc40a4 * util/grub.d/00_header.in: Add some more quoting (of
"${prev_saved_entry}" and "${boot_once}") needed to make savedefault
work again.
Reported by: Mario 'BitKoenig' Holbe (Debian bug #584812).
2010-06-07 14:22:40 +01:00
Colin Watson
db8fa1ad87 * util/grub-mkpasswd-pbkdf2.c (main): Rename top-level `c' variable
to `count', fixing variable shadowing that broke the -c option.
2010-06-07 14:15:57 +01:00
Colin Watson
71c3809882 * util/grub.d/00_header.in: Quote values assigned to `saved_entry',
in case they contain spaces.
2010-06-05 20:44:44 +01:00
Colin Watson
f28a9212b4 * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Prepend
"part_" to partmap module names, in line with grub-install.
Reported by: Jindřich Makovička (Debian bug #584426).
2010-06-04 13:53:30 +01:00
Colin Watson
9cdfe32f09 * util/grub-mkimage.c: Make target-related error messages slightly
more helpful; -O talks about "format".  Explicitly point to the use
of -O if no target is specified.
Reported by: Didier Raboud (Debian bug #584415).
2010-06-04 13:38:10 +01:00
Colin Watson
0b35b2a921 * util/grub.d/00_header.in: Add safety check to make sure that
${locale_dir} exists before trying to probe it.
2010-06-02 13:57:13 +01:00
Colin Watson
d870813427 * util/grub-script-check.c (main): Ensure defined behaviour on empty
input files (in which case exit zero).
2010-05-27 15:54:18 +01:00
Robert Millan
5fdba519bb 2010-05-27 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Insert
	partmap module to handle cross-partmap setups.
	Reported by Orestes Mas.  Gràcies!
2010-05-27 16:38:16 +02:00
Colin Watson
d1d368e426 * util/grub-mkrescue.in: Initialise override_dir rather than
assuming that it's unset or empty in the environment.
2010-05-27 12:43:22 +01:00
Vladimir 'phcoder' Serbinenko
76e6d0d767 Add default/grub support 2010-05-23 14:11:11 +02:00
Colin Watson
21717c8fca * util/grub-mkconfig.in: Fix handling of -o so that it works when
not the first option.
2010-05-21 14:17:15 +01:00
Colin Watson
c0f48e654d * util/grub-mkrelpath.c (usage): Remove excess apostrophe. 2010-05-20 23:27:15 +01:00
Colin Watson
96779aec8e * util/misc.c: Move inclusion of <limits.h> to ...
* kern/emu/misc.c: ... here.  Needed for canonicalize_file_name.
2010-05-20 23:16:10 +01:00
Christian Franke
74276c0df7 * util/grub.d/10_windows.in: Use path names instead of
drive letters to prevent warning from Cygwin 1.7.
	Add drivemap command to menuentry if needed.
2010-05-18 21:58:49 +02:00
Samuel Thibault
c4f7b52359 2010-05-18 Justus Winter <4winter@informatik.uni-hamburg.de>
* util/grub.d/10_hurd.in: Include all gnumach* kernels, not only
	gnumach and gnumach.gz.
2010-05-18 20:10:37 +02:00
Vladimir 'phcoder' Serbinenko
01b8d2d787 * Makefile.in (CPPFLAGS): Replace -DGRUB_LIBDIR with
-DGRUB_PKGLIBROOTDIR= and prepend @PACKAGE_TARNAME@. All users updated.
	* util/grub-mkimage.c (image_targets): Add i386-multiboot.
	(main): Add a slash after pkglibdirroot.
2010-05-18 13:55:26 +02:00
Vladimir 'phcoder' Serbinenko
654e1d1e0e * util/grub-install.in: Add missing "in" keyword. 2010-05-18 13:45:25 +02:00
Vladimir 'phcoder' Serbinenko
26966aeba7 2010-05-18 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-mkrescue.in: Remove -O i386-pc duplication.
	Reported by: Seth Goldberg.
2010-05-18 14:21:15 +02:00
Colin Watson
74cbf5bdcb * configure.ac: Check for Linux device-mapper support.
* util/hostdisk.c (device_is_mapped): New function.
(find_partition_start): New function, partly broken out from
linux_find_partition and grub_util_biosdisk_get_grub_dev but with
device-mapper support added.
(linux_find_partition): Use find_partition_start.
(convert_system_partition_to_system_disk): Add `st' argument.
Support Linux /dev/mapper/* devices if device-mapper support is
available; only DM-RAID devices are understood at present.
(find_system_device): Add `st' argument.  Pass it to
convert_system_partition_to_system_disk.
(grub_util_biosdisk_get_grub_dev): Pass stat result to
find_system_device and convert_system_partition_to_system_disk.  Use
find_partition_start.
* conf/common.rmk (grub_mkdevicemap_SOURCES): Add kern/env.c,
kern/err.c, kern/list.c, kern/misc.c, and kern/emu/mm.c.
* util/deviceiter.c [__linux__]: Define MINOR.
(grub_util_iterate_devices): Add support for DM-RAID disk devices.
* util/mkdevicemap.c (grub_putchar): New function.
(grub_getkey): New function.
(grub_refresh): New function.
(main): Set debug=all if -v -v is used.
2010-05-18 12:33:35 +01:00
Colin Watson
355b51e9b5 Fix build with non-GNU libcs.
* util/misc.c (canonicalize_file_name): Move to ...
* kern/emu/misc.c (canonicalize_file_name): ... here.  Needed by
grub_make_system_path_relative_to_its_root.
2010-05-18 11:57:31 +01:00
Colin Watson
7fb5c25fd0 * util/grub-mkrescue.in: Sync up with grub-install in terms of how
we handle finding grub-mkimage.  Default to finding grub-mkimage in
${bindir} with program_transform_name applied, and provide a
--grub-mkimage option to override this.
2010-05-18 11:51:37 +01:00
Colin Watson
e6127bed25 merge from trunk 2010-05-18 11:14:13 +01:00
Vladimir 'phcoder' Serbinenko
1d3293d67d Remove grub-mkisofs.
* conf/common.rmk (bin_UTILITIES): Remove grub-mkisofs.
	(grub_mkisofs_SOURCES): Removed.
	(grub_mkisofs_CFLAGS): Removed.
	* util/mkisofs/defaults.h: Removed.
	* util/mkisofs/eltorito.c: Likewise.
	* util/mkisofs/exclude.h: Likewise.
	* util/mkisofs/hash.c: Likewise.
	* util/mkisofs/include/: Likewise.
	* util/mkisofs/include/fctldefs.h: Likewise.
	* util/mkisofs/include/mconfig.h: Likewise.
	* util/mkisofs/include/prototyp.h: Likewise.
	* util/mkisofs/include/statdefs.h: Likewise.
	* util/mkisofs/iso9660.h: Likewise.
	* util/mkisofs/joliet.c: Likewise.
	* util/mkisofs/match.c: Likewise.
	* util/mkisofs/match.h: Likewise.
	* util/mkisofs/mkisofs.c: Likewise.
	* util/mkisofs/mkisofs.h: Likewise.
	* util/mkisofs/msdos_partition.h: Likewise.
	* util/mkisofs/multi.c: Likewise.
	* util/mkisofs/name.c: Likewise.
	* util/mkisofs/rock.c: Likewise.
	* util/mkisofs/tree.c: Likewise.
	* util/mkisofs/write.c: Likewise.
2010-05-17 23:33:03 +02:00
Vladimir 'phcoder' Serbinenko
8b26d1d30b add missing sh.mod 2010-05-17 22:23:22 +02:00
Vladimir 'phcoder' Serbinenko
7e70395f9c Cherrypick bugfixes and coreboot+qemu support from expermental 2010-05-17 21:35:39 +02:00
Vladimir 'phcoder' Serbinenko
918405fd8c merge mainline into rescue-efi 2010-05-17 21:26:16 +02:00