Commit graph

1596 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
e4b7f404d8 * grub-core/kern/corecmd.c (grub_core_cmd_ls): Handle error in parsing
device name.
2012-02-12 19:00:50 +01:00
Vladimir 'phcoder' Serbinenko
e7b02f9ec0 * grub-core/fs/ntfs.c (locate_attr): Avoid set in if.
(grub_ntfs_iterate_dir): Likewise.
2012-02-12 18:47:46 +01:00
Vladimir 'phcoder' Serbinenko
0331e102c9 Efiemu stylistic fixes and gettext.
* grub-core/efiemu/i386/loadcore32.c
	(grub_arch_efiemu_relocate_symbols32): Avoid set in if.
	* grub-core/efiemu/i386/loadcore64.c
	(grub_arch_efiemu_relocate_symbols64): Likewise.
	* grub-core/efiemu/i386/pc/cfgtables.c
	(grub_machine_efiemu_init_tables): Likewise.
	* grub-core/efiemu/loadcore.c (grub_efiemu_resolve_symbols): Likewise.
	(grub_efiemu_loadcore_initXX): Add a filename argument.
	All users updated.
	Improved error message.
	* grub-core/efiemu/loadcore_common.c (grub_efiemu_loadcore_init):
	Add a filename argument.
	All users updated.
	* grub-core/efiemu/symbols.c (grub_efiemu_set_virtual_address_map):
	Reclassify double relocation as GRUB_ERR_BUG.
2012-02-12 18:43:39 +01:00
Vladimir 'phcoder' Serbinenko
306fc0741f * grub-core/commands/i386/pc/play.c (grub_cmd_play): Improve error
handling.
2012-02-12 17:38:13 +01:00
Vladimir 'phcoder' Serbinenko
794d8ef2af * grub-core/commands/hdparm.c (grub_cmd_hdparm): Allow running
on partition.
2012-02-12 17:36:33 +01:00
Vladimir 'phcoder' Serbinenko
d61386e21d Improve string. Gettextize. 2012-02-12 15:25:25 +01:00
Vladimir 'phcoder' Serbinenko
4786a90fee * grub-core/disk/diskfilter.c (grub_diskfilter_print_partmap)
[GRUB_UTIL]: New function.
	(insert_array) [GRUB_UTIL]: Store partmaps.
	* include/grub/diskfilter.h (grub_diskfilter_pv) [GRUB_UTIL]: New member
	partmaps.
	(grub_diskfilter_print_partmap) [GRUB_UTIL]: New proto.
	* util/grub-probe.c (probe_partmap): Call grub_diskfilter_print_partmap.
	(probe_abstraction): Print diskfilter and not raid.
	Reported by: Lennart Sorensen
2012-02-11 11:57:47 +01:00
Vladimir 'phcoder' Serbinenko
b77c2fb725 * grub-core/kern/emu/full.c (grub_arch_dl_get_tramp_got_size): Enable
on powerpc.
	Reported by: Lennart Sorensen
2012-02-11 11:35:54 +01:00
Vladimir 'phcoder' Serbinenko
ebcecdf1c3 Increase warning level.
* conf/Makefile.common (CFLAGS_GNULIB): Add -Wno-redundant-decls
	-Wno-unreachable-code -Wno-conversion -Wno-old-style-definition.
	* configure.ac (HOST_CFLAGS): Add bunch of -W arguments.
	(TARGET_CFLAGS): Likewise.
	(HOST_CFLAGS): Add -Werror unless --disable-werror is activated.
	* grub-core/Makefile.core.def (decompressor_xz): Add
	-Wno-unreachable-code.
	(normal): Add -Wno-redundant-decls.
	(xzio): Add -Wno-unreachable-code.
	(lzopio): Add -Wno-redundant-decls -Wno-error.
	* grub-core/commands/acpi.c: Add exception to -Wcast-align.
	* grub-core/commands/lsacpi.c: Add exception to -Wcast-align.
	* grub-core/gensymlist.sh: Add exception to -Wmissing-format-attribute.
	* grub-core/kern/dl.c: Add exception to -Wcast-align.
	* grub-core/kern/efi/efi.c (grub_efi_modules_addr): Likewise.
	* grub-core/kern/i386/coreboot/init.c: Add exception to
	-Wsuggest-attribute=noreturn.
	* grub-core/kern/ia64/dl.c: Add exception to -Wcast-align.
	* grub-core/kern/ia64/dl_helper.c: Likewise.
	* grub-core/kern/mips/dl.c: Likewise.
	* grub-core/kern/sparc64/dl.c: Likewise.
	* grub-core/lib/LzmaEnc.c: Add exception to -Wshadow.
	* grub-core/lib/libgcrypt_wrap/cipher_wrap.h (memcpy): Likewise.
	(memcmp): Likewise.
	* grub-core/lib/pbkdf2.c: Add exception to -Wunreachable-code.
	* grub-core/loader/ia64/efi/linux.c: Add exception to -Wcast-align.
	* grub-core/loader/mips/linux.c: Likewise.
	* grub-core/loader/multiboot_elfxx.c: Likewise.
	* grub-core/script/parser.y: Add exception to -Wunreachable-code.
	* grub-core/video/sm712.c: Add exception to -Wcast-align.
	* util/import_gcry.py: Add -Wno-cast-align to modules checked by hand.
	* grub-core/font/font.c (grub_font_loader_init): Add explicit cast and
	fixme.
	* grub-core/fs/iso9660.c (grub_iso9660_iterate_dir): Likewise.
	* grub-core/kern/i386/multiboot_mmap.c (grub_machine_mmap_init):
	Fix prototype.
