merge from trunk

This commit is contained in:
Colin Watson 2009-12-08 00:55:17 +00:00
commit e8b2988803
108 changed files with 3024 additions and 5764 deletions

View File

@ -7,12 +7,15 @@ autom4te.cache
build_env.mk
.bzrignore
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
conf/*.mk
conf/gcry.rmk
*.d
DISTLIST
docs/*.info
@ -44,10 +47,13 @@ grub_setup_init.h
*.img
include/grub/cpu
include/grub/machine
install-sh
lib/libgcrypt-grub
*.lst
Makefile
*.mod
mod-*.c
missing
*.pf2
po/*.mo
po/grub.pot

608
ChangeLog
View File

@ -1,3 +1,611 @@
2009-12-08 Carles Pina i Estany <carles@pina.cat>
* include/grub/misc.h (grub_printf_): New declaration.
* kern/misc.c (grub_printf_): New definition.
* normal/main.c (grub_normal_reader_init): Use `grub_printf_' and `N_'
instead of `grub_printf' and `_'.
* normal/menu_entry.c (store_completion): Likewise.
(run): Likewise.
(grub_menu_entry_run): Likewise.
* normal/menu_text.c (grub_wait_after_message): Likewise.
(notify_booting): Likewise.
(notify_fallback): Likewise.
(notify_execution_failure): Likewise.
2009-12-07 Colin Watson <cjwatson@ubuntu.com>
* configure.ac: Check for vasprintf.
* util/misc.c (asprintf): Move allocation from here ...
(vasprintf): ... to here. New function.
(xasprintf): New function.
* include/grub/util/misc.h (vasprintf, xasprintf): Add
prototypes.
* util/getroot.c (grub_util_get_grub_dev): Use xasprintf.
* util/grub-mkfont.c (write_font): Likewise.
* util/grub-probe.c (probe): Likewise.
* util/hostdisk.c (make_device_name): Likewise.
2009-12-06 David S. Miller <davem@sunset.davemloft.net>
* 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>
* util/misc.c (make_system_path_relative_to_its_root): Correctly cope with
mount points.
2009-12-05 Carles Pina i Estany <carles@pina.cat>
* gettext/gettext.c: Include `<grub/list.h>'. Define grub_gettext_msg,
grub_gettext_msg_list.
(grub_gettext_gettranslation_from_position): Return const char *
and not char *.
(grub_gettext_translate): Add the translated strings into a list,
returns from the list if existing there.
(grub_gettext_init_ext): Add \n at the end of grub_dprintf string.
(grub_gettext_delete_list): Delete the list.
(grub_gettext_env_write_lang): Call grub_gettext_delete_list when
lang environment variable is changed.
(GRUB_MOD_FINI): Call grub_gettext_delete_list.
2009-12-05 Vladimir Serbinenko <phcoder@gmail.com>
Rename kernel.mod to kernel.img.
* conf/i386-efi.rmk (pkglib_MODULES): Change kernel.mod to kernel.img.
(kernel_mod_EXPORTS): Rename to ...
(kernel_img_EXPORTS): ... this.
(kernel_mod_SOURCES): Rename to ...
(kernel_img_SOURCES): ... this.
(kernel_mod_HEADERS): Rename to ...
(kernel_img_HEADERS): ... this. All users updated.
(kernel_mod_CFLAGS): Rename to ...
(kernel_img_CFLAGS): ... this.
(kernel_mod_ASFLAGS): Rename to ...
(kernel_img_ASFLAGS): ... this.
(kernel_mod_LDFLAGS): Rename to ...
(kernel_img_LDFLAGS): ... this.
* conf/x86_64-efi.rmk: Likewise.
* util/i386/efi/grub-mkimage.c (read_kernel_module): Rename to ...
(read_kernel_image): ... this. All users updated.
(read_kernel_image): Read "kernel.img" instead of "kernel.mod".
2009-12-05 Carles Pina i Estany <carles@pina.cat>
* normal/menu_text.c (grub_color_menu_high): Gettexttize string.
(print_spaces): New function.
(grub_print_ucs4): New function.
(getstringwidth): New function.
(print_message_indented): New function.
(print_message): Gettexttize strings using print_message_indented.
(run_menu): Replaces grub_printf by print_spaces and dynamic terminal
width.
(get_entry_number): Gettextize and uses dynamic terminal width.
(notify_booting, notify_fallback, notify_execution_failure):
Gettextize.
* normal/menu_entry.c (store_completion): Cleanup the gettextized
string.
(run): Likewise.
(grub_menu_entry_run): Likewise.
* PO/POTFILES: Add normal/menu_entry.c.
2009-12-05 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac (TARGET_ASFLAGS): Add "-D<MACHINE>".
2009-12-05 Carles Pina i Estany <carles@pina.cat>
* util/grub-install.in: Install gettext .mo files.
* util/grub-mkrescue.in (process_input_dir): Copy gettext .mo files.
2009-12-05 Carles Pina i Estany <carles@pina.cat>
* gettext/gettext.c (grub_gettext_init_ext): Replace grub_printf with
grub_dprintf.
2009-12-05 Robert Millan <rmh.grub@aybabtu.com>
* kern/ieee1275/openfw.c (grub_reboot): Disable for i386. The
non-firmware-dependant one in realmode.S takes precedence.
2009-12-04 Robert Millan <rmh.grub@aybabtu.com>
* commands/halt.c: Replace misc arch-specific headers with
`<grub/misc.h>'.
* commands/reboot.c: Likewise.
* commands/i386/pc/halt.c: Replace `<grub/machine/init.h>' with
`<grub/misc.h>'.
* conf/i386-coreboot.rmk (kernel_img_HEADERS): Remove `cpu/reboot.h'.
(halt_mod_SOURCES): Move `kern/i386/halt.c' from here ...
(kernel_img_SOURCES): ... to here.
* include/grub/efi/efi.h (grub_reboot, grub_halt): Remove prototypes.
* include/grub/i386/pc/init.h: Likewise.
* include/grub/powerpc/ieee1275/kernel.h: Likewise.
* include/grub/sparc64/ieee1275/kernel.h: Likewise.
* include/grub/misc.h (grub_reboot, grub_halt): New prototypes.
* include/grub/i386/halt.h: Remove.
* include/grub/i386/reboot.h: Likewise.
* kern/i386/halt.c: Remove `<grub/cpu/halt.h>'.
2009-12-03 David S. Miller <davem@sunset.davemloft.net>
* conf/sparc64-ieee1275.rmk (grub_mkimage_SOURCES,
grub_setup_SOURCES, grub_ofpathname_SOURCES): Add gnulib/progname.c
* util/sparc64/ieee1275/grub-mkimage.c: Include <grub/i18n.h> and
"progname.h"
* util/sparc64/ieee1275/grub-ofpathname.c: Likewise.
* util/sparc64/ieee1275/grub-setup.c: Likewise.
(usage): Add missing comma in printf.
2009-12-02 Robert Millan <rmh.grub@aybabtu.com>
Use the same reboot approach on i386 coreboot and qemu as we do on
BIOS.
* conf/i386-coreboot.rmk (kernel_img_HEADERS): Add `cpu/reboot.h'.
(reboot_mod_SOURCES): Remove `kern/i386/reboot.c'.
* kern/i386/reboot.c: Remove.
* include/grub/i386/reboot.h (grub_reboot): Export function.
* kern/i386/pc/startup.S (grub_reboot): Move from here ...
* kern/i386/realmode.S (grub_reboot): ... to here. Jump to
0xf000:0xfff0 instead of 0xffff:0x0000.
[!GRUB_MACHINE_PCBIOS] (prot_to_real): Do not restore interrupts.
* kern/i386/qemu/startup.S: Include `"../realmode.S"'.
2009-11-30 Robert Millan <rmh.grub@aybabtu.com>
Fix $srcdir != $objdir build.
* Makefile.in (po/%.po): Rewrite as ...
($(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po)): ... this.
2009-11-29 Samuel Thibault <samuel.thibault@ens-lyon.org>
Fix GNU/Hurd grub-install crash.
* util/grub-probe.c (probe): Try to access `path' only when it is not
NULL.
2009-11-28 Vladimir Serbinenko <phcoder@gmail.com>
Correct module naming.
* video/efi_uga.c (GRUB_MOD_INIT(efi_fb)): Renamed from this ...
(GRUB_MOD_INIT(efi_uga)): ... to this
(GRUB_MOD_FINI(efi_fb)): Renamed from this ...
(GRUB_MOD_FINI(efi_uga)): ... to this
* video/efi_gop.c (GRUB_MOD_INIT(efi_fb)): Renamed from this ...
(GRUB_MOD_INIT(efi_gop)): ... to this
(GRUB_MOD_FINI(efi_fb)): Renamed from this ...
(GRUB_MOD_FINI(efi_gop)): ... to this
2009-11-28 Robert Millan <rmh.grub@aybabtu.com>
* util/mkisofs/mkisofs.c (ld_options): Mark all `arg' strings as
translatable.
(usage): Translate `arg' strings using gettext().
Thanks to Jordi Mallach for the suggestion.
2009-11-28 Vladimir Serbinenko <phcoder@gmail.com>
GOP support. Based on patch from Bean
(http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00384.html)
* video/efi_gop.c: New file.
* include/grub/efi/graphics_output.h: Likewise.
* conf/i386-efi.rmk (pkglib_MODULES): Add `efi_gop.mod'.
(efi_fb_mod_SOURCES, efi_fb_mod_CFLAGS, efi_fb_mod_LDFLAGS): New
variables.
* conf/x86_64-efi.rmk: Likewise.
2009-11-28 Vladimir Serbinenko <phcoder@gmail.com>
Rename efi_fb to efi_uga.
* conf/i386-efi.rmk (pkglib_MODULES): Rename 'efi_fb.mod' to
'efi_uga.mod'.
(efi_fb_mod_SOURCES): Rename this ...
(efi_uga_mod_SOURCES): ... to this.
(efi_fb_mod_CFLAGS): Rename this ...
(efi_uga_mod_CFLAGS): ... to this.
(efi_fb_mod_LDFLAGS): Rename this ...
(efi_uga_mod_LDFLAGS): ... to this.
* conf/x86_64-efi.rmk (pkglib_MODULES): Rename 'efi_fb.mod' to
'efi_uga.mod'.
(efi_fb_mod_SOURCES): Rename this ...
(efi_uga_mod_SOURCES): ... to this.
(efi_fb_mod_CFLAGS): Rename this ...
(efi_uga_mod_CFLAGS): ... to this.
(efi_fb_mod_LDFLAGS): Rename this ...
(efi_uga_mod_LDFLAGS): ... to this.
* video/efi_fb.c: Move this ...
* video/efi_uga.c: ... to this. Change prefix to 'grub_video_uga_'.
2009-11-27 Robert Millan <rmh.grub@aybabtu.com>
* po/README: New file. Explain our PO file workflow.
2009-11-27 Robert Millan <rmh.grub@aybabtu.com>
* po/ChangeLog: Remove. Move relevant entries back to ...
* ChangeLog: ... here.
* po/ca.po: Remove (now handled by TLP).
* po/id.po: Likewise.
* po/zh_CN.po: Likewise.
* Makefile.in (LINGUAS): Initialize in a way that supports
empty set.
2009-11-27 Robert Millan <rmh.grub@aybabtu.com>
* Makefile.in (LINGUAS): Rewrite by scanning po/ directory instead of
reliing on po/LINGUAS.
($(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po)): Rewrite as ...
(po/%.po): ... this.
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'.
2009-11-26 Felix Zielcke <fzielcke@z-51.de>
* conf/i386-efi.rmk (grub_mkimage_SOURCES): Add `gnulib/progname.c'.
* conf/x86_64-efi.rmk (grub_mkimage_SOURCES): Likewise.
2009-11-26 Robert Millan <rmh.grub@aybabtu.com>
* conf/i386-coreboot.rmk: Cleanup stale filenames from my previous
commit.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
2009-11-26 Felix Zielcke <fzielcke@z-51.de>
* conf/any-emu.rmk (grub_emu_SOURCES): Add `gnulib/progname.c'.
2009-11-26 Felix Zielcke <fzielcke@z-51.de>
* conf/any-emu.rmk (grub_mkfont_SOURCES): Add `gnulib/progname.c'.
2009-11-26 Robert Millan <rmh.grub@aybabtu.com>
* conf/common.rmk (sbin_UTILITIES): Add `grub-mkdevicemap'.
(grub_mkdevicemap_SOURCES): New variable.
(grub_probe_SOURCES, grub_fstest_SOURCES, grub_mkfont_SOURCES)
(grub_mkrelpath_SOURCES, grub_editenv_SOURCES)
(grub_pe2elf_SOURCES): Add `gnulib/progname.c'.
* conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-mkdevicemap'.
(grub_mkdevicemap_SOURCES): Remove.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* util/elf/grub-mkimage.c: Include `<grub/i18n.h>' and `"progname.h"'.
(usage): Fix strings to use `program_name'.
(main): Initialize gettext.
* util/grub-editenv.c: Likewise.
* util/grub-emu.c: Likewise.
* util/grub-fstest.c: Likewise.
* util/grub-mkdevicemap.c: Likewise.
* util/grub-mkfont.c: Likewise.
* util/grub-mkrelpath.c: Likewise.
* util/grub-pe2elf.c: Likewise.
* util/grub-probe.c: Likewise.
* util/sparc64/ieee1275/grub-mkimage.c: Likewise.
* util/sparc64/ieee1275/grub-ofpathname.c: Likewise.
* util/sparc64/ieee1275/grub-setup.c: Likewise.
* util/misc.c: Include `"progname.h"'.
(progname): Remove variable.
(grub_util_warn, grub_util_info, grub_util_error): Use `program_name'.
2009-11-25 Felix Zielcke <fzielcke@z-51.de>
* util/grub.d/10_linux.in (linux_entry): Quote the arguments to
printf and print a newline after the menuentry header line.
* util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise.
2009-11-25 Felix Zielcke <fzielcke@z-51.de>
autoconf >= 2.60 support $(localedir).
* INSTALL: Note that autoconf 2.60 is required.
* configure.ac (AC_PREREQ): Bump to 2.60.
* util/grub.d/10_kfreebsd.in (TEXTDOMAINDIR): Set to lowercased @localedir@.
* util/grub.d/10_linux.in (TEXTDOMAINDIR): Likewise.
2009-11-25 Yves Blusseau <yves.blusseau@zetam.org>
* configure.ac: move the call to AM_GNU_GETTEXT to avoid warnings when
aclocal is run.
2009-11-25 Robert Millan <rmh.grub@aybabtu.com>
* normal/main.c (grub_normal_read_line): Fix off-by-one
buffer overflow.
2009-11-25 Robert Millan <rmh.grub@aybabtu.com>
* normal/main.c (grub_normal_execute): Replace "parser.sh" with
"parser.grub" in grub_command_execute() call.
2009-11-24 Carles Pina i Estany <carles@pina.cat>
* conf/i386-coreboot.rmk (kernel_img_HEADERS): Add i18n.h.
* conf/i386-efi.rmk: Likewise.
* conf/i386-ieee1275.rmk: Likewise.
* conf/i386-pc.rmk: Likewise.
* conf/powerpc-ieee1275.rmk: Likewise.
* conf/sparc64-ieee1275.rmk: Likewise.
* conf/x86_64-efi.rmk: Likewise.
* gettext/gettex.c: Include <grub/i18n.h>.
* include/grub/misc.h (grub_gettext_dummy, grub_gettext): Move from
here ...
* include/grub/i18n.h: ... to here
* include/grub/i18n.h: ... to here.
* kern/misc.c: Include <grub/i18n.h>
(grub_gettext_dummy): Move above user.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/Makefile.in (install-local): Convert a `for' into a normal
shell expansion.
2009-11-24 Robert Millan <rmh.grub@aybabtu.com>
* autogen.sh: Add automake call.
* config.guess: Remove.
* config.sub: Likewise.
* install-sh: Likewise.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/Makefile.in (install-local): Fix the use of $lang shell variable.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/Makefile.in (install-local): Convert a make `$(foreach)'
function to a normal shell `for'.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* conf/i386-coreboot.rmk (grub_mkimage_SOURCES): Add `gnulib/progname.c'.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkrelpath.c: New file.
* conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath.
(grub_mkrelpath_SOURCES): New variable.
* include/grub/util/misc.h: New function prototype.
* util/misc.c (make_system_path_relative_to_its_root): New function.
* util/grub-mkconfig_lib.in (bindir): New variable.
(grub_mkrelpath): Likewise.
(make_system_path_relative_to_its_root): Use grub-mkrelpath.
* util/probe.c (probe): Make the file path relative to its root.
Change a info message to use the GRUB path. Enable again the
check if we can read the file with GRUB facilities.
* util/i386/pc/grub-setup.c (setup): Make core.img path relative
to its root.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* Makefile.in: Don't include GRUB_CONTRIB makefiles with emu
platform.
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/getroot.c (grub_util_get_dev_abstraction): Properly use
strncmp().
2009-11-24 Felix Zielcke <fzielcke@z-51.de>
* util/getroot.c (grub_util_is_dmraid): New function.
(grub_util_get_dev_abstraction): Treat dmraid and multipath
devices as normal ones, not as LVM.
2009-11-23 Carles Pina i Estany <carles@pina.cat>
* conf/common.rmk: Add grub-gettext_lib target and updates
lib_DATA and CLEANFILES. Adds gettext.mod SOURCES, CFLAGS,
LDFLAGS.
* gettext/gettext.c: New file. (Reads mo files).
* include/grub/file.h (grub_file_pread): New prototype.
* include/grub/i18n.h (_): New prototype.
* include/grub/misc.h (grub_gettext_dummy, grub_gettext): New
prototypes.
* kern/misc.c (grub_gettext_dummy): New function.
* normal/menu_text.c: Include <grub/i18n.h>.
* normal/menu_text.c (print_timeout): Gettexttize string.
* normal/menu_text.c (print_message): Gettexttize string.
* po/POTFILES: Add `normal/menu_text.c'.
* po/ca.po: Add new translations.
* util/grub.d/00_header.in: Define locale_dir and lang. insmod
gettext module and defines locale_dir and lang in grub.cfg.
* NEWS: Add gettext support.
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
* util/hostdisk.c: Include `<grub/i18n.h>'.
(find_grub_drive): Use ARRAY_SIZE for map size calculation.
(make_device_name): Rewrite using asprintf.
(convert_system_partition_to_system_disk): Replace 0 with NULL.
(find_system_device): If a device is not found, generate one just
by reusing the OS path name.
(read_device_map): Make it permissible for device.map not to exist.
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
* script/sh/execute.c: Move from here ...
* script/execute.c: ... to here. Update all users.
* script/sh/function.c: Move from here ...
* script/function.c: ... to here. Update all users.
* script/sh/lexer.c: Move from here ...
* script/lexer.c: ... to here. Update all users.
* script/sh/main.c: Move from here ...
* script/main.c: ... to here. Update all users.
* script/sh/parser.y: Move from here ...
* script/parser.y: ... to here. Update all users.
* script/sh/script.c: Move from here ...
* script/script.c: ... to here. Update all users.
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
* configure.ac: Detect all `emu' platforms. Define
GRUB_MACHINE_* macros in TARGET_CFLAGS. Remove
--enable-grub-emu logic. Disable include/grub/machine
symlink on `emu' platforms.
* genkernsyms.sh.in: Use @TARGET_CFLAGS@ during symbol generation.
* gensymlist.sh.in: Likewise.
* include/grub/i386/coreboot/machine.h: Remove file.
* include/grub/i386/efi/machine.h: Likewise.
* include/grub/i386/ieee1275/machine.h: Likewise.
* include/grub/i386/pc/machine.h: Likewise.
* include/grub/i386/qemu/machine.h: Likewise.
* include/grub/powerpc/ieee1275/machine.h: Likewise.
* include/grub/sparc64/ieee1275/machine.h: Likewise.
* include/grub/x86_64/efi/machine.h: Likewise.
* commands/acpi.c: Remove `<grub/machine/machine.h>'.
* commands/halt.c: Likewise.
* commands/reboot.c: Likewise.
* include/grub/autoefi.h: Likewise.
* include/grub/i386/at_keyboard.h: Likewise.
* include/grub/i386/kernel.h: Likewise.
* include/grub/i386/loader.h: Likewise.
* include/grub/i386/pc/memory.h: Likewise.
* kern/dl.c: Likewise.
* kern/i386/coreboot/init.c: Likewise.
* loader/i386/bsd.c: Likewise.
* loader/i386/linux.c: Likewise.
* loader/multiboot_loader.c: Likewise.
* term/i386/pc/serial.c: Likewise.
* term/usb_keyboard.c: Likewise.
* include/grub/time.h [!GRUB_MACHINE_EMU]: Remove
`<grub/machine/machine.h>'
[!GRUB_MACHINE_EMU] (GRUB_TICKS_PER_SECOND): New macro.
* util/misc.c: Remove `<grub/machine/machine.h>' and
`<grub/machine/time.h>'.
* Makefile.in (enable_grub_emu): Remove variable.
Include $(srcdir)/conf/any-emu.mk for the `emu' platform.
* conf/any-emu.rmk: New file.
* conf/common.rmk (grub_emu_init.lst, grub_emu_init.h)
(grub_emu_init.c): Move from here ...
* conf/any-emu.rmk: ... to here.
* conf/i386-coreboot.rmk (sbin_UTILITIES): Remove `grub-emu'.
(grub_emu_SOURCES, grub_emu_LDFLAGS): Move from here ...
* conf/any-emu.rmk: ... to here.
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
* include/grub/parser.h (grub_parser_register): Document need
of `name' parameter.
* normal/main.c (grub_normal_read_line): Simplify prompt string.
* script/sh/main.c (grub_sh_parser, GRUB_MOD_INIT(sh)): Rename
"sh" to "grub".
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
* Makefile.in ($(srcdir)/po/$(PACKAGE).pot): Pass --keyword=N_ to
`$(XGETTEXT)'.
* include/grub/i18n.h (N_): New macro.
* util/mkisofs/mkisofs.h: Likewise.
* util/mkisofs/mkisofs.c (ld_options): Wrap all translatable strings
around N_().
(usage): Use gettext() to translate help strings when printing them.
2009-11-23 Robert Millan <rmh.grub@aybabtu.com>
Based on patch from Bean
(http://lists.gnu.org/archive/html/grub-devel/2009-08/msg00384.html)
* video/efi_fb.c: New file.
* conf/i386-efi.rmk (pkglib_MODULES): Add `efi_fb.mod'.
(efi_fb_mod_SOURCES, efi_fb_mod_CFLAGS, efi_fb_mod_LDFLAGS): New
variables.
* conf/x86_64-efi.rmk: Likewise.
2009-11-22 Robert Millan <rmh.grub@aybabtu.com>
* util/i386/pc/grub-mkimage.c: Ungettextize grub_util_info() strings.
* util/i386/pc/grub-setup.c: Likewise.
2009-11-21 Samuel Thibault <samuel.thibault@ens-lyon.org>
* util/getroot.c [__GNU__]: Include <hurd.h>, <hurd/lookup.h>, and
<hurd/fs.h>
[__GNU__] (grub_guess_root_device): Call file_name_lookup and
file_get_storage_info to implement grub_guess_root_device.
2009-11-21 Felix Zielcke <fzielcke@z-51.de>
* Makefile.in (target): Use make's builtin $(shell) function
instead of calling directly $(SHELL) to create the locale directories,
inside the $(foreach) function.
2009-11-21 Felix Zielcke <fzielcke@z-51.de>
* util/grub-mkrescue.in: Print an error and usage if output option
has not been given.
2009-11-21 Felix Zielcke <fzielcke@z-51.de>
Patch from Loïc Minier <loic.minier@ubuntu.com>.
* util/grub.d/30_os-prober.in: Cope with Linux entries where
root and /boot are on different devices.
2009-11-21 Robert Millan <rmh.grub@aybabtu.com>
Fix build for srcdir != objdir.
* Makefile.in (po/$(PACKAGE).pot): Rename to ...
($(srcdir)/po/$(PACKAGE).pot): ... this. Run $(XGETTEXT) from
$(srcdir).
($(foreach lang, $(LINGUAS), po/$(lang).po)): Rename to ...
($(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po): ... this. Use $^
reference for input.
2009-11-21 Robert Millan <rmh.grub@aybabtu.com>
* util/grub-mkrescue.in: Use source directory direcly (without copiing
or hardlinking it). Remove -J option, Joliet is not compatible with
multiple source directories.
2009-11-21 Carles Pina i Estany <carles@pina.cat>
2009-11-21 Robert Millan <rmh.grub@aybabtu.com>
* util/grub-mkrescue.in: Recognize `--override-directory' option.
(process_input_dir): New function. Process an arbitrary input
directory.
Misc adjustments to support both "override mode" and system-wide mode.
2009-11-20 Felix Zielcke <fzielcke@z-51.de>
* configure.ac (UNIFONT_BDF): Rename to ...
(FONT_SOURCE): ... this. Update all users.
2009-11-20 Felix Zielcke <fzielcke@z-51.de>
* configure.ac: Add `/usr/share/fonts/X11/misc/unifont.pcf.gz'
to the list of unifont files to look for.
2009-11-19 Robert Millan <rmh.grub@aybabtu.com>
Patch from Joe Auricchio <jauricchio@gmail.com>

View File

@ -22,7 +22,7 @@ need the following.
* Ruby 1.6 or later
* Python 2.5.2 or later
* Autoconf 2.59d or later
* Autoconf 2.60 or later
* Automake 1.10.1 or later
Configuring the GRUB

View File

@ -45,7 +45,9 @@ XGETTEXT = @XGETTEXT@
MSGMERGE = @MSGMERGE@
MSGFMT = @MSGFMT@
LINGUAS = $(shell tr '\n' ' ' < $(srcdir)/po/LINGUAS)
LINGUAS = $(shell for i in $(srcdir)/po/*.po ; do \
if test -e $$i ; then echo $$i ; fi ; \
done | sed -e "s,.*/po/\(.*\)\.po$$,\1,")
PACKAGE = @PACKAGE@
PACKAGE_NAME = @PACKAGE_NAME@
@ -108,10 +110,9 @@ AWK = @AWK@
LIBCURSES = @LIBCURSES@
LIBUSB = @LIBUSB@
YACC = @YACC@
UNIFONT_BDF = @UNIFONT_BDF@
FONT_SOURCE = @FONT_SOURCE@
# Options.
enable_grub_emu = @enable_grub_emu@
enable_grub_emu_usb = @enable_grub_emu_usb@
enable_grub_fstest = @enable_grub_fstest@
enable_grub_pe2elf = @enable_grub_pe2elf@
@ -153,10 +154,13 @@ $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb
$(RUBY) $(srcdir)/genmk.rb < $< > $@; \
fi
ifeq ($(platform), emu)
include $(srcdir)/conf/any-emu.mk
else
include $(srcdir)/conf/$(target_cpu)-$(platform).mk
# For external modules.
-include $(wildcard $(GRUB_CONTRIB)/*/conf/common.mk)
endif
### General targets.
@ -207,7 +211,7 @@ docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi
$(MKDIR_P) docs
-$(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@
ifeq (, $(UNIFONT_BDF))
ifeq (, $(FONT_SOURCE))
else
ifeq ($(enable_grub_mkfont),yes)
@ -218,11 +222,11 @@ pkgdata_DATA += unicode.pf2 ascii.pf2
UNICODE_ARROWS=0x2190-0x2193
UNICODE_LINES=0x2501-0x251B
unicode.pf2: $(UNIFONT_BDF) grub-mkfont
$(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF)
unicode.pf2: $(FONT_SOURCE) grub-mkfont
$(builddir)/grub-mkfont -o $@ $(FONT_SOURCE)
ascii.pf2: $(UNIFONT_BDF) grub-mkfont
$(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
ascii.pf2: $(FONT_SOURCE) grub-mkfont
$(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
endif
endif
@ -308,13 +312,13 @@ install-local: all
dest="`echo $$file | sed 's,.*/,,'`"; \
$(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \
done
$(foreach lang, $(LINGUAS), \
$(SHELL) $(mkinstalldirs) $(DESTDIR)/$(datadir)/locale/$(lang)/LC_MESSAGES \
@list='po/$(lang).mo'; \
for file in $$list; do \
@langs='$(LINGUAS)'; \
for lang in $$langs; do \
$(SHELL) $(mkinstalldirs) $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES; \
file="po/$$lang.mo"; \
if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
$(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$(lang)/LC_MESSAGES/$(PACKAGE).mo; \
done)
$(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
done
$(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(info_INFOS)'; \
for file in $$list; do \
@ -472,12 +476,12 @@ gensymlist.sh: gensymlist.sh.in config.status
genkernsyms.sh: genkernsyms.sh.in config.status
$(SHELL) ./config.status
po/$(PACKAGE).pot: po/POTFILES po/POTFILES-shell
$(XGETTEXT) --from-code=utf-8 -o $@ -f $< --keyword=_
$(XGETTEXT) --from-code=utf-8 -o $@ -f po/POTFILES-shell -j --language=Shell
$(srcdir)/po/$(PACKAGE).pot: po/POTFILES po/POTFILES-shell
cd $(srcdir) && $(XGETTEXT) --from-code=utf-8 -o $@ -f $< --keyword=_ --keyword=N_
cd $(srcdir) && $(XGETTEXT) --from-code=utf-8 -o $@ -f po/POTFILES-shell -j --language=Shell
$(foreach lang, $(LINGUAS), po/$(lang).po): po/$(PACKAGE).pot
$(MSGMERGE) -U $@ po/$(PACKAGE).pot
$(foreach lang, $(LINGUAS), $(srcdir)/po/$(lang).po): po/$(PACKAGE).pot
$(MSGMERGE) -U $@ $^
po/%.mo: po/%.po
$(MKDIR_P) $$(dirname $@)

2
NEWS
View File

@ -1,5 +1,7 @@
New in 1.97 - :
* Add support for gettext.
* Add support for loading XNU (MacOS X kernel).
* ACPI override support.

View File

@ -6,6 +6,9 @@ aclocal
autoconf
autoheader
# FIXME: automake doesn't like that there's no Makefile.am
automake -a -c -f || true
echo timestamp > stamp-h.in
python util/import_gcry.py lib/libgcrypt/ .

View File

@ -26,7 +26,6 @@
#include <grub/gzio.h>
#include <grub/acpi.h>
#include <grub/mm.h>
#include <grub/machine/machine.h>
#include <grub/machine/memory.h>
#include <grub/memory.h>

View File

@ -18,17 +18,8 @@
*/
#include <grub/dl.h>
#include <grub/machine/machine.h>
#include <grub/command.h>
#if defined(GRUB_MACHINE_IEEE1275)
#include <grub/machine/kernel.h>
#elif defined(GRUB_MACHINE_EFI)
#include <grub/efi/efi.h>
#else
/* Platforms shipping standalone halt, such as coreboot. */
#include <grub/cpu/halt.h>
#endif
#include <grub/misc.h>
static grub_err_t
grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)),

View File

@ -18,7 +18,7 @@
*/
#include <grub/dl.h>
#include <grub/machine/init.h>
#include <grub/misc.h>
#include <grub/extcmd.h>
static const struct grub_arg_option options[] =

View File

@ -18,20 +18,8 @@
*/
#include <grub/dl.h>
#include <grub/machine/machine.h>
#include <grub/command.h>
#if defined(GRUB_MACHINE_IEEE1275)
#include <grub/machine/kernel.h>
#elif defined(GRUB_MACHINE_EFI)
#include <grub/efi/efi.h>
#elif defined(GRUB_MACHINE_PCBIOS)
#include <grub/machine/init.h>
#else
/* Platforms shipping standalone reboot, such as coreboot. */
#include <grub/cpu/reboot.h>
#endif
#include <grub/misc.h>
static grub_err_t
grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)),

