Compare commits

..

3 Commits

Author SHA1 Message Date
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
5 changed files with 24 additions and 10 deletions

3
debian/changelog vendored
View File

@@ -1,7 +1,8 @@
amber-ce-bookworm (12.7.5) UNRELEASED; urgency=low
amber-ce-bookworm (12.8.0) UNRELEASED; urgency=low
* 通用 ACE 构建,现不再需要单独使用构建脚本
* 更方便地更改成其他ACE
* 现可在容器内使用 dpkg-buildpackage
* 支持 Ubuntu 25 等 systemd 不再提供 utmp 的情景下获取当前用户名
-- 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
if [ "${PACKAGE_NAME}" = "amber-ce-bookworm" ];then
systemctl daemon-reload
systemctl enable amber-ce-bookworm-auto-upgrade
systemctl start amber-ce-bookworm-auto-upgrade
systemctl enable $PACKAGE_NAME-auto-upgrade
systemctl start $PACKAGE_NAME-auto-upgrade
# enable kernel.unprivileged_userns_clone
# disable kernel.apparmor_restrict_unprivileged_unconfined and kernel.apparmor_restrict_unprivileged_userns
if [ -f /usr/lib/sysctl.d/amber-ce-bookworm.conf ];then
sysctl -p /usr/lib/sysctl.d/amber-ce-bookworm.conf
if [ -f /usr/lib/sysctl.d/$PACKAGE_NAME.conf ];then
sysctl -p /usr/lib/sysctl.d/$PACKAGE_NAME.conf
fi
fi
true

View File

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

1
debian/control vendored
View File

@@ -13,4 +13,5 @@ Package: cn.flamescion.bookworm-compatibility-mode
Architecture: any
Multi-Arch: foreign
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

View File

@@ -22,8 +22,20 @@ fi
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)
function bookworm-run(){