From 2d399c57bad5a9dd966ae299a616d64ae9cfc06b Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Fri, 3 Mar 2023 22:33:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95chroot?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mount.sh | 3 ++- pardus-chroot | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Mount.sh b/Mount.sh index af997d9..d1070ad 100755 --- a/Mount.sh +++ b/Mount.sh @@ -51,4 +51,5 @@ fi # 写入 DNS cat /etc/resolv.conf > etc/resolv.conf # 如果参数 3 存在 -"$programPath/pardus-chroot" --userspec=$2:$2 . env "HOME=/home/$2" ${@:3} +"$programPath/pardus-chroot" . #env "HOME=/home/$2" ${@:3} +chroot "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3} diff --git a/pardus-chroot b/pardus-chroot index 2289e55..193560c 100755 --- a/pardus-chroot +++ b/pardus-chroot @@ -25,8 +25,8 @@ if [[ -d /sys/firmware/efi/ ]] ; then mount -t efivarfs efivarfs "$DESTDIR/sys/firmware/efi/efivars" fi #cat /etc/resolv.conf > $DESTDIR/etc/resolv.conf -SHELL=/bin/bash unshare --fork --pid chroot "$DESTDIR" "$@" -exit +#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