summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2017-04-28 20:31:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-29 11:16:25 +0100
commit86a2db0b2997fd05882ae0119ef45b1ea5411d39 (patch)
treee19e07c666d4da63f1b54bd8f3e90dc061d3cef5
parent1092a8d4bc78a53f60ad0137aeb08b31853db9eb (diff)
downloadopenembedded-core-86a2db0b2997fd05882ae0119ef45b1ea5411d39.tar.gz
openembedded-core-86a2db0b2997fd05882ae0119ef45b1ea5411d39.tar.bz2
openembedded-core-86a2db0b2997fd05882ae0119ef45b1ea5411d39.zip
busybox: make bash a valid login shell if enabled
Add bash to /etc/shells if busybox is built with bash applet anabled to fix login via dropbear. Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/busybox/busybox.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index 375632dcc3..adc6e9a717 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -398,6 +398,9 @@ pkg_postinst_${PN} () {
fi
done
fi
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links*; then
+ grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+ fi
}
pkg_prerm_${PN} () {
@@ -422,6 +425,12 @@ pkg_prerm_${PN} () {
export PATH=$PATH:$tmpdir
}
+pkg_postrm_${PN} () {
+ if grep -q "^${base_bindir}/bash$" $D${sysconfdir}/busybox.links* && [ ! -e $D${base_bindir}/bash ]; then
+ printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+ fi
+}
+
pkg_prerm_${PN}-syslog () {
# remove syslog
if test "x$D" = "x"; then