]> TLD Linux GIT Repositories - packages/grub2.git/blob - grub-mkconfig-diagnostics.patch
- grub2 from PLD
[packages/grub2.git] / grub-mkconfig-diagnostics.patch
1 diff -dur grub-2.00.orig/util/grub-mkconfig.in grub-2.00/util/grub-mkconfig.in
2 --- grub-2.00.orig/util/grub-mkconfig.in        2012-10-27 15:05:15.000000000 +0200
3 +++ grub-2.00/util/grub-mkconfig.in     2012-10-27 15:14:32.787243346 +0200
4 @@ -221,11 +236,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.cfg ..." >&2
17 -echo >&2
18 +gettext "Generating grub.cfg ..." >&3
19 +echo >&3
20  
21  cat << EOF
22  #
23 @@ -259,12 +279,15 @@
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    else
30      # none of the children aborted with error, install the new grub.cfg
31      mv -f ${grub_cfg}.new ${grub_cfg}
32    fi
33  fi
34  
35 -gettext "done" >&2
36 -echo >&2
37 +gettext "done" >&3
38 +echo >&3
39 +
40 +# close diagnostic stream
41 +exec 3>&-
42 diff -dur grub-2.00.orig/util/grub.d/00_header.in grub-2.00/util/grub.d/00_header.in
43 --- grub-2.00.orig/util/grub.d/00_header.in     2012-05-04 01:04:39.000000000 +0200
44 +++ grub-2.00/util/grub.d/00_header.in  2012-10-27 15:16:00.665356307 +0200
45 @@ -219,7 +219,7 @@
46  if [ "x$gfxterm" = x1 ]; then
47      if [ "x$GRUB_THEME" != x ] && [ -f "$GRUB_THEME" ] \
48         && is_path_readable_by_grub "$GRUB_THEME"; then
49 -       gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&2
50 +       gettext_printf "Found theme: %s\n" "$GRUB_THEME" >&3
51  
52         prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_THEME"`
53         cat << EOF
54 @@ -255,12 +255,12 @@
55  EOF
56      elif [ "x$GRUB_BACKGROUND" != x ] && [ -f "$GRUB_BACKGROUND" ] \
57             && is_path_readable_by_grub "$GRUB_BACKGROUND"; then
58 -       gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&2
59 +       gettext_printf "Found background: %s\n" "$GRUB_BACKGROUND" >&3
60         case "$GRUB_BACKGROUND" in 
61             *.png)         reader=png ;;
62             *.tga)         reader=tga ;;
63             *.jpg|*.jpeg)  reader=jpeg ;;
64 -           *)             gettext "Unsupported image format" >&2; echo >&2; exit 1 ;;
65 +           *)             gettext "Unsupported image format" >&3; echo >&3; exit 1 ;;
66         esac
67         prepare_grub_to_access_device `${grub_probe} --target=device "$GRUB_BACKGROUND"`
68         cat << EOF
69 diff -dur grub-2.00.orig/util/grub.d/10_hurd.in grub-2.00/util/grub.d/10_hurd.in
70 --- grub-2.00.orig/util/grub.d/10_hurd.in       2012-03-04 21:10:04.000000000 +0100
71 +++ grub-2.00/util/grub.d/10_hurd.in    2012-10-27 15:16:00.665356307 +0200
72 @@ -45,8 +45,8 @@
73      basename=`basename $i`
74      dirname=`dirname $i`
75      rel_dirname=`make_system_path_relative_to_its_root $dirname`
76 -    gettext_printf "Found GNU Mach: %s" "$i" >&2
77 -    echo >&2
78 +    gettext_printf "Found GNU Mach: %s" "$i" >&3
79 +    echo >&3
80      kernels="${kernels} ${rel_dirname}/${basename}"
81      at_least_one=true
82    fi
83 @@ -60,8 +60,8 @@
84  
85  for i in /hurd/${hurd_fs}.static /hurd/exec ; do
86    if test -e "$i" ; then
87 -    gettext_printf "Found Hurd module: %s" "$i" >&2
88 -    echo >&2
89 +    gettext_printf "Found Hurd module: %s" "$i" >&3
90 +    echo >&3
91      at_least_one=true
92    else
93      all_of_them=false
94 @@ -74,8 +74,8 @@
95  fi
96  
97  if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else
98 -  gettext "Some Hurd stuff found, but not enough to boot." >&2
99 -  echo >&2
100 +  gettext "Some Hurd stuff found, but not enough to boot." >&3
101 +  echo >&3
102    exit 1
103  fi
104  
105 diff -dur grub-2.00.orig/util/grub.d/10_kfreebsd.in grub-2.00/util/grub.d/10_kfreebsd.in
106 --- grub-2.00.orig/util/grub.d/10_kfreebsd.in   2012-03-04 22:02:30.000000000 +0100
107 +++ grub-2.00/util/grub.d/10_kfreebsd.in        2012-10-27 15:16:00.668689695 +0200
108 @@ -158,7 +158,7 @@
109  
110  while [ "x$list" != "x" ] ; do
111    kfreebsd=`version_find_latest $list`
112 -  gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&2
113 +  gettext_printf "Found kernel of FreeBSD: %s\n" "$kfreebsd" >&3
114    basename=`basename $kfreebsd`
115    dirname=`dirname $kfreebsd`
116    rel_dirname=`make_system_path_relative_to_its_root $dirname`
117 @@ -207,7 +207,7 @@
118      fi
119    done
120    if test -n "${module_dir}" ; then
121 -    gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&2
122 +    gettext_printf "Found kernel module directory: %s\n" "${module_dir}" >&3
123      module_dir_rel=$(make_system_path_relative_to_its_root $module_dir)
124    fi
125  
126 diff -dur grub-2.00.orig/util/grub.d/10_linux.in grub-2.00/util/grub.d/10_linux.in
127 --- grub-2.00.orig/util/grub.d/10_linux.in      2012-10-27 15:05:15.000000000 +0200
128 +++ grub-2.00/util/grub.d/10_linux.in   2012-10-27 15:16:00.668689695 +0200
129 @@ -182,7 +182,7 @@
130  is_first_entry=true
131  while [ "x$list" != "x" ] ; do
132    linux=`version_find_latest $list`
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 @@ -220,7 +220,7 @@
139    fi
140  
141    if test -n "${initrd}" ; then
142 -    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
143 +    gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
144    elif test -z "${initramfs}" ; then
145      # "UUID=" and "ZFS=" magic is parsed by initrd or initramfs.  Since there's
146      # no initrd or builtin initramfs, it can't work here.
147 diff -dur grub-2.00.orig/util/grub.d/10_netbsd.in grub-2.00/util/grub.d/10_netbsd.in
148 --- grub-2.00.orig/util/grub.d/10_netbsd.in     2012-03-04 20:47:35.000000000 +0100
149 +++ grub-2.00/util/grub.d/10_netbsd.in  2012-10-27 15:16:00.668689695 +0200
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    if [ "x$is_first_entry" = xtrue ]; then
158        netbsd_entry "knetbsd"   "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}"
159 diff -dur grub-2.00.orig/util/grub.d/10_windows.in grub-2.00/util/grub.d/10_windows.in
160 --- grub-2.00.orig/util/grub.d/10_windows.in    2012-03-04 22:11:43.000000000 +0100
161 +++ grub-2.00/util/grub.d/10_windows.in 2012-10-27 15:16:00.668689695 +0200
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 diff -dur grub-2.00.orig/util/grub.d/20_linux_xen.in grub-2.00/util/grub.d/20_linux_xen.in
172 --- grub-2.00.orig/util/grub.d/20_linux_xen.in  2012-06-03 21:57:42.000000000 +0200
173 +++ grub-2.00/util/grub.d/20_linux_xen.in       2012-10-27 15:16:00.672023083 +0200
174 @@ -203,7 +203,7 @@
175      fi
176      while [ "x$list" != "x" ] ; do
177         linux=`version_find_latest $list`
178 -       gettext_printf "Found linux image: %s\n" "$linux" >&2
179 +       gettext_printf "Found linux image: %s\n" "$linux" >&3
180         basename=`basename $linux`
181         dirname=`dirname $linux`
182         rel_dirname=`make_system_path_relative_to_its_root $dirname`
183 @@ -226,7 +226,7 @@
184             fi
185         done
186         if test -n "${initrd}" ; then
187 -           gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&2
188 +           gettext_printf "Found initrd image: %s\n" "${dirname}/${initrd}" >&3
189         else
190      # "UUID=" magic is parsed by initrds.  Since there's no initrd, it can't work here.
191             linux_root_device_thisversion=${GRUB_DEVICE}
192 diff -dur grub-2.00.orig/util/grub.d/30_os-prober.in grub-2.00/util/grub.d/30_os-prober.in
193 --- grub-2.00.orig/util/grub.d/30_os-prober.in  2012-03-04 21:52:03.000000000 +0100
194 +++ grub-2.00/util/grub.d/30_os-prober.in       2012-10-27 15:16:00.675356471 +0200
195 @@ -117,7 +117,7 @@
196      LONGNAME="${LABEL}"
197    fi
198  
199 -  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2
200 +  gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&3
201  
202    case ${BOOT} in
203      chain)
204 @@ -267,7 +267,7 @@
205      *)
206        echo -n "  "
207        # TRANSLATORS: %s is replaced by OS name.
208 -      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2
209 +      gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&3
210      ;;
211    esac
212  done