Patchwork [1/1] sysvinit: use ALTERNATIVE to manage sulogin

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date Nov. 15, 2013, 10:45 a.m.
Message ID <251777d6d4284fb929939d626990ee3f26394c05.1384512287.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/61769/
State Accepted
Commit 42f1d64c8e6fc9cbdc6b126a224bd33ff6c48c19
Headers show

Comments

Qi.Chen@windriver.com - Nov. 15, 2013, 10:45 a.m.
From: Chen Qi <qi.chen@windriver.com>

Busybox also provides sulogin command, so we need to use the ALTERNATIVE
mechanism to manage it.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Phil Blundell - Nov. 15, 2013, 12:51 p.m.
On Fri, 2013-11-15 at 18:45 +0800, Qi.Chen@windriver.com wrote:
> -FILES_sysvinit-sulogin = "${base_sbindir}/sulogin"
> +FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"

At the risk of seeming dim, how does ${base_sbindir}/sulogin.sysvinit
get installed in the first place?

p.
Qi.Chen@windriver.com - Nov. 16, 2013, 2:31 a.m.
On 11/15/2013 08:51 PM, Phil Blundell wrote:
> On Fri, 2013-11-15 at 18:45 +0800, Qi.Chen@windriver.com wrote:
>> -FILES_sysvinit-sulogin = "${base_sbindir}/sulogin"
>> +FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
> At the risk of seeming dim, how does ${base_sbindir}/sulogin.sysvinit
> get installed in the first place?
>
> p.
>
>
>
>
It's handled in the update-alternative.bbclass.

# We need to do the rename after the image creation step, but before
# the split and strip steps..  packagecopy seems to be the earliest 
reasonable
# place.
python perform_packagecopy_append () {
.....
}

Best Regards,
Chen Qi

Patch

diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
index 50842e2..f2d5659 100644
--- a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -44,6 +44,9 @@  ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
 ALTERNATIVE_${PN}-pidof = "pidof"
 ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
 
+ALTERNATIVE_${PN}-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1"
 
 ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
@@ -56,7 +59,7 @@  ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
 PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
 FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
 FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
-FILES_sysvinit-sulogin = "${base_sbindir}/sulogin"
+FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
 
 RDEPENDS_${PN} += "sysvinit-pidof"