From a48dc4c512b576a2cd9f2d17a4c446c25713d0c8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 1 Jul 2011 00:29:11 +0200 Subject: [PATCH] xbps-src [chroot]: try different shells for /bin/sh symlinks. --- xbps-src/shutils/chroot.sh.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index a55ad57893..b3f85dad35 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -183,7 +183,17 @@ _EOF create_binsh_symlink() { if [ ! -h $XBPS_MASTERDIR/bin/sh ]; then - cd $XBPS_MASTERDIR/bin && ln -sf bash sh + cd $XBPS_MASTERDIR/bin + if [ -x bash ]; then + ln -sf bash sh + elif [ -x dash ]; then + ln -sf dash sh + elif [ -x busybox ]; then + ln -sf busybox sh + else + msg_error "cannot find a suitable shell for chroot!\n" + fi + fi }