2012-02-10 16:48:48 +01:00
Vladimir 'phcoder' Serbinenko
37bb97fe9a * grub-core/lib/i386/relocator16.S: Fix incorrect use of absolute
address.
2012-02-10 14:47:06 +01:00
Vladimir 'phcoder' Serbinenko
29a3550b61 * grub-core/commands/legacycfg.c (grub_cmd_legacy_kernel):
Avoid improper use of strings.
	(grub_cmd_legacy_initrdnounzip): Likewise.
2012-02-10 14:30:19 +01:00
Vladimir 'phcoder' Serbinenko
7e94d044ad * grub-core/disk/geli.c (grub_md_sha256_real): Respect format security.
(grub_md_sha512_real): Likewise.
	(grub_util_get_geli_uuid): Likewise.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Likewise.
	(grub_util_biosdisk_open): Fix format specification.
	Respect format security.
	* grub-core/kern/emu/misc.c (xmalloc): Respect format security.
	(xrealloc): Likewise.
	(xasprintf): Likewise.
2012-02-10 14:01:53 +01:00
Vladimir 'phcoder' Serbinenko
31a2600267 * grub-core/partmap/bsdlabel.c (iterate_real): Fix freeing of static
buffer.
2012-02-10 12:43:11 +01:00
Vladimir 'phcoder' Serbinenko
a655c182c5 * grub-core/disk/ldm.c (grub_util_get_ldm): Remove unused variables.
(grub_util_ldm_embed): Likewise.
2012-02-10 12:40:22 +01:00
Vladimir 'phcoder' Serbinenko
6fa679671e * grub-core/disk/ldm.c (grub_util_get_ldm): Remove unused variables.
(grub_util_ldm_embed): Likewise.
2012-02-10 12:36:02 +01:00
Vladimir 'phcoder' Serbinenko
4f96abd198 * grub-core/script/lexer.c (grub_script_lexer_init): Rename getline
to arg_getline to avoid shadowing.
2012-02-10 12:25:27 +01:00
Vladimir 'phcoder' Serbinenko
44d10dada6 * grub-core/partmap/gpt.c (gpt_partition_map_embed): Rename disk to
disk_ to avoid shadowing.
2012-02-10 12:24:03 +01:00
Vladimir 'phcoder' Serbinenko
340ba63ede * grub-core/lib/LzFind.c (MatchFinder_GetIndexByte): Rename index to
curindex to avoid shadowing.
	Make static.
	(MatchFinder_GetNumAvailableBytes): Make static.
2012-02-10 12:21:28 +01:00
Vladimir 'phcoder' Serbinenko
22965bce9b * grub-core/fs/squash4.c (direct_read): Rename read to curread to
avoid shadowing.
2012-02-10 12:17:40 +01:00
Vladimir 'phcoder' Serbinenko
7b5784d4d3 * grub-core/disk/cryptodisk.c (grub_cryptodisk_endecrypt): Rename
argument from encrypt to do_encrypt to avoid shadowing.
2012-02-10 12:11:50 +01:00
Vladimir 'phcoder' Serbinenko
6f48ca0143 * grub-core/loader/multiboot_elfxx.c (grub_multiboot_load_elf): Fix
incorrect nesting of #if's.
2012-02-09 23:53:27 +01:00
Vladimir 'phcoder' Serbinenko
a4ea2dff4b * grub-core/commands/lsacpi.c (disp_acpi_xsdt_table): #if'-out the
checks which are always false on some platforms.
	(grub_cmd_lsacpi): Likewise.
	* grub-core/kern/misc.c (grub_strtoul): Likewise.
	* grub-core/loader/multiboot.c (grub_multiboot_set_video_mode):
	Likewise.
