mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-12-14 19:12:05 +08:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bc1d029e64 | |||
| 4d51bd9dc4 | |||
| 5e41a8f9e7 | |||
| 2949a3df3f | |||
| c1030dd35b | |||
| 8d95934a7d | |||
| 0f4ae31462 | |||
| c04007eccd | |||
| 98575a442c | |||
| ddabb804d0 | |||
| caadd5d785 | |||
| f89f92533f | |||
| a1593ea635 | |||
| d06eaed9e3 | |||
| 00a12285d9 | |||
|
|
c26bf5aa06 | ||
|
|
fb8752e0ba | ||
| e2769c15d2 | |||
|
|
1e88351964 | ||
| 6322718144 | |||
| 60ef6a9893 | |||
| 722efa9726 |
@@ -1,8 +1,8 @@
|
||||
Package: cn.flamescion.bookworm-compatibility-mode
|
||||
Version: 12.3.4
|
||||
Version: 12.4
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Depends: bubblewrap,flatpak,zenity
|
||||
Depends: bubblewrap,xdg-desktop-portal | flatpak,zenity,policykit-1,gcc
|
||||
Maintainer: shenmo <shenmo@spark-app.store>
|
||||
Architecture: arm64
|
||||
Description: bwrap wrapper for install and running debs inside a bookworm container
|
||||
|
||||
17
src/etc/profile.d/ACE-Bookworm.sh
Executable file
17
src/etc/profile.d/ACE-Bookworm.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
# shellcheck shell=sh
|
||||
|
||||
|
||||
|
||||
# Ensure base distro defaults xdg path are set if nothing filed up some
|
||||
# defaults yet.
|
||||
if [ -z "$XDG_DATA_DIRS" ]; then
|
||||
export XDG_DATA_DIRS="/usr/local/share:/usr/share"
|
||||
fi
|
||||
|
||||
# Desktop files (used by desktop environments within both X11 and Wayland) are
|
||||
# looked for in XDG_DATA_DIRS; make sure it includes the relevant directory for ACE
|
||||
ACE_path="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share/"
|
||||
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
|
||||
export XDG_DATA_DIRS="${ACE_path}:${XDG_DATA_DIRS}"
|
||||
fi
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export XDG_DATA_DIRS
|
||||
APP_ROOT="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share"
|
||||
XDG_DATA_DIRS="${APP_ROOT}:/usr/local/share:/usr/share"
|
||||
export APP_ROOT
|
||||
@@ -4,7 +4,7 @@ Name=ACE Software Uninstaller
|
||||
Name[zh_CN]=ACE软件卸载器
|
||||
Comment=用于卸载ACE容器的应用
|
||||
Type=Application
|
||||
Exec=/home/shenmo-ikun/Desktop/bookworm-compatibility-mode/src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
||||
Exec=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
||||
Icon=ACE-uninstaller
|
||||
Categories=AudioVideo
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ if [ -f "$DPKG_INFO_PATH/$PKGNAME_GUESS.list" ]; then
|
||||
elif ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" 1> /dev/null 2>&1; then
|
||||
DPKG_LIST_FILE=$(ls "$DPKG_INFO_PATH/${PKGNAME_GUESS}:*.list" | head -n 1)
|
||||
else
|
||||
echo "No dpkg list file found for $PKGNAME_GUESS.desktop,try to scan to search for the package"
|
||||
echo "Warn:No dpkg list file found for $PKGNAME_GUESS.desktop,try to scan to search for the package"
|
||||
fi
|
||||
|
||||
# 验证文件并执行操作
|
||||
@@ -53,20 +53,21 @@ if [ -f "$DPKG_LIST_FILE" ]; then
|
||||
ret=$?
|
||||
if [ "$ret" = "0" ];then
|
||||
echo "Operation succeeded."
|
||||
exit
|
||||
else
|
||||
echo "Operation failed."
|
||||
exit $ret
|
||||
fi
|
||||
|
||||
else
|
||||
echo "Error: Path not found in the dpkg list file."
|
||||
exit 1
|
||||
echo "Warn: Path not found in the dpkg list file,try to scan to search for the package"
|
||||
fi
|
||||
else
|
||||
# 遍历所有list文件
|
||||
fi
|
||||
# 遍历所有list文件 As fallback
|
||||
for file in "$DPKG_INFO_PATH"/*.list; do
|
||||
if grep -q "$IN_CONTAINER_PATH" "$file"; then
|
||||
PKGNAME_GUESS=$(basename "$file" .list | cut -d':' -f1)
|
||||
echo "Get pkgname $PKGNAME_GUESS, uninstalling..."
|
||||
bookworm-run apt autopurge $PKGNAME_GUESS -y
|
||||
ret=$?
|
||||
if [ "$ret" = "0" ];then
|
||||
@@ -81,5 +82,5 @@ else
|
||||
done
|
||||
echo "Error: No matching package found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
if [ "$UID" != "0" ];then
|
||||
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $0
|
||||
pkexec $0
|
||||
exit
|
||||
fi
|
||||
# 定义应用列表文件路径
|
||||
@@ -23,7 +23,13 @@ for file in "$ACE_dir"/usr/share/applications/*.desktop; do
|
||||
else
|
||||
name=$name_i18n
|
||||
fi
|
||||
comment=$(grep -m 1 '^Comment=' "$file" | cut -d '=' -f 2)
|
||||
comment_orig=$(grep -m 1 '^Comment=' "$file" | cut -d '=' -f 2)
|
||||
comment_i18n=$(grep -m 1 "^Comment\[${LANGUAGE}\]\=" "$file" | cut -d '=' -f 2)
|
||||
if [ -z "$comment_i18n" ] ;then
|
||||
comment=$comment_orig
|
||||
else
|
||||
comment=$comment_i18n
|
||||
fi
|
||||
# 如果没有简介,则显示"N/A"
|
||||
[[ -z "$comment" ]] && comment="N/A"
|
||||
# 添加到应用列表数组
|
||||
|
||||
@@ -36,9 +36,10 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--setenv IS_ACE_ENV "1" \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev-bind /tmp /tmp \
|
||||
--dev-bind-try /media /media \
|
||||
--dev-bind-try /tmp /tmp \
|
||||
--dev /dev \
|
||||
--dev-bind-try /dev/dri /dev/dri \
|
||||
--proc /proc \
|
||||
@@ -49,10 +50,10 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
--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 \
|
||||
--hostname bookworm-compatibility-mode \
|
||||
--hostname Amber-CE-Bookworm \
|
||||
--unshare-uts \
|
||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind /home /home \
|
||||
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind-try /home /home \
|
||||
$@
|
||||
|
||||
|
||||
@@ -177,9 +178,13 @@ printf "%s:%s" "${container_user_name}" "${temporary_password}" | chpasswd -e
|
||||
printf "%s:" "root" | chpasswd -e
|
||||
printf "%s:" "${container_user_name}" | chpasswd -e
|
||||
|
||||
mkdir -p /usr/share/fonts
|
||||
mkdir -p /usr/share/icons
|
||||
mkdir -p /usr/share/themes
|
||||
|
||||
## init host-spawn
|
||||
unlink /flamescion-container-tools/bin-override/host-spawn
|
||||
ln -sfv /flamescion-container-tools/bin-override/host-spawn-`arch` /flamescion-container-tools/bin-override/host-spawn
|
||||
ln -sfv /flamescion-container-tools/bin-override/host-spawn-$(uname -m) /flamescion-container-tools/bin-override/host-spawn
|
||||
|
||||
## install host-integration
|
||||
|
||||
@@ -208,9 +213,10 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--setenv IS_ACE_ENV "1" \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev-bind /tmp /tmp \
|
||||
--dev-bind-try /media /media \
|
||||
--dev-bind-try /tmp /tmp \
|
||||
--dev /dev \
|
||||
--dev-bind-try /dev/dri /dev/dri \
|
||||
--proc /proc \
|
||||
@@ -218,13 +224,13 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
|
||||
--dev-bind /run /run \
|
||||
--dev-bind-try /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 \
|
||||
--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 \
|
||||
--hostname Amber-CE-Bookworm \
|
||||
--unshare-uts \
|
||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind /home /home \
|
||||
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind-try /home /home \
|
||||
locale-gen
|
||||
|
||||
chown -R root $chrootEnvPath
|
||||
|
||||
@@ -54,24 +54,25 @@ bwrap --dev-bind / / \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--setenv IS_ACE_ENV "1" \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev-bind /tmp /tmp \
|
||||
--dev-bind-try /media /media \
|
||||
--dev-bind-try /tmp /tmp \
|
||||
--dev /dev \
|
||||
--dev-bind /dev/dri /dev/dri \
|
||||
--dev-bind-try /dev/dri /dev/dri \
|
||||
--proc /proc \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /run /run \
|
||||
--dev-bind-try /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/share/icons \
|
||||
--ro-bind /usr/share/fonts /usr/local/share/fonts \
|
||||
--hostname bookworm-compatibility-mode \
|
||||
--ro-bind-try /usr/share/themes /usr/local/share/themes \
|
||||
--ro-bind-try /usr/share/icons /usr/share/icons \
|
||||
--ro-bind-try /usr/share/fonts /usr/local/share/fonts \
|
||||
--hostname Amber-CE-Bookworm \
|
||||
--unshare-uts \
|
||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
|
||||
--cap-add CAP_SYS_ADMIN \
|
||||
--dev-bind /home /home \
|
||||
--dev-bind-try /home /home \
|
||||
bash -c "${container_command}"
|
||||
|
||||
|
||||
|
||||
@@ -53,24 +53,25 @@ bwrap --dev-bind / / \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--setenv IS_ACE_ENV "1" \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev-bind /tmp /tmp \
|
||||
--dev-bind-try /media /media \
|
||||
--dev-bind-try /tmp /tmp \
|
||||
--dev /dev \
|
||||
--dev-bind /dev/dri /dev/dri \
|
||||
--dev-bind-try /dev/dri /dev/dri \
|
||||
--proc /proc \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /run /run \
|
||||
--dev-bind-try /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 \
|
||||
--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 \
|
||||
--hostname Amber-CE-Bookworm \
|
||||
--unshare-uts \
|
||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||
--dev-bind-try /etc/resolv.conf /etc/resolv.conf \
|
||||
--cap-add CAP_SYS_ADMIN \
|
||||
--dev-bind /home /home \
|
||||
--dev-bind-try /home /home \
|
||||
bash -c "${container_command}"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||
<policyconfig>
|
||||
<vendor>cn.flamescion.ace-uninstaller</vendor>
|
||||
<icon_name>x-package-repository</icon_name>
|
||||
<action id="cn.flamescion.ace-uninstaller">
|
||||
<description>运行cn.flamescion.ace-uninstaller需要权限</description>
|
||||
<message>要使用cn.flamescion.ace-uninstaller需要权限</message>
|
||||
<defaults>
|
||||
<allow_any>yes</allow_any>
|
||||
<allow_inactive>yes</allow_inactive>
|
||||
<allow_active>yes</allow_active>
|
||||
</defaults>
|
||||
<annotate key="org.freedesktop.policykit.exec.path">/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui</annotate>
|
||||
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||
</action>
|
||||
</policyconfig>
|
||||
|
||||
Reference in New Issue
Block a user