summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-11-14 16:31:18 +0800
committerChen Qi <Qi.Chen@windriver.com>2014-11-14 16:31:18 +0800
commitd3cbb9c8c3bbd91fceb64ce2b645d3d0b342eb7d (patch)
tree2f4fa9c87508e27a64897c860c8b7dc16b070a07
parent9cb8e916d701dab7ea9f2796621a94ba45029591 (diff)
downloadopenembedded-core-contrib-ChenQi/alternatives-nologin.tar.gz
openembedded-core-contrib-ChenQi/alternatives-nologin.tar.bz2
openembedded-core-contrib-ChenQi/alternatives-nologin.zip
shadow: use ALTERNATIVE to manage 'nologin'ChenQi/alternatives-nologin
Both util-linux and shadow provide 'nologin', so use the ALTERNATIVE mechanism in OE to manage it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
-rw-r--r--meta/recipes-extended/shadow/shadow.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 14c7281f53..81924e27b7 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -146,18 +146,23 @@ do_install_append() {
# Handle link properly after rename, otherwise missing files would
# lead rpm failed dependencies.
ln -sf newgrp.${BPN} ${D}${bindir}/sg
+
+ # mv nologin to nologin.${BPN}
+ mv ${D}${base_sbindir}/nologin ${D}${base_sbindir}/nologin.${BPN}
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "200"
-ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su"
+ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su nologin"
ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+ALTERNATIVE_LINK_NAME[nologin] = "${sbindir}/nologin"
+ALTERNATIVE_TARGET[nologin] = "${base_sbindir}/nologin.${BPN}"
ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3"
ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"