Merge multiterm into gfxmenu+multiterm

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-01-05 16:34:10 +01:00
commit e6e86df1de
238 changed files with 3524 additions and 1873 deletions

737
ChangeLog
View File

@ -1,4 +1,713 @@
2009-12-23 Felix Zielcke <fzielcke@z-51.de>
2010-01-05 Colin Watson <cjwatson@ubuntu.com>
* util/mkisofs/write.c (padblock_write): Check return value of
fread.
2010-01-05 Robert Millan <rmh.grub@aybabtu.com>
Remove grub-mkfloppy. Images produced by grub-mkrescue are valid
floppy images now.
* util/i386/pc/grub-mkfloppy.in: Remove. Update all users.
2010-01-04 Robert Millan <rmh.grub@aybabtu.com>
* disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Use ALIGN_UP macro
instead of manual alignment.
* kern/disk.c (grub_disk_read): Remove grub_dprintf call (excessively
verbose). Avoid attempts to read past end of the device
(grub_disk_adjust_range() guarantees that we can read `size' bytes,
but GRUB_DISK_CACHE_SIZE may exceed that).
2010-01-04 Robert Millan <rmh.grub@aybabtu.com>
* commands/crc.c (grub_cmd_crc): Abort on read errors.
* fs/iso9660.c (grub_iso9660_read): Check for read error and pass
it to upper layer.
2010-01-04 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/efi/api.h (GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE):
New constant.
(grub_efi_piwg_device_path): New structure
(grub_efi_piwg_device_path_t): New type.
* loader/efi/appleloader.c (piwg_full_device_path): New structure.
(devpath_1): Transform to a structure. All users updated.
(devpath_2): Likewise.
(devpath_3): Likewise.
(devpath_4): Likewise.
(devpath_5): Likewise.
2010-01-04 Vladimir Serbinenko <phcoder@gmail.com>
* loader/efi/appleloader.c: Restored. Update all users.
2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* boot/i386/pc/diskboot.S: Fix inaccurate comment.
* util/i386/pc/grub-setup.c: Include `<assert.h>'.
(struct boot_blocklist): Move from here ...
* include/grub/i386/pc/boot.h [ASM_FILE]
(struct grub_boot_blocklist): ... to here. Update all users.
(setup): Only initialize `start' member of `first_block'
structure. Add assert() calls to verify the other members.
* util/i386/pc/grub-mkimage.c: Include `<assert.h>'.
(generate_image): Fix broken blocklist length initialization.
Add assert() call to verify blocklist `segment' field.
2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* loader/efi/appleloader.c: Remove. Update all users.
2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* boot/i386/pc/boot.S: Update copyright year.
* boot/i386/pc/cdboot.S: Likewise.
* boot/i386/pc/diskboot.S: Likewise.
* boot/i386/pc/lnxboot.S: Likewise.
* boot/i386/pc/pxeboot.S: Likewise.
* bus/pci.c: Likewise.
* commands/cmp.c: Likewise.
* commands/help.c: Likewise.
* commands/hexdump.c: Likewise.
* commands/i386/pc/halt.c: Likewise.
* commands/i386/pc/play.c: Likewise.
* commands/i386/pc/vbeinfo.c: Likewise.
* commands/ls.c: Likewise.
* commands/test.c: Likewise.
* disk/dmraid_nvidia.c: Likewise.
* disk/i386/pc/biosdisk.c: Likewise.
* disk/ieee1275/nand.c: Likewise.
* disk/ieee1275/ofdisk.c: Likewise.
* disk/lvm.c: Likewise.
* disk/raid.c: Likewise.
* disk/raid6_recover.c: Likewise.
* disk/scsi.c: Likewise.
* fs/affs.c: Likewise.
* fs/cpio.c: Likewise.
* fs/ext2.c: Likewise.
* fs/hfs.c: Likewise.
* fs/iso9660.c: Likewise.
* fs/ntfs.c: Likewise.
* fs/sfs.c: Likewise.
* fs/udf.c: Likewise.
* fs/ufs.c: Likewise.
* fs/xfs.c: Likewise.
* gencmdlist.sh: Likewise.
* genmk.rb: Likewise.
* include/grub/disk.h: Likewise.
* include/grub/efi/api.h: Likewise.
* include/grub/efi/efi.h: Likewise.
* include/grub/efi/pe32.h: Likewise.
* include/grub/elf.h: Likewise.
* include/grub/fs.h: Likewise.
* include/grub/i386/at_keyboard.h: Likewise.
* include/grub/i386/pc/memory.h: Likewise.
* include/grub/i386/pc/vbe.h: Likewise.
* include/grub/i386/pci.h: Likewise.
* include/grub/i386/tsc.h: Likewise.
* include/grub/ieee1275/ieee1275.h: Likewise.
* include/grub/ntfs.h: Likewise.
* include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
* include/grub/sparc64/libgcc.h: Likewise.
* include/grub/symbol.h: Likewise.
* include/grub/types.h: Likewise.
* include/multiboot2.h: Likewise.
* io/gzio.c: Likewise.
* kern/device.c: Likewise.
* kern/disk.c: Likewise.
* kern/efi/efi.c: Likewise.
* kern/efi/mm.c: Likewise.
* kern/elf.c: Likewise.
* kern/file.c: Likewise.
* kern/i386/dl.c: Likewise.
* kern/i386/pc/init.c: Likewise.
* kern/i386/pc/startup.S: Likewise.
* kern/ieee1275/ieee1275.c: Likewise.
* kern/ieee1275/init.c: Likewise.
* kern/main.c: Likewise.
* kern/mm.c: Likewise.
* kern/powerpc/dl.c: Likewise.
* kern/sparc64/dl.c: Likewise.
* kern/x86_64/dl.c: Likewise.
* lib/hexdump.c: Likewise.
* loader/efi/appleloader.c: Likewise.
* loader/i386/ieee1275/linux.c: Likewise.
* loader/i386/pc/chainloader.c: Likewise.
* loader/i386/pc/linux.c: Likewise.
* loader/i386/pc/multiboot2.c: Likewise.
* loader/ieee1275/multiboot2.c: Likewise.
* loader/multiboot2.c: Likewise.
* loader/multiboot_loader.c: Likewise.
* loader/powerpc/ieee1275/linux.c: Likewise.
* normal/completion.c: Likewise.
* normal/menu_entry.c: Likewise.
* partmap/apple.c: Likewise.
* util/grub.d/10_hurd.in: Likewise.
* util/hostfs.c: Likewise.
* video/readers/png.c: Likewise.
2010-01-03 Colin Watson <cjwatson@ubuntu.com>
* include/grub/misc.h (GNUC_PREREQ): New macro.
(ATTRIBUTE_ERROR): New macro.
* include/grub/list.h (grub_bad_type_cast_real): Use
ATTRIBUTE_ERROR.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* normal/menu_text.c (print_message): Change messages.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* normal/menu_entry.c (store_completion): Gettextizze.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* kern/env.c (grub_env_unset): Set the variable to "" if has hooks.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* po/POTFILES: Sort correctly.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* commands/acpi.c (GRUB_MOD_INIT): Capitalise some words from help.
* commands/efi/loadbios.c (GRUB_MOD_INIT): Capitalise BIOS.
* commands/i386/pc/drivemap.c (GRUB_MOD_INIT): Remove space. Add
full stop.
* commands/loadenv.c (GRUB_MOD_INIT): Remove command name from
summary. Gettextizze the strings.
* commands/probe.c (grub_cmd_probe): Capitalise UUID and FS.
* commands/xnu_uuid.c (GRUB_MOD_INIT): Capitalise XNU.
* disk/loopback.c (grub_arg_options): Capitalise first letter. Add
full stop.
(GRUB_MOD_INIT): Remove command name from summary.
* hello/hello.c (GRUD_MOT_INIT): Add missing full stop. Improve the
summary.
* loader/i386/bsd.c (grub_arg_option): Capitalise CDROM.
* term/i386/pc/serial.c (options): Add full stops.
(GRUB_MOD_INIT): Remove command name from the summary.
2010-01-03 Carles Pina i Estany <carles@pina.cat>
* commands/acpi.c: Gettextizze help strings and/or options. Include
`grub/i18n.h' if needed.
* commands/blocklist.c: Likewise.
* commands/boot.c: Likewise.
* commands/cat.c: Likewise.
* commands/cmp.c: Likewise.
* commands/configfile.c: Likewise.
* commands/crc.c: Likewise.
* commands/date.c: Likewise.
* commands/echo.c: Likewise.
* commands/efi/fixvideo.c: Likewise.
* commands/efi/loadbios.c: Likewise.
* commands/gptsync.c: Likewise.
* commands/halt.c: Likewise.
* commands/handler.c: Likewise.
* commands/hdparm.c: Likewise.
* commands/hexdump.c: Likewise.
* commands/i386/cpuid.c: Likewise.
* commands/i386/pc/drivemap.c: Likewise.
* commands/i386/pc/halt.c: Likewise.
* commands/i386/pc/pxecmd.c: Likewise.
* commands/i386/pc/vbeinfo.c: Likewise.
* commands/i386/pc/vbetest.c: Likewise.
* commands/ieee1275/suspend.c: Likewise.
* commands/keystatus.c: Likewise.
* commands/loadenv.c: Likewise.
* commands/ls.c: Likewise.
* commands/lsmmap.c: Likewise.
* commands/lspci.c: Likewise.
* commands/memrw.c: Likewise.
* commands/minicmd.c: Likewise.
* commands/parttool.c: Likewise.
* commands/password.c: Likewise.
* commands/probe.c: Likewise.
* commands/read.c: Likewise.
* commands/reboot.c: Likewise.
* commands/search.c: Likewise.
* commands/sleep.c: Likewise.
* commands/test.c: Likewise.
* commands/true.c: Likewise.
* commands/usbtest.c: Likewise.
* commands/videotest.c: Likewise.
* commands/xnu_uuid.c: Likewise.
* disk/loopback.c: Likewise.
* hello/hello.c: Likewise.
* loader/i386/bsd.c: Likewise.
* term/i386/pc/serial.c: Likewise.
* po/POTFILES: Add new files.
2010-01-02 Colin Watson <cjwatson@ubuntu.com>
* term/i386/pc/at_keyboard.c
(keyboard_controller_wait_untill_ready): Rename to ...
(keyboard_controller_wait_until_ready): ... this. Update all users.
2010-01-01 Carles Pina i Estany <carles@pina.cat>
* commands/help.c: Include `grub/mm.h' and `grub/normal.h'.
(grub_cmd_help): Print the cmd->name before the cmd->summary. Cut the
string using string width.
* normal/menu_text.c (grub_print_message_indented): Use
grub_print_spaces and not print_spaces.
(print_timeout): Likewise.
(print_spaces): Move to...
* include/grub/term.h: ... here. Change the name to grub_print_spaces.
2010-01-01 Robert Millan <rmh.grub@aybabtu.com>
Import from Gnulib.
* gnulib/getdelim.c: New file.
* gnulib/getline.c: Likewise.
2009-12-31 BVK Chaitanya <bvk.groups@gmail.com>
* include/grub/list.h (grub_assert_fail): Removed.
(grub_bad_type_cast_real): New function.
(grub_bad_type_cast): New macro.
(GRUB_AS_LIST): Use grub_bad_type_cast.
(GRUB_AS_LIST_P): Likewise.
(GRUB_AS_NAMED_LIST): Likewise.
(GRUB_AS_NAMED_LIST_P): Likewise.
(GRUB_AS_PRIO_LIST): Likewise.
(GRUB_AS_PRIO_LIST_P): Likewise.
* include/grub/handler.h (GRUB_AS_HANDLER): Likewise.
2009-12-29 Vladimir Serbinenko <phcoder@gmail.com>
* loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT (linux)):
Fix syntax error.
2009-12-29 Robert Millan <rmh.grub@aybabtu.com>
* configure.ac: Check for TARGET_CFLAGS initialization before we
initialize it ourselves (sigh).
Move a few modifications to TARGET_CFLAGS to be unconditional
(extra warning flags, loop alignment, i386 CPU extensions, GCC 4.4
eh_frame)
* gettext/gettext.c (grub_gettext_delete_list): Add `void' argument.
* term/i386/pc/at_keyboard.c
(keyboard_controller_wait_untill_ready): Likewise.
(keyboard_controller_led): Rename `led_status' paramter to avoid
name conflict.
2009-12-28 Carles Pina i Estany <carles@pina.cat>
* normal/misc.c (grub_normal_print_device_info): Add spaces and double
quotes.
2009-12-27 Vladimir Serbinenko <phcoder@gmail.com>
* kern/parser.c (grub_parser_split_cmdline): Don't dereference NULL.
2009-12-27 Vladimir Serbinenko <phcoder@gmail.com>
* normal/menu_text.c (grub_print_message_indented): Prevent
past-the-end-of-array dereference.
2009-12-27 Vladimir Serbinenko <phcoder@gmail.com>
* video/readers/jpeg.c (GRUB_MOD_FINI (grub_cmd_jpegtest)): Rename to ..
(GRUB_MOD_FINI (video_reader_jpeg)): ...this
2009-12-27 Carles Pina i Estany <carles@pina.cat>
* normal/cmdline.c (grub_cmdline_get): Print a space after prompt.
* normal/main.c (grub_normal_read_line): Remove a space from the
default prompt.
2009-12-27 Carles Pina i Estany <carles@pina.cat>
* loader/i386/efi/linux.c (GRUB_MOD_INIT): Improve command summary.
* loader/i386/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/i386/linux.c (GRUB_MOD_INIT): Likewise.
* loader/i386/pc/linux.c (GRUB_MOD_INIT): Likewise.
* loader/powerpc/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/xnu.c (GRUB_MOD_INIT): Likewise.
2009-12-26 Carles Pina i Estany <carles@pina.cat>
* video/readers/jpeg.c (cmd): Declare.
(grub_cmd_jpegtest): Use `grub_command_t' type.
(GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'.
Assign to `cmd'.
(GRUB_MOD_FINI): Use `cmd' to unregister.
* video/readers/png.c (cmd): Declare.
(grub_cmd_pngtest): Use `grub_command_t' type.
(GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'.
Assign to `cmd'.
(GRUB_MOD_FINI): Use `cmd' to unregister.
* video/readers/tga.c (cmd): Declare.
(grub_cmd_tgatest): Use `grub_command_t' type.
(GRUB_MOD_INIT): Fix arguments passed to `grub_register_command'.
Assign to `cmd'.
(GRUB_MOD_FINI): Use `cmd' to unregister.
2009-12-26 Carles Pina i Estany <carles@pina.cat>
* efiemu/main.c (GRUB_MOD_INIT): Fix capitalizations and/or full
stops.
* kern/corecmd.c (grub_register_core_commands): Likewise.
* loader/efi/chainloader.c (GRUB_MOD_INIT): Likewise.
* loader/i386/bsd.c (GRUB_MOD_INIT): Likewise.
* loader/i386/efi/linux.c (GRUB_MOD_INIT): Likewise.
* loader/i386/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/i386/linux.c (GRUB_MOD_INIT): Likewise.
* loader/i386/pc/chainloader.c (GRUB_MOD_INIT): Likewise.
* loader/i386/pc/linux.c (GRUB_MOD_INIT): Likewise.
* loader/multiboot_loader.c (GRUB_MOD_INIT): Likewise.
* loader/powerpc/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/sparc64/ieee1275/linux.c (GRUB_MOD_INIT): Likewise.
* loader/xnu.c (GRUB_MOD_INIT): Likewise.
* mmap/mmap.c (GRUB_MOD_INIT): Likewise.
* normal/handler.c (insert_handler): Likewise.
* normal/main.c (GRUB_MOD_INIT): Likewise.
* term/gfxterm.c (GRUB_MOD_INIT): Likewise.
2009-12-26 Carles Pina i Estany <carles@pina.cat>
* commands/help.c (grub_cmd_help): Print the command name before the
summary.
(GRUB_MOD_INIT): Remove command name from the summary.
* kern/command.c (GRUB_MOD_INIT): If summary is null assign an empty
string as summary.
* lib/arg.c (find_long): Print the command name before the summary.
* commands/acpi.c (GRUB_MOD_INIT): Remove command name from the
summary.
* commands/blocklist.c (GRUB_MOD_INIT): Likewise.
* commands/cat.c (GRUB_MOD_INIT): Likewise.
* commands/cmp.c (GRUB_MOD_INIT): Likewise.
* commands/configfile.c (GRUB_MOD_INIT): Likewise.
* commands/crc.c (GRUB_MOD_INIT): Likewise.
* commands/date.c (GRUB_MOD_INIT): Likewise.
* commands/echo.c (GRUB_MOD_INIT): Likewise.
* commands/efi/loadbios.c (GRUB_MOD_INIT): Likewise.
* commands/gptsync.c (GRUB_MOD_INIT): Likewise.
* commands/handler.c (GRUB_MOD_INIT): Likewise.
* commands/hdparm.c (GRUB_MOD_INIT): Likewise.
* commands/hexdump.c (GRUB_MOD_INIT): Likewise.
* commands/i386/cpuid.c (GRUB_MOD_INIT): Likewise.
* commands/i386/pc/halt.c (GRUB_MOD_INIT): Likewise.
* commands/i386/pc/play.c (GRUB_MOD_INIT): Likewise.
* commands/i386/pc/pxecmd.c (GRUB_MOD_INIT): Likewise.
* commands/keystatus.c (GRUB_MOD_INIT): Likewise.
* commands/loadenv.c (GRUB_MOD_INIT): Likewise.
* commands/ls.c (GRUB_MOD_INIT): Likewise.
* commands/lspci.c (GRUB_MOD_INIT): Likewise.
* commands/memrw.c (GRUB_MOD_INIT): Likewise.
* commands/minicmd.c (GRUB_MOD_INIT): Likewise.
* commands/parttool.c (GRUB_MOD_INIT): Likewise.
* commands/password.c (GRUB_MOD_INIT): Likewise.
* commands/probe.c (GRUB_MOD_INIT): Likewise.
* commands/read.c (GRUB_MOD_INIT): Likewise.
* commands/search.c (GRUB_MOD_INIT): Likewise.
* commands/sleep.c (GRUB_MOD_INIT): Likewise.
* commands/test.c (GRUB_MOD_INIT): Likewise.
* commands/xnu_uuid.c (GRUB_MOD_INIT): Likewise.
* efiemu/main.c (GRUB_MOD_INIT): Likewise.
* font/font_cmd.c (GRUB_MOD_INIT): Likewise.
* gettext/gettext.c (GRUB_MOD_INIT): Likewise.
* kern/corecmd.c (GRUB_MOD_INIT): Likewise.
* lib/arg.c (GRUB_MOD_INIT): Likewise.
* loader/efi/appleloader.c (GRUB_MOD_INIT): Likewise.
* loader/i386/bsd.c (GRUB_MOD_INIT): Likewise.
* loader/xnu.c (GRUB_MOD_INIT): Likewise.
* mmap/mmap.c (GRUB_MOD_INIT): Likewise.
* term/terminfo.c (GRUB_MOD_INIT): Likewise.
* video/readers/jpeg.c (GRUB_MOD_INIT): Likewise.
* video/readers/png.c (GRUB_MOD_INIT): Likewise.
* video/readers/tga.c (GRUB_MOD_INIT): Likewise.
2009-12-25 Vladimir Serbinenko <phcoder@gmail.com>
Use search command for preliminar UUID search.
* commands/search.c: Split into ...
* commands/search_wrap.c: ...this
* commands/search.c: ...and this.
* commands/search_file.c: New file.
* commands/search_label.c: New file.
* commands/search_uuid.c: New file.
* conf/any-emu.rmk (grub_emu_SOURCES): Remove commands/search.c.
Add commands/search_wrap.c, commands/search_file.c,
commands/search_label.c and commands/search_uuid.c.
* conf/common.rmk (pkglib_MODULES): Remove fs_uuid.mod and fs_file.mod.
(search_mod_SOURCES): Set to commands/search_wrap.c.
(pkglib_MODULES): Add search_fs_file.mod, search_fs_uuid.mod and
search_label.mod.
(search_fs_file_mod_SOURCES): New variable.
(search_fs_file_mod_CFLAGS): Likewise.
(search_fs_file_mod_LDFLAGS): Likewise.
(search_label_mod_SOURCES): Likewise.
(search_label_mod_CFLAGS): Likewise.
(search_label_mod_LDFLAGS): Likewise.
(search_fs_uuid_mod_SOURCES): New variable.
(search_fs_uuid_mod_CFLAGS): Likewise.
(search_fs_uuid_mod_LDFLAGS): Likewise.
(fs_file_mod_SOURCES): Removed.
(fs_file_mod_CFLAGS): Likewise.
(fs_file_mod_LDFLAGS): Likewise.
(fs_uuid_mod_SOURCES): Removed.
(fs_uuid_mod_CFLAGS): Likewise.
(fs_uuid_mod_LDFLAGS): Likewise.
* conf/sparc64-ieee1275.rmk (grub_install_SOURCES):
Set to util/grub-install.in.
* disk/fs_file.c: Removed.
* disk/fs_uuid.c: Likewise.
* include/grub/search.h: New file.
* util/grub-install.in: Handle sparc64.
Create and use load.cfg.
* util/sparc64/ieee1275/grub-install.in: Removed.
2009-12-25 Vladimir Serbinenko <phcoder@gmail.com>
* kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions):
Ignore return status if CF is cleared.
(grub_biosdisk_get_diskinfo_standard): Likewise.
2009-12-25 Robert Millan <rmh.grub@aybabtu.com>
* term/i386/pc/at_keyboard.c
(keyboard_controller_wait_untill_ready): New function.
(grub_keyboard_controller_write, grub_keyboard_controller_read)
(keyboard_controller_led): Use keyboard_controller_wait_untill_ready()
for keyboard polling, rather than duplicate the same loop. This
saves a few bytes in code size.
2009-12-25 Vladimir Serbinenko <phcoder@gmail.com>
Support for (pxe[:server[:gateway]]) syntax and
use environment variable for PXE.
* commands/i386/pc/pxecmd.c (options): Removed.
(print_ip): Removed.
(grub_cmd_pxe): Removed
(grub_cmd_pxe_unload): New function.
* fs/i386/pc/pxe.c (grub_pxe_disk_data): New structure.
(grub_pxe_your_ip): Made static.
(grub_pxe_default_server_ip): Likewise.
(grub_pxe_default_gateway_ip): Likewise.
(grub_pxe_blksize): Likewise.
(parse_ip): New function.
(grub_pxe_open): Support server and gateway specification.
(grub_pxe_close): Free disk->data.
(grub_pxefs_open): Use disk->data.
(grub_pxefs_read): Likewise.
(grub_env_write_readonly): New function.
(set_mac_env): Likewise.
(set_env_limn_ro): Likewise.
(parse_dhcp_vendor): Likewise.
(grub_pxe_detect): Set the environment variables.
(set_ip_env): New function.
(write_ip_env): Likewise.
(grub_env_write_pxe_default_server): Likewise.
(grub_env_write_pxe_default_gateway): Likewise.
(grub_env_write_pxe_blocksize): Likewise.
(GRUB_MOD_INIT(pxe)): Set environment variables.
* include/grub/i386/pc/pxe.h (grub_pxe_mac_addr): Rename to ...
(grub_pxe_mac_addr_t): ... this. All users updated.
(grub_pxe_your_ip): Removed.
(grub_pxe_server_ip): Likewise.
(grub_pxe_gateway_ip): Likewise.
(grub_pxe_blksize): Likewise.
2009-12-25 Carles Pina i Estany <carles@pina.cat>
* commands/help.c: Include `<grub/i18n.h>'.
(grub_cmd_help): Gettextizze.
(GRUB_MOD_INIT): Likewise.
* commands/i386/pc/play.c: Include `<grub/i18n.h>'.
(GRUB_MOD_INIT): Gettextizze.
* commands/search.c: Include `<grub/i18n.h>'.
(options): Gettextizze.
(GRUB_MOD_INIT): Gettextizze.
* lib/arg.c: Include `<grub/i18n.h>'.
(help_options): Gettextizze.
(find_long): Likewise.
(grub_arg_show_help): Likewise.
* normal/dyncmd.c: Include `<grub/i18n.h>'.
(read_command_list): Gettextizze.
* po/POTFILES: Add `commands/i386/pc/play.c', `commands/search.c',
`commands/help.c', `lib/arg.c' and `normal/dyncmd.c'.
2009-12-25 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/i386/at_keyboard.h (NUM_LOCK, SCROLL_LOCK): New macros.
* term/i386/pc/at_keyboard.c (KEYBOARD_STATUS_NUM_LOCK)
(KEYBOARD_LED_SCROLL, KEYBOARD_LED_NUM, KEYBOARD_LED_CAPS): New macros.
(led_status): New variable.
(keyboard_controller_led): New function.
(grub_at_keyboard_getkey_noblock): Handle num lock and scroll lock,
update led status for caps lock, num lock and scroll lock.
2009-12-25 Felix Zielcke <fzielcke@z-51.de>
* util/hostdisk.c (open_device): Fix a comment.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* util/grub-install.in (host_os): New variable.
* util/i386/efi/grub-install.in (host_os): Likewise.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* util/mkisofs/write.c (padblock_write): Abort when given an
excedingly large embed image, instead of silently truncating it.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* include/multiboot.h: Indentation fixes.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* include/multiboot.h (struct multiboot_aout_symbol_table)
(struct multiboot_elf_section_header_table): New structure
declarations (stolen from GRUB Legacy).
(struct multiboot_info): Replace opaque `syms' with a.out and ELF
table information.
(multiboot_aout_symbol_table_t, multiboot_elf_section_header_table_t)
(multiboot_info_t, multiboot_memory_map_t, multiboot_module_t): New
type aliases.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* include/multiboot.h: Make comments src2texi-friendly.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
For consistency with [multiboot]/docs/boot.S.
* include/multiboot.h (MULTIBOOT_MAGIC): Rename from this ...
(MULTIBOOT_HEADER_MAGIC): ... to this. Update all users.
(MULTIBOOT_MAGIC2): Rename from this ...
(MULTIBOOT_BOOTLOADER_MAGIC): ... to this. Update all users.
2009-12-24 Robert Millan <rmh.grub@aybabtu.com>
* include/multiboot.h: Remove `<grub/types.h>'.
(multiboot_uint16_t, multiboot_uint32_t, multiboot_uint64_t): New
types. Update all users.
2009-12-25 Carles Pina i Estany <carles@pina.cat>
* commands/efi/loadbios.c: Capitalize acronyms, replace `could not' by
`couldn't' and `can not' by `cannot'.
* commands/i386/pc/drivemap.c: Likewise.
* disk/ata.c: Likewise.
* disk/ieee1275/nand.c: Likewise.
* fs/affs.c: Likewise.
* fs/fat.c: Likewise.
* fs/hfs.c: Likewise.
* fs/hfsplus.c: Likewise.
* fs/iso9660.c: Likewise.
* fs/jfs.c: Likewise.
* fs/minix.c: Likewise.
* fs/reiserfs.c: Likewise.
* fs/sfs.c: Likewise.
* fs/udf.c: Likewise.
* fs/ufs.c: Likewise.
* fs/xfs.c: Likewise.
* loader/powerpc/ieee1275/linux.c: Likewise.
* loader/sparc64/ieee1275/linux.c: Likewise.
* util/grub-probe.c: Likewise.
* util/misc.c: Likewise.
2009-12-24 Carles Pina i Estany <carles@pina.cat>
* bus/usb/usbhub.c: Fix capitalization, fullstop and newlines in
grub_errno calls.
* commands/acpi.c: Likewise.
* commands/blocklist.c: Likewise.
* commands/efi/loadbios.c: Likewise.
* commands/i386/pc/drivemap.c: Likewise.
* commands/loadenv.c: Likewise.
* commands/memrw.c: Likewise.
* commands/password.c: Likewise.
* commands/videotest.c: Likewise.
* disk/ata.c: Likewise.
* disk/ata_pthru.c: Likewise.
* disk/dmraid_nvidia.c: Likewise.
* disk/ieee1275/nand.c: Likewise.
* disk/ieee1275/ofdisk.c: Likewise.
* disk/loopback.c: Likewise.
* disk/lvm.c: Likewise.
* disk/mdraid_linux.c: Likewise.
* disk/raid.c: Likewise.
* disk/raid6_recover.c: Likewise.
* disk/scsi.c: Likewise.
* efiemu/main.c: Likewise.
* efiemu/mm.c: Likewise.
* efiemu/pnvram.c: Likewise.
* efiemu/symbols.c: Likewise.
* font/font.c: Likewise.
* fs/cpio.c: Likewise.
* fs/hfsplus.c: Likewise.
* fs/iso9660.c: Likewise.
* fs/jfs.c: Likewise.
* fs/minix.c: Likewise.
* fs/ntfs.c: Likewise.
* fs/ntfscomp.c: Likewise.
* fs/reiserfs.c: Likewise.
* fs/ufs.c: Likewise.
* fs/xfs.c: Likewise.
* gettext/gettext.c: Likewise.
* include/grub/auth.h: Likewise.
* kern/elf.c: Likewise.
* kern/file.c: Likewise.
* kern/ieee1275/init.c: Likewise.
* kern/ieee1275/mmap.c: Likewise.
* kern/ieee1275/openfw.c: Likewise.
* kern/powerpc/dl.c: Likewise.
* kern/sparc64/dl.c: Likewise.
* lib/arg.c: Likewise.
* loader/i386/bsd.c: Likewise.
* loader/i386/bsdXX.c: Likewise.
* loader/i386/efi/linux.c: Likewise.
* loader/i386/efi/xnu.c: Likewise.
* loader/i386/ieee1275/linux.c: Likewise.
* loader/i386/linux.c: Likewise.
* loader/i386/multiboot.c: Likewise.
* loader/i386/pc/linux.c: Likewise.
* loader/i386/pc/multiboot2.c: Likewise.
* loader/i386/xnu.c: Likewise.
* loader/ieee1275/multiboot2.c: Likewise.
* loader/macho.c: Likewise.
* loader/machoXX.c: Likewise.
* loader/multiboot2.c: Likewise.
* loader/multiboot_loader.c: Likewise.
* loader/powerpc/ieee1275/linux.c: Likewise.
* loader/sparc64/ieee1275/linux.c: Likewise.
* loader/xnu.c: Likewise.
* loader/xnu_resume.c: Likewise.
* mmap/i386/pc/mmap.c: Likewise.
* normal/menu_viewer.c: Likewise.
* partmap/acorn.c: Likewise.
* partmap/amiga.c: Likewise.
* partmap/apple.c: Likewise.
* script/lexer.c: Likewise.
* term/gfxterm.c: Likewise.
* term/i386/pc/serial.c: Likewise.
* term/i386/pc/vga.c: Likewise.
* term/ieee1275/ofconsole.c: Likewise.
* term/terminfo.c: Likewise.
* video/bitmap.c: Likewise.
* video/efi_gop.c: Likewise.
* video/efi_uga.c: Likewise.
* video/fb/video_fb.c: Likewise.
* video/i386/pc/vbe.c: Likewise.
* video/readers/tga.c: Likewise.
* video/video.c: Likewise.
2009-12-23 Felix Zielcke <fzielcke@z-51.de>
* commands/i386/pc/drivemap.c: Remove all trailing whitespace.
* commands/lspci.c: Likewise.
@ -51,7 +760,7 @@
* video/efi_gop.c (grub_video_gop_get_bitmask): Fix off-by-one in mask
size counting.
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkrescue.in (pkglib_DATA): Set to @pkglib_DATA@.
* genmk.rb (class SCRIPT): Modify the target file instead of source.
@ -69,11 +778,11 @@
(grub_cmd_read): Restructure for readability. Support "-v" option.
(grub_cmd_write): Restructure for readability.
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
* genmk.rb (class SCRIPT): Prepend #{src} path with $(srcdir).
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
* genmk.rb (class SCRIPT): Use sed to substitute @pkglib_DATA@
with the actual contents of the correspondending make variable.
@ -81,7 +790,7 @@
(process_input_dir): Copy all $pkglib_DATA files instead of explicitly
specifying `*.lst' and `efiemu??.o'
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
* util/grub.d/30_os-prober.in (osx_entry): Add round brackets
after function name.
@ -97,7 +806,7 @@
(GRUB_MOD_INIT(lspci)): Use extcmd.
(GRUB_MOD_FINI(lspci)): Likewise.
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
2009-12-22 Felix Zielcke <fzielcke@z-51.de>
* util/grub.d/30_os-prober.in (osx_entry): Remove non POSIX compliant
`function' keyword.
@ -157,7 +866,7 @@
`$(XGETTEXT)'.
* po/POTFILES: Add `commands/loadenv.c'.
2009-12-21 Felix Zielcke <fzielcke@z-51.de>
2009-12-21 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkrescue.in (process_input_dir): Copy `*.lst' files
instead of specifying them explicit.
@ -470,7 +1179,7 @@
(grub_vbe_get_video_mode): Use 'last_set_mode' if get_mode fails.
(grub_video_vbe_setup): Don't check for reserved flag.
2009-12-17 Felix Zielcke <fzielcke@z-51.de>
2009-12-17 Felix Zielcke <fzielcke@z-51.de>
* gendistlist.sh: Use POSIX compliant `!' instead of `-not' in
the `find' command.
@ -483,7 +1192,7 @@
(grub_hfs_fs): New value .uuid.
* include/grub/hfs.h (grub_hfs_sblock): New field 'num_serial'.
2009-12-14 Felix Zielcke <fzielcke@z-51.de>
2009-12-14 Felix Zielcke <fzielcke@z-51.de>
Fix a segfault with parsing unknown long options.
@ -493,7 +1202,7 @@
* include/grub/misc.h (grub_puts): New declaration.
(grub_puts_): Likewise.
* kern/mis.c (grub_puts): New definition.
* kern/misc.c (grub_puts): New definition.
(grub_puts_): Likewise.
2009-12-13 Robert Millan <rmh.grub@aybabtu.com>
@ -632,11 +1341,11 @@
* include/grub/pciutils.h: New file.
* util/pci.c: Likewise.
2009-12-11 Felix Zielcke <fzielcke@z-51.de>
2009-12-11 Felix Zielcke <fzielcke@z-51.de>
* util/misc.c: Don't include <errno.h> twice.
2009-12-10 Felix Zielcke <fzielcke@z-51.de>
2009-12-10 Felix Zielcke <fzielcke@z-51.de>
* disk/i386/pc/biosdisk.c (grub_biosdisk_open): Show the disk
name in an error message.
@ -732,7 +1441,7 @@
* disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Recognize
anything even prefixed with 'cdrom' as a cdrom.
2009-12-06 Felix Zielcke <fzielcke@z-51.de>
2009-12-06 Felix Zielcke <fzielcke@z-51.de>
* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with
mount points.
@ -948,7 +1657,7 @@
($(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po)): Rewrite as ...
(po/%.po): ... this.
2009-11-26 Felix Zielcke <fzielcke@z-51.de>
2009-11-26 Felix Zielcke <fzielcke@z-51.de>
* util/i386/efi/grub-mkimage.c: Include "progname.h".
(main): Use `program_name' instead of nonexistent `progname'.

View File

@ -1,6 +1,6 @@
# -*- makefile -*-
#
# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# This Makefile.in is free software; the author
# gives unlimited permission to copy and/or distribute it,
@ -41,6 +41,9 @@ includedir = @includedir@
pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'`
pkglibdir = $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'`
# Internationalization library.
LIBINTL = @LIBINTL@
XGETTEXT = @XGETTEXT@
MSGMERGE = @MSGMERGE@
MSGFMT = @MSGFMT@
@ -72,10 +75,12 @@ MKDIR_P = @MKDIR_P@
mkinstalldirs = $(srcdir)/mkinstalldirs
LIBS = @LIBS@ $(LIBINTL)
CC = @CC@
CFLAGS = @CFLAGS@
ASFLAGS = @ASFLAGS@
LDFLAGS = @LDFLAGS@
LDFLAGS = @LDFLAGS@ $(LIBS)
CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/gnulib -I$(srcdir)/include -Wall -W \
-DGRUB_LIBDIR=\"$(pkglibdir)\" -DLOCALEDIR=\"$(localedir)\"
TARGET_CC = @TARGET_CC@

View File

@ -1,7 +1,7 @@
/* -*-Asm-*- */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* -*-Asm-*- */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2006,2007 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2006,2007,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -370,7 +370,7 @@ blocklist_default_start:
the start of the disk, sector 0 */
.long 2, 0
blocklist_default_len:
/* this is the number of sectors to read the command "install"
/* this is the number of sectors to read. grub-mkimage
will fill this up */
.word 0
blocklist_default_seg:

View File