89
conf/any-emu.rmk Normal file
View File

@ -0,0 +1,89 @@
# -*- makefile -*-
# Used by various components. These rules need to precede them.
script/lexer.c_DEPENDENCIES = grub_script.tab.h
sbin_UTILITIES += grub-emu
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 \
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 \
commands/password.c commands/keystatus.c \
disk/host.c disk/loopback.c disk/scsi.c \
fs/fshelp.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/reader.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c \
normal/completion.c normal/main.c normal/color.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/menu_text.c \
script/main.c script/execute.c script/function.c \
script/lexer.c script/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_emu_init.c gnulib/progname.c
ifeq ($(target_cpu), i386)
grub_emu_SOURCES += commands/i386/cpuid.c
endif
grub_emu_LDFLAGS = $(LIBCURSES)
ifeq ($(enable_grub_emu_usb), yes)
grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \
commands/usbtest.c
grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB)
endif
grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES))
rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
DISTCLEANFILES += grub_emu_init.lst
grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh
rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
DISTCLEANFILES += grub_emu_init.h
grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
# FIXME: this could be shared with common.rmk
# For grub-mkfont.
ifeq ($(enable_grub_mkfont), yes)
bin_UTILITIES += grub-mkfont
grub_mkfont_SOURCES = gnulib/progname.c util/grub-mkfont.c util/misc.c
grub_mkfont_CFLAGS = $(freetype_cflags)
grub_mkfont_LDFLAGS = $(freetype_libs)
endif
grub_script.tab.c grub_script.tab.h: script/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/parser.y
DISTCLEANFILES += grub_script.tab.c grub_script.tab.h

View File

@ -1,15 +1,21 @@
# -*- makefile -*-
sbin_UTILITIES += grub-mkdevicemap
grub_mkdevicemap_SOURCES = gnulib/progname.c util/grub-mkdevicemap.c \
util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-mkelfimage.
bin_UTILITIES += grub-mkelfimage
grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \
grub_mkelfimage_SOURCES = gnulib/progname.c \
util/elf/grub-mkimage.c util/misc.c \
util/resolve.c
util/elf/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-probe.
sbin_UTILITIES += grub-probe
util/grub-probe.c_DEPENDENCIES = grub_probe_init.h
grub_probe_SOURCES = util/grub-probe.c \
grub_probe_SOURCES = gnulib/progname.c util/grub-probe.c \
util/hostdisk.c util/misc.c util/getroot.c \
kern/device.c kern/disk.c kern/err.c kern/misc.c \
kern/parser.c kern/partition.c kern/file.c \
@ -44,7 +50,8 @@ grub_mkisofs_CFLAGS = -D_FILE_OFFSET_BITS=64 \
# For grub-fstest.
util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h
grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
grub_fstest_SOURCES = gnulib/progname.c util/grub-fstest.c util/hostfs.c \
util/misc.c \
kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \
disk/host.c disk/loopback.c kern/list.c kern/command.c \
lib/arg.c commands/extcmd.c normal/datetime.c normal/misc.c \
@ -66,29 +73,20 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \
# For grub-mkfont.
ifeq ($(enable_grub_mkfont), yes)
bin_UTILITIES += grub-mkfont
grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c
grub_mkfont_SOURCES = gnulib/progname.c util/grub-mkfont.c util/misc.c
grub_mkfont_CFLAGS = $(freetype_cflags)
grub_mkfont_LDFLAGS = $(freetype_libs)
endif
# For grub-mkrelpath.
bin_UTILITIES += grub-mkrelpath
grub_mkrelpath_SOURCES = gnulib/progname.c util/grub-mkrelpath.c util/misc.c
# For the parser.
grub_script.tab.c grub_script.tab.h: script/sh/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y
grub_script.tab.c grub_script.tab.h: script/parser.y
$(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/parser.y
DISTCLEANFILES += grub_script.tab.c grub_script.tab.h
# For grub-emu.
grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES))
rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
DISTCLEANFILES += grub_emu_init.lst
grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh
rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@
DISTCLEANFILES += grub_emu_init.h
grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h
rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@
DISTCLEANFILES += grub_emu_init.c
# For grub-probe.
grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES))
rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
@ -130,7 +128,7 @@ DISTCLEANFILES += grub_fstest_init.c
# for grub-editenv
bin_UTILITIES += grub-editenv
grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c
grub_editenv_SOURCES = gnulib/progname.c util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c
CLEANFILES += grub-editenv
# Needed for genmk.rb to work
@ -138,7 +136,7 @@ ifeq (0,1)
bin_UTILITIES += grub-macho2img grub-pe2elf
endif
grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c
grub_pe2elf_SOURCES = gnulib/progname.c util/grub-pe2elf.c util/misc.c
CLEANFILES += grub-pe2elf
grub_macho2img_SOURCES = util/grub-macho2img.c
@ -163,6 +161,12 @@ update-grub_lib: util/update-grub_lib.in config.status
lib_SCRIPTS += update-grub_lib
CLEANFILES += update-grub_lib
grub-gettext_lib: util/grub-gettext_lib.in config.status
./config.status --file=$@:$<
chmod +x $@
lib_DATA += grub-gettext_lib
CLEANFILES += grub-gettext_lib
%: util/grub.d/%.in config.status
./config.status --file=$@:$<
chmod +x $@
@ -552,8 +556,8 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS)
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For sh.mod.
sh_mod_SOURCES = script/sh/main.c script/sh/script.c script/sh/execute.c \
script/sh/function.c script/sh/lexer.c grub_script.tab.c
sh_mod_SOURCES = script/main.c script/script.c script/execute.c \
script/function.c script/lexer.c grub_script.tab.c
sh_mod_CFLAGS = $(COMMON_CFLAGS)
sh_mod_LDFLAGS = $(COMMON_LDFLAGS)
@ -624,6 +628,12 @@ bufio_mod_SOURCES = io/bufio.c
bufio_mod_CFLAGS = $(COMMON_CFLAGS)
bufio_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For gettext.mod.
pkglib_MODULES += gettext.mod
gettext_mod_SOURCES = gettext/gettext.c
gettext_mod_CFLAGS = $(COMMON_CFLAGS)
gettext_mod_LDFLAGS = $(COMMON_LDFLAGS)
# Misc.
pkglib_MODULES += xnu_uuid.mod

