[Skiboot] [PATCH] Makefile: Use implict rules for .xz and .stb

Stewart Smith stewart at linux.ibm.com
Wed Jul 17 15:23:24 AEST 2019


"Oliver O'Halloran" <oohall at gmail.com> writes:
> Currently we use explicit rules to make:
>
> 	skiboot.lid.xz
> 	skiboot.lid.xz.stb
> 	skiboot.lid.stb
>
> There's no real need to use an explicit rule here and converting them
> to use an implicit rule allows you to do this:
>
> $ touch /tmp/test
> $ make /tmp/test.stb
>         [STB-DEVELOPMENT-SIGNED-CONTAINER] /tmp/test.stb
>
> Or slightly more usefully:
>
> $ make zImage.epapr.stb
>         [STB-DEVELOPMENT-SIGNED-CONTAINER] zImage.epapr.stb
>
> Do it for the .xz rule too since it's the same and I always forget that
> embedded XZ chokes unless you use the 32bit crc.
>
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>
> ---
>  Makefile.main  | 9 ---------
>  Makefile.rules | 6 ++++++
>  2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/Makefile.main b/Makefile.main
> index fac6e4487460..2997b6ebc305 100644
> --- a/Makefile.main
> +++ b/Makefile.main
> @@ -258,18 +258,9 @@ ALL_OBJS = $(OBJS) version.o
>  ALL_OBJS_1 = $(TARGET).tmp.a asm/dummy_map.o
>  ALL_OBJS_2 = $(TARGET).tmp.a asm/real_map.o
>  
> -$(TARGET).lid.xz: $(TARGET).lid
> -	$(call Q,XZ, cat $^ | xz -9 -C crc32 > $@, $@)
> -
>  $(TARGET).lid: $(TARGET).elf
>  	$(call Q,OBJCOPY, $(OBJCOPY) -O binary -S $^ $@, $@)
>  
> -$(TARGET).lid.stb: $(TARGET).lid libstb/create-container
> -	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
> -
> -$(TARGET).lid.xz.stb: $(TARGET).lid.xz libstb/create-container
> -	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
> -
>  $(TARGET).tmp.a: $(ALL_OBJS)
>  	@rm -f $(TARGET).tmp.a
>  	$(call Q,AR, $(AR) rcsTPD $@ $(ALL_OBJS), $@)
> diff --git a/Makefile.rules b/Makefile.rules
> index 11b0e5ee8a19..6b35dbafbd9e 100644
> --- a/Makefile.rules
> +++ b/Makefile.rules
> @@ -76,3 +76,9 @@ endif
>  
>  %.map: %.elf
>  	$(call Q,NM, $(NM) --synthetic -n $< | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $@, $@)
> +
> +%.xz: %
> +	$(call Q,XZ, cat $^ | xz -9 -C crc32 > $@, $@)
> +
> +%.stb: % libstb/create-container
> +	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)

Note that some firmware components do care about that PAYLOAD there as
it's passed through as a Label to be stored in the secure boot wrapper.

Note that they also just suddenly started caring about it one day and
didn't like, tell anybody or anything.

Anyway,

Reviewed-by: Stewart Smith <stewart at linux.ibm.com>

-- 
Stewart Smith
OPAL Architect, IBM.


More information about the Skiboot mailing list