From: ChenQi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] systemd: Remove init.d dir if systemd unit file is present and sysvinit not a distro feature
Date: Thu, 25 Jul 2013 19:08:14 +0800 [thread overview]
Message-ID: <51F1071E.4040304@windriver.com> (raw)
In-Reply-To: <1374573823-27458-1-git-send-email-muhammad_shakeel@mentor.com>
On 07/23/2013 06:03 PM, Shakeel, Muhammad wrote:
> From: Muhammad Shakeel <muhammad_shakeel@mentor.com>
>
> If systemd is supported DISTRO_FEATURE and sysvinit is not and also if
> systemd_unitdir contains a service file(s) then no need to keep init.d scripts
> for sysvinit compatibility.
>
> Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
> ---
> meta/classes/systemd.bbclass | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
> index 9763faa..55f378e 100644
> --- a/meta/classes/systemd.bbclass
> +++ b/meta/classes/systemd.bbclass
> @@ -170,3 +170,22 @@ python rm_systemd_unitdir (){
> shutil.rmtree(systemd_unitdir)
> }
> do_install[postfuncs] += "rm_systemd_unitdir "
> +
> +python rm_sysvinit_initddir (){
> + import shutil
> + if ("systemd" in d.getVar("DISTRO_FEATURES", True).split() and
> + "sysvinit" not in d.getVar("DISTRO_FEATURES", True).split()):
> + service_file_exists = False
> + systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True), "system")
> + if os.path.exists(systemd_unitdir):
> + for filename in os.listdir(systemd_unitdir):
> + if filename.endswith(".service"):
> + service_file_exists = True
> + break
> +
> + if service_file_exists:
> + sysv_initddir = oe.path.join(d.getVar("D", True), d.getVar('INIT_D_DIR', True))
> + if os.path.exists(sysv_initddir):
> + shutil.rmtree(sysv_initddir)
> +}
> +do_install[postfuncs] += "rm_sysvinit_initddir "
Hi,
I just tried this patch out.
It resulted in the following warning.
WARNING: busybox: NOT adding alternative provide /etc/init.d/syslog:
/etc/init.d/syslog.busybox does not exist
I know this warning is harmless. But it's still somewhat misleading. So
are we going to do something about it?
//Chen Qi
//Chen Qi
next prev parent reply other threads:[~2013-07-25 11:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 10:03 [PATCH] systemd: Remove init.d dir if systemd unit file is present and sysvinit not a distro feature Shakeel, Muhammad
2013-07-23 10:46 ` Enrico Scholz
2013-07-24 13:22 ` Muhammad Shakeel
2013-07-24 13:55 ` Paul Eggleton
2013-07-25 9:56 ` Burton, Ross
2013-07-25 10:10 ` Muhammad Shakeel
2013-07-25 11:08 ` ChenQi [this message]
2013-07-25 11:19 ` Muhammad Shakeel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51F1071E.4040304@windriver.com \
--to=qi.chen@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.