@ -1,7 +1,7 @@
/* -*-Asm-*- */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -185,7 +185,7 @@ real_code_2:
call LOCAL(move_memory)
/* Check for multiboot signature. */
cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END)
cmpl $MULTIBOOT_HEADER_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END)
jz 1f
movl (ramdisk_image - start), %esi

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000,2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2000,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -1,7 +1,7 @@
/* pci.c - Generic PCI interfaces. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 Free Software Foundation, Inc.
* Copyright (C) 2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -50,7 +50,7 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller, grub_usb_speed_t speed)
}
if (i == 128)
{
grub_error (GRUB_ERR_IO, "Can't assign address to USB device");
grub_error (GRUB_ERR_IO, "can't assign address to USB device");
return NULL;
}

View File

@ -28,6 +28,7 @@
#include <grub/mm.h>
#include <grub/machine/memory.h>
#include <grub/memory.h>
#include <grub/i18n.h>
#ifdef GRUB_MACHINE_EFI
#include <grub/efi/efi.h>
@ -36,23 +37,23 @@
static const struct grub_arg_option options[] = {
{"exclude", 'x', 0,
"Don't load host tables specified by comma-separated list.",
N_("Don't load host tables specified by comma-separated list."),
0, ARG_TYPE_STRING},
{"load-only", 'n', 0,
"Load only tables specified by comma-separated list.", 0, ARG_TYPE_STRING},
{"v1", '1', 0, "Expose v1 tables.", 0, ARG_TYPE_NONE},
{"v2", '2', 0, "Expose v2 and v3 tables.", 0, ARG_TYPE_NONE},
{"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
N_("Load only tables specified by comma-separated list."), 0, ARG_TYPE_STRING},
{"v1", '1', 0, N_("Expose v1 tables."), 0, ARG_TYPE_NONE},
{"v2", '2', 0, N_("Expose v2 and v3 tables."), 0, ARG_TYPE_NONE},
{"oemid", 'o', 0, N_("Set OEMID of RSDP, XSDT and RSDT."), 0, ARG_TYPE_STRING},
{"oemtable", 't', 0,
"Set OEMTABLE ID of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
N_("Set OEMTABLE ID of RSDP, XSDT and RSDT."), 0, ARG_TYPE_STRING},
{"oemtablerev", 'r', 0,
"Set OEMTABLE revision of RSDP, XSDT and RSDT.", 0, ARG_TYPE_INT},
N_("Set OEMTABLE revision of RSDP, XSDT and RSDT."), 0, ARG_TYPE_INT},
{"oemtablecreator", 'c', 0,
"Set creator field of RSDP, XSDT and RSDT.", 0, ARG_TYPE_STRING},
N_("Set creator field of RSDP, XSDT and RSDT."), 0, ARG_TYPE_STRING},
{"oemtablecreatorrev", 'd', 0,
"Set creator revision of RSDP, XSDT and RSDT.", 0, ARG_TYPE_INT},
{"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some."
" BIOSes but makes it ineffective with OS not receiving RSDP from GRUB.",
N_("Set creator revision of RSDP, XSDT and RSDT."), 0, ARG_TYPE_INT},
{"no-ebda", 'e', 0, N_("Don't update EBDA. May fix failures or hangs on some."
" BIOSes but makes it ineffective with OS not receiving RSDP from GRUB."),
0, ARG_TYPE_NONE},
{0, 0, 0, 0, 0, 0}
};
@ -277,7 +278,7 @@ grub_acpi_create_ebda (void)
{
grub_mmap_unregister (mmapregion);
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't find suitable spot in EBDA");
"couldn't find suitable spot in EBDA");
}
/* Remove any other RSDT. */
@ -551,7 +552,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
grub_free (exclude);
grub_free (load_only);
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't allocate table");
"couldn't allocate table");
}
grub_memcpy (table_dsdt, dsdt, dsdt->length);
}
@ -578,7 +579,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
grub_free (exclude);
grub_free (load_only);
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't allocate table structure");
"couldn't allocate table structure");
}
table->size = curtable->length;
table->addr = grub_malloc (table->size);
@ -587,7 +588,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
{
free_tables ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't allocate table");
"couldn't allocate table");
}
table->next = acpi_tables;
acpi_tables = table;
@ -674,7 +675,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
{
free_tables ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't allocate table structure");
"couldn't allocate table structure");
}
table->size = size;
@ -709,7 +710,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd,
{
free_tables ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Couldn't allocate space for ACPI tables");
"couldn't allocate space for ACPI tables");
}
setup_common_tables ();
@ -759,11 +760,11 @@ GRUB_MOD_INIT(acpi)
{
cmd = grub_register_extcmd ("acpi", grub_cmd_acpi,
GRUB_COMMAND_FLAG_BOTH,
"acpi [-1|-2] [--exclude=table1,table2|"
"--load-only=table1,table2] filename1 "
" [filename2] [...]",
"Load host acpi tables and tables "
"specified by arguments.",
N_("[-1|-2] [--exclude=TABLE1,TABLE2|"
"--load-only=table1,table2] FILE1"
" [FILE2] [...]"),
N_("Load host ACPI tables and tables "
"specified by arguments."),
options);
}

View File

@ -24,6 +24,7 @@
#include <grub/disk.h>
#include <grub/partition.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
@ -87,7 +88,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
if (! file->device->disk)
return grub_error (GRUB_ERR_BAD_DEVICE,
"this command is available only for disk devices.");
"this command is available only for disk devices");
if (file->device->disk->partition)
part_start = grub_partition_get_start (file->device->disk->partition);
@ -110,7 +111,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(blocklist)
{
cmd = grub_register_command ("blocklist", grub_cmd_blocklist,
"blocklist FILE", "Print a block list.");
N_("FILE"), N_("Print a block list."));
}
GRUB_MOD_FINI(blocklist)

View File

@ -23,6 +23,7 @@
#include <grub/loader.h>
#include <grub/kernel.h>
#include <grub/mm.h>
#include <grub/i18n.h>
static grub_err_t (*grub_loader_boot_func) (void);
static grub_err_t (*grub_loader_unload_func) (void);
@ -186,7 +187,7 @@ GRUB_MOD_INIT(boot)
{
cmd_boot =
grub_register_command ("boot", grub_cmd_boot,
0, "Boot an operating system.");
0, N_("Boot an operating system."));
}
GRUB_MOD_FINI(boot)

View File

@ -24,6 +24,7 @@
#include <grub/misc.h>
#include <grub/gzio.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)),
@ -78,7 +79,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(cat)
{
cmd = grub_register_command_p1 ("cat", grub_cmd_cat,
"cat FILE", "Show the contents of a file.");
N_("FILE"), N_("Show the contents of a file."));
}
GRUB_MOD_FINI(cat)

View File

@ -1,7 +1,7 @@
/* cmd.c - command to cmp an operating system */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc.
* Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -23,6 +23,7 @@
#include <grub/mm.h>
#include <grub/gzio.h>
#include <grub/command.h>
#include <grub/i18n.h>
#define BUFFER_SIZE 512
@ -109,7 +110,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(cmp)
{
cmd = grub_register_command ("cmp", grub_cmd_cmp,
"cmp FILE1 FILE2", "Compare two files.");
N_("FILE1 FILE2"), N_("Compare two files."));
}
GRUB_MOD_FINI(cmp)

View File

@ -22,6 +22,7 @@
#include <grub/env.h>
#include <grub/normal.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_source (grub_command_t cmd, int argc, char **args)
@ -53,16 +54,16 @@ GRUB_MOD_INIT(configfile)
{
cmd_configfile =
grub_register_command ("configfile", grub_cmd_source,
"configfile FILE", "Load another config file.");
N_("FILE"), N_("Load another config file."));
cmd_source =
grub_register_command ("source", grub_cmd_source,
"source FILE",
"Load another config file without changing context."
N_("FILE"),
N_("Load another config file without changing context.")
);
cmd_dot =
grub_register_command (".", grub_cmd_source,
". FILE",
"Load another config file without changing context."
N_("FILE"),
N_("Load another config file without changing context.")
);
}

View File

@ -1,7 +1,7 @@
/* crc.c - command to calculate the crc32 checksum of a file */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -23,6 +23,7 @@
#include <grub/misc.h>
#include <grub/lib/crc.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_crc (grub_command_t cmd __attribute__ ((unused)),
@ -45,10 +46,13 @@ grub_cmd_crc (grub_command_t cmd __attribute__ ((unused)),
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0)
crc = grub_getcrc32 (crc, buf, size);
grub_file_close (file);
if (grub_errno)
goto fail;
grub_printf ("%08x\n", crc);
fail:
grub_file_close (file);
return 0;
}
@ -57,8 +61,8 @@ static grub_command_t cmd;
GRUB_MOD_INIT(crc)
{
cmd = grub_register_command ("crc", grub_cmd_crc,
"crc FILE",
"Calculate the crc32 checksum of a file.");
N_("FILE"),
N_("Calculate the crc32 checksum of a file."));
}
GRUB_MOD_FINI(crc)

View File

@ -22,6 +22,7 @@
#include <grub/misc.h>
#include <grub/datetime.h>
#include <grub/command.h>
#include <grub/i18n.h>
#define GRUB_DATETIME_SET_YEAR 1
#define GRUB_DATETIME_SET_MONTH 2
@ -135,8 +136,8 @@ GRUB_MOD_INIT(date)
{
cmd =
grub_register_command ("date", grub_cmd_date,
"date [[year-]month-day] [hour:minute[:second]]",
"Command to display/set current datetime.");
N_("[[year-]month-day] [hour:minute[:second]]"),
N_("Command to display/set current datetime."));
}
GRUB_MOD_FINI(date)

View File

@ -20,11 +20,12 @@
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{0, 'n', 0, "Do not output the trailing newline.", 0, 0},
{0, 'e', 0, "Enable interpretation of backslash escapes.", 0, 0},
{0, 'n', 0, N_("Do not output the trailing newline."), 0, 0},
{0, 'e', 0, N_("Enable interpretation of backslash escapes."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -113,7 +114,7 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(echo)
{
cmd = grub_register_extcmd ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH,
"echo [-e|-n] STRING", "Display a line of text.",
N_("[-e|-n] STRING"), N_("Display a line of text."),
options);
}

View File

@ -22,6 +22,7 @@
#include <grub/file.h>
#include <grub/pci.h>
#include <grub/command.h>
#include <grub/i18n.h>
static struct grub_video_patch
{
@ -99,7 +100,7 @@ static grub_command_t cmd_fixvideo;
GRUB_MOD_INIT(fixvideo)
{
cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo,
0, "Fix video problem.");
0, N_("Fix video problem."));
}

View File

@ -23,6 +23,7 @@
#include <grub/efi/efi.h>
#include <grub/pci.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID;
static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID;
@ -160,7 +161,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)),
int size;
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "No rom image specified");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no ROM image specified");
if (argc > 1)
{
@ -169,7 +170,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)),
return grub_errno;
if (file->size != 4)
grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid int10 dump size");
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid int10 dump size");
else
grub_file_read (file, (void *) 0x40, 4);
@ -184,7 +185,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)),
size = file->size;
if ((size < 0x10000) || (size > 0x40000))
grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid bios dump size");
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid bios dump size");
else if (enable_rom_area ())
{
grub_file_read (file, (void *) VBIOS_ADDR, size);
@ -201,11 +202,11 @@ static grub_command_t cmd_fakebios, cmd_loadbios;
GRUB_MOD_INIT(loadbios)
{
cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios,
0, "Fake bios.");
0, N_("Fake BIOS."));
cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios,
"loadbios BIOS_DUMP [INT10_DUMP]",
"Load bios dump.");
"BIOS_DUMP [INT10_DUMP]",
N_("Load BIOS dump."));
}
GRUB_MOD_FINI(loadbios)

View File

@ -27,6 +27,7 @@
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/fs.h>
#include <grub/i18n.h>
/* Convert a LBA address to a CHS address in the INT 13 format. */
/* Taken from grub1. */
@ -240,13 +241,13 @@ GRUB_MOD_INIT(gptsync)
{
(void) mod; /* To stop warning. */
cmd = grub_register_command ("gptsync", grub_cmd_gptsync,
"gptsync DEVICE [PARTITION[+/-[TYPE]]] ...",
"Fill hybrid MBR of GPT drive DEVICE. "
N_("DEVICE [PARTITION[+/-[TYPE]]] ..."),
N_("Fill hybrid MBR of GPT drive DEVICE. "
"specified partitions will be a part "
"of hybrid mbr. Up to 3 partitions are "
"allowed. TYPE is an MBR type. "
"+ means that partition is active. "
"Only one partition can be active.");
"Only one partition can be active."));
}
GRUB_MOD_FINI(gptsync)

View File

@ -20,6 +20,7 @@
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/misc.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)),
@ -35,8 +36,8 @@ static grub_command_t cmd;
GRUB_MOD_INIT(halt)
{
cmd = grub_register_command ("halt", grub_cmd_halt,
0, "Halts the computer. This command does not"
" work on all firmware implementations.");
0, N_("Halts the computer. This command does"
" not work on all firmware implementations."));
}
GRUB_MOD_FINI(halt)

View File

@ -23,6 +23,7 @@
#include <grub/term.h>
#include <grub/handler.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_handler (struct grub_command *cmd __attribute__ ((unused)),
@ -90,8 +91,8 @@ GRUB_MOD_INIT(handler)
{
cmd_handler =
grub_register_command ("handler", grub_cmd_handler,
"handler [class [handler]]",
"List or select a handler.");
N_("[class [handler]]"),
N_("List or select a handler."));
}
GRUB_MOD_FINI(handler)

View File

@ -24,29 +24,30 @@
#include <grub/mm.h>
#include <grub/lib/hexdump.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] = {
{"apm", 'B', 0, "Set Advanced Power Management\n"
"(1=low, ..., 254=high, 255=off).",
{"apm", 'B', 0, N_("Set Advanced Power Management\n"
"(1=low, ..., 254=high, 255=off)."),
0, ARG_TYPE_INT},
{"power", 'C', 0, "Check power mode.", 0, ARG_TYPE_NONE},
{"security-freeze", 'F', 0, "Freeze ATA security settings until reset.",
{"power", 'C', 0, N_("Check power mode."), 0, ARG_TYPE_NONE},
{"security-freeze", 'F', 0, N_("Freeze ATA security settings until reset."),
0, ARG_TYPE_NONE},
{"health", 'H', 0, "Check SMART health status.", 0, ARG_TYPE_NONE},
{"aam", 'M', 0, "Set Automatic Acoustic Management\n"
"(0=off, 128=quiet, ..., 254=fast).",
{"health", 'H', 0, N_("Check SMART health status."), 0, ARG_TYPE_NONE},
{"aam", 'M', 0, N_("Set Automatic Acoustic Management\n"
"(0=off, 128=quiet, ..., 254=fast)."),
0, ARG_TYPE_INT},
{"standby-timeout", 'S', 0, "Set standby timeout\n"
"(0=off, 1=5s, 2=10s, ..., 240=20m, 241=30m, ...).",
{"standby-timeout", 'S', 0, N_("Set standby timeout\n"
"(0=off, 1=5s, 2=10s, ..., 240=20m, 241=30m, ...)."),
0, ARG_TYPE_INT},
{"standby", 'y', 0, "Set drive to standby mode.", 0, ARG_TYPE_NONE},
{"sleep", 'Y', 0, "Set drive to sleep mode.", 0, ARG_TYPE_NONE},
{"identify", 'i', 0, "Print drive identity and settings.",
{"standby", 'y', 0, N_("Set drive to standby mode."), 0, ARG_TYPE_NONE},
{"sleep", 'Y', 0, N_("Set drive to sleep mode."), 0, ARG_TYPE_NONE},
{"identify", 'i', 0, N_("Print drive identity and settings."),
0, ARG_TYPE_NONE},
{"dumpid", 'I', 0, "Dump contents of ATA IDENTIFY sector.",
{"dumpid", 'I', 0, N_("Dump contents of ATA IDENTIFY sector."),
0, ARG_TYPE_NONE},
{"smart", -1, 0, "Disable/enable SMART (0/1).", 0, ARG_TYPE_INT},
{"quiet", 'q', 0, "Do not print messages.", 0, ARG_TYPE_NONE},
{"smart", -1, 0, N_("Disable/enable SMART (0/1)."), 0, ARG_TYPE_INT},
{"quiet", 'q', 0, N_("Do not print messages."), 0, ARG_TYPE_NONE},
{0, 0, 0, 0, 0, 0}
};
@ -410,8 +411,8 @@ GRUB_MOD_INIT(hdparm)
{
cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm,
GRUB_COMMAND_FLAG_BOTH,
"hdparm [OPTIONS] DISK",
"Get/set ATA disk parameters.", options);
N_("[OPTIONS] DISK"),
N_("Get/set ATA disk parameters."), options);
}
GRUB_MOD_FINI(hdparm)

View File

@ -1,7 +1,7 @@
/* help.c - command to show a help text. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,6 +21,10 @@
#include <grub/misc.h>
#include <grub/term.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/mm.h>
#include <grub/normal.h>
#include <grub/charset.h>
static grub_err_t
grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
@ -37,26 +41,51 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
if ((cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) &&
(cmd->flags & GRUB_COMMAND_FLAG_CMDLINE))
{
struct grub_term_output *cur;
int desclen = grub_strlen (cmd->summary);
FOR_ACTIVE_TERM_OUTPUTS(cur)
{
int width = grub_term_width(cur);
char description[width / 2];
struct grub_term_output *term;
const char *summary_translated = _(cmd->summary);
char *command_help;
grub_uint32_t *unicode_command_help;
grub_uint32_t *unicode_last_position;
/* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled
with the description followed by spaces. */
grub_memset (description, ' ', width / 2 - 1);
description[width / 2 - 1] = '\0';
grub_memcpy (description, cmd->summary,
(desclen < width / 2 - 1
? desclen : width / 2 - 1));
grub_puts_terminal (description, cur);
command_help = grub_malloc (grub_strlen (cmd->name) +
sizeof (" ") - 1 +
grub_strlen (summary_translated));
grub_sprintf(command_help, "%s %s", cmd->name, summary_translated);
grub_utf8_to_ucs4_alloc (command_help, &unicode_command_help,
&unicode_last_position);
FOR_ACTIVE_TERM_OUTPUTS(term)
{
unsigned stringwidth;
grub_uint32_t *unicode_last_screen_position;
unicode_last_screen_position = unicode_command_help;
stringwidth = 0;
while (unicode_last_screen_position < unicode_last_position &&
stringwidth < ((grub_term_width (term) / 2) - 2))
{
stringwidth
+= grub_term_getcharwidth (term,
*unicode_last_screen_position);
unicode_last_screen_position++;
}
grub_print_ucs4 (unicode_command_help,
unicode_last_screen_position, term);
if (!(cnt % 2))
grub_print_spaces (term, grub_term_width (term) / 2
- stringwidth);
}
if ((cnt++) % 2)
if (cnt % 2)
grub_printf ("\n");
else
grub_printf (" ");
cnt++;
grub_free (command_help);
grub_free (unicode_command_help);
}
return 0;
}
@ -73,8 +102,8 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc,
if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)
grub_arg_show_help ((grub_extcmd_t) cmd->data);
else
grub_printf ("Usage: %s\n%s\b", cmd->summary,
cmd->description);
grub_printf ("%s %s %s\n%s\b", _("Usage:"), cmd->name, _(cmd->summary),
_(cmd->description));
}
}
return 0;
@ -106,8 +135,8 @@ GRUB_MOD_INIT(help)
{
cmd = grub_register_extcmd ("help", grub_cmd_help,
GRUB_COMMAND_FLAG_CMDLINE,
"help [PATTERN ...]",
"Show a help message.", 0);
N_("[PATTERN ...]"),
N_("Show a help message."), 0);
}
GRUB_MOD_FINI(help)