View File

@ -5,7 +5,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
@ -18,6 +18,7 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \
kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/multiboot_mmap.c \
kern/i386/halt.c \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
@ -34,7 +35,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h list.h handler.h command.h
machine/memory.h machine/loader.h list.h handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR),-Bstatic
@ -53,7 +54,7 @@ boot_img_FORMAT = binary
bin_UTILITIES += grub-mkimage
grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \
util/resolve.c
util/resolve.c gnulib/progname.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
pkglib_IMAGES += kernel.img
@ -61,6 +62,7 @@ kernel_img_SOURCES = kern/i386/qemu/startup.S \
kern/i386/misc.S \
kern/i386/coreboot/init.c \
kern/i386/qemu/mmap.c \
kern/i386/halt.c \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
@ -77,7 +79,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h list.h handler.h command.h
machine/memory.h machine/loader.h list.h handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR)
@ -93,62 +95,6 @@ symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Utilities.
sbin_UTILITIES = grub-mkdevicemap
ifeq ($(enable_grub_emu), yes)
sbin_UTILITIES += grub-emu
endif
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu.
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/gptsync.c commands/probe.c commands/xnu_uuid.c \
commands/password.c commands/keystatus.c \
lib/hexdump.c commands/i386/cpuid.c \
lib/envblk.c commands/loadenv.c \
disk/host.c disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
fs/fshelp.c \
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/reader.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c \
normal/completion.c normal/datetime.c normal/main.c \
normal/menu_text.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in
@ -180,12 +126,12 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS)
linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For reboot.mod.
reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c
reboot_mod_SOURCES = commands/reboot.c
reboot_mod_CFLAGS = $(COMMON_CFLAGS)
reboot_mod_LDFLAGS = $(COMMON_LDFLAGS)
# For halt.mod.
halt_mod_SOURCES = commands/halt.c kern/i386/halt.c
halt_mod_SOURCES = commands/halt.c
halt_mod_CFLAGS = $(COMMON_CFLAGS)
halt_mod_LDFLAGS = $(COMMON_LDFLAGS)

View File

@ -5,18 +5,14 @@ COMMON_CFLAGS = -fno-builtin -m32
COMMON_LDFLAGS = -melf_i386 -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-mkdevicemap
#ifeq ($(enable_grub_emu), yes)
#sbin_UTILITIES += grub-emu
#endif
# For grub-mkimage.
grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
util/resolve.c
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c
util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# For grub-setup.
@ -27,55 +23,6 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
# kern/fs.c kern/env.c fs/fshelp.c
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu.
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/help.c \
commands/handler.c commands/ls.c commands/test.c \
commands/search.c commands/hexdump.c lib/hexdump.c \
commands/halt.c commands/reboot.c commands/keystatus.c \
commands/i386/cpuid.c \
commands/password.c \
lib/envblk.c commands/loadenv.c \
disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/reader.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \
normal/auth.c normal/autofs.c \
normal/completion.c normal/context.c normal/main.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/menu_text.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
# Scripts.
sbin_SCRIPTS = grub-install
@ -83,14 +30,14 @@ sbin_SCRIPTS = grub-install
grub_install_SOURCES = util/i386/efi/grub-install.in
# Modules.
pkglib_MODULES = kernel.mod chain.mod appleldr.mod \
pkglib_MODULES = kernel.img chain.mod appleldr.mod \
linux.mod halt.mod reboot.mod pci.mod lspci.mod \
datetime.mod date.mod datehook.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod
# For kernel.mod.
kernel_mod_EXPORTS = no
kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
# For kernel.img.
kernel_img_EXPORTS = no
kernel_img_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
kern/rescue_parser.c kern/rescue_reader.c \
@ -101,22 +48,22 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/rtc_get_time_ms.c \
kern/generic/millisleep.c
kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h
kernel_mod_CFLAGS = $(COMMON_CFLAGS)
kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
MOSTLYCLEANFILES += symlist.c
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
@ -196,6 +143,16 @@ fixvideo_mod_SOURCES = commands/efi/fixvideo.c
fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_uga.mod
efi_uga_mod_SOURCES = video/efi_uga.c
efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_gop.mod
efi_gop_mod_SOURCES = video/efi_gop.c
efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += xnu.mod
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\
loader/macho.c loader/xnu.c loader/i386/xnu_helper.S

View File

@ -5,7 +5,7 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3
COMMON_LDFLAGS = -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
pkglib_PROGRAMS = kernel.img
@ -33,7 +33,7 @@ kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \
list.h handler.h command.h
list.h handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic
@ -47,61 +47,6 @@ symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# Utilities.
sbin_UTILITIES = grub-mkdevicemap
ifeq ($(enable_grub_emu), yes)
sbin_UTILITIES += grub-emu
endif
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu.
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 \
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 \
commands/i386/cpuid.c \
commands/password.c commands/keystatus.c \
disk/host.c disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c fs/befs.c \
fs/befs_be.c fs/tar.c \
\
fs/fshelp.c \
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/reader.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c \
normal/completion.c normal/main.c normal/menu_text.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
# Scripts.
sbin_SCRIPTS = grub-install

View File

@ -7,7 +7,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32
COMMON_LDFLAGS = -m32 -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \
@ -64,7 +64,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \
machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \
machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h
machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS) $(TARGET_IMG_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) $(COMMON_CFLAGS)
@ -81,10 +81,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-setup grub-mkdevicemap
ifeq ($(enable_grub_emu), yes)
sbin_UTILITIES += grub-emu
endif
sbin_UTILITIES = grub-setup
# For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/i386/pc/grub-mkimage.c util/misc.c \
@ -112,63 +109,6 @@ grub_setup_SOURCES = gnulib/progname.c \
util/raid.c util/lvm.c \
grub_setup_init.c
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu.
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 \
lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \
lib/envblk.c commands/loadenv.c \
commands/gptsync.c commands/probe.c commands/xnu_uuid.c \
commands/i386/cpuid.c \
commands/password.c commands/keystatus.c \
disk/host.c disk/loopback.c disk/scsi.c \
fs/fshelp.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/reader.c kern/term.c \
kern/rescue_reader.c kern/rescue_parser.c \
lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c \
normal/completion.c normal/main.c normal/color.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/menu_text.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
ifeq ($(enable_grub_emu_usb), yes)
grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \
commands/usbtest.c
grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB)
endif
sbin_SCRIPTS += grub-install
grub_install_SOURCES = util/grub-install.in

View File

@ -6,7 +6,7 @@ COMMON_CFLAGS = -ffreestanding
COMMON_LDFLAGS += -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
@ -17,7 +17,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \
symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \
msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \
command.h
command.h i18n.h
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
@ -28,62 +28,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
# Programs
pkglib_PROGRAMS = kernel.img
# Utilities.
sbin_UTILITIES = grub-mkdevicemap
ifeq ($(enable_grub_emu), yes)
sbin_UTILITIES += grub-emu
endif
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu
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/help.c \
commands/search.c commands/handler.c commands/test.c \
commands/ls.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 \
commands/password.c commands/keystatus.c \
disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \
kern/misc.c kern/parser.c kern/partition.c kern/reader.c \
kern/rescue_reader.c kern/rescue_parser.c \
kern/term.c kern/list.c kern/handler.c fs/fshelp.c \
kern/command.c kern/corecmd.c commands/extcmd.c \
lib/arg.c normal/cmdline.c normal/datetime.c \
normal/completion.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c normal/main.c \
normal/menu.c \
normal/menu_text.c \
normal/menu_entry.c normal/menu_viewer.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_script.tab.c grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \
kern/ieee1275/ieee1275.c kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \

View File

@ -6,7 +6,7 @@ COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs
COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Images.
pkglib_IMAGES = boot.img diskboot.img kernel.img
@ -29,7 +29,7 @@ DEFSYMFILES += kernel_syms.lst
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
list.h handler.h command.h \
list.h handler.h command.h i18n.h \
sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \
sparc64/ieee1275/ieee1275.h
kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \
@ -59,14 +59,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-setup grub-mkdevicemap grub-ofpathname
ifeq ($(enable_grub_emu), yes)
sbin_UTILITIES += grub-emu
endif
sbin_UTILITIES = grub-setup grub-ofpathname
# For grub-mkimage.
grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \
util/resolve.c
util/resolve.c gnulib/progname.c
# For grub-setup.
util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h
@ -85,62 +82,12 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \
partmap/sun.c partmap/acorn.c \
\
disk/raid.c disk/mdraid_linux.c disk/lvm.c \
util/raid.c util/lvm.c \
util/raid.c util/lvm.c gnulib/progname.c \
grub_setup_init.c
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/ieee1275/ofpath.c util/ieee1275/devicemap.c util/misc.c
# For grub-ofpathname.
grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \
util/ieee1275/ofpath.c util/misc.c
# For grub-emu
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/help.c \
commands/search.c commands/handler.c commands/test.c \
commands/ls.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 \
commands/password.c commands/keystatus.c \
disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
fs/befs.c fs/befs_be.c fs/tar.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \
kern/misc.c kern/parser.c kern/partition.c kern/reader.c \
kern/rescue_reader.c kern/rescue_parser.c \
kern/term.c kern/list.c kern/handler.c fs/fshelp.c \
kern/command.c kern/corecmd.c commands/extcmd.c \
lib/arg.c normal/cmdline.c normal/datetime.c \
normal/completion.c normal/misc.c \
normal/handler.c normal/auth.c normal/autofs.c normal/main.c \
normal/menu.c \
normal/menu_text.c \
normal/menu_entry.c normal/menu_viewer.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_script.tab.c grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
util/ieee1275/ofpath.c util/misc.c gnulib/progname.c
# Scripts.
sbin_SCRIPTS = grub-install

View File

@ -5,18 +5,14 @@ COMMON_CFLAGS = -fno-builtin -m64
COMMON_LDFLAGS = -melf_x86_64 -nostdlib
# Used by various components. These rules need to precede them.
script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h
script/lexer.c_DEPENDENCIES = grub_script.tab.h
# Utilities.
bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-mkdevicemap
#ifeq ($(enable_grub_emu), yes)
#sbin_UTILITIES += grub-emu
#endif
# For grub-mkimage.
grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
util/resolve.c
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c
# For grub-setup.
#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \
@ -26,54 +22,6 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \
# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \
# kern/fs.c kern/env.c fs/fshelp.c
# For grub-mkdevicemap.
grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
util/devicemap.c util/misc.c
# For grub-emu.
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/help.c \
commands/handler.c commands/ls.c commands/test.c \
commands/search.c commands/hexdump.c lib/hexdump.c \
commands/halt.c commands/reboot.c \
commands/i386/cpuid.c \
commands/password.c commands/keystatus.c \
lib/envblk.c commands/loadenv.c \
disk/loopback.c \
\
fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \
fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \
\
io/gzio.c \
kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \
kern/err.c kern/list.c kern/handler.c \
kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \
kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \
kern/partition.c kern/readerescue.c kern/term.c \
lib/arg.c normal/cmdline.c normal/misc.c normal/auth.c \
normal/autofs.c \
normal/completion.c normal/datetime.c normal/context.c \
normal/main.c \
normal/menu.c normal/menu_entry.c normal/menu_viewer.c \
normal/menu_text.c \
normal/color.c \
script/sh/main.c script/sh/execute.c script/sh/function.c \
script/sh/lexer.c script/sh/script.c grub_script.tab.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \
partmap/acorn.c partmap/gpt.c \
util/console.c util/hostfs.c util/grub-emu.c util/misc.c \
util/hostdisk.c util/getroot.c \
\
disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \
disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
commands/parttool.c parttool/msdospart.c \
grub_emu_init.c
grub_emu_LDFLAGS = $(LIBCURSES)
# Scripts.
sbin_SCRIPTS = grub-install
@ -81,14 +29,14 @@ sbin_SCRIPTS = grub-install
grub_install_SOURCES = util/i386/efi/grub-install.in
# Modules.
pkglib_MODULES = kernel.mod chain.mod appleldr.mod \
pkglib_MODULES = kernel.img chain.mod appleldr.mod \
halt.mod reboot.mod linux.mod pci.mod lspci.mod \
datetime.mod date.mod datehook.mod loadbios.mod \
fixvideo.mod mmap.mod acpi.mod ata.mod
# For kernel.mod.
kernel_mod_EXPORTS = no
kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
# For kernel.img.
kernel_img_EXPORTS = no
kernel_img_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
kern/main.c kern/device.c \
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
kern/misc.c kern/mm.c kern/reader.c kern/term.c \
@ -99,23 +47,23 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \
kern/i386/tsc.c kern/i386/pit.c \
kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \
term/efi/console.c disk/efi/efidisk.c
kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \
env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \
partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \
efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \
handler.h command.h
kernel_mod_CFLAGS = $(COMMON_CFLAGS)
kernel_mod_ASFLAGS = $(COMMON_ASFLAGS)
kernel_mod_LDFLAGS = $(COMMON_LDFLAGS)
handler.h command.h i18n.h
kernel_img_CFLAGS = $(COMMON_CFLAGS)
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
MOSTLYCLEANFILES += symlist.c
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
DEFSYMFILES += kernel_syms.lst
symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh
symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh
/bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh
kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh
/bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1)
# For boot.mod.
@ -201,6 +149,16 @@ fixvideo_mod_SOURCES = commands/efi/fixvideo.c
fixvideo_mod_CFLAGS = $(COMMON_CFLAGS)
fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_uga.mod
efi_uga_mod_SOURCES = video/efi_uga.c
efi_uga_mod_CFLAGS = $(COMMON_CFLAGS)
efi_uga_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += efi_gop.mod
efi_gop_mod_SOURCES = video/efi_gop.c
efi_gop_mod_CFLAGS = $(COMMON_CFLAGS)
efi_gop_mod_LDFLAGS = $(COMMON_LDFLAGS)
pkglib_MODULES += xnu.mod
xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\
loader/macho.c loader/xnu.c loader/i386/xnu_helper.S

1494
config.guess vendored

File diff suppressed because it is too large Load Diff

1700
config.sub vendored

File diff suppressed because it is too large Load Diff

View File

