Message ID | 20190312150538.11449-1-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] Makefile: SWDESCRIPTION sanity check | expand |
On 12/03/19 16:05, Christian Storm wrote: > Introduce a sanity check for a set CONFIG_SETSWDESCRIPTION but an empty > CONFIG_SWDESCRIPTION. This would happily compile but result in SWUpdate > not being able to find any configuration file in an .swu. > Hence, error out in such a condition. > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > Makefile | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index c9facdc..1589bf6 100644 > --- a/Makefile > +++ b/Makefile > @@ -377,6 +377,13 @@ shared-dirs := $(shareds-y) > shared-libs := $(patsubst %,%/built-in.o, $(shareds-y)) > shared-all := $(shared-libs) > > +PHONY += cfg-sanity-check > +cfg-sanity-check: > + @if [ "x$(CONFIG_SETSWDESCRIPTION)" = "xy" -a -z "$(patsubst "%",%,$(strip $(CONFIG_SWDESCRIPTION)))" ]; then \ > + echo "ERROR: CONFIG_SETSWDESCRIPTION set but not CONFIG_SWDESCRIPTION"; \ > + exit 1; \ > + fi > + > all: swupdate ${tools-bins} ${lua_swupdate} > > # Do modpost on a prelinked vmlinux. The finally linked vmlinux has > @@ -426,7 +433,7 @@ cmd_strip = $(STRIP) -s --remove-section=.note --remove-section=.comment \ > $@_unstripped -o $@; chmod a+x $@ > endif > > -swupdate: swupdate_unstripped > +swupdate: cfg-sanity-check swupdate_unstripped > $(call cmd,strip) > > ${tools-bins}: ${tools-objs} ${swupdate-libs} FORCE > Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/Makefile b/Makefile index c9facdc..1589bf6 100644 --- a/Makefile +++ b/Makefile @@ -377,6 +377,13 @@ shared-dirs := $(shareds-y) shared-libs := $(patsubst %,%/built-in.o, $(shareds-y)) shared-all := $(shared-libs) +PHONY += cfg-sanity-check +cfg-sanity-check: + @if [ "x$(CONFIG_SETSWDESCRIPTION)" = "xy" -a -z "$(patsubst "%",%,$(strip $(CONFIG_SWDESCRIPTION)))" ]; then \ + echo "ERROR: CONFIG_SETSWDESCRIPTION set but not CONFIG_SWDESCRIPTION"; \ + exit 1; \ + fi + all: swupdate ${tools-bins} ${lua_swupdate} # Do modpost on a prelinked vmlinux. The finally linked vmlinux has @@ -426,7 +433,7 @@ cmd_strip = $(STRIP) -s --remove-section=.note --remove-section=.comment \ $@_unstripped -o $@; chmod a+x $@ endif -swupdate: swupdate_unstripped +swupdate: cfg-sanity-check swupdate_unstripped $(call cmd,strip) ${tools-bins}: ${tools-objs} ${swupdate-libs} FORCE
Introduce a sanity check for a set CONFIG_SETSWDESCRIPTION but an empty CONFIG_SWDESCRIPTION. This would happily compile but result in SWUpdate not being able to find any configuration file in an .swu. Hence, error out in such a condition. Signed-off-by: Christian Storm <christian.storm@siemens.com> --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)