How to work with Linux/Yocto/Bitbake and patching a service?
Hi!
Overview
I´m trying to change a startup "*.service" file by using patching in a Yocto project (GDP), but I have been running in to quite a lot of issues with this which makes me belive that this might not be the correct way to work with ".service" files.
I have created my own layer:
/home/vagrant/GDP/genivi-dev-platform/meta-dev/recipes-dev-hmi/genivi-dev-platform-hmi/gdp-new-hmi.bbappend
gdp-new-hmi.bbappend:
-------------------------------------------------------------
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-removed-auto-start-hmi.patch"
-------------------------------------------------------------
My patch
/home/vagrant/GDP/genivi-dev-platform/meta-dev/recipes-dev-hmi/genivi-dev-platform-hmi/gdp-new-hmi/0001-removed-auto-start-hmi.patch
0001-removed-auto-start-hmi.patch:
-----------------------------------------------------------------
Subject: [PATCH] removed auto start hmi
---
gdp-new-hmi.service | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gdp-new-hmi.service b/gdp-new-hmi.service
index 2b030b2..94850c8 100644
--- a/gdp-new-hmi.service
+++ b/gdp-new-hmi.service
@@ -5,9 +5,9 @@ After=weston.service
[Service]
Environment=LD_PRELOAD=/usr/lib/libEGL.so
-ExecStart=/opt/genivi-11-hmi/bin/genivi-11-hmi -platform wayland
-Restart=always
-RestartSec=5
+#ExecStart=/opt/genivi-11-hmi/bin/genivi-11-hmi -platform wayland
+#Restart=always
+#RestartSec=5
[Install]
WantedBy=default.target
--
1.9.1
-----------------------------------------------------
When running bitbake "gdp-new-hmi" i get below error:
-------------------------------------------------------
ERROR: gdp-new-hmi-1.0-r0 do_patch: Command Error: 'quilt --quiltrc /home/vagrant/GDP/genivi-dev-platform/gdp-src-build/tmp/sysroots/x86_64-linux/etc/quiltrc push' exited with 1 Output:
Applying patch 0001-removed-auto-start-hmi.patch
can't find file to patch at input line 13
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From a91e616fd972f26b80bc8210431e3df111cbc9db Mon Sep 17 00:00:00 2001
|From: Johans <johan.strand@melcogot.com>
|Date: Wed, 1 Feb 2017 14:54:45 +0000
|Subject: [PATCH] removed auto start hmi
|
|---
| gdp-new-hmi.service | 6 +++---
| 1 file changed, 3 insertions(+), 3 deletions(-)
|diff --git a/gdp-new-hmi.service b/gdp-new-hmi.service
|index 2b030b2..94850c8 100644
|--- a/gdp-new-hmi.service
|+++ b/gdp-new-hmi.service
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored
Patch 0001-removed-auto-start-hmi.patch does not apply (enforce with -f)
ERROR: gdp-new-hmi-1.0-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/vagrant/GDP/genivi-dev-platform/gdp-src-build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/gdp-new-hmi/1.0-r0/temp/log.do_patch.5933
ERROR: Task 1 (/home/vagrant/GDP/genivi-dev-platform/gdp-src-build/../meta-genivi-dev/meta-genivi-dev/recipes-dev-hmi/genivi-dev-platform-hmi/gdp-new-hmi.bb, do_patch) failed with exit code '1'
--------------------------------------------------------------------------------------------
So far I have found that the "$S" variable points to "/home/vagrant/GDP/genivi-dev-platform/gdp-src-build/tmp/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/gdp-new-hmi/1.0-r0/git" and that if I, for testing purpose, move the "gdp-new-hmi.service" file to the git-folder, the Diff finds the source (but I get other issues offcourse). In patching examples I have only seen it beeing done on source files and they appear always to be in a folder structure above the git-folder or other folder.
Note that I have tried changing the path in the path-file to "a/../gdp-new-hmi.service", redefining $S and alot of other things, without any success.
So now to the questions:
Question 1
What is the correct way to work with "*.service" files in a Linux/Yocto project? Are you supposed to be able to patch them?
Question 2
If patching a service file is a normal use-case. Do anyone have any suggestion on what I might be doing wrong?
Thank you in advance!
Last edited by scritz; 02-03-2017 at 04:20 AM.
|