diff mbox series

[v3,1/2] package/linux-backports: fix kernel version check

Message ID 20201113130941.67928-1-ju.o@free.fr
State Accepted
Headers show
Series [v3,1/2] package/linux-backports: fix kernel version check | expand

Commit Message

Julien Olivain Nov. 13, 2020, 1:09 p.m. UTC
The commit 05fea6e4a60a38a797d9bacbf318a2cd7dbd435f "infra/pkg-kconfig:
do not rely on package's .config as a timestamp" broke the kernel
version check of this linux-backports package (it was no longer
executed). Since linux-4.19, the kernel's build system internally
touches its .config file, so it can no longer be used as a stamp file.
The stamp file defined in KCONFIG_STAMP_DOTCONFIG variable of
pkg-kconfig infra need to be used instead.

This commit fixes the kernel version check.

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
Changes v1 -> v3:
  - new patch to fix kernel version check
---
 package/linux-backports/linux-backports.mk | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Petr Vorel Nov. 13, 2020, 7:06 p.m. UTC | #1
Hi Julien,

> The commit 05fea6e4a60a38a797d9bacbf318a2cd7dbd435f "infra/pkg-kconfig:
> do not rely on package's .config as a timestamp" broke the kernel
> version check of this linux-backports package (it was no longer
> executed). Since linux-4.19, the kernel's build system internally
> touches its .config file, so it can no longer be used as a stamp file.
> The stamp file defined in KCONFIG_STAMP_DOTCONFIG variable of
> pkg-kconfig infra need to be used instead.

> This commit fixes the kernel version check.
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Tested-by: Petr Vorel <petr.vorel@gmail.com>

Kind regards,
Petr
Yann E. MORIN Nov. 13, 2020, 10:08 p.m. UTC | #2
Kulien, All,

On 2020-11-13 14:09 +0100, Julien Olivain spake thusly:
> The commit 05fea6e4a60a38a797d9bacbf318a2cd7dbd435f "infra/pkg-kconfig:
> do not rely on package's .config as a timestamp" broke the kernel
> version check of this linux-backports package (it was no longer
> executed). Since linux-4.19, the kernel's build system internally
> touches its .config file, so it can no longer be used as a stamp file.
> The stamp file defined in KCONFIG_STAMP_DOTCONFIG variable of
> pkg-kconfig infra need to be used instead.
> 
> This commit fixes the kernel version check.
> 
> Signed-off-by: Julien Olivain <ju.o@free.fr>

