Skip to contentSkip to conversation

utils/genrandconfig: handle BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y

PATCH In review Thomas Petazzoni via buildroot 2 participants 5 messages Sep 15, 2024 – Nov 12, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 utils/genrandconfig: handle BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y

When BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y, BR2_LINUX_KERNEL_IMAGE_TARGET_NAME is supposed to be non-empty. But in the context of genraconfig, we don't know to what value BR2_LINUX_KERNEL_IMAGE_TARGET_NAME can be set, so let's avoid cases where BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y. By dropping this option, kconfig will revert back to the default image format for the selected architecture.

Fixes:

http://autobuild.buildroot.net/results/1d104a051c83bb31e98565369a2ec7badfa21eca/

---
 utils/genrandconfig | 4 ++++
 1 file changed, 4 insertions(+)
utils/genrandconfig +4 -0
index 282a9ebdea..0698cc5ff0 100755
@@ -248,6 +248,10 @@ async def fixup_config(sysinfo, configfile):
             configlines.remove('BR2_LINUX_KERNEL_SIMPLEIMAGE=y\n')
             configlines.append('BR2_LINUX_KERNEL_VMLINUX=y\n')
 
+    if 'BR2_LINUX_KERNEL=y\n' in configlines and \
+       'BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n' in configlines:
+        configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')
+
     if 'BR2_LINUX_KERNEL_EXT_AUFS=y\n' in configlines and \
        'BR2_LINUX_KERNEL_EXT_AUFS_VERSION=""\n' in configlines:
         configlines.remove('BR2_LINUX_KERNEL_EXT_AUFS=y\n')
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 linux: handle empty BR2_LINUX_KERNEL_IMAGE_TARGET_NAME situation

When BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y, BR2_LINUX_KERNEL_IMAGE_TARGET_NAME should be set or the build will fail. Instead of miserably failing the build, let's catch this earlier and warn the user in a more informative way.

Related to:

http://autobuild.buildroot.net/results/1d104a051c83bb31e98565369a2ec7badfa21eca/

---
 linux/linux.mk | 4 ++++
 1 file changed, 4 insertions(+)
linux/linux.mk +4 -0
index 16d9f19470..b52f07a0cc 100644
@@ -644,6 +644,10 @@ $(error No kernel device tree source specified, check your \
 	BR2_LINUX_KERNEL_INTREE_DTS_NAME / BR2_LINUX_KERNEL_CUSTOM_DTS_PATH settings)
 endif
 
+ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM):$(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_TARGET_NAME)),y:)
+$(error No image name specified in BR2_LINUX_KERNEL_IMAGE_TARGET_NAME despite BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y)
+endif
+
 endif # BR_BUILDING
 
 $(eval $(kconfig-package))
Signature · 6 lines
2.46.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] linux: handle empty BR2_LINUX_KERNEL_IMAGE_TARGET_NAME situation

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

When BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y, BR2_LINUX_KERNEL_IMAGE_TARGET_NAME should be set or the build will fail. Instead of miserably failing the build, let's catch this earlier and warn the user in a more informative way.

Quoted 5 lines

Related to:

http://autobuild.buildroot.net/results/1d104a051c83bb31e98565369a2ec7badfa21eca/

Committed to 2024.02.x and 2024.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 8 lines · On Sun, 15 Sep 2024 14:37:27 +0200 Thomas Petazzoni via buildroot…

When BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y, BR2_LINUX_KERNEL_IMAGE_TARGET_NAME is supposed to be non-empty. But in the context of genraconfig, we don't know to what value BR2_LINUX_KERNEL_IMAGE_TARGET_NAME can be set, so let's avoid cases where BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y. By dropping this option, kconfig will revert back to the default image format for the selected architecture.

Quoted 8 lines

Fixes:

http://autobuild.buildroot.net/results/1d104a051c83bb31e98565369a2ec7badfa21eca/

---
 utils/genrandconfig | 4 ++++
 1 file changed, 4 insertions(+)

Both applied!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni via buildroot <[email protected]> writes:

When BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y, BR2_LINUX_KERNEL_IMAGE_TARGET_NAME is supposed to be non-empty. But in the context of genraconfig, we don't know to what value BR2_LINUX_KERNEL_IMAGE_TARGET_NAME can be set, so let's avoid cases where BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y. By dropping this option, kconfig will revert back to the default image format for the selected architecture.

Quoted 5 lines

Fixes:

http://autobuild.buildroot.net/results/1d104a051c83bb31e98565369a2ec7badfa21eca/

Committed to 2024.02.x and 2024.08.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot