]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub-mkconfig-diagnostics.patch
- updated to 2.02-rc1
[packages/grub2.git] / grub-mkconfig-diagnostics.patch
1 diff -urNp grub-2.02-rc1.orig/util/grub.d/00_header.in grub-2.02-rc1/util/grub.d/00_header.in
2 --- grub-2.02-rc1.orig/util/grub.d/00_header.in 2017-02-08 15:03:12.814319390 +0000
3 +++ grub-2.02-rc1/util/grub.d/00_header.in      2017-02-08 15:03:25.069319252 +0000
4 @@ -229,7 +229,7 @@ esac
5  if [ "x$gfxterm" = x1 ]; then
6      if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
7         && is_path_readable_by_grub "$GRUB_THEME"; then
8 -       gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
9 +       gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&3
10  
11         prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
12         cat << EOF
13 @@ -265,12 +265,12 @@ export theme
14  EOF
15      elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
16             && is_path_readable_by_grub "$GRUB_BACKGROUND"; then
17 -       gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
18 +       gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&3
19         case "$GRUB_BACKGROUND" in 
20             *.png)         reader=png ;;
21             *.tga)         reader=tga ;;
22             *.jpg|*.jpeg)  reader=jpeg ;;
23 -           *)             gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
24 +           *)             gettext "Unsupported image format" >&3; echo >&3; exit 1 ;;
25         esac
26         prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
27         cat << EOF
28 diff -urNp grub-2.02-rc1.orig/util/grub.d/10_hurd.in grub-2.02-rc1/util/grub.d/10_hurd.in
29 --- grub-2.02-rc1.orig/util/grub.d/10_hurd.in   2017-02-08 15:03:12.814319390 +0000
30 +++ grub-2.02-rc1/util/grub.d/10_hurd.in        2017-02-08 15:03:25.069319252 +0000
31 @@ -45,8 +45,8 @@ for i in /boot/gnumach* ; do
32      basename=`basename $i`
33      dirname=`dirname $i`
34      rel_dirname=`make_system_path_relative_to_its_root $dirname`
35 -    gettext_printf "Found GNU Mach: %s" "$i" >&2
36 -    echo >&2
37 +    gettext_printf "Found GNU Mach: %s" "$i" >&3
38 +    echo >&3
39      kernels="${kernels} ${rel_dirname}/${basename}"
40      at_least_one=true
41    fi
42 @@ -60,8 +60,8 @@ esac
43  
44  for i in /hurd/${hurd_fs}.static /hurd/exec ; do
45    if test -e "$i" ; then
46 -    gettext_printf "Found Hurd module: %s" "$i" >&2
47 -    echo >&2
48 +    gettext_printf "Found Hurd module: %s" "$i" >&3
49 +    echo >&3
50      at_least_one=true
51    else
52      all_of_them=false
53 @@ -74,8 +74,8 @@ if ${at_least_one} ; then : ; else
54  fi
55  
56  if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
57 -  gettext "Some Hurd stuff found, but not enough to boot." >&2
58 -  echo >&2
59 +  gettext "Some Hurd stuff found, but not enough to boot." >&3
60 +  echo >&3
61    exit 1
62  fi
63  
64 diff -urNp grub-2.02-rc1.orig/util/grub.d/10_kfreebsd.in grub-2.02-rc1/util/grub.d/10_kfreebsd.in
65 --- grub-2.02-rc1.orig/util/grub.d/10_kfreebsd.in       2017-02-08 15:03:12.814319390 +0000
66 +++ grub-2.02-rc1/util/grub.d/10_kfreebsd.in    2017-02-08 15:03:25.069319252 +0000
67 @@ -161,7 +161,7 @@ is_top_level=true
68  
69  while [ "x$list" != "x" ] ; do
70    kfreebsd=`version_find_latest $list`
71 -  gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2
72 +  gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&3
73    basename=`basename $kfreebsd`
74    dirname=`dirname $kfreebsd`
75    rel_dirname=`make_system_path_relative_to_its_root $dirname`
76 @@ -210,7 +210,7 @@ while [ "x$list" != "x" ] ; do
77      fi
78    done
79    if test -n "${module_dir}" ; then
80 -    gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2
81 +    gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&3
82      module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
83    fi
84  
85 diff -urNp grub-2.02-rc1.orig/util/grub.d/10_linux.in grub-2.02-rc1/util/grub.d/10_linux.in
86 --- grub-2.02-rc1.orig/util/grub.d/10_linux.in  2017-02-08 15:03:12.814319390 +0000
87 +++ grub-2.02-rc1/util/grub.d/10_linux.in       2017-02-08 15:03:25.070319252 +0000
88 @@ -180,7 +180,7 @@ submenu_indentation=""
89  is_top_level=true
90  while [ "x$list" != "x" ] ; do
91    linux=`version_find_latest $list`
92 -  gettext_printf "Found linux image: %s\n" "$linux" >&2
93 +  gettext_printf "Found linux image: %s\n" "$linux" >&3
94    basename=`basename $linux`
95    dirname=`dirname $linux`
96    rel_dirname=`make_system_path_relative_to_its_root $dirname`
97 @@ -217,7 +217,7 @@ while [ "x$list" != "x" ] ; do
98    fi
99  
100    if test -n "${initrd}" ; then
101 -    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
102 +    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
103    elif test -z "${initramfs}" ; then
104      # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs.  Since there's
105      # no initrd or builtin initramfs, it can't work here.
106 diff -urNp grub-2.02-rc1.orig/util/grub.d/10_netbsd.in grub-2.02-rc1/util/grub.d/10_netbsd.in
107 --- grub-2.02-rc1.orig/util/grub.d/10_netbsd.in 2017-02-08 15:03:12.814319390 +0000
108 +++ grub-2.02-rc1/util/grub.d/10_netbsd.in      2017-02-08 15:03:25.070319252 +0000
109 @@ -155,7 +155,7 @@ for k in /netbsd $(ls -t /netbsd?* 2>/de
110      continue
111    fi
112  
113 -  gettext_printf "Found NetBSD kernel: %s\n" "$k" >&2
114 +  gettext_printf "Found NetBSD kernel: %s\n" "$k" >&3
115  
116    if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then
117        netbsd_entry "knetbsd"   "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}"
118 diff -urNp grub-2.02-rc1.orig/util/grub.d/10_windows.in grub-2.02-rc1/util/grub.d/10_windows.in
119 --- grub-2.02-rc1.orig/util/grub.d/10_windows.in        2017-02-08 15:03:12.814319390 +0000
120 +++ grub-2.02-rc1/util/grub.d/10_windows.in     2017-02-08 15:03:25.070319252 +0000
121 @@ -82,7 +82,7 @@ for drv in $drives ; do
122    # Get boot device.
123    dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue
124  
125 -  gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&2
126 +  gettext_printf "Found %s on %s (%s)\n" "$OS" "$drv" "$dev" >&3
127    cat << EOF
128  menuentry '$(echo "$OS" | grub_quote)' \$menuentry_id_option '$osid-$(grub_get_device_id "${dev}")' {
129  EOF
130 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
131 --- grub-2.02-rc1.orig/util/grub.d/20_linux_xen.in      2017-02-08 15:03:12.814319390 +0000
132 +++ grub-2.02-rc1/util/grub.d/20_linux_xen.in   2017-02-08 15:03:25.070319252 +0000
133 @@ -208,7 +208,7 @@ while [ "x${xen_list}" != "x" ] ; do
134      fi
135      while [ "x$list" != "x" ] ; do
136         linux=`version_find_latest $list`
137 -       gettext_printf "Found linux image: %s\n" "$linux" >&2
138 +       gettext_printf "Found linux image: %s\n" "$linux" >&3
139         basename=`basename $linux`
140         dirname=`dirname $linux`
141         rel_dirname=`make_system_path_relative_to_its_root $dirname`
142 @@ -231,7 +231,7 @@ while [ "x${xen_list}" != "x" ] ; do
143             fi
144         done
145         if test -n "${initrd}" ; then
146 -           gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
147 +           gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
148         else
149      # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
150             linux_root_device_thisversion=${GRUB_DEVICE}
151 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
152 --- grub-2.02-rc1.orig/util/grub.d/30_os-prober.in      2017-02-08 15:03:12.814319390 +0000
153 +++ grub-2.02-rc1/util/grub.d/30_os-prober.in   2017-02-08 15:03:25.070319252 +0000
154 @@ -141,7 +141,7 @@ for OS in ${OSPROBED} ; do
155    # os-prober returns text string followed by optional counter
156    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')"
157  
158 -  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2
159 +  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&3
160  
161    case ${BOOT} in
162      chain)
163 @@ -329,7 +329,7 @@ EOF
164      ;;
165      *)
166        # TRANSLATORS: %s is replaced by OS name.
167 -      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "  ${LONGNAME}" >&2
168 +      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "  ${LONGNAME}" >&3
169      ;;
170    esac
171  done
172 diff -urNp grub-2.02-rc1.orig/util/grub-mkconfig.in grub-2.02-rc1/util/grub-mkconfig.in
173 --- grub-2.02-rc1.orig/util/grub-mkconfig.in    2017-02-08 15:03:12.813319390 +0000
174 +++ grub-2.02-rc1/util/grub-mkconfig.in 2017-02-08 15:04:41.230318395 +0000
175 @@ -247,11 +247,16 @@ export GRUB_DEFAULT \
176  if test "x${grub_cfg}" != "x"; then
177    rm -f "${grub_cfg}.new"
178    oldumask=$(umask); umask 077
179 +  # open fd &3 for diagnostic messages
180 +  exec 3>&1
181    exec > "${grub_cfg}.new"
182    umask $oldumask
183 +else
184 +  # open fd &3 for diagnostic messages
185 +  exec 3>&2
186  fi
187 -gettext "Generating grub configuration file ..." >&2
188 -echo >&2
189 +gettext "Generating grub configuration file ..." >&3
190 +echo >&3
191  
192  cat << EOF
193  #
194 @@ -286,8 +291,8 @@ if test "x${grub_cfg}" != "x" ; then
195      gettext_printf "Syntax errors are detected in generated GRUB config file.
196  Ensure that there are no errors in /etc/sysconfig/grub
197  and /etc/grub.d/* files or please file a bug report with
198 -%s file attached." "${grub_cfg}.new" >&2
199 -    echo >&2
200 +%s file attached." "${grub_cfg}.new" >&3
201 +    echo >&3
202      exit 1
203    else
204      # none of the children aborted with error, install the new grub.cfg
205 @@ -295,5 +300,8 @@ and /etc/grub.d/* files or please file a
206    fi
207  fi
208  
209 -gettext "done" >&2
210 -echo >&2
211 +gettext "done" >&3
212 +echo >&3
213 +
214 +# close diagnostic stream
215 +exec 3>&-