diff options
author | 2017-09-11 18:24:25 +0200 | |
---|---|---|
committer | 2017-09-11 18:24:25 +0200 | |
commit | ebbd34942183b0bdb247a04389634a039960fd9b (patch) | |
tree | e4af6a452eb92ce0baedd512e835a318874482b6 | |
parent | 46a646b3f0410da733b6479e4d430e4ebf9bafe3 (diff) |
set bash as default shell in container
By default, debian 8 uses dash as a diversion for /bin/sh.
This may break some script and in particular in AGL SDK.
This patch adds a change in the diversion between dash and bash
Bug-AGL: SPEC-743
Change-Id: Ibadce48b054263ce1596086c8a983985db45d2bd
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
-rw-r--r-- | INSTALL/common.d/10_base | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/INSTALL/common.d/10_base b/INSTALL/common.d/10_base index e429e65..5cff36b 100644 --- a/INSTALL/common.d/10_base +++ b/INSTALL/common.d/10_base @@ -1,5 +1,16 @@ #!/bin/bash +# set bash as default shell for /bin/sh +diverter=$(dpkg-divert --listpackage /bin/sh) +[[ "$diverter" == "dash" ]] && { + # inspired by dash postinstall + dpkg-divert --package dash --remove /bin/sh + dpkg-divert --package bash --divert /bin/sh.distrib --add /bin/sh + [[ -e /bin/sh ]] && cp -dp /bin/sh /bin/sh.distrib + ln -sf bash /bin/sh.tmp + mv -f /bin/sh.tmp /bin/sh +} + # add backports and testing repositories echo "deb http://http.debian.net/debian jessie-backports main contrib" >>/etc/apt/sources.list |