Compare commits

...

20 Commits

Author SHA1 Message Date
cb0112c1c2 9.0
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-11-19 15:54:21 +00:00
a2378626c5 Revert "修复每次启动后ACE中安装过的应用都被标记为最新的问题"
This reverts commit 2d22c3383a.
2025-09-17 12:31:02 +00:00
2d22c3383a 修复每次启动后ACE中安装过的应用都被标记为最新的问题
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-09-16 12:35:56 +00:00
39e1a9e9e7 log.info
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-07-25 08:57:02 +00:00
15a917a6c2 https://share.spark-app.store/index.php?share/folder&user=1&sid=Ua5mg4sP
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-07-15 15:55:05 +00:00
0f0c590ee4 fix 磐石 2025-07-07 10:55:29 +08:00
7347bf0bee https://mirrors.sdu.edu.cn/spark-store/amber-ce/
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-07-07 02:52:51 +00:00
04bc7c8917 update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-06-14 04:15:08 +00:00
5fffd313f5 !10 更新 ACE 兼容环境图标
* 删除文件 src/usr/share/icons/.keep
* 更新图标
* 新建 icons
* 删除文件 src/usr/share/icons/@PKG_NAME@.png
* 删除文件 src/usr/share/icons/@PKG_NAME@-uninstaller.png
* 更新图标
* 删除文件 src/opt/apps/@PKG_NAME@/ACE-uninstaller-orig.png
* 删除文件 src/opt/apps/@PKG_NAME@/ACE-transparent.png
* 删除文件 src/opt/apps/@PKG_NAME@/ACE logo.png
2025-06-14 04:14:33 +00:00
51e7c1a4d8 new share link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-06-07 04:01:54 +00:00
3fa34672ca 8.4 2025-06-07 10:59:02 +08:00
51b30d0ef7 修复递归问题
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-06-04 15:30:40 +00:00
6246cf3c98 自动添加 X-AMBER-CE-DESKTOP-NAME
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-05-30 15:32:16 +00:00
f169fee3ac fix init lauguage
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-27 19:09:35 +00:00
1b2eaddb4d !9 Revert "update src/opt/apps/@PKG_NAME@/files/bin/ace-init."
Merge pull request !9 from shenmo/revert-05c5b4a
2025-04-27 19:08:43 +00:00
9071dbf2ff Revert "update src/opt/apps/@PKG_NAME@/files/bin/ace-init."
This reverts commit 05c5b4a2b9.
2025-04-27 19:08:24 +00:00
05c5b4a2b9 update src/opt/apps/@PKG_NAME@/files/bin/ace-init.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-27 17:43:23 +00:00
26dcf96d87 支持 Ubuntu 25 等 systemd 不再提供 utmp 的情景下获取当前用户名
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-18 15:01:44 +00:00
05e00b41f9 12.7.6
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-16 13:40:04 +00:00
e99d4b5e58 pkgname 通用
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-04-15 14:41:58 +00:00
27 changed files with 204 additions and 101 deletions

View File

@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -18,7 +18,7 @@ Please use `git clone --recurse-submodules` to obtain the env
## Install GuideDebian/Fedora/Arch) ## Install GuideDebian/Fedora/Arch)
Share Linkhttps://share.spark-app.store/index.php?share/folder&user=1&sid=wHP86Kp4 Share Linkhttps://mirrors.sdu.edu.cn/spark-store/amber-ce/ or https://share.spark-app.store/index.php?share/folder&user=1&sid=Ua5mg4sP
Ubuntu 18.04 Need install https://packages.debian.org/buster/bubblewrap Ubuntu 18.04 Need install https://packages.debian.org/buster/bubblewrap
@@ -35,7 +35,7 @@ Run an amd64 Debian Bookworm container via LATX
Command bookworm-run-x86 Command bookworm-run-x86
https://share.spark-app.store/index.php?share/folder&user=1&sid=GnktisUQ https://mirrors.sdu.edu.cn/spark-store/amber-ce/ or https://share.spark-app.store/index.php?share/folder&user=1&sid=Ua5mg4sP
--- ---

View File

@@ -14,7 +14,7 @@
## 安装指南 Debian/Fedora/Arch) ## 安装指南 Debian/Fedora/Arch)
分享链接https://share.spark-app.store/index.php?share/folder&user=1&sid=wHP86Kp4 分享链接:https://mirrors.sdu.edu.cn/spark-store/amber-ce/ 或者 https://share.spark-app.store/index.php?share/folder&user=1&sid=Ua5mg4sP
Ubuntu 18.04 需要安装 https://packages.debian.org/buster/bubblewrap Ubuntu 18.04 需要安装 https://packages.debian.org/buster/bubblewrap
@@ -30,7 +30,7 @@ Arch`yay -S amber-ce-bookworm`
使用方法: bookworm-run-x86 使用方法: bookworm-run-x86
https://share.spark-app.store/index.php?share/folder&user=1&sid=GnktisUQ https://mirrors.sdu.edu.cn/spark-store/amber-ce/ 或者 https://share.spark-app.store/index.php?share/folder&user=1&sid=Ua5mg4sP
--- ---

View File

@@ -2,3 +2,5 @@
@HOST_NAME@=Amber-CE-Bookworm @HOST_NAME@=Amber-CE-Bookworm
@EXEC_NAME@=bookworm-run @EXEC_NAME@=bookworm-run
@PRETTY_NAME@=Bookworm @PRETTY_NAME@=Bookworm
@VERSION@=12.8.5
@CODE_NAME@=bookworm

View File

@@ -22,13 +22,17 @@ read_config() {
} }
pushd $(dirname $(realpath $0)) pushd $(dirname $(realpath $0))
read_config "ace-base.config" cp ace-base.config ace-base-build.config
echo "@ARCH@=$(dpkg --print-architecture)" >> ace-base-build.config
read_config "ace-base-build.config"
# 访问变量 # 访问变量
echo "Package Name: $PKG_NAME" echo "Package Name: $PKG_NAME"
echo "Host Name: $HOST_NAME" echo "Host Name: $HOST_NAME"
echo "Executable Name: $EXEC_NAME" echo "Executable Name: $EXEC_NAME"
echo "Pretty Name: $PRETTY_NAME" echo "Pretty Name: $PRETTY_NAME"
echo "Architecture: $ARCH"
echo "Codename: $CODE_NAME"
if [[ -z "$1" ]];then if [[ -z "$1" ]];then
echo "Need TARGET DIR" echo "Need TARGET DIR"
@@ -38,5 +42,5 @@ target_dir="${1}" # 要处理的目标目录
bash replacer.sh ${target_dir}/ bash replacer.sh ${target_dir}/
bash linker.sh ${target_dir}/ bash linker.sh ${target_dir}/
cd ${target_dir}/opt/apps/$PKG_NAME/files && bash build-container.sh $(uname -m) cd ${target_dir}/opt/apps/$PKG_NAME/files && bash build-container.sh $ARCH $CODE_NAME
popd popd

7
debian-build.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
pushd $(dirname $(realpath $0))
sudo apt install debootstrap systemd-container sudo file -y
cp -vr src pkg
bash build-pkg.sh pkg
dpkg-deb -Z gzip -b pkg/ ./
popd

5
debian/changelog vendored
View File

@@ -1,7 +1,10 @@
amber-ce-bookworm (12.7.5) UNRELEASED; urgency=low amber-ce-bookworm (12.9.1) UNRELEASED; urgency=low
* 通用 ACE 构建,现不再需要单独使用构建脚本 * 通用 ACE 构建,现不再需要单独使用构建脚本
* 更方便地更改成其他ACE * 更方便地更改成其他ACE
* 现可在容器内使用 dpkg-buildpackage * 现可在容器内使用 dpkg-buildpackage
* 支持 Ubuntu 25 等 systemd 不再提供 utmp 的情景下获取当前用户名
* 自动添加 X-AMBER-CE-DESKTOP-NAME
* 修复更新时的递归问题
-- shenmo <shenmo@spark-app.store> Wed, 25 Sep 2024 23:15:49 +0800 -- shenmo <shenmo@spark-app.store> Wed, 25 Sep 2024 23:15:49 +0800

View File

@@ -19,16 +19,16 @@ fi
/opt/apps/$PACKAGE_NAME/files/bin/ace-init /opt/apps/$PACKAGE_NAME/files/bin/ace-init
if [ "${PACKAGE_NAME}" = "amber-ce-bookworm" ];then
systemctl daemon-reload systemctl daemon-reload
systemctl enable amber-ce-bookworm-auto-upgrade systemctl enable $PACKAGE_NAME-auto-upgrade
systemctl start amber-ce-bookworm-auto-upgrade systemctl start $PACKAGE_NAME-auto-upgrade
# enable kernel.unprivileged_userns_clone # enable kernel.unprivileged_userns_clone
# disable kernel.apparmor_restrict_unprivileged_unconfined and kernel.apparmor_restrict_unprivileged_userns # disable kernel.apparmor_restrict_unprivileged_unconfined and kernel.apparmor_restrict_unprivileged_userns
if [ -f /usr/lib/sysctl.d/amber-ce-bookworm.conf ];then if [ -f /usr/lib/sysctl.d/$PACKAGE_NAME.conf ];then
sysctl -p /usr/lib/sysctl.d/amber-ce-bookworm.conf sysctl -p /usr/lib/sysctl.d/$PACKAGE_NAME.conf
fi fi
fi
true true

View File

@@ -3,8 +3,8 @@ PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then
PACKAGE_NAME=amber-ce-bookworm # 为了后面正确清理 PACKAGE_NAME=amber-ce-bookworm # 为了后面正确清理
systemctl stop amber-ce-bookworm-auto-upgrade systemctl stop $PACKAGE_NAME-auto-upgrade
systemctl disable amber-ce-bookworm-auto-upgrade systemctl disable $PACKAGE_NAME-auto-upgrade
fi fi

1
debian/control vendored
View File

@@ -13,4 +13,5 @@ Package: cn.flamescion.bookworm-compatibility-mode
Architecture: any Architecture: any
Multi-Arch: foreign Multi-Arch: foreign
Depends: ${misc:Depends},bubblewrap,flatpak,zenity,policykit-1 | pkexec | polkit-1 | polkit,systemd,procps Depends: ${misc:Depends},bubblewrap,flatpak,zenity,policykit-1 | pkexec | polkit-1 | polkit,systemd,procps
Conflicts: ace-host-integration
Description: bwrap wrapper for install and running debs inside a bookworm container Description: bwrap wrapper for install and running debs inside a bookworm container

View File

@@ -22,13 +22,14 @@ read_config() {
} }
read_config "ace-base.config" read_config "ace-base-build.config"
# 访问变量 # 访问变量
echo "Package Name: $PKG_NAME" echo "Package Name: $PKG_NAME"
echo "Host Name: $HOST_NAME" echo "Host Name: $HOST_NAME"
echo "Executable Name: $EXEC_NAME" echo "Executable Name: $EXEC_NAME"
echo "Pretty Name: $PRETTY_NAME" echo "Pretty Name: $PRETTY_NAME"
echo "Version: $VERSION"
target_dir="${1}" target_dir="${1}"
mkdir ${target_dir}/usr/bin mkdir ${target_dir}/usr/bin
ln -vfs ../../opt/apps/$PKG_NAME/files/bin/ace-run ${target_dir}/usr/bin/$EXEC_NAME ln -vfs ../../opt/apps/$PKG_NAME/files/bin/ace-run ${target_dir}/usr/bin/$EXEC_NAME

2
replacer.sh Normal file → Executable file
View File

@@ -3,7 +3,7 @@
######################################## ########################################
# 配置部分 # 配置部分
######################################## ########################################
config_file="ace-base.config" # 配置文件路径 config_file="ace-base-build.config" # 配置文件路径
if [[ -z "$1" ]];then if [[ -z "$1" ]];then
echo "Need TARGET DIR" echo "Need TARGET DIR"
exit exit

13
src/DEBIAN/control Normal file
View File

@@ -0,0 +1,13 @@
Package: @PKG_NAME@
Source: amber-ce
Version: @VERSION@
Architecture: @ARCH@
Maintainer: shenmo <shenmo@spark-app.store>
Installed-Size: 145627
Depends: bubblewrap, flatpak, zenity, policykit-1 | pkexec | polkit-1 | polkit, systemd, procps
Section: misc
Conflists: ace-host-integration
Priority: optional
Multi-Arch: foreign
Homepage: https://gitee.com/amber-ce/amber-ce-bookworm/
Description: bwrap wrapper for install and running debs inside a @PRETTY_NAME@ container

18
src/DEBIAN/postinst Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
/opt/apps/$PACKAGE_NAME/files/bin/ace-init
systemctl daemon-reload
systemctl enable $PACKAGE_NAME-auto-upgrade
systemctl start $PACKAGE_NAME-auto-upgrade
if [ -f /usr/lib/sysctl.d/$PACKAGE_NAME.conf ];then
sysctl -p /usr/lib/sysctl.d/$PACKAGE_NAME.conf
fi
true

21
src/DEBIAN/postrm Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
systemctl stop $PACKAGE_NAME-auto-upgrade
systemctl disable $PACKAGE_NAME-auto-upgrade
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留"
rm -rf /opt/apps/$PACKAGE_NAME
else
echo "非卸载,跳过清理"
fi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 289 KiB

View File

@@ -38,50 +38,61 @@ function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; } function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; } function log.debug() { log.log "debug" $@; }
function do_integrate(){ function do_integrate(){
local file=$1 local file=$1
if [ -f "$file" ]; then if [ -f "$file" ]; then
exec_line=$(grep "^Exec=" "$file") # 获取文件名(不带.desktop后缀作为X-AMBER-CE-DESKTOP-NAME的值
# 检查是否是@EXEC_NAME@ local desktop_name=$(basename "$file" .desktop)
if [[ $exec_line != Exec="@EXEC_NAME@ "* ]]; then
echo "$file is detected. Processing host system integration..."
sed -i 's|^Exec=\(.*\)|Exec=@EXEC_NAME@ \1|' "$file"
sed -i '/^TryExec=/d' "$file"
sed -i '/^Name=/ s/$/ (@PRETTY_NAME@)/' "$file"
sed -i "/^Name\[${LANGUAGE}\]=/ s/\$/ (@PRETTY_NAME@)/" "$file"
icon_line=$(grep "^Icon=" "$file")
if [[ "$icon_line" == "Icon=/"* ]]; then
# 如果Icon=后面接的是/,则添加前缀
sed -i 's|^Icon=/|Icon=/opt/apps/@PKG_NAME@/files/ace-env/|' "$file"
fi
fi # 检查是否已经处理过通过检查X-AMBER-CE-DESKTOP-NAME字段
if ! grep -q "^X-AMBER-CE-DESKTOP-NAME=" "$file"; then
echo "$file is detected. Processing host system integration..."
# 修改Exec行如果尚未修改
if ! grep -q "^Exec=@EXEC_NAME@ " "$file"; then
sed -i 's|^Exec=\(.*\)|Exec=@EXEC_NAME@ \1|' "$file"
fi
# 删除TryExec行
sed -i '/^TryExec=/d' "$file"
# 修改Name行包括本地化Name
sed -i '/^Name=/ s/$/ (@PRETTY_NAME@)/' "$file"
sed -i "/^Name\[${LANGUAGE}\]=/ s/\$/ (@PRETTY_NAME@)/" "$file"
# 修改GenericName行包括本地化GenericName
sed -i '/^GenericName=/ s/$/ (@PRETTY_NAME@)/' "$file"
sed -i "/^GenericName\[${LANGUAGE}\]=/ s/\$/ (@PRETTY_NAME@)/" "$file"
# 添加X-AMBER-CE-DESKTOP-NAME字段
echo "X-AMBER-CE-DESKTOP-NAME=${desktop_name}" >> "$file"
# 处理Icon行
icon_line=$(grep "^Icon=" "$file")
if [[ "$icon_line" == "Icon=/"* ]]; then
# 如果Icon=后面接的是/,则添加前缀
sed -i 's|^Icon=/|Icon=/opt/apps/@PKG_NAME@/files/ace-env/|' "$file"
fi
fi
fi fi
chmod +x $file chmod +x "$file"
} }
if [ "${IS_ACE_ENV}" != "" ] ;then if [ "${IS_ACE_ENV}" != "" ]; then
if [ -e /opt/apps/ ];then if [ -e /opt/apps/ ]; then
for app_dir in $(ls /opt/apps/); do for app_dir in $(ls /opt/apps/); do
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do for file in /opt/apps/$app_dir/entries/applications/*.desktop; do
do_integrate $file do_integrate "$file"
done
done
done else
done log.warn "No /opt/apps directory. Skip..."
else fi
log.warn "No /opt/apps directory. Skip..."
fi
for file in /usr/share/applications/*.desktop; do
do_integrate $file
done
find "/usr/share/applications/" -xtype l -delete
for file in /usr/share/applications/*.desktop; do
do_integrate "$file"
done
find "/usr/share/applications/" -xtype l -delete
else else
log.error "DO NOT run me on host OS"
log.error "DO NOT run me on host OS"
fi fi

View File

@@ -22,8 +22,20 @@ fi
HERE="$(dirname $(realpath $0))" HERE="$(dirname $(realpath $0))"
function get_current_user() {
# 优先通过 who 命令获取用户
local user
user=$(who | awk '{print $1}' | head -n 1 2>/dev/null)
non_root_user=$(who | awk '{print $1}' | head -n 1) # 如果 who 无输出,则通过 loginctl 获取
if [[ -z "$user" ]]; then
user=$(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $3}' | head -n 1)
fi
# 返回最终结果(可能为空)
echo "${user}"
}
non_root_user=$(get_current_user)
uid=$(id -u $non_root_user) uid=$(id -u $non_root_user)
function bookworm-run(){ function bookworm-run(){
@@ -74,8 +86,8 @@ chmod 777 $chrootEnvPath/etc/localtime
bookworm-run cp /host/etc/locale.gen /etc/locale.gen && locale-gen bookworm-run cp /host/etc/locale.gen /etc/locale.gen && locale-gen
bookworm-run touch /finish.flag bookworm-run touch /finish.flag
bookworm-run apt clean bookworm-run apt clean
bookworm-run chown -R $(who | awk '{print $1}' | head -n 1) /usr/lib/locale/ bookworm-run chown -R $(get_current_user) /usr/lib/locale/
sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ / \ sudo -u $(get_current_user) bwrap --dev-bind $chrootEnvPath/ / \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \ --setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /amber-ce-tools/bin-override:$PATH \ --setenv PATH /amber-ce-tools/bin-override:$PATH \
--setenv IS_ACE_ENV "1" \ --setenv IS_ACE_ENV "1" \
@@ -100,4 +112,5 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
bookworm-run update-locale LANG=$LANG bookworm-run update-locale LANG=$LANG
chown -R root $chrootEnvPath chown -R root $chrootEnvPath
chmod 777 -R $chrootEnvPath/usr/share/icons chmod 777 -R $chrootEnvPath/usr/share/icons
rm -vfr $chrootEnvPath/dev/*
${HERE}/amber-ce-configure-nvidia || true ${HERE}/amber-ce-configure-nvidia || true

View File

@@ -24,17 +24,19 @@ uid=$(id -u $non_root_user)
#### This part is for args pharm #### This part is for args pharm
if [ "$1" = "" ];then if [ $# -eq 0 ]; then
container_command="bash" container_command="bash"
else else
container_command="$1" # 正确转义所有参数,处理空格和特殊字符
shift container_command=""
for arg in "$@"; do for arg in "$@"; do
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')" # 使用 printf %q 进行安全的 shell 转义
arg="${arg%x}" escaped_arg="$(printf "%q" "$arg")"
container_command="${container_command} '${arg}'" container_command="${container_command} ${escaped_arg}"
done done
container_command="${container_command# }" # 移除开头的空格
fi fi
######################################################################################### #########################################################################################
##########合成bwrap 1. 基础函数配置段 ##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令 # 初始化 EXEC_COMMAND 为 bwrap 基础指令

View File

@@ -24,17 +24,19 @@ uid=$(id -u $non_root_user)
#### This part is for args pharm #### This part is for args pharm
if [ "$1" = "" ];then if [ $# -eq 0 ]; then
container_command="bash" container_command="bash"
else else
container_command="$1" # 正确转义所有参数,处理空格和特殊字符
shift container_command=""
for arg in "$@"; do for arg in "$@"; do
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')" # 使用 printf %q 进行安全的 shell 转义
arg="${arg%x}" escaped_arg="$(printf "%q" "$arg")"
container_command="${container_command} '${arg}'" container_command="${container_command} ${escaped_arg}"
done done
container_command="${container_command# }" # 移除开头的空格
fi fi
######################################################################################### #########################################################################################
##########合成bwrap 1. 基础函数配置段 ##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令 # 初始化 EXEC_COMMAND 为 bwrap 基础指令

View File

@@ -54,7 +54,7 @@ fi
if [ -f "$DPKG_LIST_FILE" ]; then if [ -f "$DPKG_LIST_FILE" ]; then
if grep -q "$IN_CONTAINER_PATH" "$DPKG_LIST_FILE" || grep -q "/opt/apps/$PKGNAME_GUESS/entries/applications/$PKGNAME_GUESS.desktop" "$DPKG_LIST_FILE"; then if grep -q "$IN_CONTAINER_PATH" "$DPKG_LIST_FILE" || grep -q "/opt/apps/$PKGNAME_GUESS/entries/applications/$PKGNAME_GUESS.desktop" "$DPKG_LIST_FILE"; then
bookworm-run apt autopurge $PKGNAME_GUESS -y @EXEC_NAME@ apt autopurge $PKGNAME_GUESS -y
ret=$? ret=$?
if [ "$ret" = "0" ];then if [ "$ret" = "0" ];then
echo "Operation succeeded." echo "Operation succeeded."
@@ -73,7 +73,7 @@ fi
if grep -q "$IN_CONTAINER_PATH" "$file"; then if grep -q "$IN_CONTAINER_PATH" "$file"; then
PKGNAME_GUESS=$(basename "$file" .list | cut -d':' -f1) PKGNAME_GUESS=$(basename "$file" .list | cut -d':' -f1)
echo "Get pkgname $PKGNAME_GUESS, uninstalling..." echo "Get pkgname $PKGNAME_GUESS, uninstalling..."
bookworm-run apt autopurge $PKGNAME_GUESS -y @EXEC_NAME@ apt autopurge $PKGNAME_GUESS -y
ret=$? ret=$?
if [ "$ret" = "0" ];then if [ "$ret" = "0" ];then
echo "Operation succeeded." echo "Operation succeeded."

View File

@@ -62,5 +62,5 @@ if [ $copied -eq 1 ]; then
echo "$nvidia_version" > "$ACE_DIR/current_version" echo "$nvidia_version" > "$ACE_DIR/current_version"
log.info "NVIDIA 驱动库已成功链接 Nvidia Driver Libs are successfully linked. " log.info "NVIDIA 驱动库已成功链接 Nvidia Driver Libs are successfully linked. "
else else
log.error "未找到有效 NVIDIA 库文件 No valid NVIDIA Driver Libs found." log.info "未找到有效 NVIDIA 库文件 No valid NVIDIA Driver Libs found."
fi fi

View File

@@ -9,35 +9,40 @@ if [ `which systemd-nspawn` = "" ];then
echo "Need to install systemd-container!" echo "Need to install systemd-container!"
exit exit
fi fi
if [ "$2" = "" ];then
echo "Usage: $0 ARCHITECTURE CODENAME"
exit
fi
sudo cp /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/crimson -v
sudo cp /usr/share/debootstrap/scripts/sid /usr/share/debootstrap/scripts/beige -v
CODENAME=$2
# Set distroname based on codename
if [ "$CODENAME" = "beige" ] || [ "$CODENAME" = "crimson" ]; then
DISTRONAME="deepin"
else
DISTRONAME="debian"
fi
if [ "$1" = "amd64" ] || [ "$1" = "x86_64" ];then if [ "$1" = "amd64" ] || [ "$1" = "x86_64" ];then
ARCH="amd64" ARCH="amd64"
ARCH_ANOTHERWAY="x64" ARCH_ANOTHERWAY="x64"
cd "`dirname $0`" cd "`dirname $0`"
sudo debootstrap --components=main,contrib,non-free,non-free-firmware --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} bookworm ./ace-env https://mirrors.ustc.edu.cn/debian/ sudo debootstrap --components=main,contrib,non-free,non-free-firmware --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} $2 ./ace-env https://mirrors.cernet.edu.cn/${DISTRONAME}/
elif [ "$1" = "arm64" ] || [ "$1" = "arm" ]|| [ "$1" = "aarch64" ];then elif [ "$1" = "arm64" ] || [ "$1" = "arm" ]|| [ "$1" = "aarch64" ];then
ARCH="arm64" ARCH="arm64"
ARCH_ANOTHERWAY="arm64" ARCH_ANOTHERWAY="arm64"
cd "`dirname $0`" cd "`dirname $0`"
sudo debootstrap --components=main,contrib,non-free,non-free-firmware --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} bookworm ./ace-env https://mirrors.ustc.edu.cn/debian/ sudo debootstrap --components=main,contrib,non-free,non-free-firmware --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} $2 ./ace-env https://mirrors.cernet.edu.cn/${DISTRONAME}/
elif [ "$1" = "loongarch64" ] || [ "$1" = "loong64" ];then
ARCH="loong64"
ARCH_ANOTHERWAY="loong64"
sudo debootstrap --no-check-gpg --include=libnotify-bin,debian-ports-archive-keyring,apt-utils,bash-completion,bc,curl,dialog,diffutils,gnupg,findutils,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1,libgl1-mesa-dri,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} --variant=buildd sid ./ace-env https://deb.debian.org/debian-ports/
else
echo "Need to point out architecture"
exit
fi fi
sudo rm -rf ace-env/var/cache/apt/archives/*.deb sudo rm -rf ace-env/var/cache/apt/archives/*.deb
sudo rm -vfr ace-env/dev/*
sudo tar -I 'xz -T0' -cvf ace-env.tar.xz ace-env/* sudo tar -I 'xz -T0' -cvf ace-env.tar.xz ace-env/*
sudo rm -rf ace-env sudo rm -rf ace-env

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 290 KiB