@ -33,8 +33,7 @@ dnl type.
AC_INIT([GRUB],[1.97],[bug-grub@gnu.org])
AM_INIT_AUTOMAKE()
AM_GNU_GETTEXT()
AC_PREREQ(2.59d)
AC_PREREQ(2.60)
AC_CONFIG_SRCDIR([include/grub/dl.h])
AC_CONFIG_HEADER([config.h])
@ -91,6 +90,7 @@ case "$target_cpu"-"$platform" in
i386-qemu) ;;
powerpc-ieee1275) ;;
sparc64-ieee1275) ;;
*-emu) ;;
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
esac
@ -113,6 +113,18 @@ case "$host_os" in
cygwin) host_kernel=windows ;;
esac
case "$platform" in
coreboot) machine_CFLAGS="-DGRUB_MACHINE_COREBOOT=1" ;;
efi) machine_CFLAGS="-DGRUB_MACHINE_EFI=1" ;;
ieee1275) machine_CFLAGS="-DGRUB_MACHINE_IEEE1275=1" ;;
qemu) machine_CFLAGS="-DGRUB_MACHINE_QEMU=1" ;;
pc) machine_CFLAGS="-DGRUB_MACHINE_PCBIOS=1" ;;
emu) machine_CFLAGS="-DGRUB_MACHINE_EMU=1" ;;
esac
CFLAGS="$CFLAGS $machine_CFLAGS"
TARGET_ASFLAGS="$TARGET_ASFLAGS $machine_CFLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $machine_CFLAGS"
AC_SUBST(host_cpu)
AC_SUBST(host_os)
AC_SUBST(host_kernel)
@ -136,9 +148,9 @@ if test "x$YACC" = x; then
AC_MSG_ERROR([bison is not found])
fi
for file in /usr/src/unifont.bdf ; do
for file in /usr/src/unifont.bdf /usr/share/fonts/X11/misc/unifont.pcf.gz ; do
if test -e $file ; then
AC_SUBST([UNIFONT_BDF], [$file])
AC_SUBST([FONT_SOURCE], [$file])
break
fi
done
@ -161,6 +173,7 @@ AC_PROG_CC
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
AC_GNU_SOURCE
AM_GNU_GETTEXT
AC_SYS_LARGEFILE
# Identify characteristics of the host architecture.
@ -181,7 +194,7 @@ else
fi
# Check for functions.
AC_CHECK_FUNCS(posix_memalign memalign asprintf)
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf)
# For grub-mkisofs
AC_HEADER_MAJOR
@ -509,40 +522,28 @@ AC_ARG_ENABLE([mm-debug],
[AC_DEFINE([MM_DEBUG], [1],
[Define to 1 if you enable memory manager debugging.])])
AC_ARG_ENABLE([grub-emu],
[AS_HELP_STRING([--enable-grub-emu],
[build and install the `grub-emu' debugging utility (default=guessed)])])
AC_ARG_ENABLE([grub-emu-usb],
[AS_HELP_STRING([--enable-grub-emu-usb],
[build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
if test x"$enable_grub_emu" = xno ; then
grub_emu_excuse="explicitly disabled"
fi
[# Check for curses libraries.]
[if [ x"$grub_emu_excuse" = x ]; then ]
if test "$platform" = emu; then
missing_ncurses=
[# Check for curses libraries.]
AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
[AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
[grub_emu_excuse=["need (n)curses libraries"]])])
[missing_ncurses=[true]])])
AC_SUBST([LIBCURSES])
[fi]
[if [ x"$grub_emu_excuse" = x ]; then ]
[if [ x"$missing_ncurses" = x ]; then ]
[# Check for headers.]
AC_CHECK_HEADERS([ncurses/curses.h], [],
[AC_CHECK_HEADERS([ncurses.h], [],
[AC_CHECK_HEADERS([curses.h], [],
[grub_emu_excuse=["need (n)curses headers"]])])])
[missing_ncurses=[true]])])])
[fi]
if test x"$missing_ncurses" = xtrue ; then
AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
fi
if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then
AC_MSG_ERROR([grub-emu was explicitly requested but can't be compiled])
fi
if test x"$grub_emu_excuse" = x ; then
enable_grub_emu=yes
else
enable_grub_emu=no
grub_emu_usb_excuse="grub-emu isn't built"
fi
if test x"$enable_grub_emu_usb" = xno ; then
grub_emu_usb_excuse="explicitly disabled"
fi
@ -565,9 +566,8 @@ enable_grub_emu_usb=yes
else
enable_grub_emu_usb=no
fi
AC_SUBST([enable_grub_emu])
AC_SUBST([enable_grub_emu_usb])
fi
AC_ARG_ENABLE([grub-fstest],
[AS_HELP_STRING([--enable-grub-fstest],
@ -615,14 +615,18 @@ AC_SUBST(ASFLAGS)
# Output files.
grub_CHECK_LINK_DIR
if test x"$link_dir" = xyes ; then
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu
include/grub/machine:include/grub/$target_cpu/$platform])
AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu])
if test "$platform" != emu ; then
AC_CONFIG_LINKS([include/grub/machine:include/grub/$target_cpu/$platform])
fi
else
mkdir -p include/grub 2>/dev/null
rm -rf include/grub/cpu
cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null
rm -rf include/grub/machine
cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
if test "$platform" != emu ; then
rm -rf include/grub/machine
cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null
fi
fi
AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh])
AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
@ -631,16 +635,13 @@ AC_OUTPUT
echo "*******************************************************"
echo GRUB2 will be compiled with following components:
echo Platform: "$target_cpu"-"$platform"
if [ x"$grub_emu_excuse" = x ]; then
echo grub-emu: Yes
else
echo grub-emu: No "($grub_emu_excuse)"
fi
if [ x"$platform" = xemu ]; then
if [ x"$grub_emu_usb_excuse" = x ]; then
echo USB support for grub-emu: Yes
else
echo USB support for grub-emu: No "($grub_emu_usb_excuse)"
fi
fi
if [ x"$enable_mm_debug" = xyes ]; then
echo With memory debugging: Yes
else

View File

@ -107,7 +107,7 @@ grub_ofdisk_iterate (int (*hook) (const char *name))
}
if (! grub_strcmp (alias->type, "block") &&
grub_strcmp (alias->name, "cdrom"))
grub_strncmp (alias->name, "cdrom", 5))
ret = hook (alias->name);
return ret;
}

View File

@ -19,7 +19,7 @@
u=
grep "^#define HAVE_ASM_USCORE" config.h >/dev/null 2>&1 && u="_"
$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \
$CC @TARGET_CFLAGS@ -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \
| grep -v '^#' \
| sed -n \
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$u"'\1 kernel/;p;}' \

View File

@ -59,7 +59,7 @@ cat <<EOF
{
EOF
$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \
$CC @TARGET_CFLAGS@ -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \
| grep -v '^#' \
| sed -n \
-e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/ {"\1", \1},/;p;}' \

368
gettext/gettext.c Normal file
View File

@ -0,0 +1,368 @@
/* gettext.c - gettext module */
/*
* 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/list.h>
#include <grub/types.h>
#include <grub/misc.h>
#include <grub/mm.h>
#include <grub/err.h>
#include <grub/dl.h>
#include <grub/normal.h>
#include <grub/file.h>
#include <grub/kernel.h>
#include <grub/gzio.h>
#include <grub/i18n.h>
/*
.mo file information from:
http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html .
*/
static grub_file_t fd_mo;
static int grub_gettext_offsetoriginal;
static int grub_gettext_max;
static const char *(*grub_gettext_original) (const char *s);
struct grub_gettext_msg
{
struct grub_gettext_msg *next;
const char *name;
const char *translated;
};
struct grub_gettext_msg *grub_gettext_msg_list = NULL;
#define GETTEXT_MAGIC_NUMBER 0
#define GETTEXT_FILE_FORMAT 4
#define GETTEXT_NUMBER_OF_STRINGS 8
#define GETTEXT_OFFSET_ORIGINAL 12
#define GETTEXT_OFFSET_TRANSLATION 16
#define MO_MAGIC_NUMBER 0x950412de
static grub_ssize_t
grub_gettext_pread (grub_file_t file, void *buf, grub_size_t len,
grub_off_t offset)
{
if (grub_file_seek (file, offset) == (grub_off_t) - 1)
{
return -1;
}
return grub_file_read (file, buf, len);
}
static grub_uint32_t
grub_gettext_get_info (int offset)
{
grub_uint32_t value;
grub_gettext_pread (fd_mo, (char *) &value, 4, offset);
value = grub_cpu_to_le32 (value);
return value;
}
static void
grub_gettext_getstring_from_offset (grub_uint32_t offset,
grub_uint32_t length, char *translation)
{
grub_gettext_pread (fd_mo, translation, length, offset);
translation[length] = '\0';
}
static const char *
grub_gettext_gettranslation_from_position (int position)
{
int offsettranslation;
int internal_position;
grub_uint32_t length, offset;
char *translation;
offsettranslation = grub_gettext_get_info (GETTEXT_OFFSET_TRANSLATION);
internal_position = offsettranslation + position * 8;
grub_gettext_pread (fd_mo, (char *) &length, 4, internal_position);
length = grub_cpu_to_le32 (length);
grub_gettext_pread (fd_mo, (char *) &offset, 4, internal_position + 4);
offset = grub_cpu_to_le32 (offset);
translation = grub_malloc (length + 1);
grub_gettext_getstring_from_offset (offset, length, translation);
return translation;
}
static char *
grub_gettext_getstring_from_position (int position)
{
int internal_position;
int length, offset;
char *original;
/* Get position for string i. */
internal_position = grub_gettext_offsetoriginal + (position * 8);
/* Get the length of the string i. */
grub_gettext_pread (fd_mo, (char *) &length, 4, internal_position);
/* Get the offset of the string i. */
grub_gettext_pread (fd_mo, (char *) &offset, 4, internal_position + 4);
/* Get the string i. */
original = grub_malloc (length + 1);
grub_gettext_getstring_from_offset (offset, length, original);
return original;
}
static const char *
grub_gettext_translate (const char *orig)
{
char *current_string;
const char *ret;
int min, max, current;
int found = 0;
struct grub_gettext_msg *cur;
cur = grub_named_list_find (GRUB_AS_NAMED_LIST (grub_gettext_msg_list),
orig);
if (cur)
return cur->translated;
if (fd_mo == 0)
return orig;
min = 0;
max = grub_gettext_max;
current = (max + min) / 2;
while (current != min && current != max && found == 0)
{
current_string = grub_gettext_getstring_from_position (current);
/* Search by bisection. */
if (grub_strcmp (current_string, orig) < 0)
{
grub_free (current_string);
min = current;
}
else if (grub_strcmp (current_string, orig) > 0)
{
grub_free (current_string);
max = current;
}
else if (grub_strcmp (current_string, orig) == 0)
{
grub_free (current_string);
found = 1;
}
current = (max + min) / 2;
}
ret = found ? grub_gettext_gettranslation_from_position (current) : orig;
if (found)
{
cur = grub_zalloc (sizeof (*cur));
if (cur)
{
cur->name = grub_strdup (orig);
if (cur->name)
{
cur->translated = ret;
grub_list_push (GRUB_AS_LIST_P (&grub_gettext_msg_list),
GRUB_AS_LIST (cur));
}
}
else
grub_errno = GRUB_ERR_NONE;
}
return ret;
}
/* This is similar to grub_gzfile_open. */
static grub_file_t
grub_mofile_open (const char *filename)
{
int unsigned magic;
int version;
/* Using fd_mo and not another variable because
it's needed for grub_gettext_get_info. */
fd_mo = grub_gzfile_open (filename, 1);
grub_errno = GRUB_ERR_NONE;
if (!fd_mo)
{
grub_dprintf ("gettext", "Cannot read %s\n", filename);
return 0;
}
magic = grub_gettext_get_info (GETTEXT_MAGIC_NUMBER);
if (magic != MO_MAGIC_NUMBER)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "mo: invalid mo file: %s",
filename);
grub_file_close (fd_mo);
fd_mo = 0;
return 0;
}
version = grub_gettext_get_info (GETTEXT_FILE_FORMAT);
if (version != 0)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE,
"mo: invalid mo version in file: %s\n", filename);
fd_mo = 0;
return 0;
}
return fd_mo;
}
static void
grub_gettext_init_ext (const char *lang)
{
char *mo_file;
char *locale_dir;
locale_dir = grub_env_get ("locale_dir");
if (locale_dir == NULL)
{
grub_dprintf ("gettext", "locale_dir variable is not set up.\n");
return;
}
fd_mo = NULL;
/* mo_file e.g.: /boot/grub/locale/ca.mo */
mo_file =
grub_malloc (grub_strlen (locale_dir) + grub_strlen ("/") +
grub_strlen (lang) + grub_strlen (".mo") + 1);
/* Warning: if changing some paths in the below line, change the grub_malloc
contents below. */
grub_sprintf (mo_file, "%s/%s.mo", locale_dir, lang);
fd_mo = grub_mofile_open (mo_file);
/* Will try adding .gz as well. */
if (fd_mo == NULL)
{
grub_sprintf (mo_file, "%s.gz", mo_file);
fd_mo = grub_mofile_open (mo_file);
}
if (fd_mo)
{
grub_gettext_offsetoriginal =
grub_gettext_get_info (GETTEXT_OFFSET_ORIGINAL);
grub_gettext_max = grub_gettext_get_info (GETTEXT_NUMBER_OF_STRINGS);
grub_gettext_original = grub_gettext;
grub_gettext = grub_gettext_translate;
}
}
static void
grub_gettext_delete_list ()
{
struct grub_gettext_msg *item;
while ((item =
grub_list_pop (GRUB_AS_LIST_P (&grub_gettext_msg_list))) != 0)
{
char *original = (char *) ((struct grub_gettext_msg *) item)->name;
grub_free (original);
// Don't delete the translated message because could be in use.
}
}
static char *
grub_gettext_env_write_lang (struct grub_env_var *var
__attribute__ ((unused)), const char *val)
{
grub_gettext_init_ext (val);
grub_gettext_delete_list ();
return grub_strdup (val);
}
static grub_err_t
grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)),
int argc, char **args)
{
if (argc != 1)
return grub_error (GRUB_ERR_BAD_ARGUMENT, "text to translate required");
const char *translation;
translation = grub_gettext_translate (args[0]);
grub_printf ("%s\n", translation);
return 0;
}
GRUB_MOD_INIT (gettext)
{
(void) mod; /* To stop warning. */
const char *lang;
lang = grub_env_get ("lang");
grub_gettext_init_ext (lang);
grub_register_command_p1 ("gettext", grub_cmd_translate,
"gettext STRING",
"Translates the string with the current settings.");
/* Reload .mo file information if lang changes. */
grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang);
/* Preserve hooks after context changes. */
grub_env_export ("lang");
}
GRUB_MOD_FINI (gettext)
{
if (fd_mo != 0)
grub_file_close (fd_mo);
grub_gettext_delete_list ();
grub_gettext = grub_gettext_original;
}

View File

@ -21,7 +21,6 @@
#ifndef GRUB_AUTOEFI_HEADER
#define GRUB_AUTOEFI_HEADER 1
#include <grub/machine/machine.h>
#ifdef GRUB_MACHINE_EFI
# include <grub/efi/efi.h>

View File

@ -54,8 +54,6 @@ char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp);
grub_efi_device_path_t *
EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle);
int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key);
void EXPORT_FUNC (grub_reboot) (void);
void EXPORT_FUNC (grub_halt) (void);
int EXPORT_FUNC (grub_efi_finish_boot_services) (void);
void grub_efi_mm_init (void);

View File

@ -0,0 +1,96 @@
/*
* 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/>.
*/
#ifndef GRUB_EFI_GOP_HEADER
#define GRUB_EFI_GOP_HEADER 1
/* Based on UEFI specification. */
#define GRUB_EFI_GOP_GUID \
{ 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a }}
typedef enum
{
GRUB_EFI_GOT_RGBA8,
GRUB_EFI_GOT_BGRA8,
GRUB_EFI_GOT_BITMASK
}
grub_efi_gop_pixel_format_t;
struct grub_efi_gop_pixel_bitmask
{
grub_uint32_t r;
grub_uint32_t g;
grub_uint32_t b;
grub_uint32_t a;
};
struct grub_efi_gop_mode_info
{
grub_efi_uint32_t version;
grub_efi_uint32_t width;
grub_efi_uint32_t height;
grub_efi_gop_pixel_format_t pixel_format;
struct grub_efi_gop_pixel_bitmask pixel_bitmask;
grub_efi_uint32_t pixels_per_scanline;
};
struct grub_efi_gop_mode
{
grub_efi_uint32_t max_mode;
grub_efi_uint32_t mode;
struct grub_efi_gop_mode_info *info;
grub_efi_uintn_t info_size;
grub_efi_physical_address_t fb_base;
grub_efi_uintn_t fb_size;
};
/* Forward declaration. */
struct grub_efi_gop;
typedef grub_efi_status_t
(*grub_efi_gop_query_mode_t) (struct grub_efi_gop *this,
grub_efi_uint32_t mode_number,
grub_efi_uintn_t *size_of_info,
struct grub_efi_gop_mode_info **info);
typedef grub_efi_status_t
(*grub_efi_gop_set_mode_t) (struct grub_efi_gop *this,
grub_efi_uint32_t mode_number);
typedef grub_efi_status_t
(*grub_efi_gop_blt_t) (struct grub_efi_gop *this,
void *buffer,
grub_efi_uintn_t operation,
grub_efi_uintn_t sx,
grub_efi_uintn_t sy,
grub_efi_uintn_t dx,
grub_efi_uintn_t dy,
grub_efi_uintn_t width,
grub_efi_uintn_t height,
grub_efi_uintn_t delta);
struct grub_efi_gop
{
grub_efi_gop_query_mode_t query_mode;
grub_efi_gop_set_mode_t set_mode;
grub_efi_gop_blt_t blt;
struct grub_efi_gop_mode *mode;
};
#endif

View File

@ -24,7 +24,13 @@
# include <libintl.h>
# define _(str) gettext(str)
#else
# define _(str) str
# define _(str) grub_gettext(str)
const char *EXPORT_FUNC(grub_gettext_dummy) (const char *s);
extern const char *(*EXPORT_VAR(grub_gettext)) (const char *s);
#endif
#define N_(str) str
#endif /* GRUB_I18N_H */

View File

@ -19,7 +19,6 @@
#ifndef GRUB_CPU_AT_KEYBOARD_HEADER
#define GRUB_CPU_AT_KEYBOARD_HEADER 1
#include <grub/machine/machine.h>
#define SHIFT_L 0x2a
#define SHIFT_R 0x36

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_COREBOOT 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_EFI 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -1,19 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 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/>.
*/
extern void grub_halt (void);

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_IEEE1275 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -19,7 +19,6 @@
#ifndef GRUB_KERNEL_CPU_HEADER
#define GRUB_KERNEL_CPU_HEADER 1
#include <grub/machine/machine.h>
#ifdef GRUB_MACHINE_IEEE1275
#define GRUB_MOD_ALIGN 0x1000

View File

@ -22,7 +22,6 @@
#include <grub/types.h>
#include <grub/err.h>
#include <grub/symbol.h>
#include <grub/machine/machine.h>
extern grub_addr_t EXPORT_VAR(grub_os_area_addr);
extern grub_size_t EXPORT_VAR(grub_os_area_size);

View File

@ -39,13 +39,6 @@ grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *
/* Turn on/off Gate A20. */
void grub_gate_a20 (int on);
/* Reboot the machine. */
void EXPORT_FUNC (grub_reboot) (void);
/* Halt the system, using APM if possible. If NO_APM is true, don't
* use APM even if it is available. */
void EXPORT_FUNC (grub_halt) (int no_apm);
void EXPORT_FUNC(grub_stop_floppy) (void);
#endif /* ! GRUB_INIT_MACHINE_HEADER */

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_PCBIOS 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -21,7 +21,6 @@
#define GRUB_MEMORY_MACHINE_HEADER 1
#include <grub/symbol.h>
#include <grub/machine/machine.h>
#ifndef ASM_FILE
#include <grub/types.h>
#include <grub/err.h>

View File

@ -1,24 +0,0 @@
/*
* 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_QEMU 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -1,19 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 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/>.
*/
extern void grub_reboot (void);

View File

@ -1,7 +1,7 @@
/* misc.h - prototypes for misc functions */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005,2006,2007,2008,2009,2008 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,2005,2006,2007,2008,2009,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
@ -171,6 +171,7 @@ char *EXPORT_FUNC(grub_strndup) (const char *s, grub_size_t n);
void *EXPORT_FUNC(grub_memset) (void *s, int c, grub_size_t n);
grub_size_t EXPORT_FUNC(grub_strlen) (const char *s);
int EXPORT_FUNC(grub_printf) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
int EXPORT_FUNC(grub_printf_) (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
void EXPORT_FUNC(grub_real_dprintf) (const char *file,
const int line,
const char *condition,
@ -222,4 +223,15 @@ grub_div_roundup (unsigned int x, unsigned int y)
return (x + y - 1) / y;
}
/* Reboot the machine. */
void EXPORT_FUNC (grub_reboot) (void);
#ifdef GRUB_MACHINE_PCBIOS
/* Halt the system, using APM if possible. If NO_APM is true, don't
* use APM even if it is available. */
void EXPORT_FUNC (grub_halt) (int no_apm);
#else
void EXPORT_FUNC (grub_halt) (void);
#endif
#endif /* ! GRUB_MISC_HEADER */

View File

@ -88,6 +88,7 @@ grub_err_t EXPORT_FUNC(grub_parser_execute) (char *source);
static inline void
grub_parser_register (const char *name __attribute__ ((unused)),
/* `name' is ignored here, but used by genhandlerlist.sh. */
grub_parser_t parser)
{
grub_handler_register (&grub_parser_class, GRUB_AS_HANDLER (parser));

View File

@ -23,9 +23,6 @@
#ifndef ASM_FILE
void EXPORT_FUNC (grub_reboot) (void);
void EXPORT_FUNC (grub_halt) (void);
/* The prefix which points to the directory where GRUB modules and its
configuration file are located. */
extern char grub_prefix[];

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_IEEE1275 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -54,9 +54,6 @@ extern grub_int32_t grub_total_module_size;
configuration file are located. */
extern char grub_prefix[];
void EXPORT_FUNC (grub_reboot) (void);
void EXPORT_FUNC (grub_halt) (void);
#endif /* ! ASM_FILE */
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_IEEE1275 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -21,9 +21,14 @@
#include <grub/types.h>
#include <grub/symbol.h>
#include <grub/machine/time.h>
#include <grub/cpu/time.h>
#ifdef GRUB_MACHINE_EMU
#define GRUB_TICKS_PER_SECOND 100000
#else
#include <grub/machine/time.h>
#endif
void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms);
grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void);

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2002,2003,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
@ -21,6 +21,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <unistd.h>
@ -57,12 +58,20 @@ void grub_util_write_image (const char *img, size_t size, FILE *out);
void grub_util_write_image_at (const void *img, size_t size, off_t offset,
FILE *out);
#ifndef HAVE_VASPRINTF
int vasprintf (char **buf, const char *fmt, va_list ap);
#endif
#ifndef HAVE_ASPRINTF
int asprintf (char **buf, const char *fmt, ...);
#endif
char *xasprintf (const char *fmt, ...);
#ifdef __MINGW32__
#define fseeko fseeko64
@ -76,4 +85,7 @@ grub_int64_t grub_util_get_disk_size (char *name);
#endif
char *make_system_path_relative_to_its_root (const char *path);
#endif /* ! GRUB_UTIL_MISC_HEADER */

View File

@ -1,24 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2007 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/>.
*/
#ifndef GRUB_MACHINE_MACHINE_HEADER
#define GRUB_MACHINE_MACHINE_HEADER 1
#define GRUB_MACHINE_EFI 1
#endif /* ! GRUB_MACHINE_MACHINE_HEADER */

View File

@ -1,519 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View File

@ -31,7 +31,6 @@
#include <grub/file.h>
#include <grub/env.h>
#include <grub/cache.h>
#include <grub/machine/machine.h>
/* Platforms where modules are in a readonly area of memory. */
#if defined(GRUB_MACHINE_QEMU)

View File

@ -23,7 +23,6 @@
#include <grub/machine/memory.h>
#include <grub/machine/console.h>
#include <grub/machine/kernel.h>
#include <grub/machine/machine.h>
#include <grub/types.h>
#include <grub/err.h>
#include <grub/dl.h>

View File

@ -17,7 +17,6 @@
*/
#include <grub/cpu/io.h>
#include <grub/cpu/halt.h>
#include <grub/machine/init.h>
#include <grub/misc.h>

View File

@ -484,21 +484,6 @@ FUNCTION(grub_exit)
jmp cold_reboot
.code32
/*
* grub_reboot()
*
* Reboot the system. At the moment, rely on BIOS.
*/
FUNCTION(grub_reboot)
call prot_to_real
.code16
cold_reboot:
/* cold boot */
movw $0x0472, %di
movw %ax, (%di)
ljmp $0xFFFF, $0x0000
.code32
/*
* grub_halt(int no_apm)
*

View File

@ -95,3 +95,5 @@ codestart:
/* This should never happen. */
jmp EXT_C(grub_stop)
#include "../realmode.S"

View File

@ -215,10 +215,27 @@ realcseg:
movw %ax, %gs
movw %ax, %ss
#ifdef GRUB_MACHINE_PCBIOS
/* restore interrupts */
sti
#endif
/* return on new stack! */
DATA32 ret
.code32
/*
* grub_reboot()
*
* Reboot the system. At the moment, rely on BIOS.
*/
FUNCTION(grub_reboot)
call prot_to_real
.code16
cold_reboot:
/* set 0x472 to 0x0000 for cold boot (0x1234 for warm boot) */
movw $0x0472, %di
movw %ax, (%di)
ljmp $0xf000, $0xfff0
.code32

View File

@ -1,32 +0,0 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 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/cpu/io.h>
#include <grub/cpu/at_keyboard.h>
#include <grub/cpu/reboot.h>
#include <grub/misc.h>
void
grub_reboot (void)
{
/* Use the keyboard controller to reboot. That's what keyboards were
designed for, isn't it? */
grub_outb (KEYBOARD_COMMAND_REBOOT, KEYBOARD_REG_STATUS);
grub_printf ("GRUB doesn't know how to reboot this machine yet!\n");
}

View File

@ -1,7 +1,7 @@
/* openfw.c -- Open firmware support functions. */
/*
* 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
@ -399,11 +399,14 @@ grub_ieee1275_encode_devname (const char *path)
return encoding;
}
/* On i386, a firmware-independant grub_reboot() is provided by realmode.S. */
#ifndef __i386__
void
grub_reboot (void)
{
grub_ieee1275_interpret ("reset-all", 0);
}
#endif
void
grub_halt (void)

View File

@ -23,6 +23,7 @@
#include <stdarg.h>
#include <grub/term.h>
#include <grub/env.h>
#include <grub/i18n.h>
static int
grub_iswordseparator (int c)
@ -30,6 +31,15 @@ grub_iswordseparator (int c)
return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&');
}
/* grub_gettext_dummy is not translating anything. */
const char *
grub_gettext_dummy (const char *s)
{
return s;
}
const char* (*grub_gettext) (const char *s) = grub_gettext_dummy;
void *
grub_memmove (void *dest, const void *src, grub_size_t n)
{
@ -116,6 +126,19 @@ grub_printf (const char *fmt, ...)
return ret;
}
int
grub_printf_ (const char *fmt, ...)
{
va_list ap;
int ret;
va_start (ap, fmt);
ret = grub_vprintf (_(fmt), ap);
va_end (ap);
return ret;
}
#if defined (APPLE_CC) && ! defined (GRUB_UTIL)
int
grub_err_printf (const char *fmt, ...)

View File

@ -23,7 +23,6 @@
#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/memory.h>
#include <grub/machine/machine.h>
#include <grub/file.h>
#include <grub/err.h>
#include <grub/dl.h>

View File

@ -17,7 +17,6 @@
*/
#include <grub/loader.h>
#include <grub/machine/machine.h>
#include <grub/machine/memory.h>
#include <grub/machine/loader.h>
#include <grub/normal.h>

View File

@ -17,7 +17,6 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/machine/machine.h>
#include <grub/multiboot.h>
#include <grub/multiboot2.h>
#include <multiboot2.h>

View File

@ -29,6 +29,7 @@
#include <grub/reader.h>
#include <grub/menu_viewer.h>
#include <grub/auth.h>
#include <grub/i18n.h>
#define GRUB_DEFAULT_HISTORY_SIZE 50
@ -414,7 +415,7 @@ grub_normal_execute (const char *config, int nested, int batch)
read_command_list ();
read_fs_list ();
read_handler_list ();
grub_command_execute ("parser.sh", 0, 0);
grub_command_execute ("parser.grub", 0, 0);
reader_nested = nested;
@ -508,10 +509,10 @@ grub_normal_reader_init (void)
grub_normal_init_page ();
grub_setcursor (1);
grub_printf ("\
grub_printf_ (N_("\
[ Minimal BASH-like line editing is supported. For the first word, TAB\n\
lists possible command completions. Anywhere else TAB lists possible\n\
device/file completions.%s ]\n\n",
device/file completions.%s ]\n\n"),
reader_nested ? " ESC at any time exits." : "");
return 0;
@ -523,9 +524,9 @@ static grub_err_t
grub_normal_read_line (char **line, int cont)
{
grub_parser_t parser = grub_parser_get_current ();
char prompt[8 + grub_strlen (parser->name)];
char prompt[sizeof("> ") + grub_strlen (parser->name)];
grub_sprintf (prompt, "%s:%s> ", parser->name, (cont) ? "" : "grub");
grub_sprintf (prompt, "%s> ", parser->name);
while (1)
{

View File

@ -24,6 +24,7 @@
#include <grub/command.h>
#include <grub/parser.h>
#include <grub/auth.h>
#include <grub/i18n.h>
enum update_mode
{
@ -835,7 +836,9 @@ store_completion (const char *item, grub_completion_type_t type, int count)
}
grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
grub_printf (" Possible %s are:\n ", what);
grub_printf (" ");
grub_printf_ (N_("Possible %s are:"), what);
grub_printf ("\n ");
}
/* Make sure that the completion buffer has enough room. */
@ -996,7 +999,9 @@ run (struct screen *screen)
}
grub_cls ();
grub_printf (" Booting a command list\n\n");
grub_printf (" ");
grub_printf_ (N_("Booting a command list"));
grub_printf ("\n\n");
/* Execute the script, line for line. */
@ -1176,6 +1181,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
grub_cls ();
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
grub_printf ("\nPress any key to continue...");
grub_putchar ('\n');
grub_printf_ (N_("Press any key to continue..."));
(void) grub_getkey ();
}

