Compare commits

..

20 Commits

Author SHA1 Message Date
bfcd224c08 update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-02-26 15:04:37 +00:00
290623e263 fix: Bwrap failed on Arch 2025-02-26 23:02:43 +08:00
0f8fb5df67 修复:无法正确展开环境
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-02-25 03:10:40 +00:00
ae87013a3a 12.6.2 2025-02-24 19:08:38 +08:00
885eb4cfc6 update:在root下也有 IS_ACE_ENV=1 了 2025-02-24 19:06:58 +08:00
72d926d928 删除文件 src/opt/apps/cn.flamescion.bookworm-compatibility-mode 2025-02-16 17:48:37 +00:00
3da7b0c9b4 update: 现在安装时可正确拉起N卡配置 2025-02-14 21:46:59 +08:00
dc01ee917c update:gitignore 2025-02-14 21:46:42 +08:00
0d0e8452bf update: amber-ce-bookworm-configure-nvidia 2025-02-14 21:39:05 +08:00
b2f1a9cccb update: bookworm-configure-nvidia 2025-02-14 21:31:46 +08:00
b1a2b02c1e update: 改为软链接到容器中
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-02-14 12:54:47 +00:00
517816ee00 update:nvidia-configure 2025-02-14 20:44:03 +08:00
f2f0c58436 update debian/changelog.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-02-14 12:19:57 +00:00
c5819be7d5 !8 feat: Support Nvidia Accelerate
Merge pull request !8 from shenmo/N/A
2025-02-12 15:16:38 +00:00
1f7a026401 feat: Support Nvidia Accelerate
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2025-02-12 15:15:00 +00:00
fa745aed12 12.5.16 2025-02-06 14:04:28 +08:00
5a7c2b41d4 update: 重新使用dpkg构建 ACE Host Integration 2025-02-06 14:02:54 +08:00
ded8320249 修改文案 2025-01-22 20:20:19 +08:00
1db8d4b98c adjust: 默认目录改成 amber-ce-bookworm 2025-01-17 21:13:16 +08:00
1ad4a2bfd4 update ignore 2025-01-17 21:12:43 +08:00
46 changed files with 105 additions and 42 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,2 @@
#*.deb
src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/ace-env.tar.xz
*.deb
src/opt/apps/amber-ce-bookworm/files/ace-env.tar.xz

View File

@@ -16,14 +16,7 @@ With the help of bubblewrap, a super tiny container solution, you can run a `Deb
Please use `git clone --recurse-submodules` to obtain the env
## Install Guide
### Quick Install (Need to install Spark Store first)
[spk://store/tools/cn.flamescion.bookworm-compatibility-mode/](https://spk-resolv.spark-app.store/?spk=spk://store/tools/cn.flamescion.bookworm-compatibility-mode/)
### Manual InstallDebian/Fedora/Arch)
## Install GuideDebian/Fedora/Arch)
Share Linkhttps://share.spark-app.store/index.php?share/folder&user=1&sid=wHP86Kp4
@@ -32,17 +25,10 @@ Ubuntu 18.04 Need install https://packages.debian.org/buster/bubblewrap
Arch: `yay -S amber-ce-bookworm`
### Amber-CE x86
Use LAT to run a x86 bookworm container. Can install x86 debs and run x86 apps
https://pan.huang1111.cn/s/P63D6Cm
---
## Build Guide
## Build From.Source
### Debian

View File

@@ -11,13 +11,7 @@
请使用 `git clone --recurse-submodules` 来获取
## 安装指南
### 快捷安装 (需要安装星火应用商店)
[spk://store/tools/cn.flamescion.bookworm-compatibility-mode/](https://spk-resolv.spark-app.store/?spk=spk://store/tools/cn.flamescion.bookworm-compatibility-mode/)
### 手动安装Debian/Fedora/Arch)
## 安装指南 Debian/Fedora/Arch)
分享链接https://share.spark-app.store/index.php?share/folder&user=1&sid=wHP86Kp4
@@ -29,7 +23,7 @@ Arch`yay -S amber-ce-bookworm`
---
## 构建指南
## 从源代码构建指南
### Debian
@@ -46,4 +40,4 @@ dpkg-buildpackage -us -uc -b
`yay -S amber-ce-bookworm`
---
---

12
debian/changelog vendored
View File

@@ -1,9 +1,19 @@
amber-ce-bookworm (12.4.15-1) UNRELEASED; urgency=low
amber-ce-bookworm (12.6.3) UNRELEASED; urgency=low
* 修复 Arch 下无法在容器中使用 Bwrap
* 修复 bwrap 下无法使用N卡加速
-- shenmo <shenmo@spark-app.store> Wed, 25 Sep 2024 23:15:49 +0800
amber-ce-bookworm (12.6.2) UNRELEASED; urgency=low
* fix: Can't pass args via bwrap
* fix: Auto upgrade service always pop up upgradable notifier
* fix: /etc/apt/sources.list only request main repo
* fix: sudo function error: Need sudo sudo to really sudo
* fix: ACE Host Integration fail
* adjust: remove dpkg from building depends
* 把默认目录改为 amber-ce-bookworm
* 支持使用Nvidia驱动加速
* 修复 Root 下无法获取IS_ACE_ENV=1
-- shenmo <shenmo@spark-app.store> Wed, 25 Sep 2024 23:15:49 +0800

View File

@@ -2,17 +2,23 @@
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then
if [ -d /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env ];then
PACKAGE_NAME=amber-ce-bookworm # 为了后面正确清理
if [ -d /opt/apps/cn.flamescion.bookworm-compatibility-mode/ ];then
mv /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/ace-env
ln -sfv /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/ace-env /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env
unlink /opt/apps/amber-ce-bookworm
mv -v /opt/apps/cn.flamescion.bookworm-compatibility-mode/ /opt/apps/amber-ce-bookworm/
fi
fi
/opt/apps/$PACKAGE_NAME/files/bin/ace-init
if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then
systemctl daemon-reload
systemctl enable ace-bookworm-auto-upgrade

View File

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

2
debian/rules vendored
View File

@@ -6,7 +6,7 @@
dh $@
override_dh_auto_configure:
cd src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files && bash build-container.sh $(shell uname -m)
cd src/opt/apps/amber-ce-bookworm/files && bash build-container.sh $(shell uname -m)
override_dh_dwz:

View File

@@ -1 +0,0 @@
./cn.flamescion.bookworm-compatibility-mode/

View File

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

View File

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 134 KiB

View File

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

View File

@@ -114,3 +114,4 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
bookworm-run update-locale LANG=$LANG
chown -R root $chrootEnvPath
chmod 777 -R $chrootEnvPath/usr/share/icons
amber-ce-bookworm-configure-nvidia || true

View File

@@ -0,0 +1,67 @@
#!/bin/bash
log.warn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
log.error() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; }
log.info() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
log.debug() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
if [ "$UID" != "0" ];then
log.error "需要以root权限运行 Need to be run as root."
exit 1
fi
# 1\. 获取宿主机 NVIDIA 驱动版本
nvidia_version=$(cat /sys/module/nvidia/version 2>/dev/null)
if [ -z "$nvidia_version" ]; then
log.error "无法获取 NVIDIA 驱动版本 Can not determine NVIDIA Driver version"
exit 1
fi
# 2\. 目标目录准备
ACE_DIR="/opt/apps/amber-ce-bookworm/files/ace-env"
if [[ ! -e "${ACE_DIR}" ]];then
log.error "未检测到 ACE Bookworm 安装,请安装后再试 ACE Bookworm is not detected. Please try again after installation"
spark-store spk://store/tools/cn.flamescion.bookworm-compatibility-mode &
log.info "请按回车关闭... Press Enter to close..."
read
exit 1
fi
mkdir -p "$ACE_DIR/usr/lib" "$ACE_DIR/usr/lib32"
log.info "正在链接 NVIDIA 驱动库 Linking NVIDIA Driver Libs"
# 3\. 收集库文件路径
lib_list=$(ldconfig -p | grep -Ei "nvidia|libcuda" | cut -d'>' -f2)
# 4\. 复制库文件
copied=0
for lib in $lib_list; do
resolved=$(readlink -f "$lib") # 解析符号链接
if file "$resolved" | grep -q "32-bit"; then
ln -sf "/host/$resolved" "$ACE_DIR/usr/lib32/$(basename $lib)"
else
ln -sf "/host/$resolved" "$ACE_DIR/usr/lib/$(basename $lib)"
copied=1
fi
done
# 5\. 复制辅助文件
additional_files=(
/usr/share/vulkan/icd.d/nvidia_icd.json
/usr/share/egl/egl_external_platform.d/20_nvidia_xcb.json
)
for file in "${additional_files[@]}"; do
if [ -f "$file" ]; then
file=$(readlink -f "$file")
dir=$(dirname "$file")
mkdir -p "$ACE_DIR/$dir"
ln -sf "/host/$file" "$ACE_DIR/$dir"
fi
done
# 6\. 标记版本
if [ $copied -eq 1 ]; then
echo "$nvidia_version" > "$ACE_DIR/current_version"
log.info "NVIDIA 驱动库已成功链接 Nvidia Driver Libs are successfully linked. "
else
log.error "未找到有效 NVIDIA 库文件 No valid NVIDIA Driver Libs found."
fi

View File

@@ -107,8 +107,7 @@ BIND_DIRS=(
"--dev-bind-try /mnt /mnt"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev /dev"
"--dev-bind-try /dev/dri /dev/dri"
"--dev-bind-try /dev /dev"
"--proc /proc"
"--dev-bind /sys /sys"
"--dev-bind /run /run"

View File

@@ -104,10 +104,10 @@ ENV_VARS=(
BIND_DIRS=(
"--dev-bind $chrootEnvPath/ /"
"--dev-bind-try /media /media"
"--dev-bind-try /mnt /mnt"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev /dev"
"--dev-bind-try /dev/dri /dev/dri"
"--dev-bind-try /dev /dev"
"--proc /proc"
"--dev-bind /sys /sys"
"--dev-bind /run /run"
@@ -116,10 +116,8 @@ BIND_DIRS=(
"--ro-bind-try /usr/share/themes /usr/local/share/themes"
"--ro-bind-try /usr/share/icons /usr/local/share/icons"
"--ro-bind-try /usr/share/fonts /usr/local/share/fonts"
"--ro-bind-try $(realpath /etc/localtime) /etc/localtime"
"--dev-bind-try /etc/resolv.conf /etc/resolv.conf"
"--dev-bind-try /home /home"
)
EXTRA_ARGS=(
"--hostname Amber-CE-Bookworm"

View File

@@ -40,7 +40,7 @@ sudo rm -rf ace-env
pushd flamescion-container-tools/ace-host-integration
#dpkg-deb -Z xz -b . ../ace-host-integration.deb
dpkg-deb -Z xz -b . ../ace-host-integration.deb
popd

View File

@@ -63,7 +63,7 @@ local file=$1
chmod +x $file
}
if [ "${IS_ACE_ENV}" != "" ] || [[ -e /opt/ace-host-integration/ace-host-integration ]] && [[ -e /flamescion-container-tools ]];then
if [ "${IS_ACE_ENV}" != "" ] ;then
if [ -e /opt/apps/ ];then
for app_dir in $(ls /opt/apps/); do
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do

View File

@@ -2,5 +2,5 @@
if [ "$UID" = "0" ];then
/usr/bin/sudo $@
else
host-spawn sudo bookworm-run sudo $@
host-spawn sudo bookworm-run sudo env IS_ACE_ENV="1" "$@"
fi

View File

@@ -0,0 +1 @@
../../opt/apps/amber-ce-bookworm/files/bin/amber-ce-bookworm-configure-nvidia