* util/grub-install.in: Gettextize.
* util/grub-mkconfig.in: Likewise.
* util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo
if not available.
(grub_warn): Gettextize.
* util/grub-mknetdir.in: Gettextize.
* util/grub-mkrescue.in: Likewise.
* util/grub-mkstandalone.in: Likewise.
* util/grub-reboot.in: Likewise.
* util/grub-set-default.in: Likewise.
* util/grub.d/00_header.in: Likewise.
* util/grub.d/10_hurd.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/10_netbsd.in: Likewise.
* util/grub.d/10_windows.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
* util/grub.d/30_os-prober.in: Likewise.
* po/POTFILES-shell.in: Regenerate.
+2012-02-03 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * util/grub-mkstandalone.in: Fix help messages. Gettextize.
+ * util/grub-install.in: Gettextize.
+ * util/grub-mkconfig.in: Likewise.
+ * util/grub-mkconfig_lib.in: Replace gettext with echo -n and not echo
+ if not available.
+ (grub_warn): Gettextize.
+ * util/grub-mknetdir.in: Gettextize.
+ * util/grub-mkrescue.in: Likewise.
+ * util/grub-mkstandalone.in: Likewise.
+ * util/grub-reboot.in: Likewise.
+ * util/grub-set-default.in: Likewise.
+ * util/grub.d/00_header.in: Likewise.
+ * util/grub.d/10_hurd.in: Likewise.
+ * util/grub.d/10_kfreebsd.in: Likewise.
+ * util/grub.d/10_linux.in: Likewise.
+ * util/grub.d/10_netbsd.in: Likewise.
+ * util/grub.d/10_windows.in: Likewise.
+ * util/grub.d/20_linux_xen.in: Likewise.
+ * util/grub.d/30_os-prober.in: Likewise.
+ * po/POTFILES-shell.in: Regenerate.
+
2012-02-03 Richard Laager <rlaager@wiktel.com>
* util/grub-mkimage.c (main): Fix format-security warning.
-# List of files which contain translatable strings. Only files written in
-# Shell language are included here.
+util/grub.d/00_header.in
util/grub.d/10_hurd.in
+util/grub.d/10_illumos.in
util/grub.d/10_kfreebsd.in
util/grub.d/10_linux.in
util/grub.d/10_netbsd.in
+util/grub.d/10_windows.in
util/grub.d/20_linux_xen.in
+util/grub.d/30_os-prober.in
+util/grub.d/40_custom.in
+util/grub.d/41_custom.in
+util/grub-install.in
+util/grub-kbdcomp.in
+util/grub-mkconfig.in
+util/grub-mkconfig_lib.in
+util/grub-mknetdir.in
+util/grub-mkrescue.in
+util/grub-mkstandalone.in
+util/grub-reboot.in
+util/grub-set-default.in
+util/powerpc/ieee1275/grub-mkrescue.in
disk_module=native
fi
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
-if [ "${target_cpu}-${platform}" = "i386-pc" ] \
- || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]; then
- cat <<EOF
-Usage: $self [OPTION] install_device
-EOF
-else
- cat <<EOF
-Usage: $self [OPTION] [install_device]
-EOF
-fi
-cat <<EOF
-Install GRUB on your drive.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- --modules=MODULES pre-load specified modules MODULES
- --boot-directory=DIR install GRUB images under the directory DIR/@grubdirname@
- instead of the $grubdir directory
- --grub-setup=FILE use FILE as grub-setup
- --grub-mkimage=FILE use FILE as grub-mkimage
- --grub-mkrelpath=FILE use FILE as grub-mkrelpath
- --grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
- --grub-probe=FILE use FILE as grub-probe
- --no-floppy do not probe any floppy drive
- --allow-floppy Make the drive also bootable as floppy
- (default for fdX devices). May break on some BIOSes.
- --recheck delete device map if it already exists
- --force install even if problems are detected
-EOF
+ if [ "${target_cpu}-${platform}" = "i386-pc" ] \
+ || [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]; then
+ gettext_printf "Usage: %s [OPTION] install_device" "$self"
+ else
+ gettext_printf "Usage: %s [OPTION] [install_device]" "$self"
+ fi
+ echo
+ gettext "Install GRUB on your drive." ; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+ dirmsg="$(printf "install GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+ printf " --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+ printf " --grub-setup=%-11s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-setup")"
+ printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+ printf " --grub-mkrelpath=%-7s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkrelpath")"
+ printf " --grub-mkdevicemap=%-5s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkdevicemap")"
+ printf " --grub-probe=%-11s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-probe")"
+ printf " --no-floppy %s\n" "$(gettext "do not probe any floppy drive")"
+ printf " --allow-floppy %s\n" "$(gettext "Make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes.")"
+ printf " --recheck %s\n" "$(gettext "delete device map if it already exists")"
+ printf " --force %s\n" "$(gettext "install even if problems are detected")"
if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
- cat <<EOF
- --disk-module=MODULE disk module to use (biosdisk or native)
-EOF
+ printf " --disk-module=%-10s%s\n" "$(gettext "MODULE")" "$(gettext "disk module to use (biosdisk or native)")"
fi
if [ "${target_cpu}-${platform}" = "i386-ieee1275" ] || [ "${target_cpu}-${platform}" = "powerpc-ieee1275" ] ; then
- cat <<EOF
- --no-nvram don't update the boot-device NVRAM variable
-EOF
+ printf " --no-nvram %s\n" "$(gettext "don't update the boot-device NVRAM variable")"
fi
if [ "${platform}" = "efi" ]; then
- cat <<EOF
- --removable the installation device is removable
- --bootloader-id=ID the ID of bootloader.
-EOF
-fi
- cat <<EOF
-
-INSTALL_DEVICE can be a GRUB device name or a system device filename.
-
-$self copies GRUB images into $grubdir, and uses grub-setup
-to install grub into the boot sector.
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ printf " --removable %s\n" "$(gettext "the installation device is removable")"
+ printf " --bootloader-id=%-8s%s\n" "$(gettext "ID")" "$(gettext "the ID of bootloader.")"
+fi
+echo
+gettext "INSTALL_DEVICE must be system device filename.";echo
+echo
+
+gettext_printf "%s copies GRUB images into %s, and uses grub-setup
+to install grub into the boot sector.\n" "$self" "$grubdir";echo
+echo
+gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
esac
done
-. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
-
if test "x$install_device" = x && ([ "${target_cpu}-${platform}" = "i386-pc" ] \
|| [ "${target_cpu}-${platform}" = "sparc64-ieee1275" ]); then
echo "install_device not specified." 1>&2
GRUB_PREFIX=`echo '/@bootdirname@/@grubdirname@' | sed "s,//*,/,g"`
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION]
-Generate a grub config file
-
- -o, --output=FILE output generated config to FILE [default=stdout]
- -h, --help print this message and exit
- -v, --version print the version information and exit
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ gettext_printf "Usage: %s [OPTION]\n" "$self"
+ gettext "Generate a grub config file"; echo
+ echo
+ printf " -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'" "$0" "$opt" 1>&2
exit 1
fi
echo $1
grub_cfg=`echo "$option" | sed 's/--output=//'`
;;
-*)
- echo "Unrecognized option \`$option'" 1>&2
+ gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
exit 1
;;
done ;;
esac
if [ $root != t ] ; then
- echo "$self: You must run this as root" >&2
+ gettext_printf "%s: You must run this as root\n" "$self" >&2
exit 1
fi
fi
if test -f "$1"; then
:
else
- echo "$1: Not found." 1>&2
+ gettext_print "%s: Not found.\n" "$1" 1>&2
exit 1
fi
fi
if [ -z "${GRUB_FONT_PATH}" ] ; then
if [ "x$termoutdefault" != "x1" ]; then
- echo "No font for gfxterm found." >&2 ; exit 1
+ gettext "No font for gfxterm found." >&2; echo >&2 ; exit 1
fi
GRUB_TERMINAL_OUTPUT=
fi
# Allow this to fail, since /boot/grub/ might need to be fatfs to support some
# firmware implementations (e.g. OFW or EFI).
- chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\
- This means that if the generated config contains a password it is readable by everyone"
+ chmod 400 ${grub_cfg}.new || grub_warn "$(gettext_printf "Could not make %s \
+readable by only root. This means that if the generated config contains a password it is readable by everyone" "${grub_cfg}.new")"
fi
-echo "Generating grub.cfg ..." >&2
+gettext "Generating grub.cfg ..." >&2
+echo >&2
cat << EOF
#
if test "x${grub_cfg}" != "x" ; then
if ! ${grub_script_check} ${grub_cfg}.new; then
- echo "Syntax errors are detected in generated GRUB config file." >&2
- echo "Ensure that there are no errors in /etc/default/grub" >&2
- echo "and /etc/grub.d/* files or please file a bug report with" >&2
- echo "${grub_cfg}.new file attached." >&2
+ gettext_printf "Syntax errors are detected in generated GRUB config file.
+Ensure that there are no errors in /etc/default/grub
+and /etc/grub.d/* files or please file a bug report with
+%s file attached." "${grub_cfg}.new" >&2
else
# none of the children aborted with error, install the new grub.cfg
mv -f ${grub_cfg}.new ${grub_cfg}
fi
fi
-echo "done" >&2
+gettext "done" >&2
+echo >&2
fi
if $(which gettext >/dev/null 2>/dev/null) ; then
- gettext="gettext"
+ :
else
- gettext="echo"
+ gettext () {
+ echo -n "$@"
+ }
fi
grub_warn ()
{
- echo "Warning: $@" >&2
+ echo "$(gettext "Warning:")" "$@" >&2
}
make_system_path_relative_to_its_root ()
# printf; so this turns ' into \'. Note that you must use the output of
# this function in a printf format string.
gettext_quoted () {
- "$gettext" "$@" | sed "s/'/'\\\\\\\\''/g"
+ gettext "$@" | sed "s/'/'\\\\\\\\''/g"
}
# Run the first argument through gettext_quoted, and then pass that and all
PACKAGE_VERSION=@PACKAGE_VERSION@
host_os=@host_os@
pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+datadir="@datadir@"
self=`basename $0`
efi64_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/x86_64-efi"
itanium_dir="${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/ia64-efi"
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION] install_device
-Install GRUB on your drive.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- --modules=MODULES pre-load specified modules MODULES
- --net-directory=DIR root directory of TFTP server
- --subdir=DIR relative subdirectory on network server
- --grub-mkimage=FILE use FILE as grub-mkimage
-
-$self copies GRUB images into net_directory/subdir/target_cpu-platform
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ gettext_printf "Usage: %s [OPTION] install_device\n" "$self"
+ gettext; echo "Install GRUB on your drive."; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+ printf " --net-directory=%-8s%s\n" "$(gettext "DIR")" "$(gettext "root directory of TFTP server")"
+ printf " --subdir=%-15s%s\n" "$(gettext "DIR")" "$(gettext "relative subdirectory on network server")"
+ printf " --grub-mkimage=%-9s%s" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+ echo
+ gettext_printf "%s copies GRUB images into net_directory/subdir/target_cpu-platform\n" "$self"
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
exit 1
fi
echo $1
;;
-*)
- echo "Unrecognized option \`$option'" 1>&2
+ gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
usage
exit 1
;;
if test -f "$1"; then
:
else
- echo "$1: Not found." 1>&2
+ gettext_printf "%s: Not found.\n" "$1" 1>&2
exit 1
fi
*-efi) mkimage_target="${platform}";
netmodules="efinet";
ext=efi ;;
- *) echo Unsupported platform ${platform};
+ *) gettext_printf "Unsupported platform %s\n" ${platform};
exit 1;;
esac
EOF
"$grub_mkimage" ${config_opt} -d "${input_dir}" -O ${mkimage_target} "--output=${grubdir}/core.$ext" "--prefix=$prefix" $modules $netmodules tftp || exit 1
- echo "Netboot directory for ${platform} created. Configure your DHCP server to point to ${subdir}/${platform}/core.$ext"
+ gettext_printf "Netboot directory for %s created. Configure your DHCP server to point to %s\n" "${platform}" "${subdir}/${platform}/core.$ext"
}
if [ "${override_dir}" = "" ] ; then
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
self=`basename $0`
xorriso=xorriso
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION] SOURCE...
-Make GRUB rescue image.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- -o, --output=FILE save output in FILE [required]
- --modules=MODULES pre-load specified modules MODULES
- --rom-directory=DIR save rom images in DIR [optional]
- --xorriso=FILE use FILE as xorriso [optional]
- --grub-mkimage=FILE use FILE as grub-mkimage
-
-$self generates a bootable rescue image with specified source files, source
-directories, or mkisofs options listed by: xorriso -as mkisofs -help
-
-Option -- switches to native xorriso command mode.
-
-Report bugs to <bug-grub@gnu.org>.
-Mail xorriso support requests to <bug-xorriso@gnu.org>.
-EOF
+ gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
+ gettext "Make GRUB rescue image."; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ printf " -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "save output in FILE [required]")"
+ printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+ printf " --rom-directory=%-8s%s\n" "$(gettext "DIR")" "$(gettext "save rom images in DIR [optional]")"
+ printf " --xorriso=%-14s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as xorriso [optional]")"
+ printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+ echo
+ gettext_printf "%s generates a bootable rescue image with specified source files, source
+directories, or mkisofs options listed by: xorriso -as mkisofs -help" "$self"
+ echo
+ gettext "Option -- switches to native xorriso command mode."; echo
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
+ gettext "Mail xorriso support requests to <bug-xorriso@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
exit 1
fi
echo $1
done
if [ "x${output_image}" = x ] ; then
- echo "output file must be given" >&2
+ gettext "output file must be given" >&2
+ echo >&2
usage
exit 1
fi
if test -f "$1"; then
:
else
- echo "$1: Not found." 1>&2
+ gettext_printf "%s: Not found.\n" "$1" 1>&2
exit 1
fi
return;
fi
- echo "Enabling $2 support ..."
+ gettext_printf "Enabling %s support ...\n" "$2"
memdisk_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
memdisk_dir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
# build BIOS core.img
if test -e "${pc_dir}" ; then
- echo "Enabling BIOS support ..."
+ gettext_printf "Enabling %s support ...\n" "BIOS"
core_img=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
$grub_mkimage -O i386-pc -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \
iso9660 biosdisk
set -e
# Make GRUB rescue image
-# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
+# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012 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
PACKAGE_TARNAME=@PACKAGE_TARNAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
pkglib_DATA="moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst"
+datadir="@datadir@"
self=`basename $0`
grub_mkimage="${bindir}/`echo grub-mkimage | sed ${transform}`"
source=
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION] SOURCE...
-Make GRUB rescue image.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- -o, --output=FILE save output in FILE [required]
- -d, --directory=DIR use images and modules under DIR [default=%s/@platform@]
- -O, --format=FORMAT generate an image in format
- available formats: %s
- -C, --compression=(xz|none|auto) choose the compression to use
- --modules=MODULES pre-load specified modules MODULES
- --grub-mkimage=FILE use FILE as grub-mkimage
-
-$self generates a standalone image (containing all modules) in the selected format
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ formats="i386-coreboot i386-multiboot i386-pc i386-pc-pxe i386-efi i386-ieee1275 i386-qemu x86_64-efi mipsel-yeeloong-flash mipsel-fuloong2f-flash mipsel-loongson-elf powerpc-ieee1275 sparc64-ieee1275-raw sparc64-ieee1275-aout ia64-efi mips-arc mipsel-qemu_mips-elf mips-qemu_mips-flash mipsel-qemu_mips-flash mips-qemu_mips-elf"
+ gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
+ gettext "Make GRUB rescue image."; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ printf " -o, --output=%-11s%s\n" "$(gettext FILE)" "$(gettext "save output in FILE [required]")"
+ dir_msg="$(gettext_printf "use images and modules under DIR [default=%s/<platform>]" "${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})")"
+ printf " -d, --directory=%-8s%s\n" \
+ "DIR" "$dir_msg"
+ printf " -O, --format=%-11s%s" "$(gettext "FORMAT")" "$(gettext "generate an image in format")"; echo
+ printf " %s %s\n" "$(gettext "available formats:")" "$formats"
+ echo
+ printf " -C, --compression=(xz|none|auto) %s\n" "$(gettext "choose the compression to use")"
+ printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
+ printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
+ echo
+ gettext_printf "%s generates a standalone image (containing all modules) in the selected format" "$self"
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
exit 1
fi
echo $1
done
if [ "x${output_image}" = x ] ; then
- echo "output file must be given" >&2
+ gettext "output file must be specified" >&2
+ echo >&2
usage
exit 1
fi
if [ "x${format}" = x ] ; then
- echo "format must be given" >&2
- usage
+ gettext "format must be specified" >&2
+ echo >&2
exit 1
fi
bindir=@bindir@
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
self=`basename $0`
bootdir=
grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION] entry
-Set the default boot entry for GRUB, for the next boot only.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- --boot-directory=DIR expect GRUB images under the directory DIR/@grubdirname@
- instead of the $grubdir directory
-
-ENTRY is a number or a menu item title.
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ gettext_printf "Usage: %s [OPTION] entry" "$self"
+ gettext "Set the default boot entry for GRUB, for the next boot only."; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ dirmsg="$(gettext_printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+ printf " --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+ echo
+ gettext "ENTRY is a number or a menu item title."; echo
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
exit 1
fi
echo $1
bootdir=`echo "$option" | sed 's/--boot-directory=//'` ;;
-*)
- echo "Unrecognized option \`$option'" 1>&2
+ gettext_printf "Unrecognized option \`%s'" "$option" 1>&2
usage
exit 1
;;
*)
if test "x$entry" != x; then
- echo "More than one entry?" 1>&2
+ gettext "More than one entry?" 1>&2
+ echo >&2
usage
exit 1
fi
done
if test "x$entry" = x; then
- echo "entry not specified." 1>&2
+ gettext "entry not specified." 1>&2
+ echo >&2
usage
exit 1
fi
bindir=@bindir@
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
+datadir="@datadir@"
self=`basename $0`
bootdir=
grubdir=`echo "/@bootdirname@/@grubdirname@" | sed 's,//*,/,g'`
+. "${datadir}/@PACKAGE@/grub-mkconfig_lib"
+
# Usage: usage
# Print the usage.
usage () {
- cat <<EOF
-Usage: $self [OPTION] entry
-Set the default boot entry for GRUB.
-
- -h, --help print this message and exit
- -v, --version print the version information and exit
- --boot-directory=DIR expect GRUB images under the directory DIR/@grubdirname@
- instead of the $grubdir directory
-
-ENTRY is a number or a menu item title.
-
-Report bugs to <bug-grub@gnu.org>.
-EOF
+ gettext_printf "Usage: %s [OPTION] entry\n" "$self"
+ gettext "Set the default boot entry for GRUB."; echo
+ echo
+ printf " -h, --help %s\n" "$(gettext "print this message and exit")"
+ printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
+ dirmsg="$(printf "expect GRUB images under the directory DIR/%s instead of the %s directory" "@grubdirname@" "$grubdir")"
+ printf " --boot-directory=%-7s%s\n" "$(gettext "DIR")" "$dirmsg"
+ echo
+ gettext "ENTRY is a number or a menu item title."; echo
+ echo
+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
}
argument () {
shift
if test $# -eq 0; then
- echo "$0: option requires an argument -- '$opt'" 1>&2
+ gettext_printf "%s: option requires an argument -- '%s'\n" "$0" "$opt" 1>&2
exit 1
fi
echo $1
bootdir=`echo "$option" | sed 's/--boot-directory=//'` ;;
-*)
- echo "Unrecognized option \`$option'" 1>&2
+ gettext_printf "Unrecognized option \`%s'" "$option" 1>&2
usage
exit 1
;;
*)
if test "x$entry" != x; then
- echo "More than one entry?" 1>&2
+ gettext "More than one entry?" 1>&2
+ echo >&2
usage
exit 1
fi
done
if test "x$entry" = x; then
- echo "entry not specified." 1>&2
+ gettext "entry not specified." 1>&2
+ echo >&2
usage
exit 1
fi
if [ "x$serial" = x1 ]; then
if ! test -e "${GRUB_PREFIX}/serial.mod" ; then
- echo "Serial terminal not available on this platform." >&2 ; exit 1
+ gettext "Serial terminal not available on this platform." >&2 ; echo >&2; exit 1
fi
if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then
- grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used."
+ grub_warn "$(gettext "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used.")"
GRUB_SERIAL_COMMAND=serial
fi
echo "${GRUB_SERIAL_COMMAND}"
if [ "x$gfxterm" = x1 ]; then
if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
&& is_path_readable_by_grub "$GRUB_THEME"; then
- echo "Found theme: $GRUB_THEME" >&2
+ gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
+
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
cat << EOF
insmod gfxmenu
EOF
elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
&& is_path_readable_by_grub "$GRUB_BACKGROUND"; then
- echo "Found background: $GRUB_BACKGROUND" >&2
+ gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
case "$GRUB_BACKGROUND" in
*.png) reader=png ;;
*.tga) reader=tga ;;
*.jpg|*.jpeg) reader=jpeg ;;
- *) echo "Unsupported image format" >&2; exit 1 ;;
+ *) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
esac
prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
cat << EOF
basename=`basename $i`
dirname=`dirname $i`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
- echo "Found GNU Mach: $i" >&2
+ gettext_printf "Found GNU Mach: %s" "$i" >&2
+ echo >&2
kernels="${kernels} ${rel_dirname}/${basename}"
at_least_one=true
fi
for i in /hurd/${hurd_fs}.static /hurd/exec ; do
if test -e "$i" ; then
- echo "Found Hurd module: $i" >&2
+ gettext_printf "Found Hurd module: %s" "$i" >&2
+ echo >&2
at_least_one=true
else
all_of_them=false
fi
if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
- echo "Some Hurd stuff found, but not enough to boot." >&2
+ gettext "Some Hurd stuff found, but not enough to boot." >&2
+ echo >&2
exit 1
fi
while [ "x$list" != "x" ] ; do
kfreebsd=`version_find_latest $list`
- echo "Found kernel of FreeBSD: $kfreebsd" >&2
+ gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2
basename=`basename $kfreebsd`
dirname=`dirname $kfreebsd`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
fi
done
if test -n "${module_dir}" ; then
- echo "Found kernel module directory: ${module_dir}" >&2
+ gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2
module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
fi
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
- echo "Found linux image: $linux" >&2
+ gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
fi
if test -n "${initrd}" ; then
- echo "Found initrd image: ${dirname}/${initrd}" >&2
+ gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
elif test -z "${initramfs}" ; then
# "UUID=" magic is parsed by initrd or initramfs. Since there's
# no initrd or builtin initramfs, it can't work here.
continue
fi
- echo "Found NetBSD kernel: $k" >&2
+ gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2
netbsd_entry "knetbsd" "$k" false "${GRUB_CMDLINE_NETBSD_DEFAULT}"
netbsd_entry "multiboot" "$k" false "${GRUB_CMDLINE_NETBSD_DEFAULT}"
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
# Check for Vista bootmgr.
if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then
- OS="Windows Vista bootmgr"
+ OS="$(gettext_quoted "Windows Vista bootmgr")"
# Check for NTLDR.
elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then
- OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="Windows NT/2000/XP loader"
+ OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="$(gettext_quoted "Windows NT/2000/XP loader")"
needmap=t
else
# Get boot /dev/ice.
dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue
- echo "Found $OS on $drv ($dev)" >&2
+ gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&2
cat << EOF
menuentry "$OS" {
EOF
echo "submenu \"Xen ${xen_version}\" {"
while [ "x$list" != "x" ] ; do
linux=`version_find_latest $list`
- echo "Found linux image: $linux" >&2
+ gettext_printf "Found linux image: %s\n" "$linux" >&2
basename=`basename $linux`
dirname=`dirname $linux`
rel_dirname=`make_system_path_relative_to_its_root $dirname`
fi
done
if test -n "${initrd}" ; then
- echo "Found initrd image: ${dirname}/${initrd}" >&2
+ gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
else
# "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here.
linux_root_device_thisversion=${GRUB_DEVICE}
fi
osx_entry() {
+ if [ x$2 = x32 ]; then
+ # TRANSLATORS: it refers to kernel architecture (32-bit)
+ bitstr="$(gettext "(32-bit)")"
+ else
+ # TRANSLATORS: it refers to kernel architecture (32-bit)
+ bitstr="$(gettext "(64-bit)")"
+ fi
+ # TRANSLATORS: it refers on the OS residing on device %s
+ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
-menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" --class osx --class darwin --class os {
+menuentry "${LONGNAME} $bitstr $onstr" --class osx --class darwin --class os {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
LONGNAME="${LABEL}"
fi
- echo "Found ${LONGNAME} on ${DEVICE}" >&2
+ gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2
case ${BOOT} in
chain)
+ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
-menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {
+menuentry "${LONGNAME} $onstr" --class windows --class os {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
LINITRD="${LINITRD#/boot}"
fi
+ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
-menuentry "${LLABEL} (on ${DEVICE})" --class gnu-linux --class gnu --class os {
+menuentry "${LLABEL} $onstr" --class gnu-linux --class gnu --class os {
EOF
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
osx_entry xnu_kernel64 64
;;
hurd)
+ onstr="$(gettext_printf "(on %s)" "${DEVICE}")"
cat << EOF
-menuentry "${LONGNAME} (on ${DEVICE})" --class hurd --class gnu --class os {
+menuentry "${LONGNAME} $onstr" --class hurd --class gnu --class os {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
EOF
;;
*)
- echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2
+ echo -n " "
+ gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
;;
esac
done