2012-02-09 23:48:34 +01:00
Vladimir 'phcoder' Serbinenko
def9fc1bb2 * grub-core/disk/diskfilter.c (read_segment): Renome unreachable code.
* grub-core/net/ip.c (grub_net_recv_ip4_packets): Likewise.
2012-02-09 23:43:43 +01:00
Vladimir 'phcoder' Serbinenko
a67b2a046c * grub-core/gnulib/regex.h (re_pattern_buffer): Declare buffer as
re_dfa_t to avoid breaking alignment invariants.
	* grub-core/gnulib/regex_internal.h (re_dfa_t): Moved to ...
	* grub-core/gnulib/regex.h (re_dfa_t): ... here.
2012-02-09 23:40:17 +01:00
Vladimir 'phcoder' Serbinenko
44c6828db4 * grub-core/loader/i386/xnu.c (grub_xnu_boot): Fix printf.
* grub-core/loader/ia64/efi/linux.c (grub_cmd_fpswa): Likewise.
2012-02-09 23:32:03 +01:00
Vladimir 'phcoder' Serbinenko
bebe0dd022 * grub-core/kern/i386/qemu/mmap.c (grub_machine_mmap_init):
Fix declaration.
2012-02-09 23:25:14 +01:00
Vladimir 'phcoder' Serbinenko
a9cdb3cf18 * grub-core/bus/usb/ehci.c (grub_ehci_ehcc_read32): Restructure to
conserve alignment invariants.
	(grub_ehci_ehcc_read16): Likewise.
	(grub_ehci_oper_read32): Likewise.
	(grub_ehci_oper_write32): Likewise.
	(grub_ehci_pci_iter) [!GRUB_HAVE_UNALIGNED_ACCESS]: Check alignment.
	Conserve alignment invariants.
2012-02-09 23:18:53 +01:00
Vladimir 'phcoder' Serbinenko
ccc3b1b898 * grub-core/kern/emu/full.c (grub_emu_post_init): Remove raid reinit.
* include/grub/disk.h [GRUB_MACHINE_EMU]: Remove now useless LVM/RAID
	declarations.
2012-02-09 23:15:27 +01:00
Vladimir 'phcoder' Serbinenko
987fbd95d0 * grub-core/kern/emu/hostfs.c (grub_hostfs_close):
Remove unused variable.
2012-02-09 23:12:09 +01:00
Vladimir 'phcoder' Serbinenko
0df363f328 * grub-core/efiemu/loadcore_common.c (grub_efiemu_loadcore_load):
Remove set in if.
2012-02-09 22:57:51 +01:00
Vladimir 'phcoder' Serbinenko
690c531fc5 Remove "payload" command in ia64 Linux loader since I couldn't
find any evidence of it being used for anything.
	Replace "relocate" command with an environment variable

	* grub-core/loader/ia64/efi/linux.c (ia64_boot_param): Remove extra
	fields.
	(ia64_boot_payload): Removed.
	(last_payload): Likewise.
	(RELOCATE_OFF): Likewise.
	(RELOCATE_ON): Likewise.
	(RELOCATE_FORCE): Likewise.
	(relocate): Likewise.
	(free_pages): Don't free payloads.
	(grub_load_elf64): Use common error messages.
	Use "linux_relocate" variable.
	Increase the space after boot_params.
	(grub_cmd_payload): Removed.
	(grub_cmd_relocate): Likewise.
	(grub_cmd_fpswa): Improve messages.
	(cmd_payload): Removed.
	(cmd_relocate): Likewise.
	(GRUB_MOD_INIT): Don't register "payload" and "relocate".
	(GRUB_MOD_FINI): Don't unregister "payload" and "relocate".
2012-02-09 15:09:40 +01:00
Vladimir 'phcoder' Serbinenko
01783768d2 Convert UHCI to DMA framework.
* grub-core/bus/usb/uhci.c (grub_uhci): Add chunk and phys members.
	(grub_uhci_pci_iter): Fill new members
	(grub_alloc_td): Use P2V and V2P functions.
	(grub_free_queue): Likewise.
	(grub_alloc_qh): Likewise.
	(grub_uhci_setup_transfer): Likewise.
	(grub_uhci_check_transfer): Likewise.
