fix-cursor

This commit is contained in:
shenmo 2023-08-26 23:00:06 +08:00
parent e86328ff07
commit f71bf0d8fb
3 changed files with 86 additions and 4 deletions

View File

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

View File

@ -8,6 +8,12 @@ PKGNAME=`basename $ppparent_dir`
export PACKAGE_NAME=$PKGNAME
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/bookworm-run-root "$@"
exit
fi
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
@ -59,9 +65,9 @@ bwrap --dev-bind $chrootEnvPath/ / \
--dev-bind /run /run \
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
--dev-bind / /host \
--bind-try /usr/share/themes /usr/local/share/themes \
--bind-try /usr/share/icons /usr/local/share/icons \
--bind-try /usr/share/fonts /usr/local/share/fonts \
--ro-bind /usr/share/themes /usr/local/share/themes \
--ro-bind /usr/share/icons /usr/share/icons \
--ro-bind /usr/share/fonts /usr/local/share/fonts \
--hostname bookworm-compatibility-mode \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \

View File

@ -0,0 +1,76 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "当前用户不是 root 用户,退出"
exit
fi
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
export PACKAGE_NAME=$PKGNAME
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/bookworm-init
else
pkexec `dirname $chrootEnvPath`/bin/bookworm-init
fi
fi
if [ "$1" = "" ];then
cmd=bash
else
# container_command=$*
cmd="$1"
shift
for arg in "$@"; do
if [[ $arg =~ \ ]]; then
arg=\'${arg//\'/\'\\\'\'}\'
fi
OPTIONS="${OPTIONS} ${arg}"
done
fi
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
bwrap --dev-bind $chrootEnvPath/ / \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--setenv LC_ALL "$LC_ALL" \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
--dev-bind $chrootEnvPath/ / \
--dev-bind /media /media \
--dev-bind /tmp /tmp \
--dev /dev \
--proc /proc \
--dev-bind /sys /sys \
--dev-bind /run /run \
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
--dev-bind / /host \
--ro-bind /usr/share/themes /usr/local/share/themes \
--ro-bind /usr/share/icons /usr/local/share/icons \
--ro-bind /usr/share/fonts /usr/local/share/fonts \
--hostname bookworm-compatibility-mode \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--dev-bind /home /home \
bash -c "${cmd} ${OPTIONS}"