Applied to master, thanks! :-)

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v3:
>   - new patch to fix kernel version check
> ---
>  package/linux-backports/linux-backports.mk | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
> index 030d7a2864..1827ee18b7 100644
> --- a/package/linux-backports/linux-backports.mk
> +++ b/package/linux-backports/linux-backports.mk
> @@ -85,21 +85,24 @@ $(eval $(kconfig-package))
>  # not have been parsed yet, so the Linux build dir LINUX_DIR is not yet
>  # known. Thus, we use a "secondary expansion" so the rule is re-evaluated
>  # after all Makefiles are parsed, and thus at that time we will have the
> -# LINUX_DIR variable set to the proper value.
> +# LINUX_DIR variable set to the proper value. Moreover, since linux-4.19,
> +# the kernel's build system internally touches its .config file, so we
> +# can't use it as a stamp file. We use the LINUX_KCONFIG_STAMP_DOTCONFIG
> +# instead.
>  #
>  # Furthermore, we want to check the kernel version, since linux-backports
>  # only supports kernels >= 3.0. To avoid overriding linux-backports'
> -# .config rule defined in the kconfig-package infra, we use an
> -# intermediate stamp-file.
> +# KCONFIG_STAMP_DOTCONFIG rule defined in the kconfig-package infra, we
> +# use an intermediate stamp-file.
>  #
>  # Finally, it must also come after the call to kconfig-package, so we get
>  # LINUX_BACKPORTS_DIR properly defined (because the target part of the
>  # rule is not re-evaluated).
>  #
> -$(LINUX_BACKPORTS_DIR)/.config: $(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version
> +$(LINUX_BACKPORTS_DIR)/$(LINUX_BACKPORTS_KCONFIG_STAMP_DOTCONFIG): $(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version
>  
>  .SECONDEXPANSION:
> -$(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version: $$(LINUX_DIR)/.config
> +$(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version: $$(LINUX_DIR)/$$(LINUX_KCONFIG_STAMP_DOTCONFIG)
>  	$(Q)LINUX_VERSION_PROBED=$(LINUX_VERSION_PROBED); \
>  	if [ $${LINUX_VERSION_PROBED%%.*} -lt 3 ]; then \
>  		printf "Linux version '%s' is too old for linux-backports (needs 3.0 or later)\n" \
> -- 
> 2.28.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard Nov. 16, 2020, 2:49 p.m. UTC | #3
>>>>> "Julien" == Julien Olivain <ju.o@free.fr> writes:

 > The commit 05fea6e4a60a38a797d9bacbf318a2cd7dbd435f "infra/pkg-kconfig:
 > do not rely on package's .config as a timestamp" broke the kernel
 > version check of this linux-backports package (it was no longer
 > executed). Since linux-4.19, the kernel's build system internally
 > touches its .config file, so it can no longer be used as a stamp file.
 > The stamp file defined in KCONFIG_STAMP_DOTCONFIG variable of
 > pkg-kconfig infra need to be used instead.

 > This commit fixes the kernel version check.

 > Signed-off-by: Julien Olivain <ju.o@free.fr>
 > ---
 > Changes v1 -> v3:
 >   - new patch to fix kernel version check

Committed to 2020.02.x and 2020.08.x, thanks.
diff mbox series

Patch

diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
index 030d7a2864..1827ee18b7 100644
--- a/package/linux-backports/linux-backports.mk
+++ b/package/linux-backports/linux-backports.mk
@@ -85,21 +85,24 @@  $(eval $(kconfig-package))
 # not have been parsed yet, so the Linux build dir LINUX_DIR is not yet
 # known. Thus, we use a "secondary expansion" so the rule is re-evaluated
 # after all Makefiles are parsed, and thus at that time we will have the
-# LINUX_DIR variable set to the proper value.
+# LINUX_DIR variable set to the proper value. Moreover, since linux-4.19,
+# the kernel's build system internally touches its .config file, so we
+# can't use it as a stamp file. We use the LINUX_KCONFIG_STAMP_DOTCONFIG
+# instead.
 #
 # Furthermore, we want to check the kernel version, since linux-backports
 # only supports kernels >= 3.0. To avoid overriding linux-backports'
-# .config rule defined in the kconfig-package infra, we use an
-# intermediate stamp-file.
+# KCONFIG_STAMP_DOTCONFIG rule defined in the kconfig-package infra, we
+# use an intermediate stamp-file.
 #
 # Finally, it must also come after the call to kconfig-package, so we get
 # LINUX_BACKPORTS_DIR properly defined (because the target part of the
 # rule is not re-evaluated).
 #
-$(LINUX_BACKPORTS_DIR)/.config: $(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version
+$(LINUX_BACKPORTS_DIR)/$(LINUX_BACKPORTS_KCONFIG_STAMP_DOTCONFIG): $(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version
 
 .SECONDEXPANSION:
-$(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version: $$(LINUX_DIR)/.config
+$(LINUX_BACKPORTS_DIR)/.stamp_check_kernel_version: $$(LINUX_DIR)/$$(LINUX_KCONFIG_STAMP_DOTCONFIG)
 	$(Q)LINUX_VERSION_PROBED=$(LINUX_VERSION_PROBED); \
 	if [ $${LINUX_VERSION_PROBED%%.*} -lt 3 ]; then \
 		printf "Linux version '%s' is too old for linux-backports (needs 3.0 or later)\n" \