Skip to contentSkip to conversation

utils/genrandconfig: add missing newline

PATCH Applied Thomas Petazzoni via buildroot 1 participant 7 messages Oct 19 – Oct 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 utils/genrandconfig: add missing newline

The line:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')

would fail with:

Traceback (most recent call last):
File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 650, in <module>
ret = asyncio.run(gen_config(args))
File "/usr/lib64/python3.14/asyncio/runners.py", line 205, in run

    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/runners.py", line 128, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/base_events.py", line 720, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 556, in gen_config
    if await fixup_config(sysinfo, configfile):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 255, in fixup_config
    configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ValueError: list.remove(x): x not in list

because all configlines end with a newline, so this needs to be fixed to:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n')

Fixes b07d21ab984d10cbabeb186fbd47d446e027c03b ("utils/genrandconfig: handle BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y")
---
 utils/genrandconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/genrandconfig +1 -1
index 8437d6342d..597602f257 100755
@@ -252,7 +252,7 @@ async def fixup_config(sysinfo, configfile):
 
     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')
+        configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n')
 
     if 'BR2_PACKAGE_LINUX_BACKPORTS=y\n' in configlines and \
        'BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG=y\n' in configlines and \
Signature · 6 lines
2.56.0

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

PATCH 2/3 utils/genrandconfig: do not select fmlib or fmc

The fmlib package contains kernel modules that can only build with NXP-provided kernel sources, as they need the fm_ioctls.h header which doesn't exist upstream. Therefore, there is absolutely no chance for fmlib to build in our autobuilders as they will always build upstream Linux kernel source code.

This commit updates genrandconfig to ensure that we don't generate a configuration that includes fmlib. This requires also disabling fmc, which selects fmlib.

---
 utils/genrandconfig | 6 ++++++
 1 file changed, 6 insertions(+)
utils/genrandconfig +6 -0
index 597602f257..5cea529354 100755
@@ -502,6 +502,12 @@ async def fixup_config(sysinfo, configfile):
         if optstr in configlines:
             configlines.remove(optstr)
 
+    # fmlib and fmc cannot build without NXP-provided kernel sources
+    for opt in ["FMLIB", "FMC"]:
+        optstr = 'BR2_PACKAGE_%s=y\n' % opt
+        if optstr in configlines:
+            configlines.remove(optstr)
+
     with open(configfile, "w+") as configf:
         configf.writelines(configlines)
 
Signature · 6 lines
2.56.0

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

Re: [Buildroot] [PATCH 2/3] utils/genrandconfig: do not select fmlib or fmc

In reply of:

Quoted 6 lines

The fmlib package contains kernel modules that can only build with NXP-provided kernel sources, as they need the fm_ioctls.h header which doesn't exist upstream. Therefore, there is absolutely no chance for fmlib to build in our autobuilders as they will always build upstream Linux kernel source code.

Quoted 6 lines

This commit updates genrandconfig to ensure that we don't generate a configuration that includes fmlib. This requires also disabling fmc, which selects fmlib.

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 11 lines
---
 utils/genrandconfig | 6 ++++++
 1 file changed, 6 insertions(+)
utils/genrandconfig +0 -0
index 597602f257..5cea529354 100755
@@ -502,6 +502,12 @@ async def fixup_config(sysinfo, configfile):
         if optstr in configlines:
             configlines.remove(optstr)

utils/genrandconfig async def fixup_config(sysinfo, configfile): · line 513

Quoted 10 lines
utils/genrandconfig +6 -0
 
+    # fmlib and fmc cannot build without NXP-provided kernel sources
+    for opt in ["FMLIB", "FMC"]:
+        optstr = 'BR2_PACKAGE_%s=y\n' % opt
+        if optstr in configlines:
+            configlines.remove(optstr)
+
     with open(configfile, "w+") as configf:
         configf.writelines(configlines)
 

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

#3 lore raw

PATCH 3/3 package/fmlib: add warning about the need for NXP kernel

In reply to Thomas Petazzoni via buildroot

Building fmlib, either on PowerPC or ARM64 against an upstream kernel will fail to build as the kernel modules include fm_ioctls.h, which doesn't exist upstream. fmlib will only build with NXP-provided Linux kernel sources. This commit mentions this in the Config.in help text.

