Skip to content

Commit

Permalink
[build] Fix hash comparison using newer versions of pesign
Browse files Browse the repository at this point in the history
Newer versions of pesign will include the input filename within the
output hash line (presumably in order to match the behaviour of
utilities such as md5sum and sha1sum).  This breaks our existing hash
comparison logic.

Fix by extracting only the hash value from the output line.

Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Jan 3, 2018
1 parent a19af6b commit f84f1d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Makefile
Expand Up @@ -22,6 +22,7 @@ RM := rm
GCAB := gcab
PESIGN := pesign
DIFF := diff
CUT := cut
BINUTILS_DIR := /usr
BFD_DIR := $(BINUTILS_DIR)
ZLIB_DIR := /usr
Expand Down Expand Up @@ -86,13 +87,13 @@ wimboot.%.unsigned : wimboot.%.elf efireloc Makefile
./efireloc $< $@

wimboot.%.unsigned.hash : wimboot.%.unsigned Makefile
$(PESIGN) -h -i $< > $@
$(PESIGN) -h -i $< | $(CUT) -d" " -f2- > $@

wimboot.%.efi : wimboot.%.unsigned Makefile
$(CP) $< $@

wimboot.%.efi.hash : wimboot.%.efi Makefile
$(PESIGN) -h -i $< > $@
$(PESIGN) -h -i $< | $(CUT) -d" " -f2- > $@

wimboot.% : wimboot.%.efi wimboot.%.efi.hash wimboot.%.unsigned.hash Makefile
$(DIFF) wimboot.$*.efi.hash wimboot.$*.unsigned.hash
Expand Down

0 comments on commit f84f1d7

Please sign in to comment.