All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Catch syntax errors in grub-mkconfig before installing
@ 2010-09-07  5:56 BVK Chaitanya
  0 siblings, 0 replies; only message in thread
From: BVK Chaitanya @ 2010-09-07  5:56 UTC (permalink / raw)
  To: The development of GRUB 2

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

Hi,


Attached patch adds long pending feature:  Use grub-script-check tool
to detect any syntax errors in generated config files (by
grub-mkconfig) before copying it to the destination.




bvk.chaitanya

[-- Attachment #2: check-mkconfig.patch --]
[-- Type: text/x-diff, Size: 794 bytes --]

=== modified file 'util/grub-mkconfig.in'
--- util/grub-mkconfig.in	2010-06-29 15:20:49 +0000
+++ util/grub-mkconfig.in	2010-09-07 05:44:47 +0000
@@ -314,8 +314,15 @@
 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
+    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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-07  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-07  5:56 [PATCH] Catch syntax errors in grub-mkconfig before installing BVK Chaitanya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.