feat: 支持容器内sudo

This commit is contained in:
shenmo 2023-11-03 11:32:40 +08:00
parent 1eb050d2e9
commit bb5ff5afb4
4 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,5 @@
Package: cn.flamescion.bookworm-compatibility-mode
Version: 12.1.12
Version: 12.2
Section: misc
Priority: optional
Depends: bubblewrap

View File

@ -219,5 +219,5 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
--dev-bind /home /home \
locale-gen
chown -R $(who | awk '{print $1}' | head -n 1) $chrootEnvPath
chown -R root $chrootEnvPath

View File

@ -42,7 +42,8 @@ done
fi
bwrap --dev-bind $chrootEnvPath/ / \
bwrap --dev-bind / / \
bwrap \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
@ -69,5 +70,8 @@ bwrap --dev-bind $chrootEnvPath/ / \
--hostname bookworm-compatibility-mode \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--cap-add CAP_SYS_ADMIN \
--dev-bind /home /home \
bash -c "${container_command}"

View File

@ -41,7 +41,8 @@ done
fi
bwrap --dev-bind $chrootEnvPath/ / \
bwrap --dev-bind / / \
bwrap \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
@ -68,6 +69,7 @@ bwrap --dev-bind $chrootEnvPath/ / \
--hostname bookworm-compatibility-mode \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--cap-add CAP_SYS_ADMIN \
--dev-bind /home /home \
bash -c "${container_command}"