View File

@ -1,7 +1,7 @@
/* hexdump.c - command to dump the contents of a file or memory */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,11 +24,12 @@
#include <grub/gzio.h>
#include <grub/lib/hexdump.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] = {
{"skip", 's', 0, "Skip offset bytes from the beginning of file.", 0,
{"skip", 's', 0, N_("Skip offset bytes from the beginning of file."), 0,
ARG_TYPE_INT},
{"length", 'n', 0, "Read only LENGTH bytes.", 0, ARG_TYPE_INT},
{"length", 'n', 0, N_("Read only LENGTH bytes."), 0, ARG_TYPE_INT},
{0, 0, 0, 0, 0, 0}
};
@ -121,8 +122,8 @@ GRUB_MOD_INIT (hexdump)
{
cmd = grub_register_extcmd ("hexdump", grub_cmd_hexdump,
GRUB_COMMAND_FLAG_BOTH,
"hexdump [OPTIONS] FILE_OR_DEVICE",
"Dump the contents of a file or memory.",
N_("[OPTIONS] FILE_OR_DEVICE"),
N_("Dump the contents of a file or memory."),
options);
}

View File

@ -25,6 +25,7 @@
#include <grub/command.h>
#include <grub/extcmd.h>
#include <grub/i386/cpuid.h>
#include <grub/i18n.h>
#define cpuid(num,a,b,c,d) \
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
@ -33,7 +34,7 @@
static const struct grub_arg_option options[] =
{
{"long-mode", 'l', 0, "Check for long mode flag (default).", 0, 0},
{"long-mode", 'l', 0, N_("Check for long mode flag (default)."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -88,7 +89,7 @@ done:
#endif
cmd = grub_register_extcmd ("cpuid", grub_cmd_cpuid, GRUB_COMMAND_FLAG_BOTH,
"cpuid [-l]", "Check for CPU features.", options);
"[-l]", N_("Check for CPU features."), options);
}
GRUB_MOD_FINI(cpuid)

View File

@ -26,6 +26,7 @@
#include <grub/env.h>
#include <grub/machine/memory.h>
#include <grub/machine/biosnum.h>
#include <grub/i18n.h>
/* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */
@ -33,9 +34,9 @@ static grub_uint32_t *const int13slot = UINT_TO_PTR (4 * 0x13);
/* Remember to update enum opt_idxs accordingly. */
static const struct grub_arg_option options[] = {
{"list", 'l', 0, "Show the current mappings.", 0, 0},
{"reset", 'r', 0, "Reset all mappings to the default values.", 0, 0},
{"swap", 's', 0, "Perform both direct and reverse mappings.", 0, 0},
{"list", 'l', 0, N_("Show the current mappings."), 0, 0},
{"reset", 'r', 0, N_("Reset all mappings to the default values."), 0, 0},
{"swap", 's', 0, N_("Perform both direct and reverse mappings."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -308,7 +309,7 @@ install_int13_handler (int noret __attribute__ ((unused)))
GRUB_MACHINE_MEMORY_RESERVED,
GRUB_MMAP_MALLOC_LOW);
if (! handler_base)
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not reserve "
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't reserve "
"memory for the int13h handler");
/* Copy int13h handler bundle to reserved area. */
@ -403,8 +404,8 @@ GRUB_MOD_INIT (drivemap)
cmd = grub_register_extcmd ("drivemap", grub_cmd_drivemap,
GRUB_COMMAND_FLAG_BOTH,
"drivemap"
" -l | -r | [-s] grubdev osdisk",
"Manage the BIOS drive mappings.",
N_("-l | -r | [-s] grubdev osdisk."),
N_("Manage the BIOS drive mappings."),
options);
drivemap_hook =
grub_loader_register_preboot_hook (&install_int13_handler,

View File

@ -1,7 +1,7 @@
/* halt.c - command to halt the computer. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,10 +20,11 @@
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"no-apm", 'n', 0, "Do not use APM to halt the computer.", 0, 0},
{"no-apm", 'n', 0, N_("Do not use APM to halt the computer."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -46,8 +47,8 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(halt)
{
cmd = grub_register_extcmd ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH,
"halt [-n]",
"Halt the system, if possible using APM.",
"[-n]",
N_("Halt the system, if possible using APM."),
options);
}

View File

@ -1,7 +1,7 @@
/* play.c - command to play a tune */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,6 +27,7 @@
#include <grub/machine/time.h>
#include <grub/cpu/io.h>
#include <grub/command.h>
#include <grub/i18n.h>
#define BASE_TEMPO 120
@ -207,7 +208,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(play)
{
cmd = grub_register_command ("play", grub_cmd_play,
"play FILE", "Play a tune.");
N_("FILE"), N_("Play a tune."));
}
GRUB_MOD_FINI(play)

View File

@ -1,7 +1,7 @@
/* pxe.c - command to control the pxe driver */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,79 +21,32 @@
#include <grub/err.h>
#include <grub/misc.h>
#include <grub/machine/pxe.h>
#include <grub/extcmd.h>
static const struct grub_arg_option options[] =
{
{"info", 'i', 0, "Show PXE information.", 0, 0},
{"bsize", 'b', 0, "Set PXE block size.", 0, ARG_TYPE_INT},
{"unload", 'u', 0, "Unload PXE stack.", 0, 0},
{0, 0, 0, 0, 0, 0}
};
static void
print_ip (grub_uint32_t ip)
{
int i;
for (i = 0; i < 3; i++)
{
grub_printf ("%d.", ip & 0xFF);
ip >>= 8;
}
grub_printf ("%d", ip);
}
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_pxe (grub_extcmd_t cmd, int argc __attribute__ ((unused)),
char **args __attribute__ ((unused)))
grub_cmd_pxe_unload (grub_command_t cmd __attribute__ ((unused)),
int argc __attribute__ ((unused)),
char **args __attribute__ ((unused)))
{
struct grub_arg_list *state = cmd->state;
if (! grub_pxe_pxenv)
return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no pxe environment");
if (state[1].set)
{
int size;
size = grub_strtoul (state[1].arg, 0, 0);
if (size < GRUB_PXE_MIN_BLKSIZE)
size = GRUB_PXE_MIN_BLKSIZE;
else if (size > GRUB_PXE_MAX_BLKSIZE)
size = GRUB_PXE_MAX_BLKSIZE;
grub_pxe_blksize = size;
}
if (state[0].set)
{
grub_printf ("blksize : %d\n", grub_pxe_blksize);
grub_printf ("client ip : ");
print_ip (grub_pxe_your_ip);
grub_printf ("\nserver ip : ");
print_ip (grub_pxe_server_ip);
grub_printf ("\ngateway ip : ");
print_ip (grub_pxe_gateway_ip);
grub_printf ("\n");
}
if (state[2].set)
grub_pxe_unload ();
grub_pxe_unload ();
return 0;
}
static grub_extcmd_t cmd;
static grub_command_t cmd;
GRUB_MOD_INIT(pxecmd)
{
cmd = grub_register_extcmd ("pxe", grub_cmd_pxe, GRUB_COMMAND_FLAG_BOTH,
"pxe [-i|-b|-u]",
"Command to control the PXE device.", options);
cmd = grub_register_command ("pxe_unload", grub_cmd_pxe_unload,
0,
N_("Unload PXE environment."));
}
GRUB_MOD_FINI(pxecmd)
{
grub_unregister_extcmd (cmd);
grub_unregister_command (cmd);
}

View File

@ -1,7 +1,7 @@
/* vbeinfo.c - command to list compatible VBE video modes. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,6 +24,7 @@
#include <grub/machine/vbe.h>
#include <grub/mm.h>
#include <grub/command.h>
#include <grub/i18n.h>
static void *
real2pm (grub_vbe_farptr_t ptr)
@ -175,7 +176,7 @@ GRUB_MOD_INIT(vbeinfo)
{
cmd =
grub_register_command ("vbeinfo", grub_cmd_vbeinfo, 0,
"List compatible VESA BIOS extension video modes.");
N_("List compatible VESA BIOS extension video modes."));
}
GRUB_MOD_FINI(vbeinfo)

View File

@ -25,6 +25,7 @@
#include <grub/machine/init.h>
#include <grub/machine/vbe.h>
#include <grub/err.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)),
@ -168,7 +169,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(vbetest)
{
cmd = grub_register_command ("vbetest", grub_cmd_vbetest,
0, "Test VESA BIOS Extension 2.0+ support.");
0, N_("Test VESA BIOS Extension 2.0+ support."));
}
GRUB_MOD_FINI(vbetest)

View File

@ -22,6 +22,7 @@
#include <grub/term.h>
#include <grub/ieee1275/ieee1275.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_suspend (grub_command_t cmd __attribute__ ((unused)),
@ -39,7 +40,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(ieee1275_suspend)
{
cmd = grub_register_command ("suspend", grub_cmd_suspend,
0, "Return to Open Firmware prompt.");
0, N_("Return to Open Firmware prompt."));
}
GRUB_MOD_FINI(ieee1275_suspend)

View File

@ -21,12 +21,13 @@
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/term.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"shift", 's', 0, "Check Shift key.", 0, 0},
{"ctrl", 'c', 0, "Check Control key.", 0, 0},
{"alt", 'a', 0, "Check Alt key.", 0, 0},
{"shift", 's', 0, N_("Check Shift key."), 0, 0},
{"ctrl", 'c', 0, N_("Check Control key."), 0, 0},
{"alt", 'a', 0, N_("Check Alt key."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -81,8 +82,8 @@ GRUB_MOD_INIT(keystatus)
{
cmd = grub_register_extcmd ("keystatus", grub_cmd_keystatus,
GRUB_COMMAND_FLAG_BOTH,
"keystatus [--shift] [--ctrl] [--alt]",
"Check key modifier status.",
N_("[--shift] [--ctrl] [--alt]"),
N_("Check key modifier status."),
options);
}

View File

@ -26,10 +26,11 @@
#include <grub/partition.h>
#include <grub/lib/envblk.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"file", 'f', 0, "Specify filename.", 0, ARG_TYPE_PATHNAME},
{"file", 'f', 0, N_("Specify filename."), 0, ARG_TYPE_PATHNAME},
{0, 0, 0, 0, 0, 0}
};
@ -328,7 +329,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args)
}
if (! argc)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "No variable is specified");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no variable is specified");
file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
if (! file)
@ -384,20 +385,20 @@ GRUB_MOD_INIT(loadenv)
cmd_load =
grub_register_extcmd ("load_env", grub_cmd_load_env,
GRUB_COMMAND_FLAG_BOTH,
"load_env [-f FILE]",
"Load variables from environment block file.",
N_("[-f FILE]"),
N_("Load variables from environment block file."),
options);
cmd_list =
grub_register_extcmd ("list_env", grub_cmd_list_env,
GRUB_COMMAND_FLAG_BOTH,
"list_env [-f FILE]",
"List variables from environment block file.",
N_("[-f FILE]"),
N_("List variables from environment block file."),
options);
cmd_save =
grub_register_extcmd ("save_env", grub_cmd_save_env,
GRUB_COMMAND_FLAG_BOTH,
"save_env [-f FILE] variable_name [...]",
"Save variables to environment block file.",
N_("[-f FILE] variable_name [...]"),
N_("Save variables to environment block file."),
options);
}

View File

@ -1,7 +1,7 @@
/* ls.c - command to list files and devices */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2003,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -30,12 +30,13 @@
#include <grub/normal.h>
#include <grub/extcmd.h>
#include <grub/datetime.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"long", 'l', 0, "Show a long list with more detailed information.", 0, 0},
{"human-readable", 'h', 0, "Print sizes in a human readable format.", 0, 0},
{"all", 'a', 0, "List all files.", 0, 0},
{"long", 'l', 0, N_("Show a long list with more detailed information."), 0, 0},
{"human-readable", 'h', 0, N_("Print sizes in a human readable format."), 0, 0},
{"all", 'a', 0, N_("List all files."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -260,8 +261,8 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(ls)
{
cmd = grub_register_extcmd ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH,
"ls [-l|-h|-a] [FILE]",
"List devices and files.", options);
N_("[-l|-h|-a] [FILE]"),
N_("List devices and files."), options);
}
GRUB_MOD_FINI(ls)

View File

@ -20,6 +20,7 @@
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)),
@ -43,7 +44,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(lsmmap)
{
cmd = grub_register_command ("lsmmap", grub_cmd_lsmmap,
0, "List memory map provided by firmware.");
0, N_("List memory map provided by firmware."));
}
GRUB_MOD_FINI(lsmmap)

View File

@ -21,6 +21,7 @@
#include <grub/dl.h>
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
struct grub_pci_classname
{
@ -218,7 +219,7 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(lspci)
{
cmd = grub_register_extcmd ("lspci", grub_cmd_lspci, GRUB_COMMAND_FLAG_BOTH,
"lspci [-i]", "List PCI devices.", options);
"[-i]", N_("List PCI devices."), options);
}
GRUB_MOD_FINI(lspci)

View File

@ -21,13 +21,14 @@
#include <grub/misc.h>
#include <grub/extcmd.h>
#include <grub/env.h>
#include <grub/i18n.h>
static grub_extcmd_t cmd_read_byte, cmd_read_word, cmd_read_dword;
static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword;
static const struct grub_arg_option options[] =
{
{0, 'v', 0, "Save read value into variable VARNAME.",
{0, 'v', 0, N_("Save read value into variable VARNAME."),
"VARNAME", ARG_TYPE_STRING},
{0, 0, 0, 0, 0, 0}
};
@ -41,7 +42,7 @@ grub_cmd_read (grub_extcmd_t cmd, int argc, char **argv)
char buf[sizeof ("XXXXXXXX")];
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid number of arguments");
addr = grub_strtoul (argv[0], 0, 0);
switch (cmd->cmd->name[sizeof ("read_") - 1])
@ -78,7 +79,7 @@ grub_cmd_write (grub_command_t cmd, int argc, char **argv)
grub_uint32_t mask = 0xffffffff;
if (argc != 2 && argc != 3)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid number of arguments");
addr = grub_strtoul (argv[0], 0, 0);
value = grub_strtoul (argv[1], 0, 0);
@ -119,22 +120,22 @@ GRUB_MOD_INIT(memrw)
{
cmd_read_byte =
grub_register_extcmd ("read_byte", grub_cmd_read, GRUB_COMMAND_FLAG_BOTH,
"read_byte ADDR", "Read byte from ADDR.", options);
N_("ADDR"), N_("Read byte from ADDR."), options);
cmd_read_word =
grub_register_extcmd ("read_word", grub_cmd_read, GRUB_COMMAND_FLAG_BOTH,
"read_word ADDR", "Read word from ADDR.", options);
N_("ADDR"), N_("Read word from ADDR."), options);
cmd_read_dword =
grub_register_extcmd ("read_dword", grub_cmd_read, GRUB_COMMAND_FLAG_BOTH,
"read_dword ADDR", "Read dword from ADDR.", options);
N_("ADDR"), N_("Read dword from ADDR."), options);
cmd_write_byte =
grub_register_command ("write_byte", grub_cmd_write,
"write_byte ADDR VALUE [MASK]", "Write byte VALUE to ADDR.");
N_("ADDR VALUE [MASK]"), N_("Write byte VALUE to ADDR."));
cmd_write_word =
grub_register_command ("write_word", grub_cmd_write,
"write_word ADDR VALUE [MASK]", "Write word VALUE to ADDR.");
N_("ADDR VALUE [MASK]"), N_("Write word VALUE to ADDR."));
cmd_write_dword =
grub_register_command ("write_dword", grub_cmd_write,
"write_dword ADDR VALUE [MASK]", "Write dword VALUE to ADDR.");
N_("ADDR VALUE [MASK]"), N_("Write dword VALUE to ADDR."));
}
GRUB_MOD_FINI(memrw)

View File

@ -27,6 +27,7 @@
#include <grub/term.h>
#include <grub/loader.h>
#include <grub/command.h>
#include <grub/i18n.h>
/* cat FILE */
static grub_err_t
@ -353,28 +354,28 @@ GRUB_MOD_INIT(minicmd)
{
cmd_cat =
grub_register_command ("cat", grub_mini_cmd_cat,
"cat FILE", "Show the contents of a file.");
N_("FILE"), N_("Show the contents of a file."));
cmd_help =
grub_register_command ("help", grub_mini_cmd_help,
0, "Show this message.");
0, N_("Show this message."));
cmd_root =
grub_register_command ("root", grub_mini_cmd_root,
"root [DEVICE]", "Set the root device.");
N_("[DEVICE]"), N_("Set the root device."));
cmd_dump =
grub_register_command ("dump", grub_mini_cmd_dump,
"dump ADDR", "Dump memory.");
N_("ADDR"), N_("Dump memory."));
cmd_rmmod =
grub_register_command ("rmmod", grub_mini_cmd_rmmod,
"rmmod MODULE", "Remove a module.");
N_("MODULE"), N_("Remove a module."));
cmd_lsmod =
grub_register_command ("lsmod", grub_mini_cmd_lsmod,
0, "Show loaded modules.");
0, N_("Show loaded modules."));
cmd_exit =
grub_register_command ("exit", grub_mini_cmd_exit,
0, "Exit from GRUB.");
0, N_("Exit from GRUB."));
cmd_clear =
grub_register_command ("clear", grub_mini_cmd_clear,
0, "Clear the screen.");
0, N_("Clear the screen."));
}
GRUB_MOD_FINI(minicmd)

View File

@ -29,6 +29,7 @@
#include <grub/partition.h>
#include <grub/parttool.h>
#include <grub/command.h>
#include <grub/i18n.h>
static struct grub_parttool *parts = 0;
static int curhandle = 0;
@ -322,7 +323,7 @@ GRUB_MOD_INIT(parttool)
{
mymod = mod;
cmd = grub_register_command ("parttool", grub_cmd_parttool,
"parttool PARTITION COMMANDS",
N_("PARTITION COMMANDS"),
helpmsg);
}

View File

@ -24,6 +24,7 @@
#include <grub/env.h>
#include <grub/normal.h>
#include <grub/dl.h>
#include <grub/i18n.h>
static grub_dl_t my_mod;
@ -48,7 +49,7 @@ grub_cmd_password (grub_command_t cmd __attribute__ ((unused)),
int copylen;
if (argc != 2)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two arguments expected.");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments expected");
pass = grub_zalloc (GRUB_AUTH_MAX_PASSLEN);
if (!pass)
@ -74,9 +75,9 @@ GRUB_MOD_INIT(password)
{
my_mod = mod;
cmd = grub_register_command ("password", grub_cmd_password,
"password USER PASSWORD",
"Set user password (plaintext). "
"Unrecommended and insecure.");
N_("USER PASSWORD"),
N_("Set user password (plaintext). "
"Unrecommended and insecure."));
}
GRUB_MOD_FINI(password)

View File

@ -30,16 +30,17 @@
#include <grub/misc.h>
#include <grub/env.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"set", 's', GRUB_ARG_OPTION_OPTIONAL,
"Set a variable to return value.", "VAR", ARG_TYPE_STRING},
{"driver", 'd', 0, "Determine driver.", 0, 0},
{"partmap", 'p', 0, "Determine partition map type.", 0, 0},
{"fs", 'f', 0, "Determine filesystem type.", 0, 0},
{"fs-uuid", 'u', 0, "Determine filesystem UUID.", 0, 0},
{"label", 'l', 0, "Determine filesystem label.", 0, 0},
N_("Set a variable to return value."), "VAR", ARG_TYPE_STRING},
{"driver", 'd', 0, N_("Determine driver."), 0, 0},
{"partmap", 'p', 0, N_("Determine partition map type."), 0, 0},
{"fs", 'f', 0, N_("Determine filesystem type."), 0, 0},
{"fs-uuid", 'u', 0, N_("Determine filesystem UUID."), 0, 0},
{"label", 'l', 0, N_("Determine filesystem label."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -150,8 +151,8 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT (probe)
{
cmd = grub_register_extcmd ("probe", grub_cmd_probe, GRUB_COMMAND_FLAG_BOTH,
"probe [DEVICE]",
"Retrieve device info.", options);
N_("[DEVICE]"),
N_("Retrieve device info."), options);
}
GRUB_MOD_FINI (probe)

View File

@ -24,6 +24,7 @@
#include <grub/term.h>
#include <grub/types.h>
#include <grub/command.h>
#include <grub/i18n.h>
static char *
grub_getline (void)
@ -79,8 +80,8 @@ static grub_command_t cmd;
GRUB_MOD_INIT(read)
{
cmd = grub_register_command ("read", grub_cmd_read,
"read [ENVVAR]",
"Set variable with user input.");
N_("[ENVVAR]"),
N_("Set variable with user input."));
}
GRUB_MOD_FINI(read)

View File

@ -20,6 +20,7 @@
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/misc.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)),
@ -35,7 +36,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(reboot)
{
cmd = grub_register_command ("reboot", grub_cmd_reboot,
0, "Reboot the computer.");
0, N_("Reboot the computer."));
}
GRUB_MOD_FINI(reboot)

View File

@ -25,29 +25,12 @@
#include <grub/device.h>
#include <grub/file.h>
#include <grub/env.h>
#include <grub/extcmd.h>
#include <grub/command.h>
#include <grub/search.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"file", 'f', 0, "Search devices by a file.", 0, 0},
{"label", 'l', 0, "Search devices by a filesystem label.", 0, 0},
{"fs-uuid", 'u', 0, "Search devices by a filesystem UUID.", 0, 0},
{"set", 's', GRUB_ARG_OPTION_OPTIONAL, "Set a variable to the first device found.", "VAR", ARG_TYPE_STRING},
{"no-floppy", 'n', 0, "Do not probe any floppy drive.", 0, 0},
{0, 0, 0, 0, 0, 0}
};
enum options
{
SEARCH_FILE,
SEARCH_LABEL,
SEARCH_FS_UUID,
SEARCH_SET,
SEARCH_NO_FLOPPY,
};
static void
search_fs (const char *key, const char *var, int no_floppy, enum options type)
void
FUNC_NAME (const char *key, const char *var, int no_floppy)
{
int count = 0;
char *buf = NULL;
@ -63,7 +46,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
return 0;
if (type == SEARCH_FILE)
#ifdef DO_SEARCH_FILE
{
grub_size_t len;
char *p;
@ -84,27 +67,29 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
grub_file_close (file);
}
}
else
#else
{
/* type is SEARCH_FS_UUID or SEARCH_LABEL */
/* SEARCH_FS_UUID or SEARCH_LABEL */
grub_device_t dev;
grub_fs_t fs;
int (*compare_fn) (const char *, const char *);
char *quid;
dev = grub_device_open (name);
if (dev)
{
fs = grub_fs_probe (dev);
compare_fn =
(type == SEARCH_FS_UUID) ? grub_strcasecmp : grub_strcmp;
if (fs && ((type == SEARCH_FS_UUID) ? fs->uuid : fs->label))
#ifdef DO_SEARCH_FS_UUID
#define compare_fn grub_strcasecmp
#define read_fn uuid
#else
#define compare_fn grub_strcmp
#define read_fn label
#endif
if (fs && fs->read_fn)
{
if (type == SEARCH_FS_UUID)
fs->uuid (dev, &quid);
else
fs->label (dev, &quid);
fs->read_fn (dev, &quid);
if (grub_errno == GRUB_ERR_NONE && quid)
{
@ -118,6 +103,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
grub_device_close (dev);
}
}
#endif
if (found)
{
@ -156,45 +142,42 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
}
static grub_err_t
grub_cmd_search (grub_extcmd_t cmd, int argc, char **args)
grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc,
char **args)
{
struct grub_arg_list *state = cmd->state;
const char *var = 0;
if (argc == 0)
return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified");
if (state[SEARCH_SET].set)
var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root";
if (state[SEARCH_LABEL].set)
search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_LABEL);
else if (state[SEARCH_FS_UUID].set)
search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FS_UUID);
else if (state[SEARCH_FILE].set)
search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FILE);
else
return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
FUNC_NAME (args[0], argc == 1 ? 0 : args[1], 0);
return grub_errno;
}
static grub_extcmd_t cmd;
static grub_command_t cmd;
GRUB_MOD_INIT(search)
#ifdef DO_SEARCH_FILE
GRUB_MOD_INIT(search_file)
#elif defined (DO_SEARCH_FS_UUID)
GRUB_MOD_INIT(search_fs_uuid)
#else
GRUB_MOD_INIT(search_fs_label)
#endif
{
cmd =
grub_register_extcmd ("search", grub_cmd_search,
GRUB_COMMAND_FLAG_BOTH,
"search [-f|-l|-u|-s|-n] NAME",
"Search devices by file, filesystem label or filesystem UUID."
" If --set is specified, the first device found is"
" set to a variable. If no variable name is"
" specified, \"root\" is used.",
options);
grub_register_command (COMMAND_NAME, grub_cmd_do_search,
N_("NAME [VARIABLE]"),
"Search devices by " SEARCH_TARGET "."
" If VARIABLE is specified, "
"the first device found is set to a variable.");
}
GRUB_MOD_FINI(search)
#ifdef DO_SEARCH_FILE
GRUB_MOD_FINI(search_file)
#elif defined (DO_SEARCH_FS_UUID)
GRUB_MOD_FINI(search_fs_uuid)
#else
GRUB_MOD_FINI(search_fs_label)
#endif
{
grub_unregister_extcmd (cmd);
grub_unregister_command (cmd);
}

5
commands/search_file.c Normal file
View File

@ -0,0 +1,5 @@
#define DO_SEARCH_FILE 1
#define FUNC_NAME grub_search_fs_file
#define COMMAND_NAME "search.file"
#define SEARCH_TARGET "file"
#include "search.c"

5
commands/search_label.c Normal file
View File

@ -0,0 +1,5 @@
#define DO_SEARCH_FS_LABEL 1
#define FUNC_NAME grub_search_label
#define COMMAND_NAME "search.fs_label"
#define SEARCH_TARGET "filesystem label"
#include "search.c"

5
commands/search_uuid.c Normal file
View File

@ -0,0 +1,5 @@
#define DO_SEARCH_FS_UUID 1
#define FUNC_NAME grub_search_fs_uuid
#define COMMAND_NAME "search.fs_uuid"
#define SEARCH_TARGET "filesystem UUID"
#include "search.c"

95
commands/search_wrap.c Normal file
View File

@ -0,0 +1,95 @@
/* search.c - search devices based on a file or a filesystem label */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/types.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/err.h>
#include <grub/dl.h>
#include <grub/env.h>
#include <grub/extcmd.h>
#include <grub/search.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"file", 'f', 0, N_("Search devices by a file."), 0, 0},
{"label", 'l', 0, N_("Search devices by a filesystem label."),
0, 0},
{"fs-uuid", 'u', 0, N_("Search devices by a filesystem UUID."),
0, 0},
{"set", 's', GRUB_ARG_OPTION_OPTIONAL,
N_("Set a variable to the first device found."), "VAR", ARG_TYPE_STRING},
{"no-floppy", 'n', 0, N_("Do not probe any floppy drive."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
enum options
{
SEARCH_FILE,
SEARCH_LABEL,
SEARCH_FS_UUID,
SEARCH_SET,
SEARCH_NO_FLOPPY,
};
static grub_err_t
grub_cmd_search (grub_extcmd_t cmd, int argc, char **args)
{
struct grub_arg_list *state = cmd->state;
const char *var = 0;
if (argc == 0)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified");
if (state[SEARCH_SET].set)
var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root";
if (state[SEARCH_LABEL].set)
grub_search_label (args[0], var, state[SEARCH_NO_FLOPPY].set);
else if (state[SEARCH_FS_UUID].set)
grub_search_fs_uuid (args[0], var, state[SEARCH_NO_FLOPPY].set);
else if (state[SEARCH_FILE].set)
grub_search_fs_file (args[0], var, state[SEARCH_NO_FLOPPY].set);
else
return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
return grub_errno;
}
static grub_extcmd_t cmd;
GRUB_MOD_INIT(search)
{
cmd =
grub_register_extcmd ("search", grub_cmd_search,
GRUB_COMMAND_FLAG_BOTH,
N_("search [-f|-l|-u|-s|-n] NAME"),
N_("Search devices by file, filesystem label"
" or filesystem UUID."
" If --set is specified, the first device found is"
" set to a variable. If no variable name is"
" specified, \"root\" is used."),
options);
}
GRUB_MOD_FINI(search)
{
grub_unregister_extcmd (cmd);
}

View File

@ -24,11 +24,12 @@
#include <grub/misc.h>
#include <grub/machine/time.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
static const struct grub_arg_option options[] =
{
{"verbose", 'v', 0, "Verbose countdown.", 0, 0},
{"interruptible", 'i', 0, "Interruptible with ESC.", 0, 0},
{"verbose", 'v', 0, N_("Verbose countdown."), 0, 0},
{"interruptible", 'i', 0, N_("Interruptible with ESC."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -102,8 +103,8 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(sleep)
{
cmd = grub_register_extcmd ("sleep", grub_cmd_sleep, GRUB_COMMAND_FLAG_BOTH,
"sleep NUMBER_OF_SECONDS",
"Wait for a specified number of seconds.",
N_("NUMBER_OF_SECONDS"),
N_("Wait for a specified number of seconds."),
options);
}

View File

@ -347,12 +347,12 @@ GRUB_MOD_INIT(terminal)
{
cmd_terminal_input =
grub_register_command ("terminal_input", grub_cmd_terminal_input,
"terminal_input [--append|--remove] "
"[--append|--remove] "
"[TERMINAL1] [TERMINAL2] ...",
"List or select an input terminal.");
cmd_terminal_output =
grub_register_command ("terminal_output", grub_cmd_terminal_output,
"terminal_output [--append|--remove] "
"[--append|--remove] "
"[TERMINAL1] [TERMINAL2] ...",
"List or select an output terminal.");
}

View File

@ -1,7 +1,7 @@
/* test.c -- The test command.. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2007 Free Software Foundation, Inc.
* Copyright (C) 2005,2007,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -25,6 +25,7 @@
#include <grub/device.h>
#include <grub/file.h>
#include <grub/command.h>
#include <grub/i18n.h>
/* A simple implementation for signed numbers. */
static int
@ -420,9 +421,9 @@ static grub_command_t cmd_1, cmd_2;
GRUB_MOD_INIT(test)
{
cmd_1 = grub_register_command ("[", grub_cmd_test,
"[ EXPRESSION ]", "Evaluate an expression.");
N_("EXPRESSION ]"), N_("Evaluate an expression."));
cmd_2 = grub_register_command ("test", grub_cmd_test,
"test EXPRESSION", "Evaluate an expression.");
N_("EXPRESSION"), N_("Evaluate an expression."));
}
GRUB_MOD_FINI(test)

View File

@ -19,6 +19,7 @@
#include <grub/dl.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)),
@ -43,10 +44,10 @@ GRUB_MOD_INIT(true)
{
cmd_true =
grub_register_command ("true", grub_cmd_true,
0, "Do nothing, successfully.");
0, N_("Do nothing, successfully."));
cmd_false =
grub_register_command ("false", grub_cmd_false,
0, "Do nothing, unsuccessfully.");
0, N_("Do nothing, unsuccessfully."));
}
GRUB_MOD_FINI(true)

View File

@ -25,6 +25,7 @@
#include <grub/dl.h>
#include <grub/usb.h>
#include <grub/command.h>
#include <grub/i18n.h>
static const char *usb_classes[] =
{
@ -195,7 +196,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(usbtest)
{
cmd = grub_register_command ("usb", grub_cmd_usbtest,
0, "Test USB support.");
0, N_("Test USB support."));
}
GRUB_MOD_FINI(usbtest)

View File

@ -24,6 +24,7 @@
#include <grub/font.h>
#include <grub/term.h>
#include <grub/command.h>
#include <grub/i18n.h>
static grub_err_t
grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
@ -73,7 +74,7 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)),
sanssmall = grub_font_get ("Helvetica 8");
fixed = grub_font_get ("Fixed 20");
if (! sansbig || ! sans || ! sanssmall || ! fixed)
return grub_error (GRUB_ERR_BAD_FONT, "No font loaded.");
return grub_error (GRUB_ERR_BAD_FONT, "no font loaded");
glyph = grub_font_get_glyph (fixed, '*');
grub_font_draw_glyph (glyph, color, 200 ,0);
@ -181,7 +182,7 @@ static grub_command_t cmd;
GRUB_MOD_INIT(videotest)
{
cmd = grub_register_command ("videotest", grub_cmd_videotest,
0, "Test video subsystem.");
0, N_("Test video subsystem."));
}
GRUB_MOD_FINI(videotest)

View File

@ -32,6 +32,7 @@
#include <grub/env.h>
#include <grub/command.h>
#include <grub/crypto.h>
#include <grub/i18n.h>
/* This prefix is used by xnu and boot-132 to hash
together with volume serial. */
@ -88,9 +89,9 @@ static grub_command_t cmd;
GRUB_MOD_INIT (xnu_uuid)
{
cmd = grub_register_command ("xnu_uuid", grub_cmd_xnu_uuid,
"xnu_uuid GRUBUUID [VARNAME]",
"Transform 64-bit UUID to format "
"suitable for xnu.");
N_("GRUBUUID [VARNAME]"),
N_("Transform 64-bit UUID to format "
"suitable for XNU."));
}
GRUB_MOD_FINI (xnu_uuid)

View File

@ -8,7 +8,9 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \
commands/configfile.c commands/echo.c commands/help.c \
commands/handler.c commands/ls.c commands/test.c \
commands/search.c commands/blocklist.c commands/hexdump.c \
commands/search_wrap.c commands/search_file.c \
commands/search_label.c commands/search_uuid.c \
commands/blocklist.c commands/hexdump.c \
lib/hexdump.c commands/halt.c commands/reboot.c \
lib/envblk.c commands/loadenv.c \
commands/gptsync.c commands/probe.c commands/xnu_uuid.c \

View File

@ -395,7 +395,7 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS)
# Commands.
pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \
ls.mod cmp.mod cat.mod help.mod search.mod loopback.mod \
fs_file.mod fs_uuid.mod configfile.mod echo.mod \
configfile.mod echo.mod \
terminfo.mod test.mod blocklist.mod hexdump.mod \
read.mod sleep.mod loadenv.mod crc.mod parttool.mod \
msdospart.mod memrw.mod normal.mod sh.mod \
@ -490,10 +490,27 @@ help_mod_CFLAGS = $(COMMON_CFLAGS)
help_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For search.mod.
search_mod_SOURCES = commands/search.c
search_mod_SOURCES = commands/search_wrap.c
search_mod_CFLAGS = $(COMMON_CFLAGS)
search_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += search_fs_file.mod search_fs_uuid.mod search_label.mod
# For search.mod.
search_fs_file_mod_SOURCES = commands/search_file.c
search_fs_file_mod_CFLAGS = $(COMMON_CFLAGS)
search_fs_file_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For search.mod.
search_label_mod_SOURCES = commands/search_label.c
search_label_mod_CFLAGS = $(COMMON_CFLAGS)
search_label_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For search.mod.
search_fs_uuid_mod_SOURCES = commands/search_uuid.c
search_fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS)
search_fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For test.mod.
test_mod_SOURCES = commands/test.c
test_mod_CFLAGS = $(COMMON_CFLAGS)
@ -504,16 +521,6 @@ loopback_mod_SOURCES = disk/loopback.c
loopback_mod_CFLAGS = $(COMMON_CFLAGS)
loopback_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For fs_file.mod
fs_file_mod_SOURCES = disk/fs_file.c
fs_file_mod_CFLAGS = $(COMMON_CFLAGS)
fs_file_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For fs_uuid.mod
fs_uuid_mod_SOURCES = disk/fs_uuid.c
fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS)
fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For configfile.mod
configfile_mod_SOURCES = commands/configfile.c
configfile_mod_CFLAGS = $(COMMON_CFLAGS)

View File

@ -115,9 +115,6 @@ grub_install_SOURCES = util/grub-install.in
bin_SCRIPTS += grub-mkrescue
grub_mkrescue_SOURCES = util/grub-mkrescue.in
bin_SCRIPTS += grub-mkfloppy
grub_mkfloppy_SOURCES = util/i386/pc/grub-mkfloppy.in
pkglib_MODULES = biosdisk.mod chain.mod \
multiboot.mod reboot.mod halt.mod \
vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \

View File

@ -93,7 +93,7 @@ grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \
sbin_SCRIPTS = grub-install
# For grub-install.
grub_install_SOURCES = util/sparc64/ieee1275/grub-install.in
grub_install_SOURCES = util/grub-install.in
# Modules.
pkglib_MODULES = halt.mod \

666
config.rpath Executable file
View File

@ -0,0 +1,666 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2007 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
darwin*)
case $cc_basename in
xlc*)
wl='-Wl,'
;;
esac
;;
mingw* | cygwin* | pw32* | os2*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
newsos6)
;;
linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
wl='-Wl,'
;;
pgcc | pgf77 | pgf90)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
wl='-Wl,'
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix3* | aix4* | aix5*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
# that the semantics of dynamic libraries on AmigaOS, at least up
# to version 4, is to share data among multiple programs linked
# with the same dynamic library. Since this doesn't match the
# behavior of shared libraries on other platforms, we cannot use
# them.
ld_shlibs=no
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix4* | aix5*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if test "$GCC" = yes ; then
:
else
case $cc_basename in
xlc*)
;;
*)
ld_shlibs=no
;;
esac
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd1*)
ld_shlibs=no
;;
freebsd2.2*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
freebsd2*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix4* | aix5*)
library_names_spec='$libname$shrext'
;;
amigaos*)
library_names_spec='$libname.a'
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd1*)
;;
freebsd* | dragonfly*)
case "$host_os" in
freebsd[123]*)
library_names_spec='$libname$shrext$versuffix' ;;
*)
library_names_spec='$libname$shrext' ;;
esac
;;
gnu*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
nto-qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF

View File

@ -1,6 +1,6 @@
# Process this file with autoconf to produce a configure script.
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
#
# This configure.ac is free software; the author
# gives unlimited permission to copy and/or distribute it,
@ -44,6 +44,11 @@ AC_CANONICAL_TARGET
# Program name transformations
AC_ARG_PROGRAM
# Optimization flag. Allow user to override.
if test "x$TARGET_CFLAGS" = x; then
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
fi
case "$target_cpu" in
i[[3456]]86) target_cpu=i386 ;;
sparc) target_cpu=sparc64 ;;
@ -173,7 +178,7 @@ AC_PROG_CC
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
AC_GNU_SOURCE
AM_GNU_GETTEXT
AM_GNU_GETTEXT([external])
AC_SYS_LARGEFILE
# Identify characteristics of the host architecture.
@ -242,60 +247,45 @@ CPPFLAGS="$TARGET_CPPFLAGS"
LDFLAGS="$TARGET_LDFLAGS"
LIBS=""
if test "x$TARGET_CFLAGS" = x; then
# debug flags.
TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-Wundef -Wstrict-prototypes -g"
# debug flags.
TARGET_CFLAGS="$TARGET_CFLAGS -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \
-Wundef -Wstrict-prototypes -g"
# optimization flags.
AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [
CFLAGS=-Os
# Force no alignment to save space on i386.
if test "x$target_cpu" = xi386; then
AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
CFLAGS="$CFLAGS -falign-loops=1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_Os=yes],
[grub_cv_cc_Os=no])
[grub_cv_cc_falign_loop=yes],
[grub_cv_cc_falign_loop=no])
])
if test "x$grub_cv_cc_Os" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
if test "x$grub_cv_cc_falign_loop" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
else
TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
fi
# Force no alignment to save space on i386.
if test "x$target_cpu" = xi386; then
AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [
CFLAGS="$CFLAGS -falign-loops=1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_falign_loop=yes],
[grub_cv_cc_falign_loop=no])
])
# Some toolchains enable these features by default, but they need
# registers that aren't set up properly in GRUB.
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
fi
if test "x$grub_cv_cc_falign_loop" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1"
else
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
fi
# By default, GCC 4.4 generates .eh_frame sections containing unwind
# information in some cases where it previously did not. GRUB doesn't need
# these and they just use up vital space. Restore the old compiler
# behaviour.
AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_fno_dwarf2_cfi_asm=yes],
[grub_cv_cc_fno_dwarf2_cfi_asm=no])
CFLAGS="$SAVE_CFLAGS"
])
# Some toolchains enable these features by default, but they need
# registers that aren't set up properly in GRUB.
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
fi
# By default, GCC 4.4 generates .eh_frame sections containing unwind
# information in some cases where it previously did not. GRUB doesn't need
# these and they just use up vital space. Restore the old compiler
# behaviour.
AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
[grub_cv_cc_fno_dwarf2_cfi_asm=yes],
[grub_cv_cc_fno_dwarf2_cfi_asm=no])
CFLAGS="$SAVE_CFLAGS"
])
if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
fi
if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
fi
grub_apple_target_cc

View File

@ -281,7 +281,7 @@ grub_ata_identify (struct grub_ata_device *dev)
else
/* Other Error. */
return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"device can not be identified");
"device cannot be identified");
}
grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE);
@ -520,7 +520,7 @@ grub_ata_setaddress (struct grub_ata_device *dev,
|| cylinder > dev->cylinders
|| head > dev->heads)
return grub_error (GRUB_ERR_OUT_OF_RANGE,
"sector %d can not be addressed "
"sector %d cannot be addressed "
"using CHS addressing", sector);
grub_ata_regset (dev, GRUB_ATA_REG_DISK, (dev->device << 4) | head);
@ -675,7 +675,7 @@ grub_ata_open (const char *name, grub_disk_t disk)
}
if (! dev)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device");
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
if (dev->atapi)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk");
@ -775,7 +775,7 @@ grub_atapi_read (struct grub_scsi *scsi,
/* Count of last transfer may be uneven. */
if (! (0 < cnt && cnt <= size - nread && (! (cnt & 1) || cnt == size - nread)))
return grub_error (GRUB_ERR_READ_ERROR, "Invalid ATAPI transfer count");
return grub_error (GRUB_ERR_READ_ERROR, "invalid ATAPI transfer count");
/* Read the data. */
grub_ata_pio_read (dev, buf + nread, cnt);
@ -821,7 +821,7 @@ grub_atapi_open (const char *name, struct grub_scsi *scsi)
grub_dprintf ("ata", "opening ATAPI dev `%s'\n", name);
if (! devfnd)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such ATAPI device");
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such ATAPI device");
scsi->data = devfnd;

View File

@ -30,7 +30,7 @@ grub_ata_pass_through (grub_disk_t disk,
{
if (disk->dev->id != GRUB_DISK_DEVICE_ATA_ID)
return grub_error (GRUB_ERR_BAD_DEVICE,
"Device not accessed via ata.mod");
"device not accessed via ata.mod");
struct grub_ata_device *dev = (struct grub_ata_device *) disk->data;

View File

@ -1,7 +1,7 @@
/* dmraid_nvidia.c - module to handle Nvidia fakeraid. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -107,7 +107,7 @@ grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array)
if (sb.version != NV_VERSION)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unknown version: %d.%d", sb.version);
"unknown version: %d.%d", sb.version);
switch (sb.array.raid_level)
{
@ -129,7 +129,7 @@ grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array)
default:
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unsupported RAID level: %d", sb.array.raid_level);
"unsupported RAID level: %d", sb.array.raid_level);
}
array->number = 0;

View File

@ -1,136 +0,0 @@
/* fs_file.c - Access partition by a file it contains. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/file.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/partition.h>
static grub_device_t
search_fs_file (const char *key, unsigned long *count)
{
char *filename = NULL;
grub_device_t ret = NULL;
*count = 0;
auto int iterate_device (const char *name);
int iterate_device (const char *name)
{
int len;
grub_file_t file;
(*count)++;
len = grub_strlen (name) + 2 + grub_strlen (key) + 1;
filename = grub_realloc (filename, len);
if (! filename)
return 1;
grub_sprintf (filename, "(%s)%s", name, key);
file = grub_file_open (filename);
if (file)
{
grub_file_close (file);
ret = grub_device_open (name);
return 1;
}
grub_errno = GRUB_ERR_NONE;
return 0;
}
grub_device_iterate (iterate_device);
grub_free (filename);
return ret;
}
static grub_err_t
grub_fs_file_open (const char *name, grub_disk_t disk)
{
grub_device_t dev;
if (grub_strncmp (name, "FILE=", sizeof ("FILE=") - 1))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a FILE virtual volume");
dev = search_fs_file (name + sizeof ("FILE=") - 1, &disk->id);
if (! dev)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching file found");
disk->total_sectors = dev->disk->total_sectors;
disk->has_partitions = 0;
if (dev->disk->partition)
{
disk->partition = grub_malloc (sizeof (*disk->partition));
if (disk->partition)
grub_memcpy (disk->partition, dev->disk->partition,
sizeof (*disk->partition));
}
else
disk->partition = NULL;
disk->data = dev;
return GRUB_ERR_NONE;
}
static void
grub_fs_file_close (grub_disk_t disk)
{
grub_device_t parent = disk->data;
grub_device_close (parent);
}
static grub_err_t
grub_fs_file_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, char *buf)
{
grub_device_t parent = disk->data;
return parent->disk->dev->read (parent->disk, sector, size, buf);
}
static grub_err_t
grub_fs_file_write (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, const char *buf)
{
grub_device_t parent = disk->data;
return parent->disk->dev->write (parent->disk, sector, size, buf);
}
static struct grub_disk_dev grub_fs_file_dev = {
.name = "fs_file",
.id = GRUB_DISK_DEVICE_FILE_ID,
.open = grub_fs_file_open,
.close = grub_fs_file_close,
.read = grub_fs_file_read,
.write = grub_fs_file_write,
.next = 0
};
GRUB_MOD_INIT (fs_file)
{
grub_disk_dev_register (&grub_fs_file_dev);
}
GRUB_MOD_FINI (fs_file)
{
grub_disk_dev_unregister (&grub_fs_file_dev);
}

View File

@ -1,149 +0,0 @@
/* fs_uuid.c - Access disks by their filesystem UUID. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/disk.h>
#include <grub/dl.h>
#include <grub/kernel.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/types.h>
#include <grub/fs.h>
#include <grub/partition.h>
static grub_device_t
search_fs_uuid (const char *key, unsigned long *count)
{
*count = 0;
grub_device_t ret = NULL;
auto int iterate_device (const char *name);
int iterate_device (const char *name)
{
grub_device_t dev;
dev = grub_device_open (name);
if (dev)
{
grub_fs_t fs;
fs = grub_fs_probe (dev);
if (fs && fs->uuid)
{
char *uuid;
(fs->uuid) (dev, &uuid);
if (grub_errno == GRUB_ERR_NONE && uuid)
{
(*count)++;
if (grub_strcasecmp (uuid, key) == 0)
{
ret = dev;
grub_free (uuid);
return 1;
}
grub_free (uuid);
}
}
grub_device_close (dev);
}
grub_errno = GRUB_ERR_NONE;
return 0;
}
grub_device_iterate (iterate_device);
return ret;
}
static grub_err_t
grub_fs_uuid_open (const char *name, grub_disk_t disk)
{
grub_device_t dev;
if (grub_strncmp (name, "UUID=", sizeof ("UUID=")-1))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a UUID virtual volume");
dev = search_fs_uuid (name + sizeof ("UUID=") - 1, &disk->id);
if (! dev)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching UUID found");
disk->total_sectors = dev->disk->total_sectors;
disk->has_partitions = 0;
if (dev->disk->partition)
{
disk->partition = grub_malloc (sizeof (*disk->partition));
if (disk->partition)
grub_memcpy (disk->partition, dev->disk->partition,
sizeof (*disk->partition));
}
else
disk->partition = NULL;
disk->data = dev;
return GRUB_ERR_NONE;
}
static void
grub_fs_uuid_close (grub_disk_t disk __attribute((unused)))
{
grub_device_t parent = disk->data;
grub_device_close (parent);
}
static grub_err_t
grub_fs_uuid_read (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, char *buf)
{
grub_device_t parent = disk->data;
return parent->disk->dev->read (parent->disk, sector, size, buf);
}
static grub_err_t
grub_fs_uuid_write (grub_disk_t disk, grub_disk_addr_t sector,
grub_size_t size, const char *buf)
{
grub_device_t parent = disk->data;
return parent->disk->dev->write (parent->disk, sector, size, buf);
}
static struct grub_disk_dev grub_fs_uuid_dev =
{
.name = "fs_uuid",
.id = GRUB_DISK_DEVICE_UUID_ID,
.open = grub_fs_uuid_open,
.close = grub_fs_uuid_close,
.read = grub_fs_uuid_read,
.write = grub_fs_uuid_write,
.next = 0
};
GRUB_MOD_INIT(fs_uuid)
{
grub_disk_dev_register (&grub_fs_uuid_dev);
}
GRUB_MOD_FINI(fs_uuid)
{
grub_disk_dev_unregister (&grub_fs_uuid_dev);
}

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -222,7 +222,7 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk,
if (cmd)
return grub_error (GRUB_ERR_WRITE_ERROR, "can\'t write to cdrom");
dap->blocks = (dap->blocks + 3) >> 2;
dap->blocks = ALIGN_UP (dap->blocks, 4) >> 2;
dap->block >>= 2;
for (i = 0; i < GRUB_BIOSDISK_CDROM_RETRY_COUNT; i++)

View File

@ -1,7 +1,7 @@
/* nand.c - NAND flash disk access. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -67,7 +67,7 @@ grub_nand_open (const char *name, grub_disk_t disk)
} args;
if (! grub_strstr (name, "nand"))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Not a nand device");
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a NAND device");
data = grub_malloc (sizeof (*data));
if (! data)
@ -76,7 +76,7 @@ grub_nand_open (const char *name, grub_disk_t disk)
grub_ieee1275_open (name, &dev_ihandle);
if (! dev_ihandle)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
goto fail;
}
@ -89,7 +89,7 @@ grub_nand_open (const char *name, grub_disk_t disk)
if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't get block size");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get block size");
goto fail;
}
@ -102,7 +102,7 @@ grub_nand_open (const char *name, grub_disk_t disk)
if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't get disk size");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get disk size");
goto fail;
}
@ -172,7 +172,7 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector,
args.result = 1;
if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
return grub_error (GRUB_ERR_READ_ERROR, "Read error");
return grub_error (GRUB_ERR_READ_ERROR, "read error");
ofs = 0;
size -= len;

View File

@ -1,7 +1,7 @@
/* ofdisk.c - Open Firmware disk access. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2004,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -175,7 +175,7 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
grub_ieee1275_open (op->devpath, &dev_ihandle);
if (! dev_ihandle)
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
goto fail;
}
@ -184,20 +184,20 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
if (grub_ieee1275_finddevice (op->devpath, &dev))
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't read device properties");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't read device properties");
goto fail;
}
if (grub_ieee1275_get_property (dev, "device_type", prop, sizeof (prop),
&actual))
{
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't read the device type");
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't read the device type");
goto fail;
}
if (grub_strcmp (prop, "block"))
{
grub_error (GRUB_ERR_BAD_DEVICE, "Not a block device");
grub_error (GRUB_ERR_BAD_DEVICE, "not a block device");
goto fail;
}
@ -244,12 +244,12 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
(int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status);
if (status < 0)
return grub_error (GRUB_ERR_READ_ERROR,
"Seek error, can't seek block %llu",
"seek error, can't seek block %llu",
(long long) sector);
grub_ieee1275_read ((grub_ieee1275_ihandle_t) (unsigned long) disk->data,
buf, size * 512UL, &actual);
if (actual != actual)
return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu",
return grub_error (GRUB_ERR_READ_ERROR, "read error on block: %llu",
(long long) sector);
return 0;

View File

@ -23,6 +23,7 @@
#include <grub/disk.h>
#include <grub/mm.h>
#include <grub/extcmd.h>
#include <grub/i18n.h>
struct grub_loopback
{
@ -36,8 +37,8 @@ static struct grub_loopback *loopback_list;
static const struct grub_arg_option options[] =
{
{"delete", 'd', 0, "delete the loopback device entry", 0, 0},
{"partitions", 'p', 0, "simulate a hard drive with partitions", 0, 0},
{"delete", 'd', 0, N_("Delete the loopback device entry."), 0, 0},
{"partitions", 'p', 0, N_("Simulate a hard drive with partitions."), 0, 0},
{0, 0, 0, 0, 0, 0}
};
@ -56,7 +57,7 @@ delete_loopback (const char *name)
break;
if (! dev)
return grub_error (GRUB_ERR_BAD_DEVICE, "Device not found");
return grub_error (GRUB_ERR_BAD_DEVICE, "device not found");
/* Remove the device from the list. */
*prev = dev->next;
@ -167,7 +168,7 @@ grub_loopback_open (const char *name, grub_disk_t disk)
break;
if (! dev)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device");
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
file = grub_file_open (dev->filename);
if (! file)
@ -245,8 +246,8 @@ GRUB_MOD_INIT(loop)
{
cmd = grub_register_extcmd ("loopback", grub_cmd_loopback,
GRUB_COMMAND_FLAG_BOTH,
"loopback [-d|-p] DEVICENAME FILE",
"Make a device of a file.", options);
N_("[-d|-p] DEVICENAME FILE."),
N_("Make a device of a file."), options);
grub_disk_dev_register (&grub_loopback_dev);
}

View File

@ -1,7 +1,7 @@
/* lvm.c - module to read Logical Volumes. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -95,7 +95,7 @@ grub_lvm_open (const char *name, grub_disk_t disk)
}
if (! lv)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown LVM device %s", name);
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown LVM device %s", name);
disk->has_partitions = 0;
disk->id = lv->number;
@ -188,7 +188,7 @@ grub_lvm_read (grub_disk_t disk, grub_disk_addr_t sector,
size << GRUB_DISK_SECTOR_BITS, buf);
else
err = grub_error (GRUB_ERR_UNKNOWN_DEVICE,
"Physical volume %s not found", pv->name);
"physical volume %s not found", pv->name);
return err;
}
@ -263,7 +263,7 @@ grub_lvm_scan_device (const char *name)
if (dlocn->offset)
{
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"We don't support multiple LVM data areas");
"we don't support multiple LVM data areas");
goto fail;
}
@ -290,7 +290,7 @@ grub_lvm_scan_device (const char *name)
|| (grub_le_to_cpu32 (mdah->version) != GRUB_LVM_FMTT_VERSION))
{
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unknown LVM metadata header");
"unknown LVM metadata header");
goto fail2;
}

View File

@ -181,7 +181,7 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array)
/* FIXME: Also support version 1.0. */
if (sb.major_version != 0 || sb.minor_version != 90)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unsupported RAID version: %d.%d",
"unsupported RAID version: %d.%d",
sb.major_version, sb.minor_version);
/* FIXME: Check the checksum. */
@ -193,7 +193,7 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array)
if (sb.level != 0 && sb.level != 1 && sb.level != 4 &&
sb.level != 5 && sb.level != 6 && sb.level != 10)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unsupported RAID level: %d", sb.level);
"unsupported RAID level: %d", sb.level);
array->number = sb.md_minor;
array->level = sb.level;