View File

@ -25,6 +25,7 @@
#include <grub/time.h>
#include <grub/env.h>
#include <grub/menu_viewer.h>
#include <grub/i18n.h>
/* Time to delay after displaying an error message about a default/fallback
entry failing to boot. */
@ -38,11 +39,105 @@ static grub_uint8_t grub_color_menu_highlight;
void
grub_wait_after_message (void)
{
grub_printf ("\nPress any key to continue...");
grub_putchar ('\n');
grub_printf_ (N_("Press any key to continue..."));
(void) grub_getkey ();
grub_putchar ('\n');
}
static void
print_spaces (int number_spaces)
{
int i;
for (i = 0; i < number_spaces; i++)
grub_putchar (' ');
}
static void
grub_print_ucs4 (const grub_uint32_t * str,
const grub_uint32_t * last_position)
{
while (str < last_position)
{
grub_putcode (*str);
str++;
}
}
static grub_ssize_t
getstringwidth (grub_uint32_t * str, const grub_uint32_t * last_position)
{
grub_ssize_t width = 0;
while (str < last_position)
{
width += grub_getcharwidth (*str);
str++;
}
return width;
}
static void
print_message_indented (const char *msg)
{
const int line_len = GRUB_TERM_WIDTH - grub_getcharwidth ('m') * 15;
grub_uint32_t *unicode_msg;
grub_ssize_t msg_len = grub_strlen (msg);
unicode_msg = grub_malloc (msg_len * sizeof (*unicode_msg));
msg_len = grub_utf8_to_ucs4 (unicode_msg, msg_len,
(grub_uint8_t *) msg, -1, 0);
if (!unicode_msg)
{
grub_printf ("print_message_indented ERROR1: %s", msg);
return;
}
if (msg_len < 0)
{
grub_printf ("print_message_indented ERROR2: %s", msg);
grub_free (unicode_msg);
return;
}
const grub_uint32_t *last_position = unicode_msg + msg_len;
grub_uint32_t *current_position = unicode_msg;
grub_uint32_t *next_new_line = unicode_msg;
while (current_position < last_position)
{
next_new_line = (grub_uint32_t *) last_position;
while (getstringwidth (current_position, next_new_line) > line_len
|| (*next_new_line != ' ' && next_new_line > current_position &&
next_new_line != last_position))
{
next_new_line--;
}
if (next_new_line == current_position)
{
next_new_line = (next_new_line + line_len > last_position) ?
(grub_uint32_t *) last_position : next_new_line + line_len;
}
print_spaces (6);
grub_print_ucs4 (current_position, next_new_line);
grub_putchar ('\n');
next_new_line++;
current_position = next_new_line;
}
grub_free (unicode_msg);
}
static void
draw_border (void)
{
@ -86,22 +181,33 @@ print_message (int nested, int edit)
if (edit)
{
grub_printf ("\n\
Minimum Emacs-like screen editing is supported. TAB lists\n\
completions. Press Ctrl-x to boot, Ctrl-c for a command-line\n\
or ESC to return menu.");
grub_putchar ('\n');
print_message_indented (_("Minimum Emacs-like screen editing is \
supported. TAB lists completions. Press Ctrl-x to boot, Ctrl-c for a \
command-line or ESC to return menu."));
}
else
{
grub_printf ("\n\
Use the %C and %C keys to select which entry is highlighted.\n",
(grub_uint32_t) GRUB_TERM_DISP_UP, (grub_uint32_t) GRUB_TERM_DISP_DOWN);
grub_printf ("\
Press enter to boot the selected OS, \'e\' to edit the\n\
commands before booting or \'c\' for a command-line.");
const char *msg = _("Use the %C and %C keys to select which \
entry is highlighted.");
char *msg_translated =
grub_malloc (sizeof (char) * grub_strlen (msg) + 1);
grub_sprintf (msg_translated, msg, (grub_uint32_t) GRUB_TERM_DISP_UP,
(grub_uint32_t) GRUB_TERM_DISP_DOWN);
grub_putchar ('\n');
print_message_indented (msg_translated);
grub_free (msg_translated);
print_message_indented (_("Press enter to boot the selected OS, \
\'e\' to edit the commands before booting or \'c\' for a command-line."));
if (nested)
grub_printf ("\n\
ESC to return previous menu.");
{
grub_printf ("\n ");
grub_printf_ (N_("ESC to return previous menu."));
}
}
}
@ -286,13 +392,17 @@ get_entry_number (grub_menu_t menu, const char *name)
static void
print_timeout (int timeout, int offset, int second_stage)
{
/* NOTE: Do not remove the trailing space characters.
They are required to clear the line. */
char *msg = " The highlighted entry will be booted automatically in %ds. ";
const char *msg =
_("The highlighted entry will be booted automatically in %ds.");
const int msg_localized_len = grub_strlen (msg);
const int number_spaces = GRUB_TERM_WIDTH - msg_localized_len - 3;
char *msg_end = grub_strchr (msg, '%');
grub_gotoxy (second_stage ? (msg_end - msg) : 0, GRUB_TERM_HEIGHT - 3);
grub_gotoxy (second_stage ? (msg_end - msg + 3) : 3, GRUB_TERM_HEIGHT - 3);
grub_printf (second_stage ? msg_end : msg, timeout);
print_spaces (second_stage ? number_spaces : 0);
grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset);
grub_refresh ();
};
@ -381,8 +491,8 @@ run_menu (grub_menu_t menu, int nested, int *auto_boot)
if (timeout >= 0)
{
grub_gotoxy (0, GRUB_TERM_HEIGHT - 3);
grub_printf ("\
");
print_spaces (GRUB_TERM_WIDTH - 1);
grub_env_unset ("timeout");
grub_env_unset ("fallback");
grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset);
@ -538,7 +648,9 @@ static void
notify_booting (grub_menu_entry_t entry,
void *userdata __attribute__((unused)))
{
grub_printf (" Booting \'%s\'\n\n", entry->title);
grub_printf (" ");
grub_printf_ (N_("Booting \'%s\'"), entry->title);
grub_printf ("\n\n");
}
/* Callback invoked when a default menu entry executed because of a timeout
@ -548,7 +660,9 @@ static void
notify_fallback (grub_menu_entry_t entry,
void *userdata __attribute__((unused)))
{
grub_printf ("\n Falling back to \'%s\'\n\n", entry->title);
grub_printf ("\n ");
grub_printf_ (N_("Falling back to \'%s\'"), entry->title);
grub_printf ("\n\n");
grub_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS);
}
@ -562,7 +676,8 @@ notify_execution_failure (void *userdata __attribute__((unused)))
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
}
grub_printf ("\n Failed to boot default entries.\n");
grub_printf ("\n ");
grub_printf_ (N_("Failed to boot default entries.\n"));
grub_wait_after_message ();
}

View File

@ -1 +0,0 @@
ca

View File

@ -10,3 +10,6 @@ util/mkisofs/multi.c
util/mkisofs/rock.c
util/mkisofs/tree.c
util/mkisofs/write.c
normal/menu_entry.c
normal/menu_text.c

24
po/README Normal file
View File

@ -0,0 +1,24 @@
If you checked out this source tree directly from GRUB Bazaar, you might
be wondering where are the POT and PO files. Here are some instructions
that will hopefully clarify the situation.
- If you're a user or a distributor, simply fill the po directory by
importing translations from the Translation Project:
rsync -Lrtvz translationproject.org::tp/latest/grub/ po
GRUB's build system will automatically detect those and include them
in your install.
- If you're a translator and want to add a new translation or improve an
existing one, get in touch with the Translation Project
(http://translationproject.org/). The GRUB project doesn't interact
with translators directly (but we dearly appreciate your work!).
- If you're a developer adding/removing/modifiing translatable strings,
you can check that these turn into a sane POT file by using the
`po/grub.pot' make rule.
- If you're the maintainer of GNU GRUB preparing a new release, don't
forget to include the latest PO files in your source tarball!

895
po/ca.po
View File

@ -1,895 +0,0 @@
# Copyright (C) 2009 Free Software Foundation, Inc
# This file is distributed under the same license as the GNU GRUB package.
# Robert Millan <rmh.grub@aybabtu.com>, 2009.
#
msgid ""
msgstr ""
"Project-Id-Version: GNU GRUB\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-11-19 00:16+0100\n"
"PO-Revision-Date: 2009-11-17 12:26+0100\n"
"Last-Translator: Robert Millan <rmh.grub@aybabtu.com>\n"
"Language-Team: None <no-team-yet@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: util/i386/pc/grub-mkimage.c:65
msgid "the core image is too small"
msgstr ""
#: util/i386/pc/grub-mkimage.c:77
msgid "cannot compress the kernel image"
msgstr ""
#: util/i386/pc/grub-mkimage.c:117
#, c-format
msgid "the size of memory disk is 0x%x"
msgstr ""
#: util/i386/pc/grub-mkimage.c:124
#, c-format
msgid "the size of config file is 0x%x"
msgstr ""
#: util/i386/pc/grub-mkimage.c:132
#, c-format
msgid "the total module size is 0x%x"
msgstr ""
#: util/i386/pc/grub-mkimage.c:138
msgid "prefix is too long"
msgstr ""
#: util/i386/pc/grub-mkimage.c:199
#, c-format
msgid "the core size is 0x%x"
msgstr ""
#: util/i386/pc/grub-mkimage.c:206
msgid "the core image is too big"
msgstr ""
#: util/i386/pc/grub-mkimage.c:211
#, c-format
msgid "diskboot.img size must be %u bytes"
msgstr ""
#: util/i386/pc/grub-mkimage.c:284
#, c-format
msgid "Core image is too big (%p > %p)\n"
msgstr ""
#: util/i386/pc/grub-mkimage.c:321 util/i386/pc/grub-setup.c:587
#, c-format
msgid "Try ``%s --help'' for more information.\n"
msgstr "Proveu «%s --help» per a obtenir més informació.\n"
#: util/i386/pc/grub-mkimage.c:323
#, c-format
msgid ""
"Usage: grub-mkimage [OPTION]... [MODULES]\n"
"\n"
"Make a bootable image of GRUB.\n"
"\n"
" -d, --directory=DIR use images and modules under DIR [default=%s]\n"
" -p, --prefix=DIR set grub_prefix directory [default=%s]\n"
" -m, --memdisk=FILE embed FILE as a memdisk image\n"
" -c, --config=FILE embed FILE as boot config\n"
" -o, --output=FILE output a generated image to FILE [default=stdout]\n"
" -h, --help display this message and exit\n"
" -V, --version print version information and exit\n"
" -v, --verbose print verbose messages\n"
"\n"
"Report bugs to <%s>.\n"
msgstr ""
#: util/i386/pc/grub-mkimage.c:429
#, c-format
msgid "cannot open %s"
msgstr ""
#: util/i386/pc/grub-setup.c:162
#, c-format
msgid "the first sector is <%llu,%u,%u>"
msgstr ""
#: util/i386/pc/grub-setup.c:166
msgid "The first sector of the core file is not sector-aligned"
msgstr ""
#: util/i386/pc/grub-setup.c:176
#, c-format
msgid "saving <%llu,%u,%u> with the segment 0x%x"
msgstr ""
#: util/i386/pc/grub-setup.c:180
msgid "Non-sector-aligned data is found in the core file"
msgstr ""
#: util/i386/pc/grub-setup.c:194
msgid "The sectors of the core file are too fragmented"
msgstr ""
#: util/i386/pc/grub-setup.c:205
#, c-format
msgid "The size of `%s' is not %u"
msgstr ""
#: util/i386/pc/grub-setup.c:222
#, c-format
msgid "The size of `%s' is too small"
msgstr ""
#: util/i386/pc/grub-setup.c:224
#, c-format
msgid "The size of `%s' is too large"
msgstr ""
#: util/i386/pc/grub-setup.c:247
#, c-format
msgid "setting the root device to `%s'"
msgstr ""
#: util/i386/pc/grub-setup.c:261
#, c-format
msgid "Unable to identify a filesystem in %s; safety check can't be performed"
msgstr ""
#: util/i386/pc/grub-setup.c:265
#, c-format
msgid ""
"%s appears to contain a %s filesystem which isn't known to reserve space for "
"DOS-style boot. Installing GRUB there could result in FILESYSTEM "
"DESTRUCTION if valuable data is overwritten by grub-setup (--skip-fs-probe "
"disables this check, use at your own risk)"
msgstr ""
#: util/i386/pc/grub-setup.c:314
msgid "No DOS-style partitions found"
msgstr ""
#: util/i386/pc/grub-setup.c:325
#, c-format
msgid "dos partition is %d, bsd partition is %d"
msgstr ""
#: util/i386/pc/grub-setup.c:330 util/i386/pc/grub-setup.c:355
msgid ""
"Attempting to install GRUB to a partitionless disk. This is a BAD idea."
msgstr ""
#: util/i386/pc/grub-setup.c:336
msgid ""
"Attempting to install GRUB to a partition instead of the MBR. This is a BAD "
"idea."
msgstr ""
#: util/i386/pc/grub-setup.c:365
msgid ""
"This msdos-style partition label has no post-MBR gap; embedding won't be "
"possible!"
msgstr ""
#: util/i386/pc/grub-setup.c:367
msgid ""
"This GPT partition label has no BIOS Boot Partition; embedding won't be "
"possible!"
msgstr ""
#: util/i386/pc/grub-setup.c:374
msgid "Your core.img is unusually large. It won't fit in the embedding area."
msgstr ""
#: util/i386/pc/grub-setup.c:376
msgid "Your embedding area is unusually small. core.img won't fit in it."
msgstr ""
#: util/i386/pc/grub-setup.c:381
#, c-format
msgid "the core image will be embedded at sector 0x%llx"
msgstr ""
#: util/i386/pc/grub-setup.c:418
msgid ""
"Embedding is not possible, but this is required when the root device is on a "
"RAID array or LVM volume."
msgstr ""
#: util/i386/pc/grub-setup.c:421
msgid ""
"Embedding is not possible. GRUB can only be installed in this setup by "
"using blocklists. However, blocklists are UNRELIABLE and its use is "
"discouraged."
msgstr ""
#: util/i386/pc/grub-setup.c:425
msgid "If you really want blocklists, use --force."
msgstr ""
#: util/i386/pc/grub-setup.c:439
#, c-format
msgid "attempting to read the core image `%s' from GRUB"
msgstr ""
#: util/i386/pc/grub-setup.c:440
#, c-format
msgid "attempting to read the core image `%s' from GRUB again"
msgstr ""
#: util/i386/pc/grub-setup.c:449
#, c-format
msgid ""
"succeeded in opening the core image but the size is different (%d != %d)"
msgstr ""
#: util/i386/pc/grub-setup.c:453
#, c-format
msgid "succeeded in opening the core image but cannot read %d bytes"
msgstr ""
#: util/i386/pc/grub-setup.c:476
msgid "succeeded in opening the core image but the data is different"
msgstr ""
#: util/i386/pc/grub-setup.c:487
msgid "couldn't open the core image"
msgstr ""
#: util/i386/pc/grub-setup.c:490
#, c-format
msgid "error message = %s"
msgstr ""
#: util/i386/pc/grub-setup.c:498
#, c-format
msgid "Cannot read `%s' correctly"
msgstr ""
#: util/i386/pc/grub-setup.c:511
msgid "No terminator in the core image"
msgstr ""
#: util/i386/pc/grub-setup.c:522
msgid "Failed to read the first sector of the core image"
msgstr ""
#: util/i386/pc/grub-setup.c:528
msgid "Failed to read the rest sectors of the core image"
msgstr ""
#: util/i386/pc/grub-setup.c:544
#, c-format
msgid "opening the core image `%s'"
msgstr ""
#: util/i386/pc/grub-setup.c:547
#, c-format
msgid "Cannot open `%s'"
msgstr ""
#: util/i386/pc/grub-setup.c:589
#, c-format
msgid ""
"Usage: grub-setup [OPTION]... DEVICE\n"
"\n"
"Set up images to boot from DEVICE.\n"
"DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n"
"\n"
" -b, --boot-image=FILE use FILE as the boot image [default=%s]\n"
" -c, --core-image=FILE use FILE as the core image [default=%s]\n"
" -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n"
" -m, --device-map=FILE use FILE as the device map [default=%s]\n"
" -r, --root-device=DEV use DEV as the root device [default=guessed]\n"
" -f, --force install even if problems are detected\n"
" -s, --skip-fs-probe do not probe for filesystems in DEVICE\n"
" -h, --help display this message and exit\n"
" -V, --version print version information and exit\n"
" -v, --verbose print verbose messages\n"
"\n"
"Report bugs to <%s>.\n"
msgstr ""
#: util/i386/pc/grub-setup.c:719
#, c-format
msgid "No device is specified.\n"
msgstr ""
#: util/i386/pc/grub-setup.c:725
#, c-format
msgid "Unknown extra argument `%s'.\n"
msgstr ""
#: util/i386/pc/grub-setup.c:742
#, c-format
msgid "Invalid device `%s'.\n"
msgstr ""
#: util/i386/pc/grub-setup.c:755
#, c-format
msgid "Invalid root device `%s'"
msgstr ""
#: util/i386/pc/grub-setup.c:766
#, c-format
msgid "guessing the root device failed, because of `%s'"
msgstr ""
#: util/i386/pc/grub-setup.c:768
msgid "Cannot guess the root device. Specify the option ``--root-device''."
msgstr ""
#: util/mkisofs/eltorito.c:96
#, c-format
msgid "A boot catalog exists and appears corrupted.\n"
msgstr ""
#: util/mkisofs/eltorito.c:97
#, c-format
msgid "Please check the following file: %s.\n"
msgstr ""
#: util/mkisofs/eltorito.c:98
#, c-format
msgid "This file must be removed before a bootable CD can be done.\n"
msgstr ""
#: util/mkisofs/eltorito.c:110
#, c-format
msgid "Error creating boot catalog (%s)"
msgstr ""
#: util/mkisofs/eltorito.c:114
#, c-format
msgid "Error writing to boot catalog (%s)"
msgstr ""
#: util/mkisofs/eltorito.c:144
#, c-format
msgid "Boot catalog cannot be found!\n"
msgstr ""
#: util/mkisofs/eltorito.c:158
#, c-format
msgid "Boot image cannot be found!\n"
msgstr ""
#: util/mkisofs/eltorito.c:221
#, c-format
msgid ""
"\n"
"Size of boot image is %d sectors"
msgstr ""
#: util/mkisofs/eltorito.c:227
#, c-format
msgid "No emulation\n"
msgstr ""
#: util/mkisofs/eltorito.c:235
#, c-format
msgid "Emulating a 1.44 meg floppy\n"
msgstr ""
#: util/mkisofs/eltorito.c:240
#, c-format
msgid "Emulating a 2.88 meg floppy\n"
msgstr ""
#: util/mkisofs/eltorito.c:245
#, c-format
msgid "Emulating a 1.2 meg floppy\n"
msgstr ""
#: util/mkisofs/eltorito.c:249
#, c-format
msgid ""
"\n"
"Error - boot image is not the an allowable size.\n"
msgstr ""
#: util/mkisofs/eltorito.c:269
msgid "Error opening boot catalog for update"
msgstr ""
#: util/mkisofs/eltorito.c:275 util/mkisofs/eltorito.c:277
msgid "Error writing to boot catalog"
msgstr ""
#: util/mkisofs/eltorito.c:291
#, c-format
msgid "Error opening boot image file '%s' for update"
msgstr ""
#: util/mkisofs/eltorito.c:299
#, c-format
msgid "Odd alignment at non-end-of-file in boot image '%s'"
msgstr ""
#: util/mkisofs/eltorito.c:311
#, c-format
msgid "Boot image file '%s' changed unexpectedly"
msgstr ""
#: util/mkisofs/eltorito.c:323
#, c-format
msgid "Error writing to boot image (%s)"
msgstr ""
#: util/mkisofs/joliet.c:359 util/mkisofs/write.c:981
#, c-format
msgid "Unable to generate sane path tables - too many directories (%d)\n"
msgstr ""
#: util/mkisofs/joliet.c:398 util/mkisofs/write.c:1017
#, c-format
msgid "Entry %d not in path tables\n"
msgstr ""
#: util/mkisofs/joliet.c:412
#, c-format
msgid "Fatal goof - directory has amnesia\n"
msgstr ""
#: util/mkisofs/joliet.c:478
#, c-format
msgid "Joliet path table lengths do not match %d %d\n"
msgstr ""
#: util/mkisofs/joliet.c:530
#, c-format
msgid "Unable to locate relocated directory\n"
msgstr ""
#: util/mkisofs/joliet.c:605
#, c-format
msgid "Fatal goof - unable to find directory location\n"
msgstr ""
#: util/mkisofs/joliet.c:654
#, c-format
msgid "Unexpected joliet directory length %d %d %s\n"
msgstr ""
#: util/mkisofs/mkisofs.c:373
#, c-format
msgid "Using \"%s\"\n"
msgstr ""
#: util/mkisofs/mkisofs.c:401
#, c-format
msgid "%s:%d: name required\n"
msgstr ""
#: util/mkisofs/mkisofs.c:411
#, c-format
msgid "%s:%d: equals sign required\n"
msgstr ""
#: util/mkisofs/mkisofs.c:445
#, c-format
msgid "%s:%d: field name \"%s\" unknown\n"
msgstr ""
#: util/mkisofs/mkisofs.c:474
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
#: util/mkisofs/mkisofs.c:476
#, c-format
msgid "Options:\n"
msgstr ""
#: util/mkisofs/mkisofs.c:706
#, c-format
msgid "-i option no longer supported.\n"
msgstr ""
#: util/mkisofs/mkisofs.c:720
#, c-format
msgid "Required boot image pathname missing\n"
msgstr ""
#: util/mkisofs/mkisofs.c:729
#, c-format
msgid "Required boot catalog pathname missing\n"
msgstr ""
#: util/mkisofs/mkisofs.c:737
#, c-format
msgid "Ignoring -no-emul-boot (no-emulation is the default behaviour)\n"
msgstr ""
#: util/mkisofs/mkisofs.c:746
#, c-format
msgid "Abstract filename string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:754
#, c-format
msgid "Application-id string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:762
#, c-format
msgid "Bibliographic filename string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:770
#, c-format
msgid "Copyright filename string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:805
#, c-format
msgid "Preparer string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:816
#, c-format
msgid "Publisher string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:837
#, c-format
msgid "System ID string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:848
#, c-format
msgid "Volume ID string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:856
#, c-format
msgid "Volume set ID string too long\n"
msgstr ""
#: util/mkisofs/mkisofs.c:867
#, c-format
msgid "Volume set sequence number too big\n"
msgstr ""
#: util/mkisofs/mkisofs.c:909 util/mkisofs/mkisofs.c:919
#: util/mkisofs/mkisofs.c:929 util/mkisofs/mkisofs.c:939
#, c-format
msgid "date string must be 16 characters.\n"
msgstr ""
#: util/mkisofs/mkisofs.c:958
msgid "Warning: getrlimit"
msgstr ""
#: util/mkisofs/mkisofs.c:962
msgid "Warning: setrlimit"
msgstr ""
#: util/mkisofs/mkisofs.c:978
#, c-format
msgid "Multisession usage bug: Must specify -C if -M is used.\n"
msgstr ""
#: util/mkisofs/mkisofs.c:984
#, c-format
msgid ""
"Warning: -C specified without -M: old session data will not be merged.\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1023
#, c-format
msgid "can't open logfile: %s"
msgstr ""
#: util/mkisofs/mkisofs.c:1027
#, c-format
msgid "re-directing all messages to %s\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1032
#, c-format
msgid "can't open logfile: %s\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1073
#, c-format
msgid "Unable to open previous session image %s\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1184
#, c-format
msgid "Invalid node - %s\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1246
msgid "Joliet tree sort failed.\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1261
msgid "Unable to open /dev/null\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1265
msgid "Unable to open disc image file\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1387
#, c-format
msgid "Max brk space used %x\n"
msgstr ""
#: util/mkisofs/mkisofs.c:1390
#, c-format
msgid "%llu extents written (%llu MiB)\n"
msgstr ""
#: util/mkisofs/multi.c:161
msgid "Seek error on old image\n"
msgstr ""
#: util/mkisofs/multi.c:179 util/mkisofs/multi.c:250
#, c-format
msgid "**Bad RR version attribute"
msgstr ""
#: util/mkisofs/multi.c:546
#, c-format
msgid ""
"Warning: Neither Rock Ridge (-R) nor TRANS.TBL (-T) name translations were "
"found on previous session. ISO (8.3) file names have been used instead.\n"
msgstr ""
#: util/mkisofs/multi.c:764
#, c-format
msgid "Read error on old image %s\n"
msgstr ""
#: util/mkisofs/multi.c:1084
msgid "Special parameters for cdwrite not specified with -C\n"
msgstr ""
#: util/mkisofs/multi.c:1091
msgid "Malformed cdwrite parameters\n"
msgstr ""
#: util/mkisofs/rock.c:309
#, c-format
msgid "symbolic link ``%s'' to long for one SL System Use Field, splitting"
msgstr ""
#: util/mkisofs/rock.c:517
#, c-format
msgid "Unable to insert transparent compressed file - name conflict\n"
msgstr ""
#: util/mkisofs/rock.c:591
msgid "Extension record too long\n"
msgstr ""
#: util/mkisofs/tree.c:226 util/mkisofs/write.c:565 util/mkisofs/write.c:1037
msgid "Fatal goof\n"
msgstr ""
#: util/mkisofs/tree.c:284
#, c-format
msgid "Unable to generate unique name for file %s\n"
msgstr ""
#: util/mkisofs/tree.c:295 util/mkisofs/tree.c:317
#, c-format
msgid "Using %s for %s%s%s (%s)\n"
msgstr ""
#: util/mkisofs/tree.c:441
#, c-format
msgid "Fatal error - RR overflow for file %s\n"
msgstr ""
#: util/mkisofs/tree.c:449
#, c-format
msgid "Unable to sort directory %s\n"
msgstr ""
#: util/mkisofs/tree.c:480
#, c-format
msgid "Translation table size mismatch %d %d\n"
msgstr ""
#: util/mkisofs/tree.c:746
msgid "Unable to locate directory parent\n"
msgstr ""
#: util/mkisofs/tree.c:796
#, c-format
msgid "Scanning %s\n"
msgstr ""
#: util/mkisofs/tree.c:811
#, c-format
msgid "Unable to open directory %s\n"
msgstr ""
#: util/mkisofs/tree.c:856
#, c-format
msgid "Ignoring file %s\n"
msgstr ""
#: util/mkisofs/tree.c:863
msgid "Overflow of stat buffer\n"
msgstr ""
#: util/mkisofs/tree.c:876
#, c-format
msgid "Excluded by match: %s\n"
msgstr ""
#: util/mkisofs/tree.c:891
#, c-format
msgid "Excluded: %s\n"
msgstr ""
#: util/mkisofs/tree.c:961
#, c-format
msgid "Non-existant or inaccessible: %s\n"
msgstr ""
#: util/mkisofs/tree.c:997 util/mkisofs/tree.c:1103
#, c-format
msgid "Unable to stat file %s - ignoring and continuing.\n"
msgstr ""
#: util/mkisofs/tree.c:1003
#, c-format
msgid "Symlink %s ignored - continuing.\n"
msgstr ""
#: util/mkisofs/tree.c:1028
#, c-format
msgid "Already cached directory seen (%s)\n"
msgstr ""
#: util/mkisofs/tree.c:1070
#, c-format
msgid "File %s is not readable (%s) - ignoring\n"
msgstr ""
#: util/mkisofs/tree.c:1083
#, c-format
msgid "Directory loop - fatal goof (%s %lx %lu).\n"
msgstr ""
#: util/mkisofs/tree.c:1093
#, c-format
msgid "Unknown file type %s - ignoring and continuing.\n"
msgstr ""
#: util/mkisofs/tree.c:1179
#, c-format
msgid "Hidden from ISO9660 tree: %s\n"
msgstr ""
#: util/mkisofs/tree.c:1191
#, c-format
msgid "Hidden from Joliet tree: %s\n"
msgstr ""
#: util/mkisofs/tree.c:1600
#, c-format
msgid "Directories too deep %s\n"
msgstr ""
#: util/mkisofs/tree.c:1632
msgid "Unable to delete non-empty directory\n"
msgstr ""
#: util/mkisofs/tree.c:1655
msgid "Unable to locate child directory in parent list\n"
msgstr ""
#: util/mkisofs/tree.c:1772
#, c-format
msgid "call to search_tree_file with an absolute path, stripping\n"
msgstr ""
#: util/mkisofs/tree.c:1773
#, c-format
msgid "initial path separator. Hope this was intended...\n"
msgstr ""
#: util/mkisofs/write.c:158
#, c-format
msgid "Cannot open '%s'"
msgstr ""
#: util/mkisofs/write.c:166
#, c-format
msgid "cannot fwrite %llu*%llu\n"
msgstr ""
#: util/mkisofs/write.c:248
#, c-format
msgid "cannot open %s\n"
msgstr ""
#: util/mkisofs/write.c:257
#, c-format
msgid "cannot read %llu bytes from %s"
msgstr ""
#: util/mkisofs/write.c:275
#, c-format
msgid "%6.2f%% done, estimate finish %s"
msgstr ""
#: util/mkisofs/write.c:542
#, c-format
msgid "Cache hit for %s%s%s\n"
msgstr ""
#: util/mkisofs/write.c:896
#, c-format
msgid "Unexpected directory length %d %d %s\n"
msgstr ""
#: util/mkisofs/write.c:908
#, c-format
msgid "Continuation entry record length mismatch (%d %d).\n"
msgstr ""
#: util/mkisofs/write.c:1072
#, c-format
msgid "Path table lengths do not match %d %d\n"
msgstr ""
#: util/mkisofs/write.c:1118 util/mkisofs/write.c:1128
#, c-format
msgid "Total extents scheduled to be written = %llu\n"
msgstr ""
#: util/mkisofs/write.c:1145
#, c-format
msgid "Total extents actually written = %llu\n"
msgstr ""
#: util/mkisofs/write.c:1154
#, c-format
msgid ""
"Number of extents written different than what was predicted. Please fix.\n"
msgstr ""
#: util/mkisofs/write.c:1155
#, c-format
msgid "Predicted = %d, written = %llu\n"
msgstr ""
#: util/mkisofs/write.c:1158
#, c-format
msgid "Total translation table size: %d\n"
msgstr ""
#: util/mkisofs/write.c:1159
#, c-format
msgid "Total rockridge attributes bytes: %d\n"
msgstr ""
#: util/mkisofs/write.c:1160
#, c-format
msgid "Total directory bytes: %d\n"
msgstr ""
#: util/mkisofs/write.c:1161
#, c-format
msgid "Path table size(bytes): %d\n"
msgstr ""
#: util/grub.d/10_kfreebsd.in:40
msgid "%s, with kFreeBSD %s"
msgstr ""
#: util/grub.d/10_linux.in:57
msgid "%s, with Linux %s (recovery mode)"
msgstr ""
#: util/grub.d/10_linux.in:59
msgid "%s, with Linux %s"
msgstr ""

View File

@ -42,13 +42,13 @@ grub_normal_parse_line (char *line, grub_reader_getline_t getline)
static struct grub_parser grub_sh_parser =
{
.name = "sh",
.name = "grub",
.parse_line = grub_normal_parse_line
};
GRUB_MOD_INIT(sh)
{
grub_parser_register ("sh", &grub_sh_parser);
grub_parser_register ("grub", &grub_sh_parser);
}
GRUB_MOD_FINI(sh)

View File

@ -16,7 +16,6 @@
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/machine/machine.h>
#include <grub/machine/memory.h>
#include <grub/machine/serial.h>
#include <grub/machine/console.h>

View File

@ -18,7 +18,6 @@
*/
#include <grub/term.h>
#include <grub/machine/machine.h>
#include <grub/machine/console.h>
#include <grub/time.h>
#include <grub/cpu/io.h>

View File

@ -1,6 +1,6 @@
/*
* 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
@ -31,6 +31,9 @@
#include <grub/util/resolve.h>
#include <grub/kernel.h>
#include <grub/cpu/kernel.h>
#include <grub/i18n.h>
#include "progname.h"
#define GRUB_IEEE1275_NOTE_NAME "PowerPC"
#define GRUB_IEEE1275_NOTE_TYPE 0x1275
@ -325,10 +328,10 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``grub-mkimage --help'' for more information.\n");
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\
Usage: %s -o FILE [OPTION]... [MODULES]\n\
\n\
Make a bootable image of GRUB.\n\
\n\
@ -342,7 +345,7 @@ Make a bootable image of GRUB.\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
", GRUB_LIBDIR, PACKAGE_BUGREPORT);
", program_name, GRUB_LIBDIR, PACKAGE_BUGREPORT);
exit (status);
}
@ -357,7 +360,10 @@ main (int argc, char *argv[])
char *memdisk = NULL;
int chrp = 0;
progname = "grub-mkimage";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
while (1)
{

View File

@ -30,6 +30,12 @@
# define DEV_CYGDRIVE_MAJOR 98
#endif
#ifdef __GNU__
#include <hurd.h>
#include <hurd/lookup.h>
#include <hurd/fs.h>
#endif
#include <grub/util/misc.h>
#include <grub/util/hostdisk.h>
#include <grub/util/getroot.h>
@ -378,8 +384,65 @@ find_cygwin_root_device (const char *path, dev_t dev)
char *
grub_guess_root_device (const char *dir)
{
struct stat st;
char *os_dev;
#ifdef __GNU__
file_t file;
mach_port_t *ports;
int *ints;
loff_t *offsets;
char *data;
error_t err;
mach_msg_type_number_t num_ports = 0, num_ints = 0, num_offsets = 0, data_len = 0;
size_t name_len;
file = file_name_lookup (dir, 0, 0);
if (file == MACH_PORT_NULL)
return 0;
err = file_get_storage_info (file,
&ports, &num_ports,
&ints, &num_ints,
&offsets, &num_offsets,
&data, &data_len);
if (num_ints < 1)
grub_util_error ("Storage info for `%s' does not include type", dir);
if (ints[0] != STORAGE_DEVICE)
grub_util_error ("Filesystem of `%s' is not stored on local disk", dir);
if (num_ints < 5)
grub_util_error ("Storage info for `%s' does not include name", dir);
name_len = ints[4];
if (name_len < data_len)
grub_util_error ("Bogus name length for storage info for `%s'", dir);
if (data[name_len - 1] != '\0')
grub_util_error ("Storage name for `%s' not NUL-terminated", dir);
os_dev = xmalloc (strlen ("/dev/") + data_len);
memcpy (os_dev, "/dev/", strlen ("/dev/"));
memcpy (os_dev + strlen ("/dev/"), data, data_len);
if (ports && num_ports > 0)
{
mach_msg_type_number_t i;
for (i = 0; i < num_ports; i++)
{
mach_port_t port = ports[i];
if (port != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self(), port);
}
munmap ((caddr_t) ports, num_ports * sizeof (*ports));
}
if (ints && num_ints > 0)
munmap ((caddr_t) ints, num_ints * sizeof (*ints));
if (offsets && num_offsets > 0)
munmap ((caddr_t) offsets, num_offsets * sizeof (*offsets));
if (data && data_len > 0)
munmap (data, data_len);
mach_port_deallocate (mach_task_self (), file);
#else /* !__GNU__ */
struct stat st;
if (stat (dir, &st) < 0)
grub_util_error ("Cannot stat `%s'", dir);
@ -393,16 +456,45 @@ grub_guess_root_device (const char *dir)
/* This might be truly slow, but is there any better way? */
os_dev = find_root_device ("/dev", st.st_dev);
#endif
#endif /* !__GNU__ */
return os_dev;
}
int
grub_util_is_dmraid (const char *os_dev)
{
if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/isw_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/via_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/asr_", 16))
return 1;
else if (! strncmp (os_dev, "/dev/mapper/sil_", 16))
return 1;
return 0;
}
int
grub_util_get_dev_abstraction (const char *os_dev UNUSED)
{
#ifdef __linux__
/* Check for LVM. */
if (!strncmp (os_dev, "/dev/mapper/", 12))
if (!strncmp (os_dev, "/dev/mapper/", 12)
&& ! grub_util_is_dmraid (os_dev)
&& strncmp (os_dev, "/dev/mapper/mpath", 17) != 0)
return GRUB_DEV_ABSTRACTION_LVM;
/* Check for RAID. */
@ -454,7 +546,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (q)
*q = ',';
asprintf (&grub_dev, "md%s", p);
grub_dev = xasprintf ("md%s", p);
free (p);
}
else if (os_dev[7] == '/' && os_dev[8] == 'd')
@ -469,7 +561,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (q)
*q = ',';
asprintf (&grub_dev, "md%s", p);
grub_dev = xasprintf ("md%s", p);
free (p);
}
else if (os_dev[7] >= '0' && os_dev[7] <= '9')
@ -482,7 +574,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (q)
*q = ',';
asprintf (&grub_dev, "md%s", p);
grub_dev = xasprintf ("md%s", p);
free (p);
}
else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9')
@ -495,7 +587,7 @@ grub_util_get_grub_dev (const char *os_dev)
if (q)
*q = ',';
asprintf (&grub_dev, "md%s", p);
grub_dev = xasprintf ("md%s", p);
free (p);
}
else

