aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-11-21 14:33:38 +0800
committerChen Qi <Qi.Chen@windriver.com>2014-11-21 15:04:18 +0800
commit9c7d48d4e2c931c5cd5873f6fa1dcb0fedfeb790 (patch)
tree2883282bb9a7e0f136d0878d80a103e682d22107
parenteec4166509e494d1e0e6e36798eb4f5ebeec312f (diff)
downloadopenembedded-core-contrib-ChenQi/nologin-alternatives.tar.gz
openembedded-core-contrib-ChenQi/nologin-alternatives.tar.bz2
openembedded-core-contrib-ChenQi/nologin-alternatives.zip
shadow: use ALTERNATIVE to manage 'nologin'ChenQi/nologin-alternatives
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"