View File

@ -1,7 +1,7 @@
/* raid.c - module to read RAID arrays. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -123,7 +123,7 @@ grub_raid_open (const char *name, grub_disk_t disk)
}
if (!array)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown RAID device %s",
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown RAID device %s",
name);
disk->has_partitions = 1;
@ -265,7 +265,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector,
}
else
err = grub_error (GRUB_ERR_READ_ERROR,
"disk missing.");
"disk missing");
k++;
if (k == array->total_devs)

View File

@ -1,7 +1,7 @@
/* raid6_recover.c - module to recover from faulty RAID6 arrays. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -157,7 +157,7 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
if (! array->device[q])
{
grub_error (GRUB_ERR_READ_ERROR, "Not enough disk to restore");
grub_error (GRUB_ERR_READ_ERROR, "not enough disk to restore");
goto quit;
}
@ -176,7 +176,7 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p,
if ((! array->device[p]) || (! array->device[q]))
{
grub_error (GRUB_ERR_READ_ERROR, "Not enough disk to restore");
grub_error (GRUB_ERR_READ_ERROR, "not enough disk to restore");
goto quit;
}

View File

@ -1,7 +1,7 @@
/* scsi.c - scsi support. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -337,14 +337,14 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector,
unsigned spb = scsi->blocksize >> GRUB_DISK_SECTOR_BITS;
if (! (spb != 0 && (scsi->blocksize & GRUB_DISK_SECTOR_SIZE) == 0))
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unsupported SCSI block size");
"unsupported SCSI block size");
grub_uint32_t sector_mod = 0;
sector = grub_divmod64 (sector, spb, &sector_mod);
if (! (sector_mod == 0 && size % spb == 0))
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
"Unaligned SCSI read not supported");
"unaligned SCSI read not supported");
size /= spb;
}

View File

@ -214,7 +214,7 @@ grub_efiemu_load_file (const char *filename)
{
grub_file_close (file);
grub_efiemu_unload ();
return grub_error (grub_errno, "Couldn't init memory management");
return grub_error (grub_errno, "couldn't init memory management");
}
grub_dprintf ("efiemu", "mm initialized\n");
@ -328,15 +328,15 @@ GRUB_MOD_INIT(efiemu)
{
cmd_loadcore = grub_register_command ("efiemu_loadcore",
grub_cmd_efiemu_load,
"efiemu_loadcore FILE",
"Load and initialize EFI emulator");
"FILE",
"Load and initialize EFI emulator.");
cmd_prepare = grub_register_command ("efiemu_prepare",
grub_cmd_efiemu_prepare,
"efiemu_prepare",
"Finalize loading of EFI emulator");
0,
"Finalize loading of EFI emulator.");
cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload,
"efiemu_unload",
"Unload EFI emulator");
0,
"Unload EFI emulator.");
}
GRUB_MOD_FINI(efiemu)

View File

@ -67,7 +67,7 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size,
* sizeof (grub_efi_memory_descriptor_t));
if (!efiemu_mmap)
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Not enough space for memory map");
"not enough space for memory map");
}
/* Fill slot*/
@ -622,7 +622,7 @@ grub_efiemu_mm_do_alloc (void)
if (!efiemu_mmap)
{
grub_efiemu_unload ();
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't initialize mmap");
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't initialize mmap");
}
if ((err = efiemu_alloc_requests ()))

View File

@ -78,8 +78,8 @@ unescape (char *in, char *out, char *outmax, int *len)
}
if (dptr == outmax)
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Too many NVRAM variables for reserved variable space."
" Try increasing EfiEmu.pnvram.size.");
"too many NVRAM variables for reserved variable space."
" Try increasing EfiEmu.pnvram.size");
*len = dptr - out;
return 0;
}
@ -132,8 +132,8 @@ nvram_set (void * data __attribute__ ((unused)))
if (nvramptr - nvram + sizeof (struct efi_variable) > nvramsize)
{
grub_error (GRUB_ERR_OUT_OF_MEMORY,
"Too many NVRAM variables for reserved variable space."
" Try increasing EfiEmu.pnvram.size.");
"too many NVRAM variables for reserved variable space."
" Try increasing EfiEmu.pnvram.size");
return 1;
}
@ -173,7 +173,7 @@ nvram_set (void * data __attribute__ ((unused)))
if (len < 0)
{
grub_error (GRUB_ERR_BAD_ARGUMENT, "Broken UTF-8 in variable name\n");
grub_error (GRUB_ERR_BAD_ARGUMENT, "broken UTF-8 in variable name");
return 1;
}

View File

@ -222,7 +222,7 @@ grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size,
/* Ensure that we are called only once */
if (*ptv_relocated)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "EfiEmu is already relocated.");
return grub_error (GRUB_ERR_BAD_ARGUMENT, "EfiEmu is already relocated");
*ptv_relocated = 1;
/* Correct addresses using information supplied by grub */

View File

@ -212,7 +212,7 @@ open_section (grub_file_t file, struct font_file_section *section)
else if (retval < 0)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font format error: can't read section name");
"font format error: can't read section name");
return 1;
}
@ -227,7 +227,7 @@ open_section (grub_file_t file, struct font_file_section *section)
else if (retval < 0)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font format error: can't read section length");
"font format error: can't read section length");
return 1;
}
@ -261,7 +261,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
if ((sect_length % FONT_CHAR_INDEX_ENTRY_SIZE) != 0)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font file format error: character index length %d "
"font file format error: character index length %d "
"is not a multiple of the entry size %d",
sect_length, FONT_CHAR_INDEX_ENTRY_SIZE);
return 1;
@ -304,7 +304,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct
if (i != 0 && entry->code <= last_code)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font characters not in ascending order: %u <= %u",
"font characters not in ascending order: %u <= %u",
entry->code, last_code);
return 1;
}
@ -370,7 +370,7 @@ read_section_as_short (struct font_file_section *section, grub_int16_t *value)
if (section->length != 2)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font file format error: section %c%c%c%c length "
"font file format error: section %c%c%c%c length "
"is %d but should be 2",
section->name[0], section->name[1],
section->name[2], section->name[3],
@ -416,7 +416,7 @@ grub_font_load (const char *filename)
if (grub_memcmp (section.name, section_names_file, 4) != 0)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font file format error: 1st section must be FILE");
"font file format error: 1st section must be FILE");
goto fail;
}
@ -426,7 +426,7 @@ grub_font_load (const char *filename)
if (section.length != 4)
{
grub_error (GRUB_ERR_BAD_FONT,
"Font file format error (file type ID length is %d "
"font file format error (file type ID length is %d "
"but should be 4)", section.length);
goto fail;
}
@ -444,7 +444,7 @@ grub_font_load (const char *filename)
if (grub_memcmp (magic, pff2_magic, 4) != 0)
{
grub_error (GRUB_ERR_BAD_FONT, "Invalid font magic %x %x %x %x",
grub_error (GRUB_ERR_BAD_FONT, "invalid font magic %x %x %x %x",
magic[0], magic[1], magic[2], magic[3]);
goto fail;
}
@ -571,7 +571,7 @@ grub_font_load (const char *filename)
|| font->descent == 0)
{
grub_error (GRUB_ERR_BAD_FONT,
"Invalid font file: missing some required data.");
"invalid font file: missing some required data");
goto fail;
}

View File

@ -62,7 +62,7 @@ GRUB_MOD_INIT(font_manager)
cmd_loadfont =
grub_register_command ("loadfont", loadfont_command,
"loadfont FILE...",
"FILE...",
"Specify one or more font files to load.");
cmd_lsfonts =
grub_register_command ("lsfonts", lsfonts_command,

View File

@ -1,7 +1,7 @@
/* affs.c - Amiga Fast FileSystem. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -182,14 +182,14 @@ grub_affs_mount (grub_disk_t disk)
/* Make sure this is an affs filesystem. */
if (grub_strncmp ((char *) (data->bblock.type), "DOS", 3))
{
grub_error (GRUB_ERR_BAD_FS, "not an affs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an AFFS filesystem");
goto fail;
}
/* Test if the filesystem is a OFS filesystem. */
if (! (data->bblock.flags & GRUB_AFFS_FLAG_FFS))
{
grub_error (GRUB_ERR_BAD_FS, "ofs not yet supported");
grub_error (GRUB_ERR_BAD_FS, "OFS not yet supported");
goto fail;
}
@ -231,7 +231,7 @@ grub_affs_mount (grub_disk_t disk)
}
if (-checksum != checksumr)
{
grub_error (GRUB_ERR_BAD_FS, "affs blocksize could not be determined");
grub_error (GRUB_ERR_BAD_FS, "AFFS blocksize couldn't be determined");
goto fail;
}
blocksize++;
@ -248,7 +248,7 @@ grub_affs_mount (grub_disk_t disk)
fail:
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not an affs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an AFFS filesystem");
grub_free (data);
grub_free (rootblock);

View File

@ -1,7 +1,7 @@
/* cpio.c - cpio and tar filesystem. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -88,7 +88,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name,
return grub_errno;
if (hd.magic != MAGIC_BCPIO)
return grub_error (GRUB_ERR_BAD_FS, "Invalid cpio archive");
return grub_error (GRUB_ERR_BAD_FS, "invalid cpio archive");
data->size = (((grub_uint32_t) hd.filesize_1) << 16) + hd.filesize_2;
@ -130,7 +130,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name,
}
if (grub_memcmp (hd.magic, MAGIC_USTAR, sizeof (MAGIC_USTAR) - 1))
return grub_error (GRUB_ERR_BAD_FS, "Invalid tar archive");
return grub_error (GRUB_ERR_BAD_FS, "invalid tar archive");
if ((*name = grub_strdup (hd.name)) == NULL)
return grub_errno;

View File

@ -1,7 +1,7 @@
/* ext2.c - Second Extended filesystem */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -338,7 +338,7 @@ grub_fat_mount (grub_disk_t disk)
fail:
grub_free (data);
grub_error (GRUB_ERR_BAD_FS, "not a fat filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a FAT filesystem");
return 0;
}

View File

@ -1,7 +1,7 @@
/* hfs.c - HFS. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -365,7 +365,7 @@ grub_hfs_mount (grub_disk_t disk)
if (grub_hfs_find_node (data, (char *) &key, data->cat_root,
0, (char *) &dir, sizeof (dir)) == 0)
{
grub_error (GRUB_ERR_BAD_FS, "can not find the hfs root directory");
grub_error (GRUB_ERR_BAD_FS, "cannot find the HFS root directory");
goto fail;
}
@ -379,7 +379,7 @@ grub_hfs_mount (grub_disk_t disk)
grub_free (data);
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not a hfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a HFS filesystem");
return 0;
}

View File

@ -502,7 +502,7 @@ grub_hfsplus_mount (grub_disk_t disk)
fail:
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not a hfsplus filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem");
grub_free (data);
return 0;
@ -653,7 +653,7 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree,
btree->nodesize, (char *) node) <= 0)
{
grub_free (node);
return grub_error (GRUB_ERR_BAD_FS, "Couldn't read i-node.");
return grub_error (GRUB_ERR_BAD_FS, "couldn't read i-node");
}
nodedesc = (struct grub_hfsplus_btnode *) node;

View File

@ -1,7 +1,7 @@
/* pxe.c - Driver to provide access to the pxe filesystem */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -24,6 +24,7 @@
#include <grub/file.h>
#include <grub/misc.h>
#include <grub/bufio.h>
#include <grub/env.h>
#include <grub/machine/pxe.h>
#include <grub/machine/memory.h>
@ -33,11 +34,17 @@
#define SEGOFS(x) ((SEGMENT(x) << 16) + OFFSET(x))
#define LINEAR(x) (void *) (((x >> 16) <<4) + (x & 0xFFFF))
struct grub_pxe_disk_data
{
grub_uint32_t server_ip;
grub_uint32_t gateway_ip;
};
struct grub_pxenv *grub_pxe_pxenv;
grub_uint32_t grub_pxe_your_ip;
grub_uint32_t grub_pxe_server_ip;
grub_uint32_t grub_pxe_gateway_ip;
int grub_pxe_blksize = GRUB_PXE_MIN_BLKSIZE;
static grub_uint32_t grub_pxe_your_ip;
static grub_uint32_t grub_pxe_default_server_ip;
static grub_uint32_t grub_pxe_default_gateway_ip;
static unsigned grub_pxe_blksize = GRUB_PXE_MIN_BLKSIZE;
static grub_file_t curr_file = 0;
@ -56,24 +63,83 @@ grub_pxe_iterate (int (*hook) (const char *name))
return 0;
}
static grub_err_t
parse_ip (const char *val, grub_uint32_t *ip, const char **rest)
{
grub_uint32_t newip = 0;
unsigned long t;
int i;
const char *ptr = val;
for (i = 0; i < 4; i++)
{
t = grub_strtoul (ptr, (char **) &ptr, 0);
if (grub_errno)
return grub_errno;
if (t & ~0xff)
return grub_error (GRUB_ERR_OUT_OF_RANGE, "Invalid IP.");
newip >>= 8;
newip |= (t << 24);
if (i != 3 && *ptr != '.')
return grub_error (GRUB_ERR_OUT_OF_RANGE, "Invalid IP.");
ptr++;
}
*ip = newip;
if (rest)
*rest = ptr - 1;
return 0;
}
static grub_err_t
grub_pxe_open (const char *name, grub_disk_t disk)
{
if (grub_strcmp (name, "pxe"))
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a pxe disk");
struct grub_pxe_disk_data *data;
if (grub_strcmp (name, "pxe") != 0
&& grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) != 0)
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a pxe disk");
data = grub_malloc (sizeof (*data));
if (!data)
return grub_errno;
if (grub_strncmp (name, "pxe:", sizeof ("pxe:") - 1) == 0)
{
const char *ptr;
grub_err_t err;
ptr = name + sizeof ("pxe:") - 1;
err = parse_ip (ptr, &(data->server_ip), &ptr);
if (err)
return err;
if (*ptr == ':')
{
err = parse_ip (ptr + 1, &(data->server_ip), 0);
if (err)
return err;
}
else
data->gateway_ip = grub_pxe_default_gateway_ip;
}
else
{
data->server_ip = grub_pxe_default_server_ip;
data->gateway_ip = grub_pxe_default_gateway_ip;
}
disk->total_sectors = 0;
disk->id = (unsigned long) "pxe";
disk->id = (unsigned long) data;
disk->has_partitions = 0;
disk->data = 0;
disk->data = data;
return GRUB_ERR_NONE;
}
static void
grub_pxe_close (grub_disk_t disk __attribute((unused)))
grub_pxe_close (grub_disk_t disk)
{
grub_free (disk->data);
}
static grub_err_t
@ -125,6 +191,7 @@ grub_pxefs_open (struct grub_file *file, const char *name)
struct grub_pxenv_tftp_open c2;
} c;
struct grub_pxe_data *data;
struct grub_pxe_disk_data *disk_data = file->device->disk->data;
grub_file_t file_int, bufio;
if (curr_file != 0)
@ -133,8 +200,8 @@ grub_pxefs_open (struct grub_file *file, const char *name)
curr_file = 0;
}
c.c1.server_ip = grub_pxe_server_ip;
c.c1.gateway_ip = grub_pxe_gateway_ip;
c.c1.server_ip = disk_data->server_ip;
c.c1.gateway_ip = disk_data->gateway_ip;
grub_strcpy ((char *)&c.c1.filename[0], name);
grub_pxe_call (GRUB_PXENV_TFTP_GET_FSIZE, &c.c1);
if (c.c1.status)
@ -184,6 +251,7 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len)
{
struct grub_pxenv_tftp_read c;
struct grub_pxe_data *data;
struct grub_pxe_disk_data *disk_data = file->device->disk->data;
grub_uint32_t pn, r;
data = file->data;
@ -203,8 +271,8 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len)
if (curr_file != 0)
grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o);
o.server_ip = grub_pxe_server_ip;
o.gateway_ip = grub_pxe_gateway_ip;
o.server_ip = disk_data->server_ip;
o.gateway_ip = disk_data->gateway_ip;
grub_strcpy ((char *)&o.filename[0], data->filename);
o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT);
o.packet_size = grub_pxe_blksize;
@ -272,6 +340,99 @@ static struct grub_fs grub_pxefs_fs =
.next = 0
};
static char *
grub_env_write_readonly (struct grub_env_var *var __attribute__ ((unused)),
const char *val __attribute__ ((unused)))
{
return NULL;
}
static void
set_mac_env (grub_uint8_t *mac_addr, grub_size_t mac_len)
{
char buf[(sizeof ("XX:") - 1) * mac_len + 1];
char *ptr = buf;
unsigned i;
for (i = 0; i < mac_len; i++)
{
grub_sprintf (ptr, "%02x:", mac_addr[i] & 0xff);
ptr += (sizeof ("XX:") - 1);
}
if (mac_len)
*(ptr - 1) = 0;
else
buf[0] = 0;
grub_env_set ("net_pxe_mac", buf);
/* XXX: Is it possible to change MAC in PXE? */
grub_register_variable_hook ("net_pxe_mac", 0, grub_env_write_readonly);
}
static void
set_env_limn_ro (const char *varname, char *value, grub_size_t len)
{
char c;
c = value[len];
value[len] = 0;
grub_env_set (varname, value);
value[len] = c;
grub_register_variable_hook (varname, 0, grub_env_write_readonly);
}
static void
parse_dhcp_vendor (void *vend, int limit)
{
grub_uint8_t *ptr, *ptr0;
ptr = ptr0 = vend;
if (grub_be_to_cpu32 (*(grub_uint32_t *) ptr) != 0x63825363)
return;
ptr = ptr + sizeof (grub_uint32_t);
while (ptr - ptr0 < limit)
{
grub_uint8_t tagtype;
grub_uint8_t taglength;
tagtype = *ptr++;
/* Pad tag. */
if (tagtype == 0)
continue;
/* End tag. */
if (tagtype == 0xff)
return;
taglength = *ptr++;
switch (tagtype)
{
case 12:
set_env_limn_ro ("net_pxe_hostname", (char *) ptr, taglength);
break;
case 15:
set_env_limn_ro ("net_pxe_domain", (char *) ptr, taglength);
break;
case 17:
set_env_limn_ro ("net_pxe_rootpath", (char *) ptr, taglength);
break;
case 18:
set_env_limn_ro ("net_pxe_extensionspath", (char *) ptr, taglength);
break;
/* If you need any other options please contact GRUB
developpement team. */
}
ptr += taglength;
}
}
static void
grub_pxe_detect (void)
{
@ -293,9 +454,15 @@ grub_pxe_detect (void)
bp = LINEAR (ci.buffer);
grub_pxe_your_ip = bp->your_ip;
grub_pxe_server_ip = bp->server_ip;
grub_pxe_gateway_ip = bp->gateway_ip;
grub_pxe_default_server_ip = bp->server_ip;
grub_pxe_default_gateway_ip = bp->gateway_ip;
set_mac_env (bp->mac_addr, bp->hw_len < sizeof (bp->mac_addr) ? bp->hw_len
: sizeof (bp->mac_addr));
set_env_limn_ro ("net_pxe_boot_file", (char *) bp->boot_file,
sizeof (bp->boot_file));
set_env_limn_ro ("net_pxe_dhcp_server_name", (char *) bp->server_name,
sizeof (bp->server_name));
parse_dhcp_vendor (&bp->vendor, sizeof (bp->vendor));
grub_pxe_pxenv = pxenv;
}
@ -311,11 +478,110 @@ grub_pxe_unload (void)
}
}
static void
set_ip_env (char *varname, grub_uint32_t ip)
{
char buf[sizeof ("XXX.XXX.XXX.XXX")];
grub_sprintf (buf, "%d.%d.%d.%d", (ip & 0xff),
(ip >> 8) & 0xff, (ip >> 16) & 0xff, (ip >> 24) & 0xff);
grub_env_set (varname, buf);
}
static char *
write_ip_env (grub_uint32_t *ip, const char *val)
{
char *buf;
grub_err_t err;
grub_uint32_t newip;
err = parse_ip (val, &newip, 0);
if (err)
return 0;
/* Normalize the IP. */
buf = grub_malloc (sizeof ("XXX.XXX.XXX.XXX"));
if (!buf)
return 0;
*ip = newip;
grub_sprintf (buf, "%d.%d.%d.%d", (newip & 0xff), (newip >> 8) & 0xff,
(newip >> 16) & 0xff, (newip >> 24) & 0xff);
return buf;
}
static char *
grub_env_write_pxe_default_server (struct grub_env_var *var
__attribute__ ((unused)),
const char *val)
{
return write_ip_env (&grub_pxe_default_server_ip, val);
}
static char *
grub_env_write_pxe_default_gateway (struct grub_env_var *var
__attribute__ ((unused)),
const char *val)
{
return write_ip_env (&grub_pxe_default_gateway_ip, val);
}
static char *
grub_env_write_pxe_blocksize (struct grub_env_var *var __attribute__ ((unused)),
const char *val)
{
unsigned size;
char *buf;
size = grub_strtoul (val, 0, 0);
if (grub_errno)
return 0;
if (size < GRUB_PXE_MIN_BLKSIZE)
size = GRUB_PXE_MIN_BLKSIZE;
else if (size > GRUB_PXE_MAX_BLKSIZE)
size = GRUB_PXE_MAX_BLKSIZE;
buf = grub_malloc (sizeof ("XXXXXX XXXXXX"));
if (!buf)
return 0;
grub_sprintf (buf, "%d", size);
grub_pxe_blksize = size;
return buf;
}
GRUB_MOD_INIT(pxe)
{
grub_pxe_detect ();
if (grub_pxe_pxenv)
{
char *buf;
buf = grub_malloc (sizeof ("XXXXXX XXXXXX"));
if (buf)
{
grub_sprintf (buf, "%d", grub_pxe_blksize);
grub_env_set ("net_pxe_blksize", buf);
}
set_ip_env ("pxe_default_server", grub_pxe_default_server_ip);
set_ip_env ("pxe_default_gateway", grub_pxe_default_gateway_ip);
set_ip_env ("net_pxe_ip", grub_pxe_your_ip);
grub_register_variable_hook ("net_pxe_default_server", 0,
grub_env_write_pxe_default_server);
grub_register_variable_hook ("net_pxe_default_gateway", 0,
grub_env_write_pxe_default_gateway);
/* XXX: Is it possible to change IP in PXE? */
grub_register_variable_hook ("net_pxe_ip", 0,
grub_env_write_readonly);
grub_register_variable_hook ("net_pxe_blksize", 0,
grub_env_write_pxe_blocksize);
grub_disk_dev_register (&grub_pxe_dev);
grub_fs_register (&grub_pxefs_fs);
}

View File

@ -2,7 +2,7 @@
SUSP, Rock Ridge. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -280,13 +280,13 @@ grub_iso9660_mount (grub_disk_t disk)
sizeof (struct grub_iso9660_primary_voldesc),
(char *) &voldesc))
{
grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
goto fail;
}
if (grub_strncmp ((char *) voldesc.voldesc.magic, "CD001", 5) != 0)
{
grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
goto fail;
}
@ -315,7 +315,7 @@ grub_iso9660_mount (grub_disk_t disk)
<< GRUB_ISO9660_LOG2_BLKSZ), 0,
sizeof (rootdir), (char *) &rootdir))
{
grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
goto fail;
}
@ -331,7 +331,7 @@ grub_iso9660_mount (grub_disk_t disk)
<< GRUB_ISO9660_LOG2_BLKSZ), sua_pos,
sua_size, sua))
{
grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
goto fail;
}
@ -773,7 +773,10 @@ grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len)
data->first_sector << GRUB_ISO9660_LOG2_BLKSZ,
file->offset,
len, buf);
data->disk->read_hook = 0;
data->disk->read_hook = NULL;
if (grub_errno)
return -1;
return len;
}
@ -832,7 +835,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid)
&& ! data->voldesc.modified.second[0] && ! data->voldesc.modified.second[1]
&& ! data->voldesc.modified.hundredth[0] && ! data->voldesc.modified.hundredth[1])
{
grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID.");
grub_error (GRUB_ERR_BAD_NUMBER, "no creation date in filesystem to generate UUID");
*uuid = NULL;
}
else

