Modify /etc/ .conf file in recipe


In our product we need to hide the mouse cursor. This is done modifying the file /etc/default/xserver-nodm in rootfs. I’ve created a custom recipe to modify the file but I’m getting errors:

ERROR: nocursor-1.0-r0 do_patch: Command Error: 'quilt --quiltrc /home/joao/projetos/mT100_imx7_2.8/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/nocursor/1.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0  Output:
Applying patch no-cursor.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|--- /etc/default/xserver-nodm	2018-10-27 15:10:21.619382641 -0300
|+++ /etc/default/xserver-nodm_new	2018-10-27 15:03:52.887492399 -0300
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
Patch no-cursor.patch does not apply (enforce with -f)
ERROR: nocursor-1.0-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/joao/projetos/mT100_imx7_2.8/build/tmp-glibc/work/armv7at2hf-neon-angstrom-linux-gnueabi/nocursor/1.0-r0/temp/log.do_patch.7314
ERROR: Task (/home/joao/projetos/mT100_imx7_2.8/build/../myTapp-OS/oe_core/meta-mytapp/recipes-mytapp/recipes-core/ failed with exit code '1'



SRC_URI += "file://no-cursor.patch"


--- /etc/default/xserver-nodm	2018-10-27 15:10:21.619382641 -0300
+++ /etc/default/xserver-nodm_new	2018-10-27 15:03:52.887492399 -0300
@@ -2,6 +2,6 @@
-ARGS=" -br -pn   "
+ARGS=" -br -pn -nocursor  "

I’m quite sure the problem is the patch file no-cursor.path. How correctly create the patch?

Best regards

I’m not sure how exactly you imagined this to work. But patch files in OpenEmbedded recipes are usually meant to be applied against source files from resp. recipe. However, your patch file seems to be targeting some config file on the root file system! Furthermore, patch files are usually created against two different top-level folder trees e.g. called a/etc/… and b/etc/… while yours has different names! Anyway, as a first step you would need to find out where exactly that file came from in the first place. Then one would write an append to that recipe. Makes sense?

Hi Marcel,

You are right, my patch makes no sense.
Researching the web I found a post configuring through packageconfig flag:

PACKAGECONFIG_pn-xserver-nodm-init = "nocursor"

I also found the recipe that implements the packageconfig:

     cat ./openembedded-core/meta/recipes-graphics/x11-common/

PACKAGECONFIG[nocursor] = ""
NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"

But when i add PACKAGECONFIG_pn-xserver-nodm-init = “nocursor” to my recipe does not effect.

Any ideias?


I found the solution creating xserver-nodm-init_%.bbappend


PACKAGECONFIG_pn-xserver-nodm-init = "nocursor"

Perfect, thanks for letting us know.