diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index a55ad578932..b3f85dad35a 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 }