2012-02-09 15:00:05 +01:00
Vladimir 'phcoder' Serbinenko
432069398f * grub-core/video/colors.c (grub_video_parse_color): Fix error message.
Remove assignment in if while on it.
2012-02-09 14:48:35 +01:00
Vladimir 'phcoder' Serbinenko
e4e37e8dfa Fix `help' with unloaded modules.
* include/grub/normal.h (grub_dyncmd_get_cmd): New proto.
	* grub-core/normal/dyncmd.c (grub_dyncmd_get_cmd): New function.
	(grub_dyncmd_dispatcher): Small stylistic fix.
	* grub-core/commands/help.c (grub_cmd_help): Load missing modules when
	explicit help is requested.
2012-02-09 14:38:34 +01:00
Vladimir 'phcoder' Serbinenko
e1ea3ade95 * grub-core/fs/cpio.c (grub_cpio_dir): Fix a bug with multiple listing.
Explicitly init restart while on it.
2012-02-09 14:27:05 +01:00
Vladimir 'phcoder' Serbinenko
275568816c * grub-core/lib/posix_wrap/wchar.h (mbrtowc): Set pwc to zero to avoid
uninited variable.
2012-02-09 14:24:55 +01:00
Vladimir 'phcoder' Serbinenko
ce6647c83c * grub-core/kern/partition.c (grub_partition_get_name): Fix uninited
variable.
2012-02-08 20:19:44 +01:00
Vladimir 'phcoder' Serbinenko
667478942a * grub-core/commands/hdparm.c (grub_cmd_hdparm): Accept device name
without quotes.
2012-02-08 20:12:41 +01:00
Vladimir 'phcoder' Serbinenko
71645f6ec2 * grub-core/net/net.c (GRUB_MOD_INIT): Don't register netfs. 2012-02-08 20:10:17 +01:00
Vladimir 'phcoder' Serbinenko
0e1c1f61b6 * grub-core/kern/partition.c (grub_partition_get_name): Fix reverse
iteration of partitions.
2012-02-08 19:53:46 +01:00
Vladimir 'phcoder' Serbinenko
9c4b5c13e6 Improve gettext support. Stylistic fixes and error handling fixes while
on it.
2012-02-08 19:26:01 +01:00
Vladimir 'phcoder' Serbinenko
215c90cb82 * grub-core/lib/i386/relocator16.S: Revert moving A20 code into PM
part. Instead setup the correct stack in RM.
	* grub-core/lib/i386/relocator.c (grub_relocator16_boot): Reserve place
	for stack.
	* include/grub/i386/relocator_private.h: New file.
2012-02-07 22:31:14 +01:00
Vladimir 'phcoder' Serbinenko
b5c1f9bf41 * grub-core/commands/minicmd.c (GRUB_MOD_INIT): Add missing SIZE
argument.
	* util/grub-fstest.c (options): Add missing DEVICE part.
2012-02-05 11:32:11 +01:00
Vladimir 'phcoder' Serbinenko
b525fd834d Clarify and unify messages.
* grub-core/commands/hashsum.c (options): Unify messages.
	* grub-core/commands/keystatus.c (GRUB_MOD_INIT): Don't mark a
	literal-only message as translatable.
	* grub-core/commands/lsacpi.c (GRUB_MOD_INIT): Likewise.
	* grub-core/loader/ia64/efi/linux.c (GRUB_MOD_INIT): Likewise.
	* grub-core/commands/legacycfg.c (GRUB_MOD_INIT): Add quoting around
	commands.
	* grub-core/commands/menuentry.c (options): Clarify that it's a keyboard
	key, not the key used to unlock. Clarify what it's used for.
	* grub-core/kern/emu/hostdisk.c (read_device_map): Unify error message.
	* grub-core/loader/xnu.c (grub_xnu_load_driver): Remove erroneous colon.
	* grub-core/script/main.c (GRUB_MOD_INIT): Clarify [n] to be [NUM].
	* util/grub-editenv.c (options): Unify "verbose" message.
	* util/grub-fstest.c (read_file): Unify error message.
	(fstest): Add quotes around commands.
	(options): Unify "verbose" message.
	* util/grub-install.in: Add quotes around variable name.
	* util/grub-kbdcomp.in: Unify error message.
	* util/grub-mkfont.c (main): Likewise.
	* util/grub-mkrescue.in: Likewise.
	* util/grub-mklayout.c (options): Unify "verbose" message.
	* util/grub-mkstandalone.in: Unify help and verbose messages.
	* util/grub-mount.c (options): Unify "verbose" message.
	* util/grub-probe.c (options): Likewise.
	* util/grub-script-check.c (options): Likewise.
	* util/grub-setup.c (setup): Unify no-terminator message.
	(options): Use DEVICE and not DEV.
	Unify "verbose" message.
	* util/ieee1275/ofpath.c (xrealpath): Unify error message.
2012-02-05 11:23:47 +01:00
Vladimir 'phcoder' Serbinenko
0ae70393ba Improve and unify messages.
* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Add argument
	name. All users updated.
	Print filename in error.
	(read_device_map): Print filename in error.
	* util/getroot.c (grub_guess_root_devices): Print filename in error.
	(grub_util_get_os_disk): Likewise.
	(grub_util_biosdisk_get_grub_dev): Likewise.
	(grub_util_check_block_device): Likewise.
	(grub_util_check_char_device): Likewise.
	(grub_make_system_path_relative_to_its_root): Likewise.
	* util/grub-editenv.c (create_envblk_file): Likewise.
	(open_envblk_file): Likewise.
	(write_envblk): Likewise.
	* util/grub-fstest.c (cmd_cp): Likewise.
	(cmd_cat): Likewise.
	(cmd_cmp): Likewise.
	* util/grub-menulst2cfg.c (main): Likewise.
	* util/grub-mkfont.c (write_font_ascii_bitmap): Likewise.
	(write_font_width_spec): Likewise.
	(write_font_pf2): Likewise.
	* util/grub-mkimage.c (generate_image): New argument outname.
	All users updated.
	Remove unreacheable message.
	(options): Unify messages.
	(help_filter): Likewise.
	* util/grub-mklayout.c (usage): Removed (unused).
	(main): Print filename in error.
	* util/grub-mkrescue.in: Fix wrong quoting.
	* util/grub-setup.c (setup): Print filename in error.
	* util/ieee1275/ofpath.c (vendor_is_ATA): Likewise.
	(check_sas): Likewise.
	* util/misc.c (grub_util_get_fp_size): Removed.
	(grub_util_get_image_size): Print filename in error.
	(grub_util_read_at): Removed.
	(grub_util_read_image): Print filename in error.
	(grub_util_load_image): Likewise.
	(grub_util_write_image_at): New argument filename. All users updated.
	Print filename in error.
	(grub_util_write_image): New argument filename. All users updated.
	Print filename in error.
	* util/raid.c (grub_util_raid_getmembers): Print filename in error.
	* util/resolve.c (grub_util_resolve_dependencies): Likewise.
2012-02-05 11:07:33 +01:00
Vladimir 'phcoder' Serbinenko
0a96117de7 * grub-core/Makefile.core.def (pxechain): New module.
* grub-core/loader/i386/pc/pxechainloader.c: New file.
	* grub-core/net/drivers/i386/pc/pxe.c (grub_pxe_get_cached): New
	function.
	(grub_pc_net_config_real): Use grub_pxe_get_cached.
	* include/grub/i386/pc/pxe.h (grub_pxe_get_cached): New proto.
2012-02-05 10:33:52 +01:00
Vladimir 'phcoder' Serbinenko
aca002f7e4 * grub-core/kern/err.c (GRUB_MAX_ERRMSG): Move to ...
* include/grub/err.h (GRUB_MAX_ERRMSG): ... here.
	* include/grub/err.h (grub_error_saved): New struct.
	(grub_errmsg): Make array size explicit.
	* include/grub/misc.h (grub_error_save): New function.
	(grub_error_load): Likewise.
	* grub-core/kern/err.c (grub_error_stack_items): Use grub_error_saved.
	(grub_error_push): Update `errno' member name.
	(grub_error_pop): Likewise
	* grub-core/net/tftp.c (tftp_data): New member save_err.
	(tftp_receive): Save error.
	(tftp_open): Restore error.
2012-02-05 10:24:53 +01:00
Vladimir 'phcoder' Serbinenko
a51dab1328 * grub-core/lib/i386/relocator16.S (grub_relocator16_start): Move switch
to real mode down to execute A20-related code in protected mode as
	intended.
2012-02-05 10:12:18 +01:00
Grégoire Sutre
eb6e664936 * grub-core/disk/diskfilter.c (grub_diskfilter_make_raid): Return
NULL when the argument `level' has an unexpected value.
2012-02-05 01:22:04 +01:00
Vladimir 'phcoder' Serbinenko
92cd0f6e45 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.
2012-02-04 21:47:29 +01:00