更新Mount

This commit is contained in:
gfdgd xi 2023-02-26 21:43:41 +08:00
parent 74c94cc58f
commit fb5dae05f8
2 changed files with 14 additions and 6 deletions

View File

@ -43,5 +43,12 @@ else
fi
# 挂载此内容以可以跨架构运行程序
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
# 判断是否有 Root 权限
cat etc/sudoers | grep "$2"
if [[ $? != 0 ]]; then
echo "$2 ALL=(ALL:ALL) ALL" >> etc/sudoers
fi
# 写入 DNS
cat /etc/resolv.conf > etc/resolv.conf
# 如果参数 3 存在
"$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3}

View File

@ -27,10 +27,11 @@ fi
#cat /etc/resolv.conf > $DESTDIR/etc/resolv.conf
SHELL=/bin/bash unshare --fork --pid chroot "$DESTDIR" "$@"
exit
if [[ -d /sys/firmware/efi/ ]] ; then
while umount "$DESTDIR/sys/firmware/efi/efivars" 2>/dev/null ; do : ;done
fi
for dir in dev/pts dev/shm dev sys proc run media ; do
while umount "$DESTDIR/$dir" 2>/dev/null; do : ;done
done
# 下面的因为有问题,不使用
#if [[ -d /sys/firmware/efi/ ]] ; then
# while umount "$DESTDIR/sys/firmware/efi/efivars" 2>/dev/null ; do : ;done
#fi
#for dir in dev/pts dev/shm dev sys proc run media ; do
# while umount "$DESTDIR/$dir" 2>/dev/null; do : ;done
#done
#umount -lf "$DESTDIR" 2>/dev/null