diff --git a/ChangeLog b/ChangeLog index c1b7ec5da..cb5ff7059 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-02-03 Vladimir Serbinenko + + * 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 * grub-core/kern/mm.c: Add missing include of i18n.h diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in index d688431c3..9b0075ca6 100644 --- a/util/powerpc/ieee1275/grub-mkrescue.in +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -38,21 +38,17 @@ grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` # Usage: usage # Print the usage. usage () { - cat <. -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 " --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 bootable rescue image with specified source files, source directories, or mkisofs options listed by: %s" "genisoimage -help" "$self" + echo + gettext "Report bugs to ."; echo } argument () { @@ -60,7 +56,7 @@ 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 @@ -68,6 +64,9 @@ argument () { input_dir=${pkglibdir} +source= +output_image= + # Check the arguments. while test $# -gt 0 do @@ -87,28 +86,23 @@ do --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; - --pkglibdir) + --override-directory) input_dir=`argument $option "$@"`; shift ;; - --pkglibdir=*) - input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;; + --override-directory=*) + input_dir=`echo "$option" | sed 's/--override-directory=//'` ;; --grub-mkimage) grub_mkimage=`argument $option "$@"`; shift ;; --grub-mkimage=*) grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; - -*) - echo "Unrecognized option \`$option'" 1>&2 - usage - exit 1 - ;; + -o | --output) + output_image=`argument $option "$@"`; shift ;; + --output=*) + output_image=`echo "$option" | sed 's/--output=//'` ;; + *) - if test "x$output_image" != x; then - echo "Unrecognized option \`$option'" 1>&2 - usage - exit 1 - fi - output_image="${option}" ;; + source="${source} ${option} $@"; break ;; esac done @@ -135,7 +129,7 @@ core_img=${boot_dir}/grub.img ${grub_mkimage} -O powerpc-ieee1275 -n -d ${input_dir}/ -o ${core_img} ${modules} genisoimage -hfs -part -no-desktop -r -J -o ${output_image} \ -map ${map_file} -hfs-bless ${boot_dir} -chrp-boot -sysid PPC \ - ${iso_dir} + ${iso_dir} ${source} rm -rf ${iso_dir} rm -f ${map_file}