* commands/search.c (search_label, search_fs_uuid, search_file): Print
search result when not saving to variable, not the other way around.
When saving to variable, abort iteration as soon as a match is found.
* util/update-grub_lib.in (prepare_grub_to_access_device): Remove
check for partition that provides /boot/grub. Its logic is flawed,
as it prevents prepare_grub_to_access_device() from being called
multiple times.
* util/update-grub_lib.in (prepare_grub_to_access_device): Issue
"insmod" command directly when abstraction modules are needed,
instead of reliing on GRUB_PRELOAD_MODULES (which had no effect
since it had already been processed).
* conf/i386-efi.rmk: Recompile grub-mkimage.c if Makefile has
changed. This is needed in case GRUB_LIBDIR changes.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-linuxbios.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Rename
kernel_elf_symlist.c to symlist.c for consistency with other
architectures. Update all users.
* conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise.
* util/i386/pc/grub-install.in: If the drive is LVM or RAID, prepend
it in prefix.
* util/i386/pc/grub-setup.c (main): Don't handle prefix at all. Set
`must_embed' to 1 when root_dev is a RAID device. When dest_dev is
a RAID device, run setup() for all members independently on whether
LVM abstraction is being used.
(setup): Don't handle prefix at all; let grub-mkimage take care of it.
If grub-mkimage has set `*install_dos_part == -2', don't override this
value.
Perform *install_dos_part adjustments independently on whether
we're embedding or not.
Clarify error message when image is too big for embedding.
Remove duplicate *install_dos_part stanza.
* term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables.
(grub_ofconsole_normal_color, grub_ofconsole_highlight_color): New
variables.
(grub_ofconsole_setcolor, grub_ofconsole_getcolor): Load/store
values in grub_ofconsole_normal_color and
grub_ofconsole_highlight_color (they're not directly related to
background and foreground).
(grub_ofconsole_setcolorstate): Extract background and foreground
from grub_ofconsole_normal_color and grub_ofconsole_highlight_color.
* util/update-grub_lib.in (prepare_grub_to_access_device): Use
/boot/grub for the check in last commit, not /boot (they could be
different partitions).
* util/update-grub_lib.in (prepare_grub_to_access_device): If we were
asked to setup access for the same partition that provides /boot,
don't bother using UUIDs since our root already has the value we
want.
* commands/ls.c (grub_ls_list_files): Use integer calculations
for human readable format, avoid floating point use.
* kern/misc.c (grub_ftoa): Remove.
(grub_vsprintf): Remove floating point support.
* util/i386/pc/grub-mkimage.c (generate_image): If we included a drive
in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be
skipped later.
(main): If a memdisk was requested, add "(memdisk)" drive explicitly to
the beginning of the prefix.
* kern/i386/pc/init.c (make_install_device): Remove memdisk check.
It is assumed that if we have a memdisk, grub-mkimage has set
grub_prefix to include the "(memdisk)" drive in it.
* term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init):
Initialize keyboard controller after registering the terminal, so that
grub_printf() can be called from grub_keyboard_controller_init().
* fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in
extent-btree which is written as big endian on disk.
Reported by Alain Greppin <al@chilibi.org>.
* fs/fshelp.c (grub_fshelp_read): New function. Implement
linear disk read with journal translation.
* fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read().
* include/grub/fshelp.h: Declare grub_fshelp_read().
Based on description from Pavel:
* kern/disk.c (grub_disk_check_range): Rename to ...
(grub_disk_adjust_range): ... this. Add a comment explaining the
tasks performed by this function.
* util/biosdisk.c (open_device): Revert last change to the
function, it broke installation. The sector needs to be
different dependent on which device is opened.
Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the
rest of GRUB, and breakage doesn't happen if its value were modified.
* include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
Redefine as an offset from `GRUB_KERNEL_MACHINE_DATA_END' instead of
a constant (same value).
* kern/i386/pc/startup.S: Replace hardcoded `0x50' with
`GRUB_KERNEL_MACHINE_DATA_END' (same value).
* util/grub-emu.c (grub_machine_init): Move code in this function from
here ...
(main): ... to here (before grub_util_biosdisk_init() call, to prevent
segfault in case grub_printf() is called).
* util/i386/pc/grub-install.in: Append `--device-map=${device_map}' to
grub_probe. Update all users not to explicitly add it again.
(grub_device): New variable; contains corresponding device for grubdir.
(fs_module, partmap_module, devabstraction_module): Pass
`--device ${grub_device}' to grub_probe to avoid traversing /dev
every time.
* util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL
before dereferencing it.
* fs/fat.c (struct grub_fat_bpb): Move fat32-specific fields into a
union with fat12/fat16-specific ones. Add some new fields, including
`num_serial' for both versions.
(struct grub_fat_data): Add `uuid' member.
(grub_fat_mount): Refer to fat32-specific fields in `bpb' by their new
names. Initialize `data->uuid' using `num_serial'.
(grub_fat_uuid): New function.
(grub_fat_fs): Reference grub_fat_uuid() in `uuid' struct member.
* fs/reiserfs.c (grub_reiserfs_superblock): Add `uuid' field.
(grub_reiserfs_uuid): New function.
(grub_reiserfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct
member.
* fs/xfs.c (grub_xfs_sblock): Add `uuid' field.
(grub_xfs_uuid): New function.
(grub_xfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member.
* disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Iterate through
floppies after everything else, to ensure floppy drive isn't accessed
unnecessarily (patch from Bean).
* term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement
using "cursor-on" and "cursor-off" commands (understood at least by
the Open Firmware flavour on OLPC).
* util/biosdisk.c (linux_find_partition): Simplify logic and
make the code more universal. Keep special processing for
devfs, but use a simple rule for all other devices. If the
device ends with a number, append 'p' and the partition number.
Otherwise, append only the partition number.
* util/update-grub.in (GRUB_DISABLE_LINUX_UUID): Export variable.
* util/grub.d/10_linux.in: If GRUB_DEVICE_UUID is set, and
GRUB_DISABLE_LINUX_UUID isn't true, use the filesystem UUIDs as
the `root' parameter to Linux.
* commands/search.c (options): Rename --fs_uuid to --fs-uuid.
* util/update-grub_lib.in (prepare_grub_to_access_device): Replace
--fs_uuid with --fs-uuid.
* util/update-grub.in: Allow filesystem UUID probes to fail (since not
all filesystems support them).
* util/grub.d/00_header.in: Remove obsolete comment referencing
convert_system_path_to_grub_path().
* util/update-grub.in: Likewise.
* util/update-grub_lib.in (is_path_readable_by_grub): New function.
(convert_system_path_to_grub_path): Add a warning message explaining
that this function is deprecated. Rely on is_path_readable_by_grub()
for the readability checks.
(font_path): Use is_path_readable_by_grub() for the readability
check rather than convert_system_path_to_grub_path().
* util/update-grub_lib.in (prepare_grub_to_access_device): New function.
* util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without
converting it first.
* util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup
grub.cfg for access to font file, and afterwards call it again to set
the root device.
* commands/search.c (options): Add --fs_uuid option.
(search_fs_uuid): New function.
(grub_cmd_search): Fix --set argument passing.
Use search_fs_uuid() when requested via --fs_uuid.
(grub_search_init): Update help message.
* fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid'
and redeclare it as an array of 16-bit words.
(grub_ext2_uuid): New function.
(grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member.
* include/grub/fs.h (struct grub_fs): Add `uuid' struct member.
* util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT)
(GRUB_DEVICE_BOOT_UUID): New variables.
(GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove.
* util/grub.d/00_header.in: Set root using `search --fs_uuid' command
whenever possible.
* util/grub.d/10_hurd.in: Avoid explicit use of root drive. Instead,
just assume `root' variable has the right value.
* util/grub.d/10_linux.in: Likewise.
* util/grub-probe.c (probe): Probe for filesystem UUID when requested
via PRINT_FS_UUID.
(main): Recognise `-t fs_uuid' argument.
* util/biosdisk.c (map): Redefine structure to hold information
about GRUB drive name.
(get_drive): Reimplement without assuming (and verifiing) BIOS-like
drive names.
(call_hook): Remove.
(grub_util_biosdisk_iterate): Access drive names via `.drive' struct
member. Assume drive has partitions.
(grub_util_biosdisk_open): Access device names via `.device' struct
member.
(open_device): Likewise.
(find_drive): Likewise.
(read_device_map): Adjust map[] usage to match the new struct
definition. Don't check for duplicates (still possible, but not cheap
anymore).
(grub_util_biosdisk_fini): Free malloced buffers referenced by map[].
(make_device_name): Remove assumption of BIOS-like drive names.