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