]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkconfig.in: Check the config script for syntax errors
authorBVK Chaitanya <bvk.groups@gmail.com>
Sun, 19 Sep 2010 03:19:25 +0000 (08:49 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Sun, 19 Sep 2010 03:19:25 +0000 (08:49 +0530)
before saving.

1  2 
ChangeLog
util/grub-mkconfig.in

diff --cc ChangeLog
index ddf61f4429de4213593550d2b4a1b1fb75b081c6,ddf61f4429de4213593550d2b4a1b1fb75b081c6..86f6f204d6eac9a6b6b80d2d812232b9690fc25a
+++ b/ChangeLog
@@@ -1,3 -1,3 +1,8 @@@
++2010-09-19  BVK Chaitanya  <bvk.groups@gmail.com>
++
++      * util/grub-mkconfig.in: Check the config script for syntax errors
++      before saving.
++
  2010-09-19  Colin Watson  <cjwatson@ubuntu.com>
  2010-09-19  Vladimir Serbinenko  <phcoder@gmail.com>
  
index 3ba9cd63e8c30a6193d406ae2c835e0e1006bc2d,145143a4b7e71c89ce10aecdbce956c83a2d037c..4a06e19bccb16f8fa5bfc6b091664141b3b1c963
@@@ -305,8 -305,15 +305,15 @@@ for i in ${grub_mkconfig_dir}/* ; d
  done
  
  if test "x${grub_cfg}" != "x" ; then
-   # none of the children aborted with error, install the new grub.cfg
-   mv -f ${grub_cfg}.new ${grub_cfg}
 -  if ! grub-script-check ${grub_cfg}.new 2>/dev/null; then
++  if ! grub-script-check ${grub_cfg}.new; then
+     echo "Syntax errors are detected in generated GRUB config file." >&2
+     echo "Ensure that there are no errors in /etc/default/grub" >&2
+     echo "and /etc/grub.d/* files or please file a bug report with" >&2
+     echo "${grub_cfg}.new file attached." >&2
+   else
+     # none of the children aborted with error, install the new grub.cfg
+     mv -f ${grub_cfg}.new ${grub_cfg}
+   fi
  fi
  
  echo "done" >&2