---
 package/fmlib/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/fmlib/Config.in +3 -0
index 459d5bf102..17ab47ec08 100644
@@ -13,6 +13,9 @@ config BR2_PACKAGE_FMLIB
 	  configure driver parameters and PCD (parse - classify -
 	  distribute) rules.
 
+	  This package builds kernel modules that need header files
+	  only available in NXP-provided Linux kernel sources.
+
 	  https://github.com/nxp-qoriq/fmlib
 
 if BR2_PACKAGE_FMLIB
Signature · 6 lines
2.56.0

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

Re: [Buildroot] [PATCH 3/3] package/fmlib: add warning about the need for NXP kernel

In reply of:

Quoted 6 lines

Building fmlib, either on PowerPC or ARM64 against an upstream kernel will fail to build as the kernel modules include fm_ioctls.h, which doesn't exist upstream. fmlib will only build with NXP-provided Linux kernel sources. This commit mentions this in the Config.in help text.

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 9 lines
---
 package/fmlib/Config.in | 3 +++
 1 file changed, 3 insertions(+)
package/fmlib/Config.in +0 -0
index 459d5bf102..17ab47ec08 100644

package/fmlib/Config.in config BR2_PACKAGE_FMLIB · line 21

Quoted 9 lines
package/fmlib/Config.in +3 -0
@@ -13,6 +13,9 @@ config BR2_PACKAGE_FMLIB
 	  configure driver parameters and PCD (parse - classify -
 	  distribute) rules.
 
+	  This package builds kernel modules that need header files
+	  only available in NXP-provided Linux kernel sources.
+
 	  https://github.com/nxp-qoriq/fmlib
 
 if BR2_PACKAGE_FMLIB

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

#5 lore raw
In reply to Thomas Petazzoni via buildroot
Quoted 30 lines · Thomas Petazzoni via buildroot

The line:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')

would fail with:

Traceback (most recent call last):
File "/home/thomas/projets/buildroot/./utils/genrandconfig", line
650, in <module>
ret = asyncio.run(gen_config(args))
File "/usr/lib64/python3.14/asyncio/runners.py", line 205, in run

    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/runners.py", line 128, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/base_events.py", line 720, in 
run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^

File "/home/thomas/projets/buildroot/./utils/genrandconfig", line
556, in gen_config
if await fixup_config(sysinfo, configfile):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thomas/projets/buildroot/./utils/genrandconfig", line
255, in fixup_config

    configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ValueError: list.remove(x): x not in list

Quoted 7 lines

because all configlines end with a newline, so this needs to be fixed to:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n')

Fixes b07d21ab984d10cbabeb186fbd47d446e027c03b ("utils/genrandconfig: handle BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y")

Series applied to master, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
In reply to Thomas Petazzoni via buildroot

In reply of:

Quoted 26 lines

The line:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')

would fail with:

Traceback (most recent call last):
File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 650, in <module>
ret = asyncio.run(gen_config(args))
File "/usr/lib64/python3.14/asyncio/runners.py", line 205, in run

    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/runners.py", line 128, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib64/python3.14/asyncio/base_events.py", line 720, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 556, in gen_config
    if await fixup_config(sysinfo, configfile):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/thomas/projets/buildroot/./utils/genrandconfig", line 255, in fixup_config
    configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y')
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ValueError: list.remove(x): x not in list

Quoted 7 lines

because all configlines end with a newline, so this needs to be fixed to:

configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n')

Fixes b07d21ab984d10cbabeb186fbd47d446e027c03b ("utils/genrandconfig: handle BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y")

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 9 lines
---
 utils/genrandconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
utils/genrandconfig +0 -0
index 8437d6342d..597602f257 100755

utils/genrandconfig async def fixup_config(sysinfo, configfile): · line 258

Quoted 8 lines
utils/genrandconfig +1 -1
@@ -252,7 +252,7 @@ async def fixup_config(sysinfo, configfile):
 
     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')
+        configlines.remove('BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y\n')
 
     if 'BR2_PACKAGE_LINUX_BACKPORTS=y\n' in configlines and \
        'BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG=y\n' in configlines and \

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