[PATCH/RFC] kernel-defaults.mk: get rid of BuildID

Petr Štetiar ynezz at true.cz
Mon Apr 4 23:28:59 PDT 2022


Daniel Golle <daniel at makrotopia.org> [2022-04-05 02:14:09]:

Hi,

thanks a lot for your and Paul's reproducible efforts!

> diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
> index 1e82f7d739..9c8d5fbe97 100644
> --- a/include/kernel-defaults.mk
> +++ b/include/kernel-defaults.mk
> @@ -46,6 +46,7 @@ else
>  	if [ -d $(LINUX_DIR)/user_headers ]; then \
>  		rm -rf $(LINUX_DIR)/user_headers; \
>  	fi

BTW we likely have LINUX_VERMAGIC md5 hash generated over kernel config
symbols:

 grep '=[ym]' $(LINUX_DIR)/.config.set | LC_ALL=C sort | $(MKHASH) md5 > $(LINUX_DIR)/.vermagic
 LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null))

So it makes me wonder if we could use something like this instead (untested):

> +	$(SED) -i $(LINUX_DIR)/Makefile  -e 's/--build-id=.*/--build-id=none/g'
+	$(SED) -i $(LINUX_DIR)/Makefile  -e 's/--build-id=.*/--build-id=0x$(LINUX_VERMAGIC)/g'

>From ld(1) `--build-id=style` help:

 or "0x hexstring " to use a chosen bit string specified as an even number of
 hexadecimal digits ("-" and ":" characters between digit pairs are ignored).

Having some kind of build ID is sometimes handy, for example during troubleshooting.

Cheers,

Petr



More information about the openwrt-devel mailing list