]>
git.proxmox.com Git - grub2.git/log
Grégoire Sutre [Sun, 5 Feb 2012 00:22:04 +0000 (01:22 +0100)]
* grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Return
NULL when the argument `level' has an unexpected value.
Vladimir 'phcoder' Serbinenko [Sat, 4 Feb 2012 20:47:29 +0000 (21:47 +0100)]
Move platform-dependent files from $prefix to $prefix/$platform.
* config.h.in (GRUB_TARGET_CPU): New definition.
(GRUB_PLATFORM): Likewise.
* configure.ac: Define GRUB_TARGET_CPU and GRUB_PLATFORM.
* grub-core/commands/parttool.c (grub_cmd_parttool): Update dir.
* grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise.
* grub-core/kern/dl.c (grub_dl_load): Likewise.
* grub-core/normal/autofs.c (read_fs_list): Likewise.
* grub-core/normal/crypto.c (read_crypto_list): Likewise.
* grub-core/normal/dyncmd.c (read_command_list): Likewise.
* grub-core/normal/term.c (read_terminal_list): Likewise.
* grub-core/gettext/gettext.c (grub_mofile_open_lang): Use
$prefix/locale.
(grub_gettext_init_ext): Likewise.
* grub-core/normal/main.c (GRUB_MOD_INIT): Define grub_cpu and
grub_platform.
* util/grub-install.in: Update directories.
* util/grub-mknetdir.in: Likewise.
* util/grub-mkrescue.in: Likewise.
Vladimir 'phcoder' Serbinenko [Sat, 4 Feb 2012 13:00:23 +0000 (14:00 +0100)]
* grub-core/kern/ieee1275/openfw.c (grub_claimmap): Change to
grub_error framework. All users updated.
Vladimir 'phcoder' Serbinenko [Sat, 4 Feb 2012 12:35:17 +0000 (13:35 +0100)]
* grub-core/gettext/gettext.c: Mostly rewritten to avoid using
lists (by always binsearching), improve caching (cache strings
used for binsearch, not only results), improve
maintainability (by using more structured binary search) and correct
error handling.
Vladimir 'phcoder' Serbinenko [Sat, 4 Feb 2012 11:21:21 +0000 (12:21 +0100)]
* grub-core/script/execute.c (grub_script_return): Fix warning.
Vladimir 'phcoder' Serbinenko [Sat, 4 Feb 2012 10:52:10 +0000 (11:52 +0100)]
* grub-core/script/execute.c (grub_script_return): Fix potential
NULL-dereference.
Reported by: Jim Meyering.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 21:52:23 +0000 (22:52 +0100)]
* po/POTFILES.in: Regenerate.
* util/grub-install.in: Gettextize the strings missed in first pass.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 21:36:51 +0000 (22:36 +0100)]
* Makefile.util.def (grub-mkdevicemap): Removed.
* include/grub/emu/hostdisk.h (grub_util_get_os_disk): New proto.
* include/grub/util/deviceiter.h: Removed.
* util/deviceiter.c: Likewise.
* util/getroot.c (grub_util_get_os_disk): New function.
* util/grub-install.in: Remove grub-mkdevicemap. Use -t disk as
replacement for EFI.
* util/grub-mkdevicemap.c: Removed.
* util/grub-probe.c (probe): Handle PRINT_DISK.
(argp_parser): Handle -t disk.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 20:45:43 +0000 (21:45 +0100)]
* util/grub-mkfont.c: Migrate to argp.
* util/grub-mklayout.c: Likewise.
* util/grub-mkpasswd-pbkdf2.c: Likewise.
* util/grub-mkrelpath.c: Likewise.
* util/grub-probe.c: Likewise.
* util/grub-script-check.c: Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 20:30:05 +0000 (21:30 +0100)]
* util/grub-reboot.in: Add missing datarootdir.
Add missing newline.
* util/grub-set-default.in: Add missing datarootdir.
* util/powerpc/ieee1275/grub-mkrescue.in: Add missing newline.
* util/grub-mkrescue.in: Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 20:25:10 +0000 (21:25 +0100)]
* util/grub.d/30_os-prober.in: Fix TRANSLATORS comment.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 20:22:12 +0000 (21:22 +0100)]
* util/grub-kbdcomp.in: Add decent help and gettextize.
* docs/man/grub-kbdcomp.h2m: New file.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 20:18:37 +0000 (21:18 +0100)]
Migrate grub-mkimage.c to argp.
* Makefile.util.def (grub-mkimage): Add util/argp_common.c.
(grub-setup): Likewise.
* util/grub-setup.c (print_version): Move to ...
* util/argp_common.c (print_version): ... here.
* util/grub-setup.c (argp_program_version_hook): Move to ...
* util/argp_common.c (argp_program_version_hook): ... here.
* util/grub-setup.c (argp_parser): Add exit (1) on fatal error for
safety.
* util/grub-mkimage.c (main): Migrate to argp.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 13:45:45 +0000 (14:45 +0100)]
* util/grub-mkrescue.in: Use same message as
util/powerpc/ieee1275/grub-mkrescue.in with %s in place of command
for better translations.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 13:38:39 +0000 (14:38 +0100)]
* util/powerpc/ieee1275/grub-mkrescue.in: Gettextize. Unify the command
options with generic grub-mkrescue.in with the goal of future
merge.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 13:20:31 +0000 (14:20 +0100)]
* grub-core/kern/mm.c: Add missing include of i18n.h
* grub-core/lib/relocator.c: Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 12:53:12 +0000 (13:53 +0100)]
* grub-core/loader/ia64/efi/linux.c (find_mmap_size): Replace fatal with
error.
(allocate_pages): Check return value.
Replace fatal with error.
(grub_linux_boot): Replace printf with dprintf.
Check find_mmap_size return value.
Replace fatal with error.
Don't call grub_machine_fini.
(grub_load_elf64): Replace printf with dprintf.
(grub_cmd_linux): Likewise.
(grub_cmd_initrd): Likewise.
(grub_cmd_payload): Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 11:47:07 +0000 (12:47 +0100)]
* grub-core/loader/i386/xnu.c (grub_cmd_devprop_load): Fix error
message.
* grub-core/video/radeon_fuloong2e.c
(grub_video_radeon_fuloong2e_setup): Likewise.
* grub-core/video/sis315pro.c (grub_video_sis315pro_setup): Likewise.
* grub-core/video/video.c (grub_video_set_mode): Don't override
standard out of memory message.
Grégoire Sutre [Fri, 3 Feb 2012 11:32:21 +0000 (12:32 +0100)]
NetBSD disk wedge support.
Mark Wooding [Fri, 3 Feb 2012 11:15:53 +0000 (12:15 +0100)]
* util/grub-mkconfig.in: Use umask rather than chmod to create
grub.cfg.new to avoid insecure grub.cfg.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 10:56:49 +0000 (11:56 +0100)]
* grub-core/commands/ls.c: Gettextize.
* grub-core/commands/setpci.c: Likewise.
* grub-core/commands/videotest.c: Likewise.
* grub-core/disk/geli.c: Likewise.
* grub-core/kern/mm.c: Likewise.
* grub-core/lib/relocator.c: Likewise.
* grub-core/loader/efi/appleloader.c: Likewise.
* grub-core/loader/i386/xnu.c: Likewise.
* grub-core/loader/ia64/efi/linux.c: Likewise.
* grub-core/loader/xnu.c: Likewise.
* grub-core/net/dns.c: Likewise.
* grub-core/net/net.c: Likewise.
* grub-core/script/lexer.c: Likewise.
* grub-core/script/parser.y: Likewise.
* grub-core/script/yylex.l: Likewise.
* util/getroot.c: Likewise.
* util/grub-setup.c: Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 10:50:18 +0000 (11:50 +0100)]
* grub-core/fs/reiserfs.c (grub_reiserfs_get_item): Use proper error
number.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 10:48:42 +0000 (11:48 +0100)]
* grub-core/disk/ldm.c (grub_util_ldm_embed): Correct error message.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 10:46:18 +0000 (11:46 +0100)]
* grub-core/commands/search_file.c (SEARCH_TARGET): Remove obsolete
macro.
* grub-core/commands/search_label.c (SEARCH_TARGET): Likewise.
* grub-core/commands/search_uuid.c (SEARCH_TARGET): Likewise.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 10:42:22 +0000 (11:42 +0100)]
* util/grub-mkstandalone.in: Fix help messages. Gettextize.
* util/grub-install.in: Gettextize.
* util/grub-mkconfig.in: Likewise.
* util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo
if not available.
(grub_warn): Gettextize.
* util/grub-mknetdir.in: Gettextize.
* util/grub-mkrescue.in: Likewise.
* util/grub-mkstandalone.in: Likewise.
* util/grub-reboot.in: Likewise.
* util/grub-set-default.in: Likewise.
* util/grub.d/00_header.in: Likewise.
* util/grub.d/10_hurd.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/10_netbsd.in: Likewise.
* util/grub.d/10_windows.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
* util/grub.d/30_os-prober.in: Likewise.
* po/POTFILES-shell.in: Regenerate.
Richard Laager [Fri, 3 Feb 2012 10:07:18 +0000 (11:07 +0100)]
* util/grub-mkimage.c (main): Fix format-security warning.
* util/grub-mkrelpath.c (main): Likewise.
* util/grub-probe.c (main): Likewise.
Richard Laager [Fri, 3 Feb 2012 10:02:06 +0000 (11:02 +0100)]
* util/grub-probe.c (probe): Don't crash on canonicalize_file_name
failure.
Put back lost PRINT_DRIVE.
Richard Laager [Fri, 3 Feb 2012 09:50:56 +0000 (10:50 +0100)]
* util/getroot.c (find_root_devices_from_libzfs): Fix compilation error.
(grub_guess_root_devices): Replace strlen with sizeof.
Avoid crash.
(find_root_devices_from_poolname): Remove unused variable.
Handle raidzN.
Vladimir 'phcoder' Serbinenko [Fri, 3 Feb 2012 09:35:28 +0000 (10:35 +0100)]
Support install on multi-device filesystems.
* include/grub/emu/getroot.h (grub_guess_root_device): Renamed to ...
(grub_guess_root_devices): ...this. Return char **. All users updated.
* include/grub/emu/misc.h (grub_find_root_device_from_mountinfo):
Removed.
* util/getroot.c (find_root_device_from_libzfs): Moved pool logic to ...
(find_root_devices_from_poolname): ... here.
(grub_find_root_devices_from_mountinfo): Return char **. Make static.
Support zfs-fuse.
(grub_guess_root_device): Rename to ...
(grub_guess_root_devices): ... this. Return char **. All users updated.
* util/grub-install.in: Handle multi-device filesystems.
* util/grub-probe.c (probe). Make device_names a char **. Add delim
argument. All users updated.
Handle multi-device filesystems.
Use 'delim' as separator.
Remove device check to allow filesystems on file.
(main): Support -0 argument. Handle multi-device.
* util/grub-setup.c (setup): Remove root argument. Handle multi-device.
Fix a cross-device check while on it.
(arguments): Remove root_dev.
(argp_parser): Remove -r.
(main): Remove root_dev.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 17:30:51 +0000 (18:30 +0100)]
* grub-core/fs/zfs/zfscrypt.c: Add link to documentation.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 16:47:47 +0000 (17:47 +0100)]
* grub-core/commands/videotest.c (grub_cmd_videotest): Fix subset
symbol.
Reported by: NODA, Kai <nodakai>.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 15:13:17 +0000 (16:13 +0100)]
Fix ehci on amd64.
* grub-core/bus/usb/usbhub.c (grub_usb_hub_add_dev): Use %p to print
pointers.
* grub-core/bus/usb/ehci.c (grub_ehci_pci_iter): Likewise.
(grub_ehci_setup_qh): Likewise.
(grub_ehci_find_qh): Likewise.
(grub_ehci_transaction): Likewise.
(grub_ehci_setup_transfer): Likewise.
(grub_ehci_check_transfer): Likewise.
(grub_ehci_portstatus): Likewise.
(grub_ehci_detect_dev): Likewise.
(grub_ehci_transfer_controller_data): New field td_last_phys.
(grub_ehci_setup_transfer): Fill td_last_phys.
(grub_ehci_check_transfer): Use td_last_phys.
Seth Goldberg [Wed, 1 Feb 2012 14:35:30 +0000 (15:35 +0100)]
* grub-core/normal/context.c (grub_env_extractor_close): Don't crash
if no submenu is present.
Aleš Nesrsta [Wed, 1 Feb 2012 14:19:10 +0000 (15:19 +0100)]
CBI support.
* include/grub/usb.h (grub_usbms_protocol_t): New values
GRUB_USBMS_PROTOCOL_CB and GRUB_USBMS_PROTOCOL_CBI.
* grub-core/disk/usbms.c (GRUB_USBMS_CBI_CMD_SIZE): New define.
(GRUB_USBMS_CBI_ADSC_REQ): Likewise.
(grub_usbms_dev): Add subclass, protocol and intrpt.
Remove in_maxsz and out_maxsz.
(grub_usbms_reset): Rename to ...
(grub_usbms_bo_reset): .. this.
(grub_usbms_cbi_cmd): New function.
(grub_usbms_cbi_reset): Likewise.
(grub_usbms_reset): Likewise.
(grub_usbms_attach): Recognize cbi. Same subclass and protocol.
(grub_usbms_transfer): Rename to ...
(grub_usbms_transfer_bo): ... this.
(grub_usbms_transfer_cbi): Likewise.
(grub_usbms_transfer): Likewise.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 13:30:40 +0000 (14:30 +0100)]
merge mainline into cbi
Aleš Nesrsta [Wed, 1 Feb 2012 13:18:43 +0000 (14:18 +0100)]
EHCI support. All of the credit goes to Aleš Nesrsta. I've just added
the support for the CS5536 modification thereos and few bugfixes.
* grub-core/Makefile.core.def (ehci): New module.
* grub-core/bus/usb/ehci.c: New file.
* grub-core/bus/usb/usbhub.c (grub_usb_hub_add_dev): New arguments
port and hubaddr. All users updated.
Save port and hubaddr into dev structure.
* include/grub/cs5536.h (GRUB_CS5536_MSR_USB_BASE_SMI_ENABLE): New
define.
* include/grub/pci.h (grub_dma_phys2virt): New function.
(grub_dma_virt2phys): Likewise.
* include/grub/usb.h (grub_usb_device): New members port and hubaddr.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 13:08:58 +0000 (14:08 +0100)]
Fix type errors. Don't stop after first EHCI controller is found.
Vladimir 'phcoder' Serbinenko [Wed, 1 Feb 2012 12:19:42 +0000 (13:19 +0100)]
merge mainline into ehci
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 22:26:07 +0000 (23:26 +0100)]
* grub-core/fs/fat.c (grub_fat_mount) [!MODE_EXFAT]: Remove fstype
check as some mkfs implementations omit it.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:59:32 +0000 (22:59 +0100)]
* docs/grub.texi (Unicode): Mention identifier and space limitations.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:49:11 +0000 (22:49 +0100)]
* grub-core/fs/jfs.c (grub_jfs_sblock): Make volname a char array.
Add new member volname2.
(grub_jfs_label): Use volname2 if available.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:43:29 +0000 (22:43 +0100)]
* grub-core/fs/nilfs2.c (grub_nilfs2_super_block): Expand volume_name
over last_mounted as seen in image generated by mkfs.nilfs2.
(grub_nilfs2_label): Use sizeof for the size of s_volume_name.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:38:08 +0000 (22:38 +0100)]
* grub-core/fs/fat.c (grub_fat_dir_entry) [MODE_EXFAT]: Expand label
to 15 UTF-16 characters as seen in FS generated by mkexfatfs.
(grub_fat_label) [MODE_EXFAT]: Use macros for size.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:25:07 +0000 (22:25 +0100)]
* grub-core/fs/romfs.c (grub_romfs_mount): Fix a bug with labels going
over the sector.
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:20:37 +0000 (22:20 +0100)]
* grub-core/fs/zfs/zfs.c (get_filesystem_dnode): Support space in
subvolume name (by removing a bogus and useless check).
Vladimir 'phcoder' Serbinenko [Tue, 31 Jan 2012 21:12:57 +0000 (22:12 +0100)]
* grub-core/fs/ext2.c (grub_ext2_label): Fix field size. Change to
sizeof while on it.
Vladimir 'phcoder' Serbinenko [Mon, 30 Jan 2012 17:33:11 +0000 (18:33 +0100)]
* grub-core/disk/scsi.c (grub_scsi_read_capacity): Renamed to ...
(grub_scsi_read_capacity10): ... this.
(grub_scsi_read_capacity16): New function.
(grub_scsi_open): Use read_capacity16 if read_capacity10 returned
0xffffffff.
Fix off-by-one error.
* include/grub/scsi.h (grub_scsi): Rename size to last_block and make it
64-bit unsigned.
* include/grub/scsicmd.h (grub_scsi_read_capacity): Rename to ...
(grub_scsi_read_capacity10): ... this.
(grub_scsi_read_capacity_data): Rename to ...
(grub_scsi_read_capacity10_data): ... this. Rename size to last_block.
(grub_scsi_read_capacity16): New struct.
(grub_scsi_read_capacity16_data): Likewise.
(grub_scsi_cmd_t): Rename grub_scsi_cmd_read_capacity to
grub_scsi_cmd_read_capacity10.
New command grub_scsi_cmd_read_capacity16.
Vladimir 'phcoder' Serbinenko [Mon, 30 Jan 2012 11:47:26 +0000 (12:47 +0100)]
SCSI >2TiB support.
* grub-core/disk/scsi.c (grub_scsi_read16): New function.
(grub_scsi_write16): Likewise.
(grub_scsi_read): Use read16 when necessary.
(grub_scsi_write): Likewise.
* include/grub/scsicmd.h (grub_scsi_read16): New struct.
(grub_scsi_write16): Likewise.
(grub_scsi_cmd_t): Add READ16 and WRITE16.
Vladimir 'phcoder' Serbinenko [Mon, 30 Jan 2012 11:26:11 +0000 (12:26 +0100)]
SCSI write support (for usbms mainly).
* grub-core/disk/scsi.c (grub_scsi_write10): Uncomment. Make buffer
a const pointer.
(grub_scsi_write): Implement.
* include/grub/scsi.h (grub_scsi_dev): Make write buffer a const pointer
Vladimir 'phcoder' Serbinenko [Mon, 30 Jan 2012 00:18:02 +0000 (01:18 +0100)]
* grub-core/io/lzopio.c (uncompress_block): Fix use of incorrect
variable.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:58:42 +0000 (23:58 +0100)]
* grub-core/lib/posix_wrap/string.h (memchr): New function.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:50:37 +0000 (23:50 +0100)]
* po/POTFILES.in: Regenerate.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:48:35 +0000 (23:48 +0100)]
* grub-core/lib/posix_wrap/assert.h (assert_real): Replace grub_fatal
with grub_printf to avoid unnecessary fatal failure.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:27:31 +0000 (23:27 +0100)]
* grub-core/lib/posix_wrap/limits.h (SHRT_MAX): New define.
(INT_MAX): Likewise.
* grub-core/lib/posix_wrap/stdio.h (snprintf): New function.
* grub-core/lib/posix_wrap/stdlib.h (abs): Likewise.
* grub-core/lib/posix_wrap/string.h (memcmp): Likewise.
(strcpy): Likewise.
(strstr): Likewise.
(strchr): Likewise.
(strncpy): Likewise.
(strcat): Likewise.
(strncat): Likewise.
(strcoll): Likewise.
* include/grub/types.h (GRUB_SHRT_MAX): New define.
(GRUB_INT_MAX): Likewise.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:22:57 +0000 (23:22 +0100)]
* grub-core/gnulib/regcomp.c (regerror): Don't use abort on
unexpected error.
(optimize_utf8): Likewise.
* grub-core/lib/posix_wrap/stdlib.h (abort): Removed.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 22:20:02 +0000 (23:20 +0100)]
* grub-core/boot/i386/pc/lnxboot.S: Use
GRUB_DECOMPRESSOR_MAX_DECOMPRESSOR_SIZE.
* grub-core/boot/i386/pc/startup_raw.S: Ensure about boot_dev
location.
* include/grub/offsets.h (GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE): New
definition.
(GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE): Likewise.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 20:49:44 +0000 (21:49 +0100)]
* util/getroot.c (grub_util_get_dm_node_linear_info): Fix memory leak.
* grub-core/disk/cryptodisk.c (cryptodisk_cleanup): Disable for
now to avoid double free.
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_dev): Rename to
hostdisk.
* include/grub/disk.h (grub_disk_dev_id): New id HOSTDISK.
* util/grub-probe.c (escape_of_path): Always return a new copy.
(print_full_name): Escape path.
(probe): Don't call grub_util_devname_to_ofpath on NULL.
Fix hints on abstractions.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 19:52:37 +0000 (20:52 +0100)]
* util/grub-mkconfig_lib.in (prepare_grub_to_access_device):
Don't add "root" line if no compatibility hont is available.
Suggested by: Seth Goldberg.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 18:00:30 +0000 (19:00 +0100)]
* include/grub/ata.h (grub_ata): Add a new element maxbuffer.
* grub-core/disk/ata.c (grub_ata_readwrite): Limit to ata->maxbuffer.
* grub-core/disk/pata.c (grub_pata_open): Set ata->maxbuffer.
* grub-core/disk/ahci.c (grub_ahci_open): Likewise.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:56:44 +0000 (18:56 +0100)]
* include/grub/zfs/dnode.h (DN_MIN_INDBLKSHIFT): Removed.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:53:38 +0000 (18:53 +0100)]
* util/grub-pe2elf.c (ehdr): Make static.
(shdr): Likewise.
(num_sections): Likewise.
(offset): Likewise.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:51:21 +0000 (18:51 +0100)]
Eliminate ofpath limits and possible overflows.
* util/ieee1275/ofpath.c (grub_util_info) [STANDALONE]: New function.
(OF_PATH_MAX): Removed.
(MAX_DISK_CAT): New const.
(find_obppath): Use allocated rather than preallocated buffer.
Return result. Argument of_path removed. All users updated.
Add missing fdstat.
(xrealpath): New function.
(block_device_get_sysfs_path_and_link): Remove sysfs argument.
Allocate rather than use preallocated buffer. All users updated.
(__of_path_common): Use allocated rather than preallocatecd buffer.
Return result. Argument of_path removed. All users updated.
(vendor_is_ATA): Read only needed part form the file.
(check_sas): Allocate depending on contents rather than fixed.
(main) [STANDALONE]: Handle NULL result.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:20:02 +0000 (18:20 +0100)]
* grub-core/normal/completion.c (iterate_dev): Close the disk.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:16:48 +0000 (18:16 +0100)]
Cryptodisk write support.
* grub-core/disk/cryptodisk.c (grub_crypto_pcbc_encrypt): New function.
(grub_cryptodisk_decrypt): Moved logic to ...
(grub_cryptodisk_endecrypt): ...this. New argument "encrypt".
(grub_cryptodisk_write): Implement.
* grub-core/kern/emu/hostdisk.c (nwrite): Rename to ...
(grub_util_fd_write): ... this. Make global.
* include/grub/emu/hostdisk.h (grub_util_fd_write): New proto.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 17:09:53 +0000 (18:09 +0100)]
* include/grub/list.h (grub_list_remove): Don't crash if element is
removed twice.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 16:01:27 +0000 (17:01 +0100)]
Rename ofconsole to console.
* grub-core/commands/terminal.c (handle_command): Handle ofconsole
as sysnonym to console.
* grub-core/term/ieee1275/ofconsole.c: Renamed to ..
* grub-core/term/ieee1275/console.c: ... this. All users updated.
Rename grub_ofconsole_ to grub_console_. All users updated
(grub_console_term_output): Rename "ofconsole" to "console".
* grub-core/term/terminfo.c (grub_cmd_terminfo): Handle "ofconsole"
as "console".
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 15:34:39 +0000 (16:34 +0100)]
* grub-core/loader/i386/pc/plan9.c (grub_cmd_plan9): Remove PXE
handling.
* include/grub/disk.h (grub_disk_dev_id): Remove obsolete
GRUB_DISK_DEVICE_UUID_ID, GRUB_DISK_DEVICE_PXE_ID and
GRUB_DISK_DEVICE_FILE_ID.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 15:24:07 +0000 (16:24 +0100)]
* grub-core/kern/partition.c (grub_partition_get_name): Simplify logic
and improve performance.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 15:22:23 +0000 (16:22 +0100)]
* grub-core/kern/ieee1275/openfw.c (grub_ieee1275_encode_devname): Fix
missing ieee1275/ prefix on whole disk.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 15:20:41 +0000 (16:20 +0100)]
* include/grub/powerpc/ieee1275/util/biosdisk.h: Remove.
* include/grub/powerpc/ieee1275/biosdisk.h: Likewise.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 14:36:06 +0000 (15:36 +0100)]
* grub-core/fs/cpio.c (handle_symlink): Fix a bug.
Vladimir 'phcoder' Serbinenko [Sun, 29 Jan 2012 13:28:01 +0000 (14:28 +0100)]
Merge common RAID and LVM logic to an abstract diskfilter.
Add LDM support using the same framework.
* Makefile.util.def (libgrubkern): Add grub-core/disk/ldm.c,
grub-core/disk/diskfilter.c and grub-core/partmap/gpt.c.
(libgrubmods): Remove grub-core/disk/raid.c and
grub-core/partmap/gpt.c.
* grub-core/Makefile.core.def (ldm): New module.
(raid): Renamed to diskfilter. All users updated.
* grub-core/disk/raid.c: Moved to ...
* grub-core/disk/diskfilter.c: ... here.
* grub-core/disk/diskfilter.c: Rename grub_raid_ to grub_diskfilter_.
(lv_num): New var.
(find_array): Renamed to ...
(find_lv): ... this. Support multi-LV. Skip nameless LVs
(grub_is_array_readable): Renamed to ...
(grub_is_lv_readable): ... this. Support multinode hierarchy.
(insert_array): New argument id.
(is_node_readable): New function.
(scan_device): Rename to ...
(scan_disk): .. this. Restrict to one disk.
(scan_devices): New function.
(grub_diskfilter_iterate): Support multi-LV.
Skip invisible and nameless LVs.
(grub_diskfilter_memberlist): Support multi-LV.
(grub_diskfilter_read_node): New function.
(grub_raid_read): Most of logic moved to ...
(read_segment): ... here
(read_lv): New function.
(grub_diskfilter_get_vg_by_uuid): New function.
(grub_diskfilter_make_raid): Likewise.
* grub-core/disk/ldm.c: New file.
* grub-core/disk/lvm.c (vg_list): Removed.
(lv_count): Likewise.
(scan_depth): Likewise.
(is_lv_readable): Likewise.
(grub_lvm_getvalue): Advance pointer past the number.
(find_lv): Removed.
(do_lvm_scan): Refactored into ...
(grub_lvm_detect): ... this. Support raid.
(grub_lvm_iterate): Removed.
(grub_lvm_memberlist): Likewise.
(grub_lvm_open): Likewise.
(grub_lvm_close): Likewise.
(read_lv): Likewise.
(read_node): Likewise.
(is_node_readable): Likewise.
(is_lv_readable): Likewise.
(grub_lvm_read): Likewise.
(grub_lvm_write): Likewise.
(grub_lvm_dev): Use diskfilter
(GRUB_MOD_INIT): Likewise.
(GRUB_MOD_FINI): Likewise.
* grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Use
new interface.
* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Likewise.
* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise.
* grub-core/disk/raid5_recover.c (grub_raid5_recover): Use
grub_diskfilter_read_node.
Fix a bug with xor.
* grub-core/disk/raid6_recover.c (grub_raid6_recover): Use
grub_diskfilter_read_node.
Support GRUB_RAID_LAYOUT_MUL_FROM_POS.
* grub-core/kern/disk.c (grub_disk_dev_list): Make global.
(grub_disk_dev_iterate): Move from here...
* include/grub/disk.h (grub_disk_dev_iterate): ... to here. Inlined.
* grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start):
Make global.
(grub_hostdisk_find_partition_start): Likewise.
(grub_hostdisk_os_dev_to_grub_drive): New function.
(grub_util_biosdisk_get_osdev): Check that disk is biosdisk.
* grub-core/kern/emu/hostdisk.c (make_device_name): Move to ...
* util/getroot.c (make_device_name): ... here.
* grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info):
Move to ...
* util/getroot.c (grub_util_get_dm_node_linear_info): ...here.
* grub-core/kern/emu/hostdisk.c
(convert_system_partition_to_system_disk): Move to ...
* util/getroot.c (convert_system_partition_to_system_disk): ...here.
* grub-core/kern/emu/hostdisk.c (device_is_wholedisk): Move to ...
* util/getroot.c (device_is_wholedisk): ... here.
* grub-core/kern/emu/hostdisk.c (find_system_device): Move to ...
* util/getroot.c (find_system_device): ... here.
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_present):
Move to ...
* util/getroot.c (grub_util_biosdisk_is_present): ...here.
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev):
Move to ...
* util/getroot.c (grub_util_biosdisk_get_grub_dev): ... here.
Handle LDM.
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy):
Move to ...
* util/getroot.c (grub_util_biosdisk_is_floppy): ... here.
* grub-core/partmap/gpt.c (grub_gpt_partition_map_iterate): Made global.
* include/grub/disk.h (grub_disk_dev_id): Replaced RAID and LVM with
DISKFILTER.
* include/grub/raid.h: Renamed to ...
* include/grub/diskfilter.h: ... this.
* include/grub/diskfilter.h: Rename grub_raid_* to grub_diskfilter_*
(GRUB_RAID_LAYOUT_*): Make into array.
(GRUB_RAID_LAYOUT_MUL_FROM_POS): New value.
(grub_diskfilter_vg): New struct.
(grub_diskfilter_pv_id): Likewise.
(grub_raid_member): Removed.
(grub_raid_array): Likewise.
(grub_diskfilter_pv): New struct.
(grub_diskfilter_lv): Likewise.
(grub_diskfilter_segment): Likewise.
(grub_diskfilter_node): Likewise.
(grub_diskfilter_get_vg_by_uuid): New proto.
(grub_raid_register): Inline.
(grub_diskfilter_unregister): Likewise.
(grub_diskfilter_make_raid): New proto.
(grub_diskfilter_vg_register): Likewise.
(grub_diskfilter_read_node): Likewise.
(grub_diskfilter_get_pv_from_disk) [GRUB_UTIL]: Likewise.
* include/grub/emu/hostdisk.h (grub_util_get_ldm): New proto.
(grub_util_is_ldm): Likewise.
(grub_util_ldm_embed) [GRUB_UTIL]: Likewise.
(grub_hostdisk_find_partition_start): Likewise.
(grub_hostdisk_os_dev_to_grub_drive): Likewise.
* include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_LDM):
New definition.
(grub_gpt_partition_map_iterate): New proto.
* include/grub/lvm.h (grub_lvm_vg): Removed.
(grub_lvm_pv): Likewise.
(grub_lvm_lv): Likewise.
(grub_lvm_segment): Likewise.
(grub_lvm_node): Likewise.
* util/getroot.c [...]
* util/grub-probe.c (probe_raid_level): Handle diskfilter.
(probe_abstraction): Likewise.
* util/grub-setup.c (setup): Remove must_embed. Support LDM.
(main): Remove dead logic.
Vladimir 'phcoder' Serbinenko [Sat, 28 Jan 2012 12:26:20 +0000 (13:26 +0100)]
Simplify root device discover and don't fail when trying to open
incorrect devices.
* grub-core/disk/efi/efidisk.c (get_diskname_from_path_real): New
function.
(get_diskname_from_path): Likewise.
(grub_efidisk_get_device_name): Use get_diskname_from_path instead
of iterating.
Vladimir 'phcoder' Serbinenko [Fri, 27 Jan 2012 12:52:48 +0000 (13:52 +0100)]
* grub-core/Makefile.core.def (setpci): Enable on all PCI platforms.
Vladimir 'phcoder' Serbinenko [Fri, 27 Jan 2012 12:50:21 +0000 (13:50 +0100)]
* grub-core/fs/zfs/zfs.c (nvlist_find_value): Check that we don't go
pastthe end.
Vladimir 'phcoder' Serbinenko [Fri, 27 Jan 2012 12:12:00 +0000 (13:12 +0100)]
* util/grub-install.in: Add missing \.
Reported by: gentoofan
Vladimir 'phcoder' Serbinenko [Fri, 27 Jan 2012 12:09:57 +0000 (13:09 +0100)]
* grub-core/fs/squash4.c (xz_decompress): Fix return value.
(direct_read): Use correct compressed size.
(grub_squash_read_data): Likewise.
Vladimir 'phcoder' Serbinenko [Thu, 26 Jan 2012 18:40:47 +0000 (19:40 +0100)]
* docs/grub.texi (Platform limitations): New section.
(Platform-specific operations): Likewise.
* docs/grub-dev.texi (Porting): Likewise.
Vladimir 'phcoder' Serbinenko [Wed, 25 Jan 2012 17:32:08 +0000 (18:32 +0100)]
IEEE1275 disk write support.
* grub-core/kern/ieee1275/ieee1275.c (grub_ieee1275_write): Make buffer
const void *.
* include/grub/ieee1275/ieee1275.h (grub_ieee1275_write): Likewise.
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_read): Move open
and seek loginc to ...
(grub_ofdisk_prepare): ... here.
(grub_ofdisk_write): Implement.
Vladimir 'phcoder' Serbinenko [Wed, 25 Jan 2012 15:13:34 +0000 (16:13 +0100)]
ARC disk write support.
* grub-core/disk/arc/arcdisk.c (handle_writable): New var.
(reopen): New argument writable. All users updated.
Handle required access mode.
(grub_arcdisk_write): Implement.
* include/grub/arc/arc.h (grub_arc_file_access): New enum.
(grub_arc_firmware_vector): Make buffer to write a const buffer.
Vladimir 'phcoder' Serbinenko [Wed, 25 Jan 2012 14:10:56 +0000 (15:10 +0100)]
* grub-core/fs/btrfs.c (grub_btrfs_device): New field size.
(read_sblock): Don't attempt to read superblocks outside the disk size.
Vladimir 'phcoder' Serbinenko [Wed, 25 Jan 2012 14:09:00 +0000 (15:09 +0100)]
* grub-core/fs/nilfs2.c (grub_nilfs2_load_sb): Use device size from
first superblock to find the second one when possible.
Vladimir 'phcoder' Serbinenko [Wed, 25 Jan 2012 14:06:27 +0000 (15:06 +0100)]
* util/grub-install.in: Fix an ARC bug.
Print a warning if no platform-specific setup is available.
Vladimir 'phcoder' Serbinenko [Tue, 24 Jan 2012 13:49:31 +0000 (14:49 +0100)]
Use static allocation rather than scratch pointer in reed_solomon.
It decreases its size significantly and avoids a variable in .text.
* grub-core/lib/reed_solomon.c (scratch): Removed.
(chosenstat): New const or static array.
(sigma): Likewise.
(errpot): Likewise.
(errpos): Likewise.
(sy): Likewise.
(mstat): Likewise.
(errvals): Likewise.
(eqstat): Likewise.
(pol_evaluate): Replace x with log_x argument. All users updated.
(syndroms): Removed.
(gauss_solve): Use statically allocated arrays.
(rs_recover): Likewise.
Calculate syndroms directly.
(decode_block): Use statically allocated arrays.
(grub_reed_solomon_add_redundancy) [TEST]: Fix -DTEST compilation.
(main) [TEST]: Allow -DTEST -DSTANDALONE.
Vladimir 'phcoder' Serbinenko [Tue, 24 Jan 2012 13:39:29 +0000 (14:39 +0100)]
Eliminate fixed limit on reed solomon decoder length.
* grub-core/boot/i386/pc/lnxboot.S: Scan for multiboot signature
rather than hardcoding the address.
* grub-core/boot/i386/pc/startup_raw.S: Add new data field
no_reed_solomon_length.
Move gate_a20 to no-reed-solomon part.
Don't force a particular size of no reed-solomon part.
* include/grub/offsets.h (GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART):
Removed.
(GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH): New define.
* util/grub-setup.c (setup): Read no_rs_length from the image itself.
Vladimir 'phcoder' Serbinenko [Tue, 24 Jan 2012 12:34:36 +0000 (13:34 +0100)]
* grub-core/commands/wildcard.c (match_files): Handle filenames
without explicit device.
(wildcard_expand): Don't add explicit device if not already present.
* tests/grub_script_echo1.in: Add a new expansion test.
Vladimir 'phcoder' Serbinenko [Tue, 24 Jan 2012 12:31:12 +0000 (13:31 +0100)]
Replace single-linked with double-linked lists. It results in more
compact and more efficient code.
* grub-core/kern/list.c (grub_list_push): Moved from here ...
* include/grub/list.h (grub_list_push): ... to here. Set prev.
(grub_list_remove): Moved from here ...
* include/grub/list.h (grub_list_remove): ... here. Use and set prev.
(grub_prio_list_insert): Set prev.
* include/grub/list.h (grub_list): Add prev. All users updated.
Vladimir 'phcoder' Serbinenko [Tue, 24 Jan 2012 12:17:36 +0000 (13:17 +0100)]
Handle newer autotools. Add some missing quotes while on it.
* Makefile.am (pkglib_DATA): Remove update-grub_lib.
(pkglib_DATA): Move grub-mkconfig_lib from here ...
(pkgdata_DATA): ... here.
* Makefile.util.def (update-grub_lib): Removed.
* conf/Makefile.common (pkglib_DATA): Removed.
(pkglib_SCRIPTS): Likewise.
(pkgdata_DATA): New variable.
* tests/util/grub-shell-tester.in: Replace pkglib with pkgdata where
needed.
Add missing quotes.
Remove unused variable while on it.
* tests/util/grub-shell.in: Likewise.
* util/grub-install.in: Likewise.
* util/grub-mkconfig.in: Likewise.
* util/grub-mknetdir.in: Likewise.
* util/grub-mkrescue.in: Likewise.
* util/grub-mkstandalone.in: Likewise.
* util/grub.d/00_header.in: Likewise.
* util/grub.d/10_hurd.in: Likewise.
* util/grub.d/10_illumos.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/10_netbsd.in: Likewise.
* util/grub.d/10_windows.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
* util/grub.d/30_os-prober.in: Likewise.
* util/update-grub_lib.in: Removed.
Seth Goldberg [Tue, 24 Jan 2012 02:01:46 +0000 (03:01 +0100)]
* grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_recv): Relax checks as
a workaround for intel problem.
Paulo de Rezende Pinatti [Mon, 23 Jan 2012 18:33:40 +0000 (19:33 +0100)]
* util/grub-install.in: Support dd'in into PreP partition.
* util/grub-probe.c (probe): Support discovering partition type.
(main): Support -t msdos_parttype.
Also-By: Vladimir Serbinenko <phcoder@gmail.com>
Also-By: pfsmorigo <>
Vladimir 'phcoder' Serbinenko [Mon, 23 Jan 2012 02:39:37 +0000 (03:39 +0100)]
* grub-core/normal/crypto.c (grub_crypto_autoload): Prevent
infinite recursion using counter.
* grub-core/lib/xzembed/xz_dec_stream.c (xz_dec_init): Defer s->crc32
init to skip it if the magic check fails.
(dec_stream_header): Init s->crc32.
Zachary Bedell [Mon, 23 Jan 2012 02:37:06 +0000 (03:37 +0100)]
* grub-core/fs/zfs/zfs.c (uberblock_verify): New parameter size.
All users updated.
(find_bestub): Determine correct size.
(fill_vdev_info_real): Fill ashift. New argument. All users updated.
(scan_disk): Align the size down.
Call check pool before find_bestub to have ashift.
Note: real text was accidently commited 2 commits ago.
Also-By: Richard Laager <rlaager@wiktel.com>
Also-By: Vladimir Serbinenko <phcoder@gmail.com>
Vladimir 'phcoder' Serbinenko [Mon, 23 Jan 2012 02:31:17 +0000 (03:31 +0100)]
* grub-core/lib/relocator.c (malloc_in_range): Remove couple of
dprintf in no-malloc zone.
Note: actual code was already committed by mistake in last commit.
Mario Limonciello [Sun, 22 Jan 2012 15:43:14 +0000 (16:43 +0100)]
* configure.ac: Add back in test for limits.h.
Vladimir 'phcoder' Serbinenko [Fri, 20 Jan 2012 14:01:35 +0000 (15:01 +0100)]
Support 4K-sector NTFS.
* include/grub/ntfs.h (GRUB_NTFS_MAX_MFT): Increase to 8.
(grub_ntfs_data): Remove blocksize.
* grub-core/fs/ntfs.c (fixup): Fix size comparison.
Remove data argument. All users updated.
Vladimir 'phcoder' Serbinenko [Fri, 20 Jan 2012 13:48:26 +0000 (14:48 +0100)]
* grub-core/kern/mips/arc/init.c (grub_total_modules_size): Mark as
being in .text to avoid dprel references.
* include/grub/mips/loongson/kernel.h (grub_arch_machine): Likewise.
* include/grub/mips/loongson/memory.h (grub_arch_memsize): Likewise.
(grub_arch_highmemsize): Likewise.
* include/grub/mips/loongson/time.h (grub_arch_busclock): Likewise.
* include/grub/mips/qemu_mips/memory.h (grub_arch_memsize): Likewise.
* include/grub/mips/time.h (grub_arch_cpuclock): Likewise.
Vladimir 'phcoder' Serbinenko [Wed, 18 Jan 2012 13:04:52 +0000 (14:04 +0100)]
Support powerpc with GCC that defines __PPC__ but not __powerpc__.
* config.h.in (__powerpc__) [__PPC__ && !__powerpc__]: New definition.
* grub-core/lib/setjmp.S: Treat __PPC__ as equivalent to __powerpc__.
Vladimir 'phcoder' Serbinenko [Wed, 18 Jan 2012 13:01:11 +0000 (14:01 +0100)]
* include/grub/datetime.h (grub_get_datetime_cmos): Don't define in
GRUB_UTIL.
(grub_set_datetime_cmos): Likewise.
Vladimir 'phcoder' Serbinenko [Wed, 18 Jan 2012 12:59:03 +0000 (13:59 +0100)]
Make XZ compression parameters dependent on target and not host CPU.
* configure.ac: Define GRUB_TARGET_CPU_XYZ series.
* grub-core/lib/xzembed/xz_config.h: Use GRUB_TARGET_CPU_XYZ.
Vladimir 'phcoder' Serbinenko [Wed, 18 Jan 2012 12:54:59 +0000 (13:54 +0100)]
* grub-core/kern/powerpc/dl.c (grub_arch_dl_get_tramp_got_size): Remove
set but not used variable.