diff -urNp grub-2.02-rc1.orig/util/grub.d/00_header.in grub-2.02-rc1/util/grub.d/00_header.in --- grub-2.02-rc1.orig/util/grub.d/00_header.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/00_header.in 2017-02-08 15:03:25.069319252 +0000 @@ -229,7 +229,7 @@ esac if [ "x$gfxterm" = x1 ]; then if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \ && is_path_readable_by_grub "$GRUB_THEME"; then - gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2 + gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&3 prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"` cat << EOF @@ -265,12 +265,12 @@ export theme EOF elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \ && is_path_readable_by_grub "$GRUB_BACKGROUND"; then - gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2 + gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&3 case "$GRUB_BACKGROUND" in *.png) reader=png ;; *.tga) reader=tga ;; *.jpg|*.jpeg) reader=jpeg ;; - *) gettext "Unsupported image format" >&2; echo >&2; exit 1 ;; + *) gettext "Unsupported image format" >&3; echo >&3; exit 1 ;; esac prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"` cat << EOF diff -urNp grub-2.02-rc1.orig/util/grub.d/10_hurd.in grub-2.02-rc1/util/grub.d/10_hurd.in --- grub-2.02-rc1.orig/util/grub.d/10_hurd.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/10_hurd.in 2017-02-08 15:03:25.069319252 +0000 @@ -45,8 +45,8 @@ for i in /boot/gnumach* ; do basename=`basename $i` dirname=`dirname $i` rel_dirname=`make_system_path_relative_to_its_root $dirname` - gettext_printf "Found GNU Mach: %s" "$i" >&2 - echo >&2 + gettext_printf "Found GNU Mach: %s" "$i" >&3 + echo >&3 kernels="${kernels} ${rel_dirname}/${basename}" at_least_one=true fi @@ -60,8 +60,8 @@ esac for i in /hurd/${hurd_fs}.static /hurd/exec ; do if test -e "$i" ; then - gettext_printf "Found Hurd module: %s" "$i" >&2 - echo >&2 + gettext_printf "Found Hurd module: %s" "$i" >&3 + echo >&3 at_least_one=true else all_of_them=false @@ -74,8 +74,8 @@ if ${at_least_one} ; then : ; else fi if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else - gettext "Some Hurd stuff found, but not enough to boot." >&2 - echo >&2 + gettext "Some Hurd stuff found, but not enough to boot." >&3 + echo >&3 exit 1 fi diff -urNp grub-2.02-rc1.orig/util/grub.d/10_kfreebsd.in grub-2.02-rc1/util/grub.d/10_kfreebsd.in --- grub-2.02-rc1.orig/util/grub.d/10_kfreebsd.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/10_kfreebsd.in 2017-02-08 15:03:25.069319252 +0000 @@ -161,7 +161,7 @@ is_top_level=true while [ "x$list" != "x" ] ; do kfreebsd=`version_find_latest $list` - gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2 + gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&3 basename=`basename $kfreebsd` dirname=`dirname $kfreebsd` rel_dirname=`make_system_path_relative_to_its_root $dirname` @@ -210,7 +210,7 @@ while [ "x$list" != "x" ] ; do fi done if test -n "${module_dir}" ; then - gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2 + gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&3 module_dir_rel=$(make_system_path_relative_to_its_root $module_dir) fi diff -urNp grub-2.02-rc1.orig/util/grub.d/10_linux.in grub-2.02-rc1/util/grub.d/10_linux.in --- grub-2.02-rc1.orig/util/grub.d/10_linux.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/10_linux.in 2017-02-08 15:03:25.070319252 +0000 @@ -180,7 +180,7 @@ submenu_indentation="" is_top_level=true while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` - gettext_printf "Found linux image: %s\n" "$linux" >&2 + gettext_printf "Found linux image: %s\n" "$linux" >&3 basename=`basename $linux` dirname=`dirname $linux` rel_dirname=`make_system_path_relative_to_its_root $dirname` @@ -217,7 +217,7 @@ while [ "x$list" != "x" ] ; do fi if test -n "${initrd}" ; then - gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3 elif test -z "${initramfs}" ; then # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs. Since there's # no initrd or builtin initramfs, it can't work here. diff -urNp grub-2.02-rc1.orig/util/grub.d/10_netbsd.in grub-2.02-rc1/util/grub.d/10_netbsd.in --- grub-2.02-rc1.orig/util/grub.d/10_netbsd.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/10_netbsd.in 2017-02-08 15:03:25.070319252 +0000 @@ -155,7 +155,7 @@ for k in /netbsd $(ls -t /netbsd?* 2>/de continue fi - gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2 + gettext_printf "Found NetBSD kernel: %s\n" "$k" >&3 if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then netbsd_entry "knetbsd" "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}" diff -urNp grub-2.02-rc1.orig/util/grub.d/10_windows.in grub-2.02-rc1/util/grub.d/10_windows.in --- grub-2.02-rc1.orig/util/grub.d/10_windows.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/10_windows.in 2017-02-08 15:03:25.070319252 +0000 @@ -82,7 +82,7 @@ for drv in $drives ; do # Get boot device. dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue - gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&2 + gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&3 cat << EOF menuentry '$(echo "$OS" | grub_quote)' \$menuentry_id_option '$osid-$(grub_get_device_id "${dev}")' { EOF diff -urNp grub-2.02-rc1.orig/util/grub.d/20_linux_xen.in grub-2.02-rc1/util/grub.d/20_linux_xen.in --- grub-2.02-rc1.orig/util/grub.d/20_linux_xen.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/20_linux_xen.in 2017-02-08 15:03:25.070319252 +0000 @@ -208,7 +208,7 @@ while [ "x${xen_list}" != "x" ] ; do fi while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` - gettext_printf "Found linux image: %s\n" "$linux" >&2 + gettext_printf "Found linux image: %s\n" "$linux" >&3 basename=`basename $linux` dirname=`dirname $linux` rel_dirname=`make_system_path_relative_to_its_root $dirname` @@ -231,7 +231,7 @@ while [ "x${xen_list}" != "x" ] ; do fi done if test -n "${initrd}" ; then - gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2 + gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3 else # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. linux_root_device_thisversion=${GRUB_DEVICE} diff -urNp grub-2.02-rc1.orig/util/grub.d/30_os-prober.in grub-2.02-rc1/util/grub.d/30_os-prober.in --- grub-2.02-rc1.orig/util/grub.d/30_os-prober.in 2017-02-08 15:03:12.814319390 +0000 +++ grub-2.02-rc1/util/grub.d/30_os-prober.in 2017-02-08 15:03:25.070319252 +0000 @@ -141,7 +141,7 @@ for OS in ${OSPROBED} ; do # os-prober returns text string followed by optional counter CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')" - gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 + gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&3 case ${BOOT} in chain) @@ -329,7 +329,7 @@ EOF ;; *) # TRANSLATORS: %s is replaced by OS name. - gettext_printf "%s is not yet supported by grub-mkconfig.\n" " ${LONGNAME}" >&2 + gettext_printf "%s is not yet supported by grub-mkconfig.\n" " ${LONGNAME}" >&3 ;; esac done diff -urNp grub-2.02-rc1.orig/util/grub-mkconfig.in grub-2.02-rc1/util/grub-mkconfig.in --- grub-2.02-rc1.orig/util/grub-mkconfig.in 2017-02-08 15:03:12.813319390 +0000 +++ grub-2.02-rc1/util/grub-mkconfig.in 2017-02-08 15:04:41.230318395 +0000 @@ -247,11 +247,16 @@ export GRUB_DEFAULT \ if test "x${grub_cfg}" != "x"; then rm -f "${grub_cfg}.new" oldumask=$(umask); umask 077 + # open fd &3 for diagnostic messages + exec 3>&1 exec > "${grub_cfg}.new" umask $oldumask +else + # open fd &3 for diagnostic messages + exec 3>&2 fi -gettext "Generating grub configuration file ..." >&2 -echo >&2 +gettext "Generating grub configuration file ..." >&3 +echo >&3 cat << EOF # @@ -286,8 +291,8 @@ if test "x${grub_cfg}" != "x" ; then gettext_printf "Syntax errors are detected in generated GRUB config file. Ensure that there are no errors in /etc/sysconfig/grub and /etc/grub.d/* files or please file a bug report with -%s file attached." "${grub_cfg}.new" >&2 - echo >&2 +%s file attached." "${grub_cfg}.new" >&3 + echo >&3 exit 1 else # none of the children aborted with error, install the new grub.cfg @@ -295,5 +300,8 @@ and /etc/grub.d/* files or please file a fi fi -gettext "done" >&2 -echo >&2 +gettext "done" >&3 +echo >&3 + +# close diagnostic stream +exec 3>&-