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