From: BVK Chaitanya Date: Sun, 19 Sep 2010 03:19:25 +0000 (+0530) Subject: * util/grub-mkconfig.in: Check the config script for syntax errors X-Git-Tag: 1.99~484 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f4e8053e04f71d2cfd551c97d04ae5e298b44e2;p=thirdparty%2Fgrub.git * util/grub-mkconfig.in: Check the config script for syntax errors before saving. --- 2f4e8053e04f71d2cfd551c97d04ae5e298b44e2 diff --cc ChangeLog index ddf61f442,ddf61f442..86f6f204d --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,3 +1,8 @@@ ++2010-09-19 BVK Chaitanya ++ ++ * util/grub-mkconfig.in: Check the config script for syntax errors ++ before saving. ++ 2010-09-19 Colin Watson 2010-09-19 Vladimir Serbinenko diff --cc util/grub-mkconfig.in index 3ba9cd63e,145143a4b..4a06e19bc --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@@ -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