* util/update-grub_lib.in (make_system_path_relative_to_its_root):
Do not print a trailing slash (therefore, the root directory is an
empty string).
(convert_system_path_to_grub_path): Do not remove trailing slash
from make_system_path_relative_to_its_root() output.
* util/i386/pc/grub-install.in: Add trailing slash to output from
make_system_path_relative_to_its_root().
* util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This
ensures that output lines aren't intermangled with those sent to
stderr (via grub_util_info()).
* util/grub-probe.c (grub_refresh): Likewise.
* util/i386/pc/grub-setup.c (grub_refresh): Likewise.
Based on patch from Fabian Greffrath <greffrath@leat.rub.de>
* util/grub.d/10_linux.in: Add ${GRUB_CMDLINE_LINUX_DEFAULT} to the
first boot option.
* util/update-grub.in: Export GRUB_CMDLINE_LINUX_DEFAULT.
* util/i386/pc/grub-mkrescue.in: Add --emulation=floppy
to create a floppy emulation boot CD when non emulation mode
does not work.
Enable Joliet CD filesystem extension.
* util/grub.d/30_os-prober.in: New script. Use `os-prober' and
`linux-boot-prober' (if installed) to detect other operating
systems which are installed on the computer and add them to
the boot menu.
* conf/common.rmk: Build and install 30_os-prober.
Revert grub/machine/init.h addition by Pavel (since it breaks on
i386-ieee1275 and others):
* util/i386/pc/misc.c: Remove grub/machine/init.h.
* util/powerpc/ieee1275/misc.c: Likewise.
* util/biosdisk.c: Include grub/util/biosdisk.h.
* util/grub-fstest.c (execute_command): Make static.
* util/grub-mkdevicemap.c (check_device): Likewise.
* util/i386/pc/misc.c: Include grub/machine/init.h.
* util/powerpc/ieee1275/misc.c: Likewise.
* util/lvm.c: Include grub/util/lvm.h.
* util/misc.c: Include grub/kernel.h, grub/misc.h and
grub/cache.h.
* util/raid.c: Include grub/util/raid.h.
(grub_util_getdiskname): Make static.
* util/grub-emu.c (main): Remove calls to grub_hostfs_init() and
grub_hostfs_fini(), as they are called from grub_init_all() and
grub_fini_all() respectively. This fixes an infinite loop in
grub-fstest due to double registration of hostfs.
Reported by Christian Franke <Christian.Franke@t-online.de>
* kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options):
Fix signedness warnings.
* kern/powerpc/ieee1275/openfw.c (grub_available_iterate):
Likewise.
* util/ieee1275/get_disk_name.c: Include config.h so that
_GNU_SOURCE is defined and getline() is declared. Mark an
unused argument as such. Fix a signedness warning.
* util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The
later is obsolete, potentially dangerous and sets a bad example.
* util/i386/efi/grub-mkimage.c (make_header): Likewise.
* util/misc.c (grub_util_get_image_size): Likewise.
* 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.
* util/update-grub.in: Reorganise terminal validity check. Accept
`ieee1275:console' (OLPC) and `*:gfxterm' as valid too.
Based on suggestion by Franklin PIAT.
* 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.
* partmap/gpt.c: Include `<grub/gpt_partition.h>'.
(grub_gpt_partition_type_empty): Redefine with macro from
`<grub/gpt_partition.h>'.
(gpt_partition_map_iterate): Adjust partition type comparison.
Export `entry' as partmap-specific `part.data' struct.
(grub_gpt_header, grub_gpt_partentry): Move from here ...
* include/grub/gpt_partition.h (grub_gpt_header)
(grub_gpt_partentry): ... to here (new file).
* util/i386/pc/grub-setup.c: Include `<grub/gpt_partition.h>'.
(grub_gpt_partition_type_bios_boot): New const variable, defined
with macro from `<grub/gpt_partition.h>'.
(setup): Replace `first_start' with `embed_region', which keeps
track of the embed region (and is partmap-agnostic).
Replace find_first_partition_start() with find_usable_region(),
which finds a usable region for embedding using partmap-specific
knowledge (supports PC/MSDOS and GPT).
Fix all assumptions that the embed region start at sector 1, using
`embed_region.start' from now on. Similarly, use `embed_region.end'
rather than `first_start' to calculate available size.
In grub_util_info() message, replace "into after the MBR" with an
indication of the specific sector our embed region starts at.
* util/i386/pc/grub-setup.c (setup): In find_first_partition_start(),
do not assume partition map is PC/MSDOS before performing checks that
are specific to that layout.
* util/getroot.c (grub_guess_root_device): Inspect /dev/evms before
/dev (like it is done for /dev/mapper). This doesn't provide support
for EVMS, but at least it is now easy to identify the problem when it
arises.
* util/biosdisk.c (grub_util_biosdisk_open, linux_find_partition)
(grub_util_biosdisk_get_grub_dev): Check open() exit status by
comparing it with -1, not 0.
* configure.ac: Probe for `help2man'.
* Makefile.in (builddir): New variable.
(HELP2MAN): Likewise. Set to `true' when @HELP2MAN@ doesn't provide it,
or otherwise add a few flags/options to it.
(install-local): For every executable utility or script that is
installed, invoke $(HELP2MAN) to install a manpage based on --help
output.
* util/i386/pc/grub-install.in: Move down `update-grub_lib' sourcing, so
that it doesn't prevent --help from working in build tree.
* util/i386/pc/grub-mkrescue.in (usage): Replace `grub-devel@gnu.org'
with `bug-grub@gnu.org'.
* util/powerpc/ieee1275/grub-mkrescue.in (usage): Likewise.
* util/update-grub.in (usage): New function.
Implement proper argument check, with support for --help and --version
(as well as existing -y).
* 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().
* util/grub-probe.c (main): When `verbosity > 1', set `debug'
environment variable to 'all' in order to obtain debug output from
non-util/ code.
* util/i386/pc/grub-setup.c (main): Likewise.
* loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical
address of entry.
(grub_multiboot_load_elf64): Likewise.
(grub_multiboot): Initialize mbi structure.
* util/grub-fstest.c: Don't include unused header file script.h.
* conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the begginning
of file.
(grub_fstest_SOURCES): Likewise.
Make grub-setup handle a separate root device.
* util/i386/pc/grub-setup.c (setup): Always open the root device,
so that the root device can be compared with the destination
device.
When embedding the core image, if the root and destination devices
are different, set ROOT_DRIVE to ROOT_DEV->DISK->ID. Otherwise, to
0xFF.
When not embedding, set ROOT_DRIVE to 0xFF.
* util/powerpc/ieee1275/grub-mkrescue.in: New file.
* conf/powerpc-ieee1275.rmk: Add grub-mkrescue support for
PowerPC.
* DISTLIST: Add util/powerpc/ieee1275/grub-mkrescue.in.
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.
* kern/i386/pc/init.c (make_install_device): When memdisk image is
present, "(memdisk)/boot/grub" becomes the default prefix.
* util/i386/pc/grub-mkrescue.in: Switch to a minimal core.img plus
a memdisk tarball with all the modules. Add --overlay=DIR option that
allows users to overlay additional files into the image.
* 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.
* 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().
* include/grub/util/getroot.h (grub_dev_abstraction_types): New enum.
(grub_util_get_dev_abstraction): New function prototype.
* util/getroot.c: Include `<grub/util/getroot.h>'
(grub_util_get_grub_dev): Move detection of abstraction type to ...
(grub_util_get_dev_abstraction): ... here (new function).
* util/grub-probe.c: Convert PRINT_* to an enum. Add
`PRINT_ABSTRACTION'.
(probe): Probe for abstraction type when requested.
(main): Understand `--target=abstraction'.
* util/i386/efi/grub-install.in: Add abstraction module to core
image when it is found to be necessary.
* util/i386/pc/grub-install.in: Likewise.
* util/powerpc/ieee1275/grub-install.in: Likewise.
* util/update-grub_lib.in (font_path): Return system path without
converting to GRUB path.
* util/update-grub.in: Convert system path returned by font_path()
to a GRUB path. Use `grub-probe -t abstraction' to determine what
abstraction module is needed for loading fonts (if any). Export
that as `GRUB_PRELOAD_MODULES'.
* util/grub.d/00_header.in: Process `GRUB_PRELOAD_MODULES' (print
insmod commands).