[OE-core] [RESEND PATCH 1/2] shadow: use ALTERNATIVE to manage 'nologin'

Mike Crowe mac at mcrowe.com
Mon Feb 1 15:48:25 UTC 2016


Both util-linux and shadow provide 'nologin', so use the ALTERNATIVE
mechanism in OE to manage it.

Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Mike Crowe <mac at mcrowe.com>
---
 meta/recipes-extended/shadow/shadow.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Originally submitted by Chen Qi in
<9c7d48d4e2c931c5cd5873f6fa1dcb0fedfeb790.1416554582.git.Qi.Chen at windriver.com>
back in 2014. I've just rebased it on master and fixed the conflicts.

diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 4313ffe..a5f1048 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -151,6 +151,9 @@ 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}
 }
 
 PACKAGES =+ "${PN}-base"
@@ -170,10 +173,12 @@ inherit update-alternatives
 
 ALTERNATIVE_PRIORITY = "200"
 
-ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr nologin"
 ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
 ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
+ALTERNATIVE_TARGET[nologin] = "${base_sbindir}/nologin.${BPN}"
 
 ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
-- 
2.1.4



More information about the Openembedded-core mailing list