View File

@ -344,7 +344,7 @@ grub_jfs_mount (grub_disk_t disk)
if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4))
{
grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem");
goto fail;
}
@ -363,7 +363,7 @@ grub_jfs_mount (grub_disk_t disk)
grub_free (data);
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a JFS filesystem");
return 0;
}
@ -715,7 +715,7 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino)
grub_jfs_find_file (data, symlink);
if (grub_errno)
grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}

View File

@ -311,7 +311,7 @@ grub_minix_lookup_symlink (struct grub_minix_data *data, int ino)
grub_minix_find_file (data, symlink);
if (grub_errno)
grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}

View File

@ -1,7 +1,7 @@
/* ntfs.c - NTFS filesystem */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,7 +42,7 @@ fixup (struct grub_ntfs_data *data, char *buf, int len, char *magic)
ss = u16at (buf, 6) - 1;
if (ss * (int) data->blocksize != len * GRUB_DISK_SECTOR_SIZE)
return grub_error (GRUB_ERR_BAD_FS, "Size not match",
return grub_error (GRUB_ERR_BAD_FS, "size not match",
ss * (int) data->blocksize,
len * GRUB_DISK_SECTOR_SIZE);
pu = buf + u16at (buf, 4);
@ -53,7 +53,7 @@ fixup (struct grub_ntfs_data *data, char *buf, int len, char *magic)
buf += data->blocksize;
pu += 2;
if (u16at (buf, 0) != us)
return grub_error (GRUB_ERR_BAD_FS, "Fixup signature not match");
return grub_error (GRUB_ERR_BAD_FS, "fixup signature not match");
v16at (buf, 0) = v16at (pu, 0);
ss--;
}
@ -147,7 +147,7 @@ find_attr (struct grub_ntfs_attr *at, unsigned char attr)
new_pos += u16at (new_pos, 4);
}
grub_error (GRUB_ERR_BAD_FS,
"Can\'t find 0x%X in attribute list",
"can\'t find 0x%X in attribute list",
(unsigned char) *at->attr_cur);
return NULL;
}
@ -186,7 +186,7 @@ find_attr (struct grub_ntfs_attr *at, unsigned char attr)
if (read_data (at, pa, at->edat_buf, 0, n, 0, 0))
{
grub_error (GRUB_ERR_BAD_FS,
"Fail to read non-resident attribute list");
"fail to read non-resident attribute list");
return NULL;
}
at->attr_nxt = at->edat_buf;
@ -315,7 +315,7 @@ retry:
goto retry;
}
}
return grub_error (GRUB_ERR_BAD_FS, "Run list overflown");
return grub_error (GRUB_ERR_BAD_FS, "run list overflown");
}
run = read_run_data (run + 1, c1, &val, 0); /* length of current VCN */
ctx->curr_vcn = ctx->next_vcn;
@ -369,7 +369,7 @@ read_data (struct grub_ntfs_attr *at, char *pa, char *dest,
if (pa[8] == 0)
{
if (ofs + len > u32at (pa, 0x10))
return grub_error (GRUB_ERR_BAD_FS, "Read out of range");
return grub_error (GRUB_ERR_BAD_FS, "read out of range");
grub_memcpy (dest, pa + u32at (pa, 0x14) + ofs, len);
return 0;
}
@ -383,7 +383,7 @@ read_data (struct grub_ntfs_attr *at, char *pa, char *dest,
if (ctx->flags & RF_COMP)
{
if (!cached)
return grub_error (GRUB_ERR_BAD_FS, "Attribute can\'t be compressed");
return grub_error (GRUB_ERR_BAD_FS, "attribute can\'t be compressed");
if (at->sbuf)
{
@ -502,7 +502,7 @@ read_attr (struct grub_ntfs_attr *at, char *dest, grub_disk_addr_t ofs,
else
ret =
(grub_errno) ? grub_errno : grub_error (GRUB_ERR_BAD_FS,
"Attribute not found");
"attribute not found");
at->attr_cur = save_cur;
return ret;
}
@ -513,7 +513,7 @@ read_mft (struct grub_ntfs_data *data, char *buf, grub_uint32_t mftno)
if (read_attr
(&data->mmft.attr, buf, mftno * ((grub_disk_addr_t) data->mft_size << BLK_SHR),
data->mft_size << BLK_SHR, 0, 0))
return grub_error (GRUB_ERR_BAD_FS, "Read MFT 0x%X fails", mftno);
return grub_error (GRUB_ERR_BAD_FS, "read MFT 0x%X fails", mftno);
return fixup (data, buf, data->mft_size, "FILE");
}
@ -541,7 +541,7 @@ init_file (struct grub_ntfs_file *mft, grub_uint32_t mftno)
pa = locate_attr (&mft->attr, mft, AT_DATA);
if (pa == NULL)
return grub_error (GRUB_ERR_BAD_FS, "No $DATA in MFT 0x%X", mftno);
return grub_error (GRUB_ERR_BAD_FS, "no $DATA in MFT 0x%X", mftno);
if (!pa[8])
mft->size = u32at (pa, 0x10);
@ -664,7 +664,7 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir,
{
if ((cur_pos = find_attr (at, AT_INDEX_ROOT)) == NULL)
{
grub_error (GRUB_ERR_BAD_FS, "No $INDEX_ROOT");
grub_error (GRUB_ERR_BAD_FS, "no $INDEX_ROOT");
goto done;
}
@ -717,7 +717,7 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir,
if (read_data (at, cur_pos, bmp, 0, bitmap_len, 0, 0))
{
grub_error (GRUB_ERR_BAD_FS,
"Fails to read non-resident $BITMAP");
"fails to read non-resident $BITMAP");
goto done;
}
bitmap_len = u32at (cur_pos, 0x30);

View File

@ -28,7 +28,7 @@ static grub_err_t
decomp_nextvcn (struct grub_ntfs_comp *cc)
{
if (cc->comp_head >= cc->comp_tail)
return grub_error (GRUB_ERR_BAD_FS, "Compression block overflown");
return grub_error (GRUB_ERR_BAD_FS, "compression block overflown");
if (grub_disk_read
(cc->disk,
(cc->comp_table[cc->comp_head][1] -
@ -87,7 +87,7 @@ decomp_block (struct grub_ntfs_comp *cc, char *dest)
{
if (copied > COM_LEN)
return grub_error (GRUB_ERR_BAD_FS,
"Compression block too large");
"compression block too large");
if (!bits)
{
@ -112,7 +112,7 @@ decomp_block (struct grub_ntfs_comp *cc, char *dest)
if (!copied)
{
grub_error (GRUB_ERR_BAD_FS, "Context window empty");
grub_error (GRUB_ERR_BAD_FS, "nontext window empty");
return 0;
}
@ -150,7 +150,7 @@ decomp_block (struct grub_ntfs_comp *cc, char *dest)
{
if (cnt != COM_LEN)
return grub_error (GRUB_ERR_BAD_FS,
"Invalid compression block size");
"invalid compression block size");
}
}
@ -187,7 +187,7 @@ read_block (struct grub_ntfs_rlst *ctx, char *buf, int num)
{
if (ctx->comp.comp_head != ctx->comp.comp_tail)
return grub_error (GRUB_ERR_BAD_FS, "Invalid compression block");
return grub_error (GRUB_ERR_BAD_FS, "invalid compression block");
ctx->comp.comp_head = ctx->comp.comp_tail = 0;
ctx->comp.cbuf_vcn = ctx->target_vcn;
ctx->comp.cbuf_ofs = (ctx->comp.spc << BLK_SHR);

View File

@ -691,7 +691,7 @@ grub_reiserfs_mount (grub_disk_t disk)
if (grub_memcmp (data->superblock.magic_string,
REISERFS_MAGIC_STRING, sizeof (REISERFS_MAGIC_STRING) - 1))
{
grub_error (GRUB_ERR_BAD_FS, "not a reiserfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem");
goto fail;
}
data->disk = disk;
@ -700,7 +700,7 @@ grub_reiserfs_mount (grub_disk_t disk)
fail:
/* Disk is too small to contain a ReiserFS. */
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not a reiserfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a ReiserFS filesystem");
grub_free (data);
return 0;
@ -998,7 +998,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name)
goto fail;
if (root.block_number == 0)
{
grub_error (GRUB_ERR_BAD_FS, "Unable to find root item");
grub_error (GRUB_ERR_BAD_FS, "unable to find root item");
goto fail; /* Should never happen since checked at mount. */
}
grub_fshelp_find_file (name, &root, &found,
@ -1014,7 +1014,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name)
goto fail;
if (info.block_number == 0)
{
grub_error (GRUB_ERR_BAD_FS, "Unable to find searched item");
grub_error (GRUB_ERR_BAD_FS, "unable to find searched item");
goto fail;
}
entry_version = grub_le_to_cpu16 (info.header.version);
@ -1289,7 +1289,7 @@ grub_reiserfs_dir (grub_device_t device, const char *path,
goto fail;
if (root.block_number == 0)
{
grub_error(GRUB_ERR_BAD_FS, "Root not found");
grub_error(GRUB_ERR_BAD_FS, "root not found");
goto fail;
}
grub_fshelp_find_file (path, &root, &found, grub_reiserfs_iterate_dir,

View File

@ -1,7 +1,7 @@
/* sfs.c - Amiga Smart FileSystem. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -279,7 +279,7 @@ grub_sfs_mount (grub_disk_t disk)
/* Make sure this is a sfs filesystem. */
if (grub_strncmp ((char *) (data->rblock.header.magic), "SFS", 4))
{
grub_error (GRUB_ERR_BAD_FS, "not a sfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not a SFS filesystem");
goto fail;
}
@ -307,7 +307,7 @@ grub_sfs_mount (grub_disk_t disk)
fail:
if (grub_errno == GRUB_ERR_OUT_OF_RANGE)
grub_error (GRUB_ERR_BAD_FS, "not an sfs filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an SFS filesystem");
grub_free (data);
grub_free (rootobjc_data);

View File

@ -1,7 +1,7 @@
/* udf.c - Universal Disk Format filesystem. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008 Free Software Foundation, Inc.
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -525,7 +525,7 @@ grub_udf_mount (grub_disk_t disk)
if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0,
sizeof (struct grub_udf_vrs), &vrs))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
@ -539,7 +539,7 @@ grub_udf_mount (grub_disk_t disk)
(grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_CDW02, 5)) &&
(grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_TEA01, 5)))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
}
@ -552,7 +552,7 @@ grub_udf_mount (grub_disk_t disk)
if (grub_disk_read (disk, *sblklist << GRUB_UDF_LOG2_BLKSZ, 0,
sizeof (struct grub_udf_avdp), &avdp))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
@ -565,7 +565,7 @@ grub_udf_mount (grub_disk_t disk)
sblklist++;
if (*sblklist == 0)
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
}
@ -579,7 +579,7 @@ grub_udf_mount (grub_disk_t disk)
if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0,
sizeof (struct grub_udf_tag), &tag))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
@ -596,7 +596,7 @@ grub_udf_mount (grub_disk_t disk)
sizeof (struct grub_udf_pd),
&data->pds[data->npd]))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
@ -612,7 +612,7 @@ grub_udf_mount (grub_disk_t disk)
sizeof (struct grub_udf_lvd),
&data->lvd))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}
@ -675,7 +675,7 @@ grub_udf_mount (grub_disk_t disk)
if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0,
sizeof (struct grub_udf_fileset), &root_fs))
{
grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem");
grub_error (GRUB_ERR_BAD_FS, "not an UDF filesystem");
goto fail;
}

View File

@ -1,7 +1,7 @@
/* ufs.c - Unix File System */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2004,2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2004,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -415,7 +415,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
grub_ufs_find_file (data, symlink);
if (grub_errno)
grub_error (grub_errno, "Can not follow symlink `%s'.", symlink);
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
return grub_errno;
}

Some files were not shown because too many files have changed in this diff Show More