Patchwork [meta-oe,for-denzil] systemd.bbclass: use system variables instead of hardcoded paths

login
register
mail settings
Submitter Ting Liu
Date Sept. 13, 2012, 7:33 a.m.
Message ID <1347521638-3093-1-git-send-email-b28495@freescale.com>
Download mbox | patch
Permalink /patch/36451/
State Superseded
Headers show

Comments

Ting Liu - Sept. 13, 2012, 7:33 a.m.
From: Ting Liu <b28495@freescale.com>

Fix below issue when check service-files for 64bit target:
| DEBUG: adding systemd calls to postinst/postrm for busybox-syslog-systemd
| ERROR: Function failed:
|
| For package busybox-syslog-systemd SYSTEMD_SERVICE-entry busybox-syslog.service does not exist
NOTE: package busybox-1.19.4-r6+fsl.0: task do_package: Failed

Signed-off-by: Ting Liu <b28495@freescale.com>
---
 meta-oe/classes/systemd.bbclass |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
Otavio Salvador - Sept. 13, 2012, 1:02 p.m.
On Thu, Sep 13, 2012 at 4:33 AM,  <b28495@freescale.com> wrote:
> From: Ting Liu <b28495@freescale.com>
>
> Fix below issue when check service-files for 64bit target:
> | DEBUG: adding systemd calls to postinst/postrm for busybox-syslog-systemd
> | ERROR: Function failed:
> |
> | For package busybox-syslog-systemd SYSTEMD_SERVICE-entry busybox-syslog.service does not exist
> NOTE: package busybox-1.19.4-r6+fsl.0: task do_package: Failed
>
> Signed-off-by: Ting Liu <b28495@freescale.com>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Otavio Salvador - Sept. 13, 2012, 1:04 p.m.
On Thu, Sep 13, 2012 at 4:33 AM,  <b28495@freescale.com> wrote:
> diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
> index a2c8ddf..9690c18 100644
> --- a/meta-oe/classes/systemd.bbclass
> +++ b/meta-oe/classes/systemd.bbclass
> @@ -154,7 +154,10 @@ python populate_packages_prepend () {
>
>         # check service-files and call systemd_add_files_and_parse for each entry
>         def systemd_check_services():
> -               searchpaths = '/etc/systemd/system/ /lib/systemd/system/ /usr/lib/systemd/system/'
> +               searchpaths = []
> +               searchpaths.append(d.getVar('sysconfdir', True))
> +               searchpaths.append(d.getVar('libdir', True))
> +               searchpaths.append(d.getVar('base_libdir', True))
>                 systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
>                 has_exactly_one_service = len(systemd_packages.split()) == 1
>                 if has_exactly_one_service:
> @@ -168,9 +171,9 @@ python populate_packages_prepend () {
>                 for pkg_systemd in systemd_packages.split():
>                         for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
>                                 path_found = ''
> -                               for path in searchpaths.split():
> -                                       if os.path.exists('${D}' + path + service):
> -                                               path_found = path
> +                               for path in searchpaths:
> +                                       if os.path.exists('${D}' + path + '/systemd/system/' + service):
> +                                               path_found = path + '/systemd/system/'
>                                 if path_found != '':
>                                         systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
>                                 else:

Please check if a similar change is need on master (inside meta-systemd).
Koen Kooi - Sept. 13, 2012, 3:20 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 13-09-12 09:33, b28495@freescale.com schreef:
> From: Ting Liu <b28495@freescale.com>
> 
> Fix below issue when check service-files for 64bit target: | DEBUG:
> adding systemd calls to postinst/postrm for busybox-syslog-systemd |
> ERROR: Function failed: | | For package busybox-syslog-systemd
> SYSTEMD_SERVICE-entry busybox-syslog.service does not exist NOTE: package
> busybox-1.19.4-r6+fsl.0: task do_package: Failed
> 
> Signed-off-by: Ting Liu <b28495@freescale.com>

Since when do changes go into denzil without going through master first?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD8DBQFQUfmgMkyGM64RGpERAssbAKCXR2IvkFpaaj9XHgJBhnitDRRbpgCfauG8
IpN4oLULM7EGk/mmU0UJNF0=
=ZEJH
-----END PGP SIGNATURE-----
McClintock Matthew-B29882 - Sept. 13, 2012, 6:01 p.m.
On Thu, Sep 13, 2012 at 10:20 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Op 13-09-12 09:33, b28495@freescale.com schreef:
>> From: Ting Liu <b28495@freescale.com>
>>
>> Fix below issue when check service-files for 64bit target: | DEBUG:
>> adding systemd calls to postinst/postrm for busybox-syslog-systemd |
>> ERROR: Function failed: | | For package busybox-syslog-systemd
>> SYSTEMD_SERVICE-entry busybox-syslog.service does not exist NOTE: package
>> busybox-1.19.4-r6+fsl.0: task do_package: Failed
>>
>> Signed-off-by: Ting Liu <b28495@freescale.com>
>
> Since when do changes go into denzil without going through master first?

This looks to be already fixed in master...

Ting,

Next time you should add a blurb in the commit message so you looked
at master and it does not have this problem / already fixed,
especially in the case you are not cherry-picking an upstream commit.

-M

>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Darwin)
> Comment: GPGTools - http://gpgtools.org
>
> iD8DBQFQUfmgMkyGM64RGpERAssbAKCXR2IvkFpaaj9XHgJBhnitDRRbpgCfauG8
> IpN4oLULM7EGk/mmU0UJNF0=
> =ZEJH
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Ting Liu - Sept. 14, 2012, 10:22 a.m.
> -----Original Message-----
> From: openembedded-devel-bounces@lists.openembedded.org
> [mailto:openembedded-devel-bounces@lists.openembedded.org] On Behalf Of
> Otavio Salvador
> Sent: Thursday, September 13, 2012 9:04 PM
> To: openembedded-devel@lists.openembedded.org
> Cc: McClintock Matthew-B29882
> Subject: Re: [oe] [meta-oe][for-denzil][PATCH] systemd.bbclass: use
> system variables instead of hardcoded paths
> 
> On Thu, Sep 13, 2012 at 4:33 AM,  <b28495@freescale.com> wrote:
> > diff --git a/meta-oe/classes/systemd.bbclass
> > b/meta-oe/classes/systemd.bbclass index a2c8ddf..9690c18 100644
> > --- a/meta-oe/classes/systemd.bbclass
> > +++ b/meta-oe/classes/systemd.bbclass
> > @@ -154,7 +154,10 @@ python populate_packages_prepend () {
> >
> >         # check service-files and call systemd_add_files_and_parse for
> each entry
> >         def systemd_check_services():
> > -               searchpaths = '/etc/systemd/system/
> /lib/systemd/system/ /usr/lib/systemd/system/'
> > +               searchpaths = []
> > +               searchpaths.append(d.getVar('sysconfdir', True))
> > +               searchpaths.append(d.getVar('libdir', True))
> > +               searchpaths.append(d.getVar('base_libdir', True))
> >                 systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
> >                 has_exactly_one_service = len(systemd_packages.split())
> == 1
> >                 if has_exactly_one_service:
> > @@ -168,9 +171,9 @@ python populate_packages_prepend () {
> >                 for pkg_systemd in systemd_packages.split():
> >                         for service in get_package_var(d,
> 'SYSTEMD_SERVICE', pkg_systemd).split():
> >                                 path_found = ''
> > -                               for path in searchpaths.split():
> > -                                       if os.path.exists('${D}' + path
> + service):
> > -                                               path_found = path
> > +                               for path in searchpaths:
> > +                                       if os.path.exists('${D}' + path
> + '/systemd/system/' + service):
> > +                                               path_found = path +
> '/systemd/system/'
> >                                 if path_found != '':
> >
> systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
> >                                 else:
> 
> Please check if a similar change is need on master (inside meta-systemd).
> 

[Liu Ting-B28495] the issue was fixed in master.
commit 980b338fb5100ff4c779335a86f3d9450ea8c54a
systemd: Upgrade to 187 tag

a new path has been sent out for denzil.

> --
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Patch

diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass
index a2c8ddf..9690c18 100644
--- a/meta-oe/classes/systemd.bbclass
+++ b/meta-oe/classes/systemd.bbclass
@@ -154,7 +154,10 @@  python populate_packages_prepend () {
 
 	# check service-files and call systemd_add_files_and_parse for each entry
 	def systemd_check_services():
-		searchpaths = '/etc/systemd/system/ /lib/systemd/system/ /usr/lib/systemd/system/'
+		searchpaths = []
+		searchpaths.append(d.getVar('sysconfdir', True))
+		searchpaths.append(d.getVar('libdir', True))
+		searchpaths.append(d.getVar('base_libdir', True))
 		systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
 		has_exactly_one_service = len(systemd_packages.split()) == 1
 		if has_exactly_one_service:
@@ -168,9 +171,9 @@  python populate_packages_prepend () {
 		for pkg_systemd in systemd_packages.split():
 			for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
 				path_found = ''
-				for path in searchpaths.split():
-					if os.path.exists('${D}' + path + service):
-						path_found = path
+				for path in searchpaths:
+					if os.path.exists('${D}' + path + '/systemd/system/' + service):
+						path_found = path + '/systemd/system/'
 				if path_found != '':
 					systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
 				else: