0032-x86-stop-relying-on-hexdump-for-image-build-signature.patch 978 B

123456789101112131415161718192021222324
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Sun, 3 Jul 2016 19:15:49 +0200
  3. Subject: x86: stop relying on hexdump for image build signature
  4. Use perl to generate random number instead.
  5. See https://github.com/freifunk-gluon/gluon/issues/811
  6. Signed-off-by: Felix Fietkau <nbd@nbd.name>
  7. Backport of LEDE d5ee23ee275fcd6550b0051de59706cc928cdac8
  8. diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
  9. index e7e02f1..6f64eba 100644
  10. --- a/target/linux/x86/image/Makefile
  11. +++ b/target/linux/x86/image/Makefile
  12. @@ -40,7 +40,7 @@ ifneq ($(GRUB_TERMINALS),)
  13. GRUB_TERMINAL_CONFIG := terminal_input $(GRUB_TERMINALS); terminal_output $(GRUB_TERMINALS)
  14. endif
  15. -SIGNATURE:=$(shell dd if=/dev/urandom bs=4 count=1 2>/dev/null | hexdump -v -e '"%08x"')
  16. +SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0xFFFFFFFF))')
  17. ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME))
  18. ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02)