View File

@ -22,6 +22,7 @@
#include <grub/util/misc.h>
#include <grub/lib/envblk.h>
#include <grub/handler.h>
#include <grub/i18n.h>
#include <stdio.h>
#include <unistd.h>
@ -29,6 +30,8 @@
#include <stdlib.h>
#include <getopt.h>
#include "progname.h"
#define DEFAULT_ENVBLK_SIZE 1024
void
@ -104,7 +107,7 @@ create_envblk_file (const char *name)
if (! buf)
grub_util_error ("out of memory");
asprintf (&namenew, "%s.new", name);
namenew = xasprintf ("%s.new", name);
fp = fopen (namenew, "wb");
if (! fp)
grub_util_error ("cannot open the file %s", namenew);
@ -252,7 +255,10 @@ main (int argc, char *argv[])
char *filename;
char *command;
progname = "grub-editenv";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Check for options. */
while (1)
@ -269,7 +275,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

View File

@ -1,6 +1,6 @@
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 2003,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
@ -36,19 +36,22 @@
#include <grub/util/getroot.h>
#include <grub/env.h>
#include <grub/partition.h>
#include <grub/i18n.h>
#include <grub_emu_init.h>
#include "progname.h"
/* Used for going back to the main function. */
static jmp_buf main_env;
/* Store the prefix specified by an argument. */
static char *prefix = 0;
static char *prefix = NULL;
grub_addr_t
grub_arch_modules_addr (void)
{
return 0;
return NULL;
}
grub_err_t
@ -155,7 +158,10 @@ main (int argc, char *argv[])
volatile int hold = 0;
int opt;
progname = "grub-emu";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
while ((opt = getopt_long (argc, argv, "r:d:m:vH:hV", options, 0)) != -1)
switch (opt)
@ -178,7 +184,7 @@ main (int argc, char *argv[])
case 'h':
return usage (0);
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
default:
return usage (1);
@ -193,7 +199,7 @@ main (int argc, char *argv[])
/* Wait until the ARGS.HOLD variable is cleared by an attached debugger. */
if (hold && verbosity > 0)
printf ("Run \"gdb %s %d\", and set ARGS.HOLD to zero.\n",
progname, (int) getpid ());
program_name, (int) getpid ());
while (hold)
{
if (hold > 0)

View File

@ -1,7 +1,7 @@
/* grub-fstest.c - debug tool for filesystem 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
@ -31,6 +31,7 @@
#include <grub/lib/hexdump.h>
#include <grub/lib/crc.h>
#include <grub/command.h>
#include <grub/i18n.h>
#include <grub_fstest_init.h>
@ -40,6 +41,8 @@
#include <stdlib.h>
#include <getopt.h>
#include "progname.h"
void
grub_putchar (int c)
{
@ -346,10 +349,10 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``grub-fstest --help'' for more information.\n");
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-fstest [OPTION]... IMAGE_PATH COMMANDS\n\
Usage: %s [OPTION]... IMAGE_PATH COMMANDS\n\
\n\
Debug tool for filesystem driver.\n\
\nCommands:\n\
@ -369,7 +372,7 @@ Debug tool for filesystem driver.\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
exit (status);
}
@ -377,10 +380,13 @@ Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
int
main (int argc, char *argv[])
{
char *debug_str = 0, *root = 0, *default_root, *alloc_root;
char *debug_str = NULL, *root = NULL, *default_root, *alloc_root;
int i, cmd, num_opts, image_index, num_disks = 1;
progname = "grub-fstest";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Find the first non option entry. */
for (num_opts = 1; num_opts < argc; num_opts++)
@ -442,7 +448,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

View File

@ -248,6 +248,14 @@ if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
done
fi
# Copy gettext files
mkdir -p ${grubdir}/locale/
for file in ${grubdir}/locale/*.mo ${pkglibdir}/locale/*.mo; do
if test -f "$file"; then
cp -f "$file" ${grubdir}/locale/
fi
done
# Write device to a variable so we don't have to traverse /dev every time.
grub_device=`$grub_probe --target=device ${grubdir}`

View File

@ -20,10 +20,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
datadir=@datadir@
bindir=@bindir@
sbindir=@sbindir@
pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
grub_probe=${sbindir}/`echo grub-probe | sed ${transform}`
grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}`
grub_warn ()
{
@ -32,49 +34,7 @@ grub_warn ()
make_system_path_relative_to_its_root ()
{
path=$1
# abort if file doesn't exist
if test -e $path ; then : ;else
return 1
fi
# canonicalize
if path=`readlink -f $path` ; then : ; else
return 1
fi
# if not a directory, climb up to the directory containing it
if test -d $path ; then
dir=$path
else
dir=`echo $path | sed -e "s,/[^/]*$,,g"`
fi
num=`stat -c %d $dir`
# this loop sets $dir to the root directory of the filesystem we're inspecting
while : ; do
parent=`readlink -f $dir/..`
if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else
# $parent is another filesystem; we found it.
break
fi
if [ "x$dir" = "x/" ] ; then
# / is our root.
break
fi
dir=$parent
done
# This function never prints trailing slashes (so that its output can be
# appended a slash unconditionally). Each slash in $dir is considered a
# preceding slash, and therefore the root directory is an empty string.
if [ "$dir" = "/" ] ; then
dir=""
fi
# XXX: This fails if $dir contains ','.
path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1
path="`${grub_mkrelpath} $1`"
case "`uname 2>/dev/null`" in
CYGWIN*)

View File

@ -1,7 +1,7 @@
/* grub-mkdevicemap.c - make a device map file automatically */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc.
* Copyright (C) 1999,2000,2001,2002,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
@ -31,10 +31,13 @@
#include <grub/util/misc.h>
#include <grub/util/deviceiter.h>
#include <grub/i18n.h>
#define _GNU_SOURCE 1
#include <getopt.h>
#include "progname.h"
static void
make_device_map (const char *device_map, int floppy_disks)
{
@ -81,10 +84,10 @@ usage (int status)
{
if (status)
fprintf (stderr,
"Try ``grub-mkdevicemap --help'' for more information.\n");
"Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-mkdevicemap [OPTION]...\n\
Usage: %s [OPTION]...\n\
\n\
Generate a device map file automatically.\n\
\n\
@ -96,7 +99,7 @@ Generate a device map file automatically.\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
",
", program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
@ -108,7 +111,10 @@ main (int argc, char *argv[])
char *dev_map = 0;
int floppy_disks = 1;
progname = "grub-mkdevicemap";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Check for options. */
while (1)
@ -140,7 +146,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

View File

@ -19,6 +19,7 @@
#include <config.h>
#include <grub/types.h>
#include <grub/util/misc.h>
#include <grub/i18n.h>
#include <stdio.h>
#include <stdlib.h>
@ -29,6 +30,8 @@
#include FT_FREETYPE_H
#include <freetype/ftsynth.h>
#include "progname.h"
#define GRUB_FONT_DEFAULT_SIZE 16
#define GRUB_FONT_RANGE_BLOCK 1024
@ -90,10 +93,10 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``grub-mkfont --help'' for more information.\n");
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-mkfont [OPTIONS] FONT_FILES\n\
Usage: %s [OPTIONS] FONT_FILES\n\
\nOptions:\n\
-o, --output=FILE_NAME set output file name\n\
-i, --index=N set face index\n\
@ -109,7 +112,7 @@ Usage: grub-mkfont [OPTIONS] FONT_FILES\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
exit (status);
}
@ -363,8 +366,8 @@ write_font (struct grub_font_info *font_info, char *output_file)
if (! style_name[0])
strcpy (style_name, " Regular");
asprintf (&font_name, "%s %s %d", font_info->name, &style_name[1],
font_info->size);
font_name = xasprintf ("%s %s %d", font_info->name, &style_name[1],
font_info->size);
write_string_section ("NAME", font_name, &offset, file);
write_string_section ("FAMI", font_info->name, &offset, file);
@ -472,7 +475,10 @@ main (int argc, char *argv[])
memset (&font_info, 0, sizeof (font_info));
progname = "grub-mkfont";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Check for options. */
while (1)
@ -560,7 +566,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

105
util/grub-mkrelpath.c Normal file
View File

@ -0,0 +1,105 @@
/* grub-mkrelpath.c - make a system path relative to its root */
/*
* 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/util/misc.h>
#include <grub/i18n.h>
#include <getopt.h>
#include "progname.h"
static struct option options[] =
{
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'V'},
};
static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: %s [OPTIONS] PATH\n\
\n\
Make a system path relative to it's root.\n\
\n\
Options:\n\
-h, --help display this message and exit\n\
-V, --version print version information and exit\n\
\n\
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
exit (status);
}
int
main (int argc, char *argv[])
{
char *argument, *relpath;
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Check for options. */
while (1)
{
int c = getopt_long (argc, argv, "hV", options, 0);
if (c == -1)
break;
else
switch (c)
{
case 'h':
usage (0);
break;
case 'V':
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
default:
usage (1);
break;
}
}
if (optind >= argc)
{
fprintf (stderr, "No path is specified.\n");
usage (1);
}
if (optind + 1 != argc)
{
fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]);
usage (1);
}
argument = argv[optind];
relpath = make_system_path_relative_to_its_root (argument);
printf ("%s\n", relpath);
free (relpath);
return 0;
}

View File

@ -27,10 +27,10 @@ PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
target_cpu=@target_cpu@
native_platform=@platform@
coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-coreboot
pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-pc
grub_mkisofs="grub-mkisofs"
# Usage: usage
# Print the usage.
@ -42,7 +42,7 @@ Make GRUB rescue image.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--output=FILE save output in FILE
--output=FILE save output in FILE [required]
$0 generates a bootable rescue image with specified source files or directories.
@ -63,6 +63,12 @@ for option in "$@"; do
modules=`echo "$option" | sed 's/--modules=//'` ;;
--output=*)
output_image=`echo "$option" | sed 's/--output=//'` ;;
# Intentionally undocumented
--override-directory=*)
override_dir=`echo "${option}/" | sed 's/--override-directory=//'`
PATH=${override_dir}:$PATH
export PATH
;;
-*)
echo "Unrecognized option \`$option'" 1>&2
usage
@ -73,25 +79,56 @@ for option in "$@"; do
esac
done
if [ "x${output_image}" = x ] ; then
echo "output file must be given" >&2
usage
exit 1
fi
iso9660_dir=`mktemp -d`
mkdir -p ${iso9660_dir}/boot/grub
for platform in pc coreboot ; do
input_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-${platform}
if test -e ${input_dir} ; then
mkdir -p ${iso9660_dir}/boot/grub/${target_cpu}-${platform}
for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
${input_dir}/handler.lst ${input_dir}/parttool.lst; do
if test -f "$file"; then
cp -f "$file" ${iso9660_dir}/boot/grub/${target_cpu}-${platform}/
fi
done
process_input_dir ()
{
input_dir="$1"
platform="$2"
mkdir -p ${iso9660_dir}/boot/grub/${target_cpu}-${platform}
for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
${input_dir}/handler.lst ${input_dir}/parttool.lst; do
if test -f "$file"; then
cp -f "$file" ${iso9660_dir}/boot/grub/${target_cpu}-${platform}/
fi
done
mkdir -p ${iso9660_dir}/boot/grub/locale
for file in ${input_dir}/po/*.mo; do
if test -f "$file"; then
cp -f "$file" ${iso9660_dir}/boot/grub/locale/
fi
done
}
if [ "${override_dir}" = "" ] ; then
if test -e "${coreboot_dir}" ; then
process_input_dir ${coreboot_dir} coreboot
fi
done
if test -e "${pc_dir}" ; then
process_input_dir ${pc_dir} pc
fi
else
process_input_dir ${override_dir} ${native_platform}
coreboot_dir=
pc_dir=
case "${native_platform}" in
coreboot) coreboot_dir=${override_dir} ;;
pc) pc_dir=${override_dir} ;;
esac
fi
# build coreboot core.img
if test -e ${coreboot_dir} ; then
if test -e "${coreboot_dir}" ; then
echo "Generates coreboot"
memdisk_img=`mktemp`
memdisk_dir=`mktemp -d`
mkdir -p ${memdisk_dir}/boot/grub
@ -115,18 +152,12 @@ EOF
memdisk tar search iso9660 configfile sh \
ata at_keyboard
rm -f ${memdisk_img}
grub_mkisofs="${grub_mkisofs} --modification-date=$(echo ${iso_uuid} | sed -e s/-//g)"
fi
if [ "${source}" != "" ] ; then
for d in ${source}; do
echo "Processing $d"
cp -dpRl "${d}" ${iso9660_dir}/
done
grub_mkisofs_arguments="${grub_mkisofs_arguments} --modification-date=$(echo ${iso_uuid} | sed -e s/-//g)"
fi
# build eltorito core.img
if test -e ${pc_dir} ; then
if test -e "${pc_dir}" ; then
echo "Generates eltorito"
core_img=`mktemp`
grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \
memdisk tar search iso9660 configfile sh \
@ -141,11 +172,11 @@ if test -e ${pc_dir} ; then
echo "source /boot/grub/grub.cfg") \
> ${iso9660_dir}/boot/grub/i386-pc/grub.cfg
grub_mkisofs="${grub_mkisofs} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
grub_mkisofs_arguments="${grub_mkisofs_arguments} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
fi
# build iso image
${grub_mkisofs} -o ${output_image} -r -J ${iso9660_dir}
grub-mkisofs ${grub_mkisofs_arguments} -o ${output_image} -r ${iso9660_dir} ${source}
rm -rf ${iso9660_dir}
exit 0

View File

@ -1,7 +1,7 @@
/* grub-pe2elf.c - tool to convert pe image to elf. */
/*
* 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
@ -40,10 +40,10 @@ static void
usage (int status)
{
if (status)
fprintf (stderr, "Try ``grub-pe2elf --help'' for more information.\n");
fprintf (stderr, "Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-pe2elf [OPTIONS] input [output]\n\
Usage: %s [OPTIONS] input [output]\n\
\n\
Tool to convert pe image to elf.\n\
\nOptions:\n\
@ -51,7 +51,7 @@ Tool to convert pe image to elf.\n\
-V, --version print version information and exit\n\
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
Report bugs to <%s>.\n", program_name, PACKAGE_BUGREPORT);
exit (status);
}
@ -467,7 +467,7 @@ main (int argc, char *argv[])
char *image;
FILE* fp;
progname = "grub-pe2elf";
set_program_name (argv[0]);
/* Check for options. */
while (1)
@ -484,7 +484,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

View File

@ -31,6 +31,7 @@
#include <grub/term.h>
#include <grub/env.h>
#include <grub/raid.h>
#include <grub/i18n.h>
#include <grub_probe_init.h>
@ -43,6 +44,8 @@
#define _GNU_SOURCE 1
#include <getopt.h>
#include "progname.h"
enum {
PRINT_FS,
PRINT_FS_UUID,
@ -235,33 +238,37 @@ probe (const char *path, char *device_name)
if (print == PRINT_FS)
{
/* FIXME: `path' can't be used to read a file via GRUB facilities,
because it's not relative to its root. */
#if 0
struct stat st;
if (path)
{
struct stat st;
stat (path, &st);
stat (path, &st);
if (S_ISREG (st.st_mode))
{
/* Regular file. Verify that we can read it properly. */
if (S_ISREG (st.st_mode))
{
/* Regular file. Verify that we can read it properly. */
grub_file_t file;
grub_util_info ("reading %s via OS facilities", path);
filebuf_via_sys = grub_util_read_image (path);
grub_file_t file;
char *rel_path;
grub_util_info ("reading %s via OS facilities", path);
filebuf_via_sys = grub_util_read_image (path);
grub_util_info ("reading %s via GRUB facilities", path);
asprintf (&grub_path, "(%s)%s", drive_name, path);
file = grub_file_open (grub_path);
filebuf_via_grub = xmalloc (file->size);
grub_file_read (file, filebuf_via_grub, file->size);
rel_path = make_system_path_relative_to_its_root (path);
grub_path = xasprintf ("(%s)%s", drive_name, rel_path);
free (rel_path);
grub_util_info ("reading %s via GRUB facilities", grub_path);
file = grub_file_open (grub_path);
if (! file)
grub_util_error ("can not open %s via GRUB facilities", grub_path);
filebuf_via_grub = xmalloc (file->size);
grub_file_read (file, filebuf_via_grub, file->size);
grub_util_info ("comparing");
grub_util_info ("comparing");
if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
grub_util_error ("files differ");
if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size))
grub_util_error ("files differ");
}
}
#endif
printf ("%s\n", fs->name);
}
@ -302,10 +309,10 @@ usage (int status)
{
if (status)
fprintf (stderr,
"Try ``grub-probe --help'' for more information.\n");
"Try ``%s --help'' for more information.\n", program_name);
else
printf ("\
Usage: grub-probe [OPTION]... [PATH|DEVICE]\n\
Usage: %s [OPTION]... [PATH|DEVICE]\n\
\n\
Probe device information for a given path (or device, if the -d option is given).\n\
\n\
@ -318,7 +325,7 @@ Probe device information for a given path (or device, if the -d option is given)
-v, --verbose print verbose messages\n\
\n\
Report bugs to <%s>.\n\
",
", program_name,
DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT);
exit (status);
@ -330,7 +337,10 @@ main (int argc, char *argv[])
char *dev_map = 0;
char *argument;
progname = "grub-probe";
set_program_name (argv[0]);
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Check for options. */
while (1)
@ -375,7 +385,7 @@ main (int argc, char *argv[])
break;
case 'V':
printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION);
printf ("%s (%s) %s\n", program_name, PACKAGE_NAME, PACKAGE_VERSION);
return 0;
case 'v':

View File

@ -22,6 +22,8 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
grub_prefix=`echo /boot/grub | sed ${transform}`
locale_dir=`echo /boot/grub/locale | sed ${transform}`
grub_lang=`echo $LANG | cut -d _ -f 1`
. ${libdir}/grub/grub-mkconfig_lib
@ -108,6 +110,15 @@ EOF
;;
esac
# Gettext variables and module
if [ "x${LANG}" != "xC" ] ; then
cat << EOF
set locale_dir=${locale_dir}
set lang=${grub_lang}
insmod gettext
EOF
fi
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=

View File

@ -24,7 +24,7 @@ libdir=@libdir@
. ${bindir}/gettext.sh
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR=@LOCALEDIR@
export TEXTDOMAINDIR=@localedir@
case "${GRUB_DISTRIBUTOR}" in
Debian) OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" ;;
@ -38,7 +38,7 @@ kfreebsd_entry ()
recovery="$3" # not used yet
args="$4" # not used yet
title="$(gettext "%s, with kFreeBSD %s")"
printf "menuentry \"${title}\" {" ${os} ${version}
printf "menuentry \"${title}\" {\n" "${os}" "${version}"
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"

View File

@ -24,7 +24,7 @@ libdir=@libdir@
. ${bindir}/gettext.sh
export TEXTDOMAIN=@PACKAGE@
export TEXTDOMAINDIR=@LOCALEDIR@
export TEXTDOMAINDIR=@localedir@
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
@ -58,7 +58,7 @@ linux_entry ()
else
title="$(gettext "%s, with Linux %s")"
fi
printf "menuentry \"${title}\" {" ${os} ${version}
printf "menuentry \"${title}\" {\n" "${os}" "${version}"
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"

View File

@ -89,11 +89,16 @@ EOF
LLABEL="${LONGNAME}"
fi
if [ "${LROOT}" != "${LBOOT}" ]; then
LKERNEL="${LKERNEL#/boot}"
LINITRD="${LINITRD#/boot}"
fi
cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/")"
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}"
cat << EOF

View File

@ -25,6 +25,7 @@
#include <grub/util/misc.h>
#include <grub/util/hostdisk.h>
#include <grub/misc.h>
#include <grub/i18n.h>
#include <stdio.h>
#include <stdlib.h>
@ -127,7 +128,7 @@ find_grub_drive (const char *name)
if (name)
{
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (map[i].drive && ! strcmp (map[i].drive, name))
return i;
}
@ -565,7 +566,10 @@ read_device_map (const char *dev_map)
fp = fopen (dev_map, "r");
if (! fp)
grub_util_error ("Cannot open `%s'", dev_map);
{
grub_util_info (_("Cannot open `%s'"), dev_map);
return;
}
while (fgets (buf, sizeof (buf), fp))
{
@ -670,34 +674,27 @@ grub_util_biosdisk_fini (void)
static char *
make_device_name (int drive, int dos_part, int bsd_part)
{
int len = strlen(map[drive].drive);
char *p;
char *ret;
char *dos_part_str = NULL;
char *bsd_part_str = NULL;
if (dos_part >= 0)
{
/* Add in char length of dos_part+1 */
int tmp = dos_part + 1;
len++;
while ((tmp /= 10) != 0)
len++;
}
if (bsd_part >= 0)
len += 2;
/* Length to alloc is: char length of map[drive].drive, plus
* char length of (dos_part+1) or of bsd_part, plus
* 2 for the comma and a null/end of string (\0)
*/
p = xmalloc (len + 2);
sprintf (p, "%s", map[drive].drive);
if (dos_part >= 0)
sprintf (p + strlen (p), ",%d", dos_part + 1);
dos_part_str = xasprintf (",%d", dos_part + 1);
if (bsd_part >= 0)
sprintf (p + strlen (p), ",%c", bsd_part + 'a');
bsd_part_str = xasprintf (",%c", dos_part + 'a');
return p;
ret = xasprintf ("%s%s%s", map[drive].drive,
dos_part_str ? : "",
bsd_part_str ? : "");
if (dos_part_str)
free (dos_part_str);
if (bsd_part_str)
free (bsd_part_str);
return ret;
}
static char *
@ -706,7 +703,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
#if defined(__linux__)
char *path = xmalloc (PATH_MAX);
if (! realpath (os_dev, path))
return 0;
return NULL;
if (strncmp ("/dev/", path, 5) == 0)
{
@ -876,22 +873,29 @@ device_is_wholedisk (const char *os_dev)
static int
find_system_device (const char *os_dev)
{
int i;
unsigned int i;
char *os_disk;
os_disk = convert_system_partition_to_system_disk (os_dev);
if (! os_disk)
return -1;
for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++)
if (map[i].device && strcmp (map[i].device, os_disk) == 0)
for (i = 0; i < ARRAY_SIZE (map); i++)
if (! map[i].device)
break;
else if (strcmp (map[i].device, os_disk) == 0)
{
free (os_disk);
return i;
}
free (os_disk);
return -1;
if (i == ARRAY_SIZE (map))
grub_util_error (_("device count exceeds limit"));
map[i].device = os_disk;
map[i].drive = xstrdup (os_disk);
return i;
}
char *

View File

@ -30,6 +30,7 @@
#include <grub/kernel.h>
#include <grub/efi/pe32.h>
#include <grub/machine/kernel.h>
#include "progname.h"
#if GRUB_TARGET_WORDSIZE == 32
# define grub_le_to_cpu(val) grub_le_to_cpu32(val)
@ -54,12 +55,12 @@ align_pe32_section (Elf_Addr addr)
/* Read the whole kernel image. Return the pointer to a read image,
and store the size in bytes in *SIZE. */
static char *
read_kernel_module (const char *dir, size_t *size)
read_kernel_image (const char *dir, size_t *size)
{
char *kernel_image;
char *kernel_path;
kernel_path = grub_util_get_path (dir, "kernel.mod");
kernel_path = grub_util_get_path (dir, "kernel.img");
*size = grub_util_get_image_size (kernel_path);
kernel_image = grub_util_read_image (kernel_path);
free (kernel_path);
@ -944,7 +945,7 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[])
int i;
/* Get the kernel image and check the format. */
kernel_image = read_kernel_module (dir, &kernel_size);
kernel_image = read_kernel_image (dir, &kernel_size);
e = (Elf_Ehdr *) kernel_image;
if (! check_elf_header (e, kernel_size))
grub_util_error ("invalid ELF header");
@ -1056,7 +1057,7 @@ main (int argc, char *argv[])
char *dir = NULL;
char *prefix = NULL;
progname = "grub-mkimage";
program_name = "grub-mkimage";
while (1)
{

View File

@ -114,14 +114,14 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
if (memdisk_path)
{
memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512);
grub_util_info (_("the size of memory disk is 0x%x"), memdisk_size);
grub_util_info ("the size of memory disk is 0x%x", memdisk_size);
total_module_size += memdisk_size + sizeof (struct grub_module_header);
}
if (config_path)
{
config_size = grub_util_get_image_size (config_path) + 1;
grub_util_info (_("the size of config file is 0x%x"), config_size);
grub_util_info ("the size of config file is 0x%x", config_size);
total_module_size += config_size + sizeof (struct grub_module_header);
}
@ -129,7 +129,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
total_module_size += (grub_util_get_image_size (p->name)
+ sizeof (struct grub_module_header));
grub_util_info (_("the total module size is 0x%x"), total_module_size);
grub_util_info ("the total module size is 0x%x", total_module_size);
kernel_img = xmalloc (kernel_size + total_module_size);
grub_util_load_image (kernel_path, kernel_img);
@ -196,7 +196,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
compress_kernel (kernel_img, kernel_size + total_module_size,
&core_img, &core_size);
grub_util_info (_("the core size is 0x%x"), core_size);
grub_util_info ("the core size is 0x%x", core_size);
#if defined(GRUB_MACHINE_PCBIOS)
{

View File

@ -90,7 +90,7 @@ setup (const char *dir,
const char *boot_file, const char *core_file,
const char *root, const char *dest, int must_embed, int force, int fs_probe)
{
char *boot_path, *core_path, *core_path_dev;
char *boot_path, *core_path, *core_path_dev, *core_path_dev_full;
char *boot_img, *core_img;
size_t boot_size, core_size;
grub_uint16_t core_sectors;
@ -159,7 +159,7 @@ setup (const char *dir,
void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset,
unsigned length)
{
grub_util_info (_("the first sector is <%llu,%u,%u>"),
grub_util_info ("the first sector is <%llu,%u,%u>",
sector, offset, length);
if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
@ -173,7 +173,7 @@ setup (const char *dir,
{
struct boot_blocklist *prev = block + 1;
grub_util_info (_("saving <%llu,%u,%u> with the segment 0x%x"),
grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x",
sector, offset, length, (unsigned) current_segment);
if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
@ -244,7 +244,7 @@ setup (const char *dir,
if (! dest_dev)
grub_util_error ("%s", grub_errmsg);
grub_util_info (_("setting the root device to `%s'"), root);
grub_util_info ("setting the root device to `%s'", root);
if (grub_env_set ("root", root) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
@ -322,7 +322,7 @@ setup (const char *dir,
bsd_part = grub_le_to_cpu32 (*install_bsd_part);
}
grub_util_info (_("dos partition is %d, bsd partition is %d"),
grub_util_info ("dos partition is %d, bsd partition is %d",
dos_part, bsd_part);
if (! dest_dev->disk->has_partitions)
@ -378,7 +378,7 @@ setup (const char *dir,
}
grub_util_info (_("the core image will be embedded at sector 0x%llx"), embed_region.start);
grub_util_info ("the core image will be embedded at sector 0x%llx", embed_region.start);
*install_dos_part = grub_cpu_to_le32 (dos_part);
*install_bsd_part = grub_cpu_to_le32 (bsd_part);
@ -426,7 +426,9 @@ unable_to_embed:
/* Make sure that GRUB reads the identical image as the OS. */
tmp_img = xmalloc (core_size);
core_path_dev = grub_util_get_path (dir, core_file);
core_path_dev_full = grub_util_get_path (dir, core_file);
core_path_dev = make_system_path_relative_to_its_root (core_path_dev_full);
free (core_path_dev_full);
/* It is a Good Thing to sync two times. */
sync ();
@ -446,11 +448,11 @@ unable_to_embed:
if (file)
{
if (grub_file_size (file) != core_size)
grub_util_info (_("succeeded in opening the core image but the size is different (%d != %d)"),
grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)",
(int) grub_file_size (file), (int) core_size);
else if (grub_file_read (file, tmp_img, core_size)
!= (grub_ssize_t) core_size)
grub_util_info (_("succeeded in opening the core image but cannot read %d bytes"),
grub_util_info ("succeeded in opening the core image but cannot read %d bytes",
(int) core_size);
else if (memcmp (core_img, tmp_img, core_size) != 0)
{
@ -473,7 +475,7 @@ unable_to_embed:
}
#endif
grub_util_info (_("succeeded in opening the core image but the data is different"));
grub_util_info ("succeeded in opening the core image but the data is different");
}
else
{
@ -484,10 +486,10 @@ unable_to_embed:
grub_file_close (file);
}
else
grub_util_info (_("couldn't open the core image"));
grub_util_info ("couldn't open the core image");
if (grub_errno)
grub_util_info (_("error message = %s"), grub_errmsg);
grub_util_info ("error message = %s", grub_errmsg);
grub_errno = GRUB_ERR_NONE;
sync ();
@ -541,7 +543,7 @@ unable_to_embed:
*install_bsd_part = grub_cpu_to_le32 (bsd_part);
/* Write the first two sectors of the core image onto the disk. */
grub_util_info (_("opening the core image `%s'"), core_path);
grub_util_info ("opening the core image `%s'", core_path);
fp = fopen (core_path, "r+b");
if (! fp)
grub_util_error (_("Cannot open `%s'"), core_path);
@ -763,7 +765,7 @@ main (int argc, char *argv[])
root_dev = grub_util_get_grub_dev (grub_guess_root_device (dir ? : DEFAULT_DIRECTORY));
if (! root_dev)
{
grub_util_info (_("guessing the root device failed, because of `%s'"),
grub_util_info ("guessing the root device failed, because of `%s'",
grub_errmsg);
grub_util_error (_("Cannot guess the root device. Specify the option ``--root-device''."));
}

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