support/check-kernel-headers: Fixup couldn't compile linux rc version
PATCH 1/1 support/check-kernel-headers: Fixup couldn't compile linux rc version
From: Guo Ren <[email protected]>
Sometimes we want to try newest kernel rc version, but the check-kernel-headers will prevent it. In package/linux-headers we use BR2_TOOLCHAIN_HEADERS_AT_LEAST for checking, I think AT_LEAST means "<" not "!=".
--- support/scripts/check-kernel-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/check-kernel-headers.sh +1 -1
@@ -23,7 +23,7 @@ int main(int argc __attribute__((unused)), char** argv __attribute__((unused))) { if((LINUX_VERSION_CODE & ~0xFF) - != KERNEL_VERSION(${HDR_M},${HDR_m},0)) + < KERNEL_VERSION(${HDR_M},${HDR_m},0)) { printf("Incorrect selection of kernel headers: "); printf("expected %d.%d.x, got %d.%d.x\n", ${HDR_M}, ${HDR_m},
Signature · 1 line
2.7.4
PATCH 1/1 support/check-kernel-headers: Fixup couldn't compile linux rc version
Hi Guo,
Quoted 4 lines · guoren at kernel.org
From: Guo Ren <[email protected]>
Sometimes we want to try newest kernel rc version, but the check-kernel-headers will prevent it.
It would indeed be good if we would be able to use newer kernel headers without
requiring an update of Buildroot.
Quoted 3 lines
In package/linux-headers we
useBR2_TOOLCHAIN_HEADERS_AT_LEASTfor checking, I thinkAT_LEASTmeans "<" not "!=".
However, I think we should not treat it as "at least" in general, but only for
the "newer" case. In other words, I think we should add BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_NEWER (and the equivalent in toolchain-external) which selects BR2_TOOLCHAIN_HEADERS_NEWER, and make the check > 5.0 (rather than == something) in that case.
It's a bigger change though.
Regards,
Arnout
Quoted 20 lines
Signed-off-by Guo Ren <[email protected]>--- support/scripts/check-kernel-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/scripts/check-kernel-headers.sh +1
-1@@ -23,7 +23,7 @@ int main(int argc __attribute__((unused)), char** argv __attribute__((unused))) { if((LINUX_VERSION_CODE & ~0xFF) - != KERNEL_VERSION(${HDR_M},${HDR_m},0)) + < KERNEL_VERSION(${HDR_M},${HDR_m},0)) { printf("Incorrect selection of kernel headers: "); printf("expected %d.%d.x, got %d.%d.x\n", ${HDR_M}, ${HDR_m},
PATCH 1/1 support/check-kernel-headers: Fixup couldn't compile linux rc version
Thx Arnout,
Quoted 15 lines · Arnout Vandecappelle
Hi Guo,
Quoted 4 lines · guoren at kernel.org
From: Guo Ren <[email protected]>
Sometimes we want to try newest kernel rc version, but the check-kernel-headers will prevent it.
It would indeed be good if we would be able to use newer kernel headers without
requiring an update of Buildroot.Quoted 3 lines
In package/linux-headers we
useBR2_TOOLCHAIN_HEADERS_AT_LEASTfor checking, I thinkAT_LEASTmeans "<" not "!=".
Quoted 7 lines
However, I think we should not treat it as "at least" in general, but only for
the "newer" case. In other words, I think we should addBR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_NEWER(and the equivalent in toolchain-external) which selectsBR2_TOOLCHAIN_HEADERS_NEWER, and make the check > 5.0 (rather than == something) in that case.It's a bigger change though.
In linux-headers.mk:
ifeq ($(BR2_KERNEL_HEADERS_VERSION)$(BR2_KERNEL_HEADERS_AS_KERNEL)$(BR2_KERNEL_HEADERS_CUSTOM_TARBALL)$(BR2_KERNEL_HEADERS_CUSTOM_GIT),y) define LINUX_HEADERS_CHECK_VERSION
$(call check_kernel_headers_version,\ $(STAGING_DIR),\ $(call qstrip,$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)))
endefLINUX_HEADERS_POST_INSTALL_STAGING_HOOKS += LINUX_HEADERS_CHECK_VERSION endif
If we use BR2_KERNEL_HEADERS_AS_KERNEL, I think it's no necessary to check _AT_LEAST. Because user has specified the linux version and he want the version without more checking.
Best Regards
Guo Ren