Patchwork [meta-systemd,1/2] Delete systemd class.

login
register
mail settings
Submitter Khem Raj
Date Feb. 13, 2013, 5:25 p.m.
Message ID <1360776335-21633-1-git-send-email-raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/44611/
State Accepted, archived
Headers show

Comments

Khem Raj - Feb. 13, 2013, 5:25 p.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-systemd/classes/systemd.bbclass |  225 ----------------------------------
 1 file changed, 225 deletions(-)
 delete mode 100644 meta-systemd/classes/systemd.bbclass
Martin Jansa - March 5, 2013, 10:18 p.m.
On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
> Signed-off-by: Khem Raj <raj.khem@gmail.com>

good old meta-systemd should now parse again, I wont apply this 2 commits
until systemd discussion in oe-core is finished and future of
meta-systemd decided.

> ---
>  meta-systemd/classes/systemd.bbclass |  225 ----------------------------------
>  1 file changed, 225 deletions(-)
>  delete mode 100644 meta-systemd/classes/systemd.bbclass
> 
> diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass
> deleted file mode 100644
> index f2a0363..0000000
> --- a/meta-systemd/classes/systemd.bbclass
> +++ /dev/null
> @@ -1,225 +0,0 @@
> -DEPENDS_append = " systemd-systemctl-native"
> -
> -SYSTEMD_AUTO_ENABLE ??= "enable"
> -
> -SYSTEMD_AUTO_RRECOMMENDS ??= "enable"
> -
> -systemd_postinst() {
> -OPTS=""
> -
> -if [ -n "$D" ]; then
> -    OPTS="--root=$D"
> -fi
> -
> -systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
> -
> -if [ -z "$D" -a ${SYSTEMD_AUTO_ENABLE} = "enable" ]; then
> -    systemctl start ${SYSTEMD_SERVICE}
> -fi
> -}
> -
> -systemd_prerm() {
> -if [ -z "$D" ]; then
> -    systemctl stop ${SYSTEMD_SERVICE}
> -fi
> -
> -systemctl disable ${SYSTEMD_SERVICE}
> -}
> -
> -def get_package_var(d, var, pkg):
> -    val = (d.getVar('%s_%s' % (var, pkg), 1) or "").strip()
> -    if val == "":
> -        val = (d.getVar(var, 1) or "").strip()
> -    return val
> -
> -def systemd_after_parse(d):
> -    def systemd_check_vars():
> -        if d.getVar('BB_WORKERCONTEXT', True) is not None:
> -            return
> -
> -        bb_filename = d.getVar('FILE')
> -        packages = d.getVar('PACKAGES', 1)
> -
> -        # check SYSTEMD_PACKAGES
> -        systemd_pkgs = d.getVar('SYSTEMD_PACKAGES', 1) or ""
> -        if systemd_pkgs == "":
> -            raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_PACKAGES" % bb_filename
> -        for pkg_systemd in systemd_pkgs.split():
> -            if pkg_systemd.find("-systemd") == -1:
> -                if pkg_systemd != d.getVar('PN', 1):
> -                    raise bb.build.FuncFailed, \
> -                        "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN}" % \
> -                        (bb_filename, pkg_systemd)
> -            else:
> -                pkg_systemd_base = pkg_systemd
> -                if pkg_systemd_base.endswith('-systemd'):
> -                    pkg_systemd_base = pkg_systemd[:-8]
> -                if pkg_systemd_base not in packages:
> -                    raise bb.build.FuncFailed, \
> -                        "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN}" % \
> -                        ( bb_filename, pkg_systemd)
> -
> -    # prepend systemd-packages not already included
> -    def systemd_create_package(pkg_systemd):
> -        packages = d.getVar('PACKAGES', 1)
> -        if not pkg_systemd in packages:
> -            packages = "%s %s" % (pkg_systemd, packages)
> -            d.setVar('PACKAGES', packages)
> -
> -
> -    bpn = d.getVar('BPN', 1)
> -    ml = d.getVar('MLPREFIX', 1) or ""
> -    if bpn + "-native" != d.getVar('PN', 1) and \
> -            bpn + "-cross" != d.getVar('PN', 1) and \
> -            ml + bpn == d.getVar('PN', 1) and \
> -            "nativesdk-" + bpn != d.getVar('PN', 1):
> -        systemd_check_vars()
> -        for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
> -            systemd_create_package(pkg_systemd)
> -
> -
> -python __anonymous() {
> -    systemd_after_parse(d)
> -}
> -
> -# automatically install all *.service and *.socket supplied in recipe's SRC_URI
> -do_install_append() {
> -    for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do
> -    # ensure installing systemd-files only (e.g not avahi *.service)
> -    if grep -q '\[Unit\]' $service ; then
> -        install -d ${D}${systemd_unitdir}/system
> -        install -m 644 $service ${D}${systemd_unitdir}/system
> -    fi
> -    done
> -}
> -
> -python populate_packages_prepend () {
> -    def systemd_generate_package_scripts(pkg):
> -        bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
> -        localdata = d.createCopy()
> -        overrides = localdata.getVar("OVERRIDES", 1)
> -        localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
> -        bb.data.update_data(localdata)
> -
> -        """
> -        systemd postinst is appended here because pkg_postinst may require to
> -        execute on the target. Not doing so may cause systemd postinst invoked
> -        twice to cause unwanted warnings.
> -        """ 
> -        postinst = localdata.getVar('pkg_postinst', 1)
> -        if not postinst:
> -            postinst = '#!/bin/sh\n'
> -        postinst += localdata.getVar('systemd_postinst', 1)
> -        d.setVar('pkg_postinst_%s' % pkg, postinst)
> -
> -        prerm = localdata.getVar('pkg_prerm', 1)
> -        if not prerm:
> -            prerm = '#!/bin/sh\n'
> -        prerm += localdata.getVar('systemd_prerm', 1)
> -        d.setVar('pkg_prerm_%s' % pkg, prerm)
> -
> -    # add files to FILES_*-systemd if existent and not already done
> -    def systemd_append_file(pkg_systemd, file_append):
> -        appended = False
> -        if os.path.exists('${D}' + file_append):
> -            var_name = "FILES_" + pkg_systemd
> -            files = d.getVar(var_name, 0) or ""
> -            if file_append not in files.split():
> -                d.setVar(var_name, "%s %s" % (files, file_append))
> -                appended = True
> -        return appended
> -
> -    # add systemd files to FILES_*-systemd, parse for Also= and follow recursive
> -    def systemd_add_files_and_parse(pkg_systemd, path, service, keys):
> -        # avoid infinite recursion
> -        if systemd_append_file(pkg_systemd, path + service):
> -            fullpath = '${D}' + path + service
> -            if service.find('.socket') != -1:
> -                # for *.socket add *.service and *@.service
> -                service_base = service.replace('.socket', '')
> -                systemd_add_files_and_parse(pkg_systemd, path, service_base + '.service', keys)
> -                systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
> -            for key in keys.split():
> -                # recurse all dependencies found in keys ('Also';'Conflicts';..) and add to files
> -                cmd = "grep %s %s | sed 's,%s=,,g' | tr ',' '\\n'" % (key, fullpath, key)
> -                pipe = os.popen(cmd, 'r')
> -                line = pipe.readline()
> -                while line:
> -                    line = line.replace('\n', '')
> -                    systemd_add_files_and_parse(pkg_systemd, path, line, keys)
> -                    line = pipe.readline()
> -                pipe.close()
> -
> -    # check service-files and call systemd_add_files_and_parse for each entry
> -    def systemd_check_services():
> -        base_libdir = d.getVar('base_libdir', 1)
> -        searchpaths = '/etc/systemd/system/' + ' '
> -        searchpaths += '/lib/systemd/system/' + ' '
> -        searchpaths += '/usr/lib/systemd/system/' + ' '
> -        systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
> -        has_exactly_one_service = len(systemd_packages.split()) == 1
> -        if has_exactly_one_service:
> -            has_exactly_one_service = len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages).split()) == 1
> -
> -        keys = 'Also' # Conflicts??
> -        if has_exactly_one_service:
> -            # single service gets also the /dev/null dummies
> -            keys = 'Also Conflicts'
> -        # scan for all in SYSTEMD_SERVICE[]
> -        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
> -                if path_found != '':
> -                    systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
> -                else:
> -                    raise bb.build.FuncFailed, "\n\nFor package %s SYSTEMD_SERVICE-entry %s does not exist" % \
> -                        (pkg_systemd, service)
> -
> -    """     Setup rdepends / rrecommmends as:
> -
> -                -----------------------------
> -                |  pkg_systemd_base: 'foo'  |
> -                -----------------------------
> -                           |    ^
> -                           |    |                 --------------
> -               rrecommends |    | rdepends        | 'systemd'  |
> -                           |    |               ->--------------
> -                           V    |              / rdepends
> -                ------------------------------/
> -                | pkg_systemd: 'foo-systemd' |
> -                ------------------------------
> -    """
> -    def systemd_add_rdepends_rrecommends(pkg_systemd):
> -        # RDEPENDS_${pkg_systemd} += pkg_systemd_base systemd
> -        rdepends = d.getVar('RDEPENDS_' + pkg_systemd, 1) or ""
> -        rdepends_arr = rdepends.split()
> -        if not 'systemd' in rdepends_arr:
> -            rdepends = '%s %s' % (rdepends, 'systemd')
> -        pkg_systemd_base = pkg_systemd.replace('-systemd', '')
> -        # no automatism for:
> -        # recipes setting rdepends themselves AND
> -        # not rdepending myself AND
> -        # avoid double entries
> -        if len(rdepends_arr) == 0 and pkg_systemd != '${PN}' and not pkg_systemd_base in rdepends:
> -            rdepends = '%s %s' % (rdepends, pkg_systemd_base)
> -        d.setVar('RDEPENDS_' + pkg_systemd, rdepends)
> -        auto_rrecommends = d.getVar('SYSTEMD_AUTO_RRECOMMENDS', 1) or 'enable'
> -        if auto_rrecommends == 'enable':
> -            # RRECOMMENDS_${pkg_systemd_base} += pkg_systemd systemd
> -            rrecommends = d.getVar('RRECOMMENDS_' + pkg_systemd_base, 1) or ""
> -            # not rrecommending myself AND avoid double entries
> -            if pkg_systemd != pkg_systemd_base and not pkg_systemd in rrecommends.split():
> -                rrecommends = '%s %s' % (rrecommends, pkg_systemd)
> -            d.setVar('RRECOMMENDS_' + pkg_systemd_base, rrecommends)
> -
> -    # run all modifications once when creating package
> -    if os.path.exists('${D}'):
> -        for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
> -            if get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd) != "":
> -                systemd_generate_package_scripts(pkg_systemd)
> -                systemd_add_rdepends_rrecommends(pkg_systemd)
> -        systemd_check_services()
> -}
> -- 
> 1.7.9.5
> 
> 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Andreas Müller - March 5, 2013, 10:50 p.m.
On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>
> good old meta-systemd should now parse again,
Thanks - will come back to test HEADs soon.

> I wont apply this 2 commits
> until systemd discussion in oe-core is finished and future of
> meta-systemd decided.
>
After systemd regression is worked around yocto 1.4 release regression
is knocking at the door...

Andreas
Martin Jansa - March 5, 2013, 10:59 p.m.
On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
> On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
> >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >
> > good old meta-systemd should now parse again,
> Thanks - will come back to test HEADs soon.

But be aware that I've fixed only parsing of avahi and wpa-supplicant.

I haven't tested it properly in runtime because my upgrade path is a bit
broken (because I was building images with khem's patches for a while to
test other stuff) and even clean build with failed to boot with
qemux86-64 and I don't have time to debug it now.

> > I wont apply this 2 commits
> > until systemd discussion in oe-core is finished and future of
> > meta-systemd decided.
> >
> After systemd regression is worked around yocto 1.4 release regression
> is knocking at the door...

yes :/

If we need to maintain meta-systemd bbappends for upgrade path we can
also maintain them with PN-systemd packages and good old systemd bbclass.
Martin Jansa - April 9, 2013, 8:01 p.m.
On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > >
> > > good old meta-systemd should now parse again,
> > Thanks - will come back to test HEADs soon.
> 
> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
> 
> I haven't tested it properly in runtime because my upgrade path is a bit
> broken (because I was building images with khem's patches for a while to
> test other stuff) and even clean build with failed to boot with
> qemux86-64 and I don't have time to debug it now.
> 
> > > I wont apply this 2 commits
> > > until systemd discussion in oe-core is finished and future of
> > > meta-systemd decided.
> > >
> > After systemd regression is worked around yocto 1.4 release regression
> > is knocking at the door...
> 
> yes :/
> 
> If we need to maintain meta-systemd bbappends for upgrade path we can
> also maintain them with PN-systemd packages and good old systemd bbclass.

Khem pinged me about this patch, so here are my thoughts:

PN-systemd discussion in oe-core haven't moved a bit since this patch
was proposed, I think we have 2-3 options, lets vote about meta-systemd future.

1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
resolve issues created by oe-core (I've fixed some issues, but still a
lot of issues in postinst/postrm/prerm scripts when both inits are
sharing the same PN)

2) give up on clean separation of PN-<init> and provide upgrade path
from PN-systemd to PN (mostly done by these 2 commits from khem).

3) give up on clean separation of PN-<init> and upgrade path (there are
many issues in other parts of oe-core, so upgrade path from danny to
dylan doesn't look usable.

A) migrate existing .bbappends to their recipes to .bb files and
remove this layer. Any volunteer for that?

My vote: 3) + A) later in 1.5
I guess we're all too busy to implement 1), upgrade path would be nice,
but is all-or-nothing, doesn't make much sense to spend a lot of time
fixing every issue from PN-systemd when there are issues from other
recipes we're not going to fix by .bbappends in meta-oe.

Vote required from Khem, Koen, Andreas, Enrico, Otavio
Vote welcome from other meta-systemd contributors
Otavio Salvador - April 9, 2013, 8:06 p.m.
On Tue, Apr 9, 2013 at 5:01 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
> My vote: 3) + A) later in 1.5
> I guess we're all too busy to implement 1), upgrade path would be nice,
> but is all-or-nothing, doesn't make much sense to spend a lot of time
> fixing every issue from PN-systemd when there are issues from other
> recipes we're not going to fix by .bbappends in meta-oe.

+1

--
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
Koen Kooi - April 9, 2013, 8:08 p.m.
Op 9 apr. 2013, om 22:01 heeft Martin Jansa <martin.jansa@gmail.com> het volgende geschreven:

> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
>>> On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>>>> On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> 
>>>> good old meta-systemd should now parse again,
>>> Thanks - will come back to test HEADs soon.
>> 
>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
>> 
>> I haven't tested it properly in runtime because my upgrade path is a bit
>> broken (because I was building images with khem's patches for a while to
>> test other stuff) and even clean build with failed to boot with
>> qemux86-64 and I don't have time to debug it now.
>> 
>>>> I wont apply this 2 commits
>>>> until systemd discussion in oe-core is finished and future of
>>>> meta-systemd decided.
>>>> 
>>> After systemd regression is worked around yocto 1.4 release regression
>>> is knocking at the door...
>> 
>> yes :/
>> 
>> If we need to maintain meta-systemd bbappends for upgrade path we can
>> also maintain them with PN-systemd packages and good old systemd bbclass.
> 
> Khem pinged me about this patch, so here are my thoughts:
> 
> PN-systemd discussion in oe-core haven't moved a bit since this patch
> was proposed, I think we have 2-3 options, lets vote about meta-systemd future.
> 
> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
> resolve issues created by oe-core (I've fixed some issues, but still a
> lot of issues in postinst/postrm/prerm scripts when both inits are
> sharing the same PN)
> 
> 2) give up on clean separation of PN-<init> and provide upgrade path
> from PN-systemd to PN (mostly done by these 2 commits from khem).
> 
> 3) give up on clean separation of PN-<init> and upgrade path (there are
> many issues in other parts of oe-core, so upgrade path from danny to
> dylan doesn't look usable.
> 
> A) migrate existing .bbappends to their recipes to .bb files and
> remove this layer. Any volunteer for that?
> 
> My vote: 3) + A) later in 1.5
> I guess we're all too busy to implement 1), upgrade path would be nice,
> but is all-or-nothing, doesn't make much sense to spend a lot of time
> fixing every issue from PN-systemd when there are issues from other
> recipes we're not going to fix by .bbappends in meta-oe.

Upgrade paths are totally broken anyway, so let's go for 3 + A
Ross Burton - April 10, 2013, 11:06 a.m.
On 9 April 2013 21:08, Koen Kooi <koen@dominion.thruhere.net> wrote:
> Upgrade paths are totally broken anyway, so let's go for 3 + A

As you keep saying this, it would be great if someone would do an
upgrade from danny to dylan and actually report the breakages.  Thanks
mainly to Martin the bulk of the package transitions that I'm aware of
have replaces/conflicts/provides in place.

Ross
Andreas Müller - April 10, 2013, 11:39 a.m.
On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
>> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> > >
>> > > good old meta-systemd should now parse again,
>> > Thanks - will come back to test HEADs soon.
>>
>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
>>
>> I haven't tested it properly in runtime because my upgrade path is a bit
>> broken (because I was building images with khem's patches for a while to
>> test other stuff) and even clean build with failed to boot with
>> qemux86-64 and I don't have time to debug it now.
>>
>> > > I wont apply this 2 commits
>> > > until systemd discussion in oe-core is finished and future of
>> > > meta-systemd decided.
>> > >
>> > After systemd regression is worked around yocto 1.4 release regression
>> > is knocking at the door...
>>
>> yes :/
>>
>> If we need to maintain meta-systemd bbappends for upgrade path we can
>> also maintain them with PN-systemd packages and good old systemd bbclass.
>
> Khem pinged me about this patch, so here are my thoughts:
>
> PN-systemd discussion in oe-core haven't moved a bit since this patch
> was proposed, I think we have 2-3 options, lets vote about meta-systemd future.
>
> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
> resolve issues created by oe-core (I've fixed some issues, but still a
> lot of issues in postinst/postrm/prerm scripts when both inits are
> sharing the same PN)
>
> 2) give up on clean separation of PN-<init> and provide upgrade path
> from PN-systemd to PN (mostly done by these 2 commits from khem).
>
> 3) give up on clean separation of PN-<init> and upgrade path (there are
> many issues in other parts of oe-core, so upgrade path from danny to
> dylan doesn't look usable.
>
> A) migrate existing .bbappends to their recipes to .bb files and
> remove this layer. Any volunteer for that?
>
> My vote: 3) + A) later in 1.5
> I guess we're all too busy to implement 1), upgrade path would be nice,
> but is all-or-nothing, doesn't make much sense to spend a lot of time
> fixing every issue from PN-systemd when there are issues from other
> recipes we're not going to fix by .bbappends in meta-oe.
>
> Vote required from Khem, Koen, Andreas, Enrico, Otavio
> Vote welcome from other meta-systemd contributors
>
tend also to 3) + A) but I would prefer to have it as one transaction.
Otherwise we might face another upgrade path breakage. I know this
will cause questions as who and when...

Andreas
Khem Raj - April 10, 2013, 2:55 p.m.
On Apr 10, 2013, at 4:39 AM, Andreas Müller <schnitzeltony@googlemail.com> wrote:

> On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
>>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
>>>> On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>>>>> On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>>> 
>>>>> good old meta-systemd should now parse again,
>>>> Thanks - will come back to test HEADs soon.
>>> 
>>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
>>> 
>>> I haven't tested it properly in runtime because my upgrade path is a bit
>>> broken (because I was building images with khem's patches for a while to
>>> test other stuff) and even clean build with failed to boot with
>>> qemux86-64 and I don't have time to debug it now.
>>> 
>>>>> I wont apply this 2 commits
>>>>> until systemd discussion in oe-core is finished and future of
>>>>> meta-systemd decided.
>>>>> 
>>>> After systemd regression is worked around yocto 1.4 release regression
>>>> is knocking at the door...
>>> 
>>> yes :/
>>> 
>>> If we need to maintain meta-systemd bbappends for upgrade path we can
>>> also maintain them with PN-systemd packages and good old systemd bbclass.
>> 
>> Khem pinged me about this patch, so here are my thoughts:
>> 
>> PN-systemd discussion in oe-core haven't moved a bit since this patch
>> was proposed, I think we have 2-3 options, lets vote about meta-systemd future.
>> 
>> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
>> resolve issues created by oe-core (I've fixed some issues, but still a
>> lot of issues in postinst/postrm/prerm scripts when both inits are
>> sharing the same PN)
>> 
>> 2) give up on clean separation of PN-<init> and provide upgrade path
>> from PN-systemd to PN (mostly done by these 2 commits from khem).
>> 
>> 3) give up on clean separation of PN-<init> and upgrade path (there are
>> many issues in other parts of oe-core, so upgrade path from danny to
>> dylan doesn't look usable.
>> 
>> A) migrate existing .bbappends to their recipes to .bb files and
>> remove this layer. Any volunteer for that?
>> 
>> My vote: 3) + A) later in 1.5
>> I guess we're all too busy to implement 1), upgrade path would be nice,
>> but is all-or-nothing, doesn't make much sense to spend a lot of time
>> fixing every issue from PN-systemd when there are issues from other
>> recipes we're not going to fix by .bbappends in meta-oe.
>> 
>> Vote required from Khem, Koen, Andreas, Enrico, Otavio
>> Vote welcome from other meta-systemd contributors
>> 
> tend also to 3) + A) but I would prefer to have it as one transaction.
> Otherwise we might face another upgrade path breakage. I know this
> will cause questions as who and when…


actually, 3+A is going to take some time I feel first 2 (without upgrade path) and then eventually 3+A would get us there


> 
> Andreas
Martin Jansa - April 10, 2013, 9:17 p.m.
On Wed, Apr 10, 2013 at 12:06:49PM +0100, Burton, Ross wrote:
> On 9 April 2013 21:08, Koen Kooi <koen@dominion.thruhere.net> wrote:
> > Upgrade paths are totally broken anyway, so let's go for 3 + A
> 
> As you keep saying this, it would be great if someone would do an
> upgrade from danny to dylan and actually report the breakages.  Thanks
> mainly to Martin the bulk of the package transitions that I'm aware of
> have replaces/conflicts/provides in place.

I should have asked which Monday he meant.. it's still not fixed
connman:
http://lists.linuxtogo.org/pipermail/openembedded-core/2013-March/037355.html

util-linux:
http://permalink.gmane.org/gmane.comp.handhelds.openembedded.core/34410

and I can find a lot more in my sent folder if I really care :/.
Andreas Müller - April 11, 2013, 12:12 a.m.
On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
>> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com> wrote:
>> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> > >
>> > > good old meta-systemd should now parse again,
>> > Thanks - will come back to test HEADs soon.
>>
>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
>>
>> I haven't tested it properly in runtime because my upgrade path is a bit
>> broken (because I was building images with khem's patches for a while to
>> test other stuff) and even clean build with failed to boot with
>> qemux86-64 and I don't have time to debug it now.
>>
>> > > I wont apply this 2 commits
>> > > until systemd discussion in oe-core is finished and future of
>> > > meta-systemd decided.
>> > >
>> > After systemd regression is worked around yocto 1.4 release regression
>> > is knocking at the door...
>>
>> yes :/
>>
>> If we need to maintain meta-systemd bbappends for upgrade path we can
>> also maintain them with PN-systemd packages and good old systemd bbclass.
>
> Khem pinged me about this patch, so here are my thoughts:
>
> PN-systemd discussion in oe-core haven't moved a bit since this patch
> was proposed, I think we have 2-3 options, lets vote about meta-systemd future.
>
> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
> resolve issues created by oe-core (I've fixed some issues, but still a
> lot of issues in postinst/postrm/prerm scripts when both inits are
> sharing the same PN)
>
> 2) give up on clean separation of PN-<init> and provide upgrade path
> from PN-systemd to PN (mostly done by these 2 commits from khem).
>
> 3) give up on clean separation of PN-<init> and upgrade path (there are
> many issues in other parts of oe-core, so upgrade path from danny to
> dylan doesn't look usable.
>
> A) migrate existing .bbappends to their recipes to .bb files and
> remove this layer. Any volunteer for that?
>
> My vote: 3) + A) later in 1.5
A bit off-topic and mentioned here & there: I am working on
network-manager(-applet) 0.9.8.0 update and xinput-calibrator. I could
add 3) + A) for them if agreed. Hope to send them beginning of next
week.

Anderas
Khem Raj - April 11, 2013, 12:51 a.m.
On Wednesday, April 10, 2013, Andreas Müller <schnitzeltony@googlemail.com>
wrote:
> On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com>
wrote:
>> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
>>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
>>> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com>
wrote:
>>> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
>>> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> > >
>>> > > good old meta-systemd should now parse again,
>>> > Thanks - will come back to test HEADs soon.
>>>
>>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
>>>
>>> I haven't tested it properly in runtime because my upgrade path is a bit
>>> broken (because I was building images with khem's patches for a while to
>>> test other stuff) and even clean build with failed to boot with
>>> qemux86-64 and I don't have time to debug it now.
>>>
>>> > > I wont apply this 2 commits
>>> > > until systemd discussion in oe-core is finished and future of
>>> > > meta-systemd decided.
>>> > >
>>> > After systemd regression is worked around yocto 1.4 release regression
>>> > is knocking at the door...
>>>
>>> yes :/
>>>
>>> If we need to maintain meta-systemd bbappends for upgrade path we can
>>> also maintain them with PN-systemd packages and good old systemd
bbclass.
>>
>> Khem pinged me about this patch, so here are my thoughts:
>>
>> PN-systemd discussion in oe-core haven't moved a bit since this patch
>> was proposed, I think we have 2-3 options, lets vote about meta-systemd
future.
>>
>> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
>> resolve issues created by oe-core (I've fixed some issues, but still a
>> lot of issues in postinst/postrm/prerm scripts when both inits are
>> sharing the same PN)
>>
>> 2) give up on clean separation of PN-<init> and provide upgrade path
>> from PN-systemd to PN (mostly done by these 2 commits from khem).
>>
>> 3) give up on clean separation of PN-<init> and upgrade path (there are
>> many issues in other parts of oe-core, so upgrade path from danny to
>> dylan doesn't look usable.
>>
>> A) migrate existing .bbappends to their recipes to .bb files and
>> remove this layer. Any volunteer for that?
>>
>> My vote: 3) + A) later in 1.5
> A bit off-topic and mentioned here & there: I am working on
> network-manager(-applet) 0.9.8.0 update and xinput-calibrator. I could
> add 3) + A) for them if agreed. Hope to send them beginning of next
> week.
>

Sure I see no problem
> Anderas
>
Ross Burton - April 11, 2013, 9:59 a.m.
On 10 April 2013 22:17, Martin Jansa <martin.jansa@gmail.com> wrote:
> I should have asked which Monday he meant.. it's still not fixed
> connman:
> http://lists.linuxtogo.org/pipermail/openembedded-core/2013-March/037355.html
>
> util-linux:
> http://permalink.gmane.org/gmane.comp.handhelds.openembedded.core/34410
>
> and I can find a lot more in my sent folder if I really care :/.

Thanks Martin, I'll chase those.  Probably too late for 1.4.0 but
obviously we can fix in master and add to 1.4.1.

Ross
Martin Jansa - April 12, 2013, 5:02 p.m.
On Wed, Apr 10, 2013 at 05:51:43PM -0700, Khem Raj wrote:
> On Wednesday, April 10, 2013, Andreas Müller <schnitzeltony@googlemail.com>
> wrote:
> > On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> >> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
> >>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
> >>> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> >>> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
> >>> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> >>> > >
> >>> > > good old meta-systemd should now parse again,
> >>> > Thanks - will come back to test HEADs soon.
> >>>
> >>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
> >>>
> >>> I haven't tested it properly in runtime because my upgrade path is a bit
> >>> broken (because I was building images with khem's patches for a while to
> >>> test other stuff) and even clean build with failed to boot with
> >>> qemux86-64 and I don't have time to debug it now.
> >>>
> >>> > > I wont apply this 2 commits
> >>> > > until systemd discussion in oe-core is finished and future of
> >>> > > meta-systemd decided.
> >>> > >
> >>> > After systemd regression is worked around yocto 1.4 release regression
> >>> > is knocking at the door...
> >>>
> >>> yes :/
> >>>
> >>> If we need to maintain meta-systemd bbappends for upgrade path we can
> >>> also maintain them with PN-systemd packages and good old systemd
> bbclass.
> >>
> >> Khem pinged me about this patch, so here are my thoughts:
> >>
> >> PN-systemd discussion in oe-core haven't moved a bit since this patch
> >> was proposed, I think we have 2-3 options, lets vote about meta-systemd
> future.
> >>
> >> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
> >> resolve issues created by oe-core (I've fixed some issues, but still a
> >> lot of issues in postinst/postrm/prerm scripts when both inits are
> >> sharing the same PN)
> >>
> >> 2) give up on clean separation of PN-<init> and provide upgrade path
> >> from PN-systemd to PN (mostly done by these 2 commits from khem).
> >>
> >> 3) give up on clean separation of PN-<init> and upgrade path (there are
> >> many issues in other parts of oe-core, so upgrade path from danny to
> >> dylan doesn't look usable.
> >>
> >> A) migrate existing .bbappends to their recipes to .bb files and
> >> remove this layer. Any volunteer for that?
> >>
> >> My vote: 3) + A) later in 1.5
> > A bit off-topic and mentioned here & there: I am working on
> > network-manager(-applet) 0.9.8.0 update and xinput-calibrator. I could
> > add 3) + A) for them if agreed. Hope to send them beginning of next
> > week.
> >
> 
> Sure I see no problem

OK, all systemd related changes should be now in master.

I'll do A) for meta-efl.

If someone starts working on A) for some other recipes, please write reply 
here so that we don't duplicate work.
Martin Jansa - April 13, 2013, 11:29 a.m.
On Fri, Apr 12, 2013 at 07:02:55PM +0200, Martin Jansa wrote:
> On Wed, Apr 10, 2013 at 05:51:43PM -0700, Khem Raj wrote:
> > On Wednesday, April 10, 2013, Andreas Müller <schnitzeltony@googlemail.com>
> > wrote:
> > > On Tue, Apr 9, 2013 at 10:01 PM, Martin Jansa <martin.jansa@gmail.com>
> > wrote:
> > >> On Tue, Mar 05, 2013 at 11:59:07PM +0100, Martin Jansa wrote:
> > >>> On Tue, Mar 05, 2013 at 11:50:41PM +0100, Andreas Müller wrote:
> > >>> > On Tue, Mar 5, 2013 at 11:18 PM, Martin Jansa <martin.jansa@gmail.com>
> > wrote:
> > >>> > > On Wed, Feb 13, 2013 at 09:25:34AM -0800, Khem Raj wrote:
> > >>> > >> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > >>> > >
> > >>> > > good old meta-systemd should now parse again,
> > >>> > Thanks - will come back to test HEADs soon.
> > >>>
> > >>> But be aware that I've fixed only parsing of avahi and wpa-supplicant.
> > >>>
> > >>> I haven't tested it properly in runtime because my upgrade path is a bit
> > >>> broken (because I was building images with khem's patches for a while to
> > >>> test other stuff) and even clean build with failed to boot with
> > >>> qemux86-64 and I don't have time to debug it now.
> > >>>
> > >>> > > I wont apply this 2 commits
> > >>> > > until systemd discussion in oe-core is finished and future of
> > >>> > > meta-systemd decided.
> > >>> > >
> > >>> > After systemd regression is worked around yocto 1.4 release regression
> > >>> > is knocking at the door...
> > >>>
> > >>> yes :/
> > >>>
> > >>> If we need to maintain meta-systemd bbappends for upgrade path we can
> > >>> also maintain them with PN-systemd packages and good old systemd
> > bbclass.
> > >>
> > >> Khem pinged me about this patch, so here are my thoughts:
> > >>
> > >> PN-systemd discussion in oe-core haven't moved a bit since this patch
> > >> was proposed, I think we have 2-3 options, lets vote about meta-systemd
> > future.
> > >>
> > >> 1) keep PN-systemd separation in meta-systemd and fixup .bbappends to
> > >> resolve issues created by oe-core (I've fixed some issues, but still a
> > >> lot of issues in postinst/postrm/prerm scripts when both inits are
> > >> sharing the same PN)
> > >>
> > >> 2) give up on clean separation of PN-<init> and provide upgrade path
> > >> from PN-systemd to PN (mostly done by these 2 commits from khem).
> > >>
> > >> 3) give up on clean separation of PN-<init> and upgrade path (there are
> > >> many issues in other parts of oe-core, so upgrade path from danny to
> > >> dylan doesn't look usable.
> > >>
> > >> A) migrate existing .bbappends to their recipes to .bb files and
> > >> remove this layer. Any volunteer for that?
> > >>
> > >> My vote: 3) + A) later in 1.5
> > > A bit off-topic and mentioned here & there: I am working on
> > > network-manager(-applet) 0.9.8.0 update and xinput-calibrator. I could
> > > add 3) + A) for them if agreed. Hope to send them beginning of next
> > > week.
> > >
> > 
> > Sure I see no problem
> 
> OK, all systemd related changes should be now in master.
> 
> I'll do A) for meta-efl.
> 
> If someone starts working on A) for some other recipes, please write reply 
> here so that we don't duplicate work.

OK, I'll take care of A) for other layers too, just please review them.

Patch

diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass
deleted file mode 100644
index f2a0363..0000000
--- a/meta-systemd/classes/systemd.bbclass
+++ /dev/null
@@ -1,225 +0,0 @@ 
-DEPENDS_append = " systemd-systemctl-native"
-
-SYSTEMD_AUTO_ENABLE ??= "enable"
-
-SYSTEMD_AUTO_RRECOMMENDS ??= "enable"
-
-systemd_postinst() {
-OPTS=""
-
-if [ -n "$D" ]; then
-    OPTS="--root=$D"
-fi
-
-systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
-
-if [ -z "$D" -a ${SYSTEMD_AUTO_ENABLE} = "enable" ]; then
-    systemctl start ${SYSTEMD_SERVICE}
-fi
-}
-
-systemd_prerm() {
-if [ -z "$D" ]; then
-    systemctl stop ${SYSTEMD_SERVICE}
-fi
-
-systemctl disable ${SYSTEMD_SERVICE}
-}
-
-def get_package_var(d, var, pkg):
-    val = (d.getVar('%s_%s' % (var, pkg), 1) or "").strip()
-    if val == "":
-        val = (d.getVar(var, 1) or "").strip()
-    return val
-
-def systemd_after_parse(d):
-    def systemd_check_vars():
-        if d.getVar('BB_WORKERCONTEXT', True) is not None:
-            return
-
-        bb_filename = d.getVar('FILE')
-        packages = d.getVar('PACKAGES', 1)
-
-        # check SYSTEMD_PACKAGES
-        systemd_pkgs = d.getVar('SYSTEMD_PACKAGES', 1) or ""
-        if systemd_pkgs == "":
-            raise bb.build.FuncFailed, "\n\n%s inherits systemd but doesn't set SYSTEMD_PACKAGES" % bb_filename
-        for pkg_systemd in systemd_pkgs.split():
-            if pkg_systemd.find("-systemd") == -1:
-                if pkg_systemd != d.getVar('PN', 1):
-                    raise bb.build.FuncFailed, \
-                        "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN}" % \
-                        (bb_filename, pkg_systemd)
-            else:
-                pkg_systemd_base = pkg_systemd
-                if pkg_systemd_base.endswith('-systemd'):
-                    pkg_systemd_base = pkg_systemd[:-8]
-                if pkg_systemd_base not in packages:
-                    raise bb.build.FuncFailed, \
-                        "\n\n%s: %s in SYSTEMD_PACKAGES does not match <existing-package>-systemd or ${PN}" % \
-                        ( bb_filename, pkg_systemd)
-
-    # prepend systemd-packages not already included
-    def systemd_create_package(pkg_systemd):
-        packages = d.getVar('PACKAGES', 1)
-        if not pkg_systemd in packages:
-            packages = "%s %s" % (pkg_systemd, packages)
-            d.setVar('PACKAGES', packages)
-
-
-    bpn = d.getVar('BPN', 1)
-    ml = d.getVar('MLPREFIX', 1) or ""
-    if bpn + "-native" != d.getVar('PN', 1) and \
-            bpn + "-cross" != d.getVar('PN', 1) and \
-            ml + bpn == d.getVar('PN', 1) and \
-            "nativesdk-" + bpn != d.getVar('PN', 1):
-        systemd_check_vars()
-        for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
-            systemd_create_package(pkg_systemd)
-
-
-python __anonymous() {
-    systemd_after_parse(d)
-}
-
-# automatically install all *.service and *.socket supplied in recipe's SRC_URI
-do_install_append() {
-    for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do
-    # ensure installing systemd-files only (e.g not avahi *.service)
-    if grep -q '\[Unit\]' $service ; then
-        install -d ${D}${systemd_unitdir}/system
-        install -m 644 $service ${D}${systemd_unitdir}/system
-    fi
-    done
-}
-
-python populate_packages_prepend () {
-    def systemd_generate_package_scripts(pkg):
-        bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
-        localdata = d.createCopy()
-        overrides = localdata.getVar("OVERRIDES", 1)
-        localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
-        bb.data.update_data(localdata)
-
-        """
-        systemd postinst is appended here because pkg_postinst may require to
-        execute on the target. Not doing so may cause systemd postinst invoked
-        twice to cause unwanted warnings.
-        """ 
-        postinst = localdata.getVar('pkg_postinst', 1)
-        if not postinst:
-            postinst = '#!/bin/sh\n'
-        postinst += localdata.getVar('systemd_postinst', 1)
-        d.setVar('pkg_postinst_%s' % pkg, postinst)
-
-        prerm = localdata.getVar('pkg_prerm', 1)
-        if not prerm:
-            prerm = '#!/bin/sh\n'
-        prerm += localdata.getVar('systemd_prerm', 1)
-        d.setVar('pkg_prerm_%s' % pkg, prerm)
-
-    # add files to FILES_*-systemd if existent and not already done
-    def systemd_append_file(pkg_systemd, file_append):
-        appended = False
-        if os.path.exists('${D}' + file_append):
-            var_name = "FILES_" + pkg_systemd
-            files = d.getVar(var_name, 0) or ""
-            if file_append not in files.split():
-                d.setVar(var_name, "%s %s" % (files, file_append))
-                appended = True
-        return appended
-
-    # add systemd files to FILES_*-systemd, parse for Also= and follow recursive
-    def systemd_add_files_and_parse(pkg_systemd, path, service, keys):
-        # avoid infinite recursion
-        if systemd_append_file(pkg_systemd, path + service):
-            fullpath = '${D}' + path + service
-            if service.find('.socket') != -1:
-                # for *.socket add *.service and *@.service
-                service_base = service.replace('.socket', '')
-                systemd_add_files_and_parse(pkg_systemd, path, service_base + '.service', keys)
-                systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
-            for key in keys.split():
-                # recurse all dependencies found in keys ('Also';'Conflicts';..) and add to files
-                cmd = "grep %s %s | sed 's,%s=,,g' | tr ',' '\\n'" % (key, fullpath, key)
-                pipe = os.popen(cmd, 'r')
-                line = pipe.readline()
-                while line:
-                    line = line.replace('\n', '')
-                    systemd_add_files_and_parse(pkg_systemd, path, line, keys)
-                    line = pipe.readline()
-                pipe.close()
-
-    # check service-files and call systemd_add_files_and_parse for each entry
-    def systemd_check_services():
-        base_libdir = d.getVar('base_libdir', 1)
-        searchpaths = '/etc/systemd/system/' + ' '
-        searchpaths += '/lib/systemd/system/' + ' '
-        searchpaths += '/usr/lib/systemd/system/' + ' '
-        systemd_packages = d.getVar('SYSTEMD_PACKAGES', 1)
-        has_exactly_one_service = len(systemd_packages.split()) == 1
-        if has_exactly_one_service:
-            has_exactly_one_service = len(get_package_var(d, 'SYSTEMD_SERVICE', systemd_packages).split()) == 1
-
-        keys = 'Also' # Conflicts??
-        if has_exactly_one_service:
-            # single service gets also the /dev/null dummies
-            keys = 'Also Conflicts'
-        # scan for all in SYSTEMD_SERVICE[]
-        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
-                if path_found != '':
-                    systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
-                else:
-                    raise bb.build.FuncFailed, "\n\nFor package %s SYSTEMD_SERVICE-entry %s does not exist" % \
-                        (pkg_systemd, service)
-
-    """     Setup rdepends / rrecommmends as:
-
-                -----------------------------
-                |  pkg_systemd_base: 'foo'  |
-                -----------------------------
-                           |    ^
-                           |    |                 --------------
-               rrecommends |    | rdepends        | 'systemd'  |
-                           |    |               ->--------------
-                           V    |              / rdepends
-                ------------------------------/
-                | pkg_systemd: 'foo-systemd' |
-                ------------------------------
-    """
-    def systemd_add_rdepends_rrecommends(pkg_systemd):
-        # RDEPENDS_${pkg_systemd} += pkg_systemd_base systemd
-        rdepends = d.getVar('RDEPENDS_' + pkg_systemd, 1) or ""
-        rdepends_arr = rdepends.split()
-        if not 'systemd' in rdepends_arr:
-            rdepends = '%s %s' % (rdepends, 'systemd')
-        pkg_systemd_base = pkg_systemd.replace('-systemd', '')
-        # no automatism for:
-        # recipes setting rdepends themselves AND
-        # not rdepending myself AND
-        # avoid double entries
-        if len(rdepends_arr) == 0 and pkg_systemd != '${PN}' and not pkg_systemd_base in rdepends:
-            rdepends = '%s %s' % (rdepends, pkg_systemd_base)
-        d.setVar('RDEPENDS_' + pkg_systemd, rdepends)
-        auto_rrecommends = d.getVar('SYSTEMD_AUTO_RRECOMMENDS', 1) or 'enable'
-        if auto_rrecommends == 'enable':
-            # RRECOMMENDS_${pkg_systemd_base} += pkg_systemd systemd
-            rrecommends = d.getVar('RRECOMMENDS_' + pkg_systemd_base, 1) or ""
-            # not rrecommending myself AND avoid double entries
-            if pkg_systemd != pkg_systemd_base and not pkg_systemd in rrecommends.split():
-                rrecommends = '%s %s' % (rrecommends, pkg_systemd)
-            d.setVar('RRECOMMENDS_' + pkg_systemd_base, rrecommends)
-
-    # run all modifications once when creating package
-    if os.path.exists('${D}'):
-        for pkg_systemd in d.getVar('SYSTEMD_PACKAGES', 1).split():
-            if get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd) != "":
-                systemd_generate_package_scripts(pkg_systemd)
-                systemd_add_rdepends_rrecommends(pkg_systemd)
-        systemd_check_services()
-}