Skip to contentSkip to conversation

kernel-module-split.bbclass: support muti-lines in module conf

PATCH In review Ming Liu 2 participants 5 messages Oct 1, 2025 – Nov 23, 2025

lore
Share & tools
lore

Ming Liu

author
#0 lore raw

PATCH 1/1 kernel-module-split.bbclass: support muti-lines in module conf

The expanded bitbake variables are raw strings so it does not support writting multiple lines to a kernel module conf, add the support by decoding it with 'unicode-escape'.

---
 meta/classes-recipe/kernel-module-split.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/kernel-module-split.bbclass +1 -1
index 75ed696b72..c289808404 100644
@@ -131,7 +131,7 @@ python split_kernel_module_packages () {
         if modconf and basename in modconflist:
             os.makedirs(os.path.dirname(name), exist_ok=True)
             with open(name, 'w') as f:
-                f.write("%s\n" % modconf)
+                f.write("%s\n" % modconf.encode().decode('unicode-escape'))
         elif modconf:
             bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
         # If the .conf file exits, then add it to FILES:* and CONFFILES:*.
Signature · 1 line
2.43.0
#1 lore raw

meta/classes-recipe/kernel-module-split.bbclass python split_kernel_module_packages () { · line 134

Quoted 6 lines · Ming Liu via lists.openembedded.org

The expanded bitbake variables are raw strings so it does not support writting multiple lines to a kernel module conf, add the support by decoding it with 'unicode-escape'.

meta/classes-recipe/kernel-module-split.bbclass +1 -1
-                f.write("%s\n" % modconf)
+                f.write("%s\n" % modconf.encode().decode('unicode-escape'))

Can you provide an example of such a variable which causes the issue?

Alex

author
#2 lore raw
Quoted 1 line

Can you provide an example of such a variable which causes the issue?

Sure, when we have the following settings:

```
KERNEL_MODULE_AUTOLOAD = "mod1"
module_conf_mod1 = "line1\nline2\nline3"
```

// MIng

Alexander Kanavin <[email protected]> 於 2025年10月1日 週三 上午11:49寫道:

Quoted 14 lines

Review

Quoted 6 lines · Ming Liu via lists.openembedded.org

The expanded bitbake variables are raw strings so it does not support writting multiple lines to a kernel module conf, add the support by decoding it with 'unicode-escape'.

(quoted diff) +1 -1
-                f.write("%s\n" % modconf)
+                f.write("%s\n" %

modconf.encode().decode('unicode-escape'))

Can you provide an example of such a variable which causes the issue?

Alex

author
#3 lore raw

Hi, Alexander/maintainers:

Could you please kindly help me review this MR? It's pending for a while.

the best.
thank you

Ming Liu <[email protected]> 於 2025年10月1日 週三 下午12:02寫道:

Quoted 28 lines
Quoted 1 line

Can you provide an example of such a variable which causes the issue?

Sure, when we have the following settings:

```
KERNEL_MODULE_AUTOLOAD = "mod1"
module_conf_mod1 = "line1\nline2\nline3"
```

// MIng

Alexander Kanavin <[email protected]> 於 2025年10月1日 週三 上午11:49寫道:

Quoted 14 lines

Review

Quoted 6 lines · Ming Liu via lists.openembedded.org

The expanded bitbake variables are raw strings so it does not support writting multiple lines to a kernel module conf, add the support by decoding it with 'unicode-escape'.

(quoted diff) +1 -1
-                f.write("%s\n" % modconf)
+                f.write("%s\n" %

modconf.encode().decode('unicode-escape'))

Can you provide an example of such a variable which causes the issue?

Alex