LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2017, 04:18 AM   #1
scritz
LQ Newbie
 
Registered: Feb 2017
Posts: 2

Rep: Reputation: Disabled
How to work with Linux/Yocto/Bitbake and patching a service?


Hi!

Overview
Im 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.
 
Old 02-06-2017, 01:09 AM   #2
scritz
LQ Newbie
 
Registered: Feb 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Update:

The patching issue have now been resolved. This was done by using "patchdir" parameter in the .bbappend which then accurately points the path for the patch.

gdp-new-hmi.bbappend:
-------------------------------------------------------------
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-removed-auto-start-hmi.patch;patchdir="path-to-patchfile-and-service""
-------------------------------------------------------------


I still, how ever, would like to know if there are any best practices for working with services?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Openembedded/yocto bitbake with gcc 4.8.2 crashes at do_compile elfutils 153rd Linux - Newbie 0 03-07-2015 01:45 PM
Yocto and Linux markcgriffiths Linux - Software 1 04-04-2014 08:02 PM
[SOLVED] What is the easiest way to upgrade a kernel manually ? Patching doesn't work. H_TeXMeX_H Linux - Kernel 2 02-22-2013 04:36 AM
iptables -m layer7 - doesn't work (after patching) ddaas Linux - Security 1 07-28-2005 09:53 PM
Internet service providers that work with Linux LindsayJ Linux - Networking 1 11-07-2001 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration