diff --git a/src/DEBIAN/control b/src/DEBIAN/control index fce42a3..5ba39af 100755 --- a/src/DEBIAN/control +++ b/src/DEBIAN/control @@ -1,5 +1,5 @@ Package: cn.flamescion.bookworm-compatibility-mode -Version: 12.1.8 +Version: 12.1.9 Section: misc Priority: optional Depends: bubblewrap diff --git a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init index 95f9f93..09548f8 100755 --- a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init +++ b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init @@ -48,14 +48,14 @@ bwrap --dev-bind $chrootEnvPath/ / \ --dev-bind /run /run \ --dev-bind-try /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/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 "${container_command}" } diff --git a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run index 21beeba..22f4a4a 100755 --- a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run +++ b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run @@ -24,27 +24,24 @@ 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) +#### This part is for args pharm +if [ "$1" = "" ];then +container_command="bash" +else +container_command="$1" +shift +for arg in "$@"; do + arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')" + arg="${arg%x}" + container_command="${container_command} '${arg}'" +done +fi + + bwrap --dev-bind $chrootEnvPath/ / \ --setenv LANG "$LANG" \ --setenv LC_COLLATE "$LC_COLLATE" \ @@ -73,4 +70,4 @@ bwrap --dev-bind $chrootEnvPath/ / \ --unshare-uts \ --dev-bind /etc/resolv.conf /etc/resolv.conf \ --dev-bind /home /home \ - bash -c "${cmd} ${OPTIONS}" + bash -c "${container_command}" diff --git a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-root b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-root index a7c135a..d924875 100755 --- a/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-root +++ b/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run-root @@ -12,6 +12,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 @@ -22,27 +28,24 @@ 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) +#### This part is for args pharm +if [ "$1" = "" ];then +container_command="bash" +else +container_command="$1" +shift +for arg in "$@"; do + arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')" + arg="${arg%x}" + container_command="${container_command} '${arg}'" +done +fi + + bwrap --dev-bind $chrootEnvPath/ / \ --setenv LANG "$LANG" \ --setenv LC_COLLATE "$LC_COLLATE" \ @@ -71,7 +74,7 @@ bwrap --dev-bind $chrootEnvPath/ / \ --unshare-uts \ --dev-bind /etc/resolv.conf /etc/resolv.conf \ --dev-bind /home /home \ - bash -c "${cmd} ${OPTIONS}" + bash -c "${container_command}"