* util/powerpc/ieee1275/grub-mkrescue.in: Gettextize. Unify the command

options with generic grub-mkrescue.in with the goal of future
	merge.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-03 14:38:39 +01:00
parent c84ba308b5
commit 18534ad91e
2 changed files with 31 additions and 31 deletions

View file

@ -1,3 +1,9 @@
2012-02-03 Vladimir Serbinenko <phcoder@gmail.com>
* util/powerpc/ieee1275/grub-mkrescue.in: Gettextize. Unify the command
options with generic grub-mkrescue.in with the goal of future
merge.
2012-02-03 Vladimir Serbinenko <phcoder@gmail.com> 2012-02-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/mm.c: Add missing include of i18n.h * grub-core/kern/mm.c: Add missing include of i18n.h

View file

@ -38,21 +38,17 @@ grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}`
# Usage: usage # Usage: usage
# Print the usage. # Print the usage.
usage () { usage () {
cat <<EOF gettext_printf "Usage: %s [OPTION] SOURCE...\n" "$self"
Usage: $self [OPTION] output_image gettext "Make GRUB rescue image."; echo
Make GRUB rescue image. echo
printf " -h, --help %s\n" "$(gettext "print this message and exit")"
-h, --help print this message and exit printf " -v, --version %s\n" "$(gettext "print the version information and exit")"
-v, --version print the version information and exit printf " --modules=%-14s%s\n" "$(gettext "MODULES")" "$(gettext "pre-load specified modules MODULES")"
--modules=MODULES pre-load specified modules MODULES printf " --grub-mkimage=%-9s%s\n" "$(gettext "FILE")" "$(gettext "use FILE as grub-mkimage")"
--pkglibdir=DIR use images from directory DIR echo
default: ${pkglibdir} gettext_printf "%s generates a bootable rescue image with specified source files, source directories, or mkisofs options listed by: %s" "genisoimage -help" "$self"
--grub-mkimage=FILE use FILE as grub-mkimage echo
gettext "Report bugs to <bug-grub@gnu.org>."; echo
$self generates a bootable rescue CD image for PowerMac and CHRP.
Report bugs to <bug-grub@gnu.org>.
EOF
} }
argument () { argument () {
@ -60,7 +56,7 @@ argument () {
shift shift
if test $# -eq 0; then 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 exit 1
fi fi
echo $1 echo $1
@ -68,6 +64,9 @@ argument () {
input_dir=${pkglibdir} input_dir=${pkglibdir}
source=
output_image=
# Check the arguments. # Check the arguments.
while test $# -gt 0 while test $# -gt 0
do do
@ -87,28 +86,23 @@ do
--modules=*) --modules=*)
modules=`echo "$option" | sed 's/--modules=//'` ;; modules=`echo "$option" | sed 's/--modules=//'` ;;
--pkglibdir) --override-directory)
input_dir=`argument $option "$@"`; shift ;; input_dir=`argument $option "$@"`; shift ;;
--pkglibdir=*) --override-directory=*)
input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;; input_dir=`echo "$option" | sed 's/--override-directory=//'` ;;
--grub-mkimage) --grub-mkimage)
grub_mkimage=`argument $option "$@"`; shift ;; grub_mkimage=`argument $option "$@"`; shift ;;
--grub-mkimage=*) --grub-mkimage=*)
grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;;
-*) -o | --output)
echo "Unrecognized option \`$option'" 1>&2 output_image=`argument $option "$@"`; shift ;;
usage --output=*)
exit 1 output_image=`echo "$option" | sed 's/--output=//'` ;;
;;
*) *)
if test "x$output_image" != x; then source="${source} ${option} $@"; break ;;
echo "Unrecognized option \`$option'" 1>&2
usage
exit 1
fi
output_image="${option}" ;;
esac esac
done done
@ -135,7 +129,7 @@ core_img=${boot_dir}/grub.img
${grub_mkimage} -O powerpc-ieee1275 -n -d ${input_dir}/ -o ${core_img} ${modules} ${grub_mkimage} -O powerpc-ieee1275 -n -d ${input_dir}/ -o ${core_img} ${modules}
genisoimage -hfs -part -no-desktop -r -J -o ${output_image} \ genisoimage -hfs -part -no-desktop -r -J -o ${output_image} \
-map ${map_file} -hfs-bless ${boot_dir} -chrp-boot -sysid PPC \ -map ${map_file} -hfs-bless ${boot_dir} -chrp-boot -sysid PPC \
${iso_dir} ${iso_dir} ${source}
rm -rf ${iso_dir} rm -rf ${iso_dir}
rm -f ${map_file} rm -f ${map_file}