grub-script-check tool to validate grub.cfg syntax
PATCH RESEND 1/1 grub-script-check tool to validate grub.cfg syntax
Hi,
Attached patch adds a new utility, grub-script-check that can be used to validate syntax of grub.cfg file generated using grub-mkconfig (or update-grub). I had sent this patch earlier based on experimental branch, but resending it now based on trunk.
It is also available as branches/grub-script-check.
Let me know your comments.
thanks,
Signature · 1 line
bvk.chaitanya
=== added file 'ChangeLog.grub-script-check'
ChangeLog.grub-script-check +9 -0
@@ -0,0 +1,9 @@ +2010-01-09 BVK Chaitanya <[email protected]> + + Added new tool, grub-scrit-check to verify grub.cfg syntax. + + * util/grub-script-check.c: grub-script-check tool. + * conf/common.rmk: Make rules for grub-script-check. + + +
=== modified file 'conf/common.rmk'
common.rmk +21 -0
@@ -88,11 +88,32 @@ bin_UTILITIES += grub-mkrelpath grub_mkrelpath_SOURCES = gnulib/progname.c util/grub-mkrelpath.c util/misc.c +# For grub-script-check. +bin_UTILITIES += grub-script-check +util/grub-script-check.c_DEPENDENCIES = grub_script_check_init.h +grub_script_check_SOURCES = gnulib/progname.c util/grub-script-check.c util/misc.c \ + script/main.c script/script.c script/function.c script/lexer.c \ + kern/handler.c kern/err.c kern/parser.c kern/list.c \ + kern/misc.c kern/env.c grub_script_check_init.c grub_script.tab.c + # For the parser. grub_script.tab.c grub_script.tab.h: script/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/parser.y DISTCLEANFILES += grub_script.tab.c grub_script.tab.h +# For grub-script-check. +grub_script_check_init.lst: geninit.sh $(filter-out grub_script_check_init.c,$(grub_script_check_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_script_check_init.lst + +grub_script_check_init.h: grub_script_check_init.lst $(filter-out grub_script_check_init.c,$(grub_script_check_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_script_check_init.h + +grub_script_check_init.c: grub_script_check_init.lst $(filter-out grub_script_check_init.c,$(grub_script_check_SOURCES)) geninit.sh + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_script_check_init.c + # For grub-probe. grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@
=== added file 'util/grub-script-check.c'
grub-script-check.c +254 -0
254 lines not on this page · raw message
Quoted 6 lines · BVK Chaitanya
Attached patch adds a new utility, grub-script-check that can be used to validate syntax of grub.cfg file generated using grub-mkconfig (or update-grub). I had sent this patch earlier based on experimental branch, but resending it now based on trunk.
This patch has been committed to trunk with some minor changes, as suggested by phcoder (in IRC).
Signature · 1 line
bvk.chaitanya