浏览代码

mklive.sh: ensure dash is /bin/sh if installed

classabbyamp 4 月之前
父节点
当前提交
c99cafb613
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      mklive.sh

+ 8 - 0
mklive.sh

@@ -164,13 +164,21 @@ install_packages() {
     if [ -f "$ROOTFS"/etc/default/libc-locales ]; then
         sed -e "s/\#\(${LOCALE}.*\)/\1/g" -i "$ROOTFS"/etc/default/libc-locales
     fi
+
     if XBPS_ARCH=$BASE_ARCH "$XBPS_QUERY_CMD" -r "$ROOTFS" dkms >/dev/null 2>&1; then
         # dkms modules alphabetically before dkms can't configure
         # if dkms hasn't configured beforehand to create /var/lib/dkms
         chroot "$ROOTFS" env -i xbps-reconfigure dkms
     fi
+
     chroot "$ROOTFS" env -i xbps-reconfigure -a
 
+    if XBPS_ARCH=$BASE_ARCH "$XBPS_QUERY_CMD" -r "$ROOTFS" dash >/dev/null 2>&1; then
+        # bash configures alphabetically before dash,
+        # so if it's installed we should ensure it's /bin/sh
+        chroot "$ROOTFS" env -i xbps-alternatives -s dash
+    fi
+
     post_install_packages
 }