Compare commits

...

140 Commits

Author SHA1 Message Date
7741a64969 export LANGUAGE
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-24 09:11:01 +00:00
35d74b48ff update src/DEBIAN/control.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-21 11:42:36 +00:00
2c598f057a update src/DEBIAN/control.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-21 06:06:30 +00:00
7b44d6f4a3 update_link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-09 16:32:07 +00:00
b0f0a99b62 gxde-fixer 2024-09-07 12:14:43 +08:00
524f3bc5e9 remove gxde fix
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-06 18:46:01 +00:00
777dcc1a38 Fix on GXDE OS initiate XDG_DATA_DIRS
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-09-06 18:32:53 +00:00
80eeb69d28 change download link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-08-13 06:51:04 +00:00
751f1400ff adjust: now won't run bookworm run in container
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-07-20 10:30:18 +00:00
AAA Elysia 猫猫侠 ⁧~喵
dc1a0eebe3 !7 【轻量级 PR】:fix: Dependency problem in Debian 13
Merge pull request !7 from AAA Elysia 猫猫侠 ⁧~喵/N/A
2024-07-18 02:51:40 +00:00
c3a8895a16 update link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-21 14:39:56 +00:00
d90e4cf529 fix-apparmor 2024-06-20 22:31:58 +08:00
a388a710a5 remove link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-16 07:18:50 +00:00
55683bce1b add data
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-05 04:38:44 +00:00
5b1697035c Add data
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-05 04:38:13 +00:00
3704dcf30a localtime不再bind
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-06-02 04:28:44 +00:00
4a266bb6d8 remove gcc depend
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-05-14 10:39:16 +00:00
e681fc9a22 changepng 2024-05-09 15:49:02 +08:00
3265a8311a adjust-png 2024-05-09 15:34:08 +08:00
f2916fa2a0 support-uos 2024-05-09 15:15:13 +08:00
2f3177b600 support-uos 2024-05-09 15:10:59 +08:00
1dab109d77 Merge remote-tracking branch 'refs/remotes/origin/master' 2024-05-07 13:51:59 +08:00
80cc726897 apparmor 2024-05-07 13:51:50 +08:00
223b86a39f spk resolv
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-05-07 05:48:18 +00:00
c1f7b9ac3b fix-apparmor 2024-05-01 21:28:16 +08:00
0fd58e7134 fix mime https://bbs.deepin.org.cn/phone/zh/post/271667
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-30 04:42:15 +00:00
99db451307 删除文件 src/etc/apparmor.d 2024-04-30 04:27:48 +00:00
87bd885bb5 update src/DEBIAN/control.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-30 04:25:20 +00:00
d98e3f7819 update src/DEBIAN/postinst.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-30 04:25:06 +00:00
e89d270e7b update src/DEBIAN/postinst.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-29 14:28:05 +00:00
d6dbc62e72 重载配置 2024-04-29 22:19:28 +08:00
a298a17a4a apparmor policy 2024-04-29 22:09:22 +08:00
ebae7611df try-fix-23-push 2024-04-18 23:07:05 +08:00
cc5684234d change version 2024-04-18 23:06:02 +08:00
c61d30ff5f try-fix-v23-settings 2024-04-17 23:35:23 +08:00
401256fab9 update database 2024-04-10 17:29:02 +08:00
b8d1d8b958 feat: support open in host os by mimetype 2024-04-10 17:25:45 +08:00
54ad42f12c update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-07 08:20:01 +00:00
8533c0478e update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-07 08:19:23 +00:00
04c4ed87e8 Change link
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-07 06:22:19 +00:00
c39b0d086a update src/DEBIAN/postinst.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-07 02:18:08 +00:00
274cd58361 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-02 05:18:39 +00:00
572e8710d9 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-02 05:18:12 +00:00
1f2e934230 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-02 05:17:44 +00:00
6d3996fc84 remove chmod
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-01 12:59:31 +00:00
5bf78dd789 update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-init.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-04-01 12:58:21 +00:00
2b311fe7ef fix: Can not use sudo when root
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-30 06:48:13 +00:00
97726bebf8 update src/DEBIAN/postinst.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-29 11:50:42 +00:00
0e8e4ecf0f update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-init.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-29 07:31:39 +00:00
e79923c206 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-23 15:02:42 +00:00
36b2ea2ced update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-23 15:02:06 +00:00
e9f2ebd9e5 修复:逻辑更改到postinst 2024-03-23 18:59:04 +08:00
99268485c4 修复:后续更新问题 2024-03-23 18:57:49 +08:00
ca582467dc damn忘了这个 2024-03-23 18:49:06 +08:00
92f87a3f62 不是龙架构不加liblol 2024-03-23 18:42:56 +08:00
6d76dc98aa 尝试修复和桌面冲突 2024-03-23 17:50:39 +08:00
fd1d9dded0 fix postinst 2024-03-23 17:05:52 +08:00
488c2f038f 修复龙架构 2024-03-23 16:09:36 +08:00
1b531a75b1 adapt to old version 2024-03-23 16:06:58 +08:00
73e3bec9c3 改回原包名 2024-03-23 16:01:18 +08:00
0bbaaea422 更改目录为ace-env 2024-03-23 15:39:58 +08:00
24fe84d5be Now change to ACE Bookworm 2024-03-23 13:40:19 +08:00
d74b603469 update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-20 07:04:15 +00:00
903788732c update ace-host-integration.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-20 02:50:43 +00:00
c976b58920 Delete unwork nvidia support
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-19 09:27:33 +00:00
516c4c30d4 fix init 2024-03-16 17:01:16 +08:00
75469cf1fc 修复:bwrap失效 2024-03-16 15:29:34 +08:00
b22439d7e6 同步更改到bwrap 2024-03-16 15:22:02 +08:00
0549dc74c3 * fix:时区出错 2024-03-16 15:19:04 +08:00
a2c95f2518 * adjust: 废弃了bookworm-run-root,重制了bookworm-run以提升代码质量
* fix: 部分应用卸载失败的问题

* fix: 光标主题失效的问题
2024-03-16 13:50:54 +08:00
34f4ba62cb update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-08 13:23:00 +00:00
63fa6b6c46 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-03-08 13:22:08 +00:00
172e219bb3 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-02-23 14:56:11 +00:00
878d559241 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-02-23 14:55:17 +00:00
e9c9f488f5 fix:lost option 2024-02-17 16:03:44 +08:00
02a70eb0e7 apt clean first 2024-02-17 15:51:34 +08:00
8d5a07277a bwrap 2024-02-17 15:45:25 +08:00
12a2c435be update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-31 04:02:30 +00:00
798554ab22 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-31 04:02:20 +00:00
a284695f80 update README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:34:38 +00:00
fe19bf6efc update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:34:02 +00:00
4c19bf865a update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:33:39 +00:00
af5594cdcb update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:33:13 +00:00
130ff44a29 add README.zh.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:32:26 +00:00
dba6361d29 update README.md.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-01-30 16:31:54 +00:00
b5f45bbecf 修改: README.md 2024-01-30 19:17:59 +08:00
f3be1f48f6 No more RPM 2024-01-30 18:56:39 +08:00
af04000b02 更新host integration 2024-01-29 23:33:42 +08:00
a9988f37f3 修复:更新提示失效 2024-01-29 23:16:18 +08:00
130839b368 修复:提示完了不更新 2024-01-29 23:04:46 +08:00
574da47849 修改如下
1. 支持滚动更新功能,自动跟随到最新的上游
2. 添加了systemd依赖和一个systemd服务,会在安装后启动(修改了postinst/rm)
2024-01-29 23:01:41 +08:00
081203e0d4 1 2024-01-29 08:07:08 +08:00
57e9b966e0 修改: README.md 2024-01-29 08:05:31 +08:00
667b83e52b 修改: README.md 2024-01-29 08:04:38 +08:00
d2cf07bd01 支持fedora 2024-01-28 00:00:01 +08:00
5e74ed9b91 !4 更新自描述文件,提供编译命令
Merge pull request !4 from 花雨落逝/master
2024-01-15 06:22:35 +00:00
花雨落逝
65dfa5291c update README.md.
Signed-off-by: 花雨落逝 <12135927+hylshi@user.noreply.gitee.com>
2024-01-15 06:01:04 +00:00
花雨落逝
2ad0ea3f42 update README.md.
Signed-off-by: 花雨落逝 <12135927+hylshi@user.noreply.gitee.com>
2024-01-15 05:36:05 +00:00
花雨落逝
aedcb5c1ed update README.md.
Signed-off-by: 花雨落逝 <12135927+hylshi@user.noreply.gitee.com>
2024-01-15 05:30:16 +00:00
7f33d2fff7 去除unlink 2024-01-11 23:54:03 +08:00
b93199bb05 feat: 直接在包体提供bin的软链接而不是在postinst做 2024-01-11 23:52:11 +08:00
6b0942d2d5 test: NVIDIA support 2024-01-05 18:57:33 +08:00
de2d84e13a fix: Can not show icons in ACE container.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-31 13:12:39 +00:00
8fca595000 update tips-slimize-container.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-25 09:35:52 +00:00
ceb863717f update tips-slimize-container.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-25 09:27:44 +00:00
f489876185 fix: Can not start app in some desktops
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-20 06:13:52 +00:00
1e47004eef !2 chore: modify the category of shortcuts
Merge pull request !2 from pzm9012/master
2023-12-12 15:40:38 +00:00
pzm9012
4afbfab976 chore: modify the category of shortcuts
Signed-off-by: pzm9012 <pzm9012@outlook.com>
2023-12-12 15:33:43 +00:00
866a866d5b 无UOS包支持 2023-12-12 22:57:17 +08:00
2bdfe5c177 update src/DEBIAN/control.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-12 09:33:40 +00:00
6b27103c18 提交:1245 2023-12-11 23:36:17 +08:00
00c2772152 change ace integration
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-11 15:29:53 +00:00
a8463e9152 1.3
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-11 15:28:30 +00:00
0f293864b6 pkexec fix
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-11 08:09:11 +00:00
6c853b2bec update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/build-container.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-11 07:06:13 +00:00
8ce2c31380 修复 部分桌面上无法出现desktop 2023-12-11 10:02:38 +08:00
Anysets
f57e80c61a 删除文件 runsript-arch 2023-12-07 15:34:16 +00:00
Anysets
8140e49602 新建 runsript-arch 2023-12-07 15:33:05 +00:00
bc1d029e64 update src/DEBIAN/control.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-12-04 08:24:47 +00:00
4d51bd9dc4 update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-23 13:11:24 +00:00
5e41a8f9e7 update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-23 13:09:54 +00:00
2949a3df3f 重命名 src/etc/profile.d/bookworm-compatability-mode.sh 为 src/etc/profile.d/ACE-Bookworm.sh 2023-11-23 07:14:13 +00:00
c1030dd35b update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-22 15:13:27 +00:00
8d95934a7d update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-22 15:09:41 +00:00
0f4ae31462 update src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-22 15:07:44 +00:00
c04007eccd arch问题 2023-11-21 15:29:26 +08:00
98575a442c 修复:media挂不上去 2023-11-21 15:26:32 +08:00
ddabb804d0 fix: 卸载工具的comment只显示英文 2023-11-17 21:01:58 +08:00
caadd5d785 修复:vim-common卸载失败 2023-11-15 16:55:17 +08:00
f89f92533f 修改: src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui 2023-11-15 14:10:49 +08:00
a1593ea635 no-pass-auth-uninstaller 2023-11-15 14:06:27 +08:00
d06eaed9e3 修复:错误的环境变量设置 2023-11-14 23:28:46 +08:00
00a12285d9 !1 针对ubuntu发行版本的修正,
Merge pull request !1 from RX6900XT/master
2023-11-13 11:40:06 +00:00
RX6900XT
c26bf5aa06 update src/etc/profile.d/bookworm-compatability-mode.sh.
Signed-off-by: RX6900XT <qq482961502@gmail.com>
2023-11-13 10:57:35 +00:00
RX6900XT
fb8752e0ba !1 update src/etc/profile.d/bookworm-compatability-mode.sh.
Merge pull request !1 from shenmo/N/A
2023-11-13 10:55:57 +00:00
e2769c15d2 update src/etc/profile.d/bookworm-compatability-mode.sh.
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-13 10:36:46 +00:00
RX6900XT
1e88351964 update src/etc/profile.d/bookworm-compatability-mode.sh.
针对ubuntu发行版本做出修正,在deepin下也能正常工作

Signed-off-by: RX6900XT <qq482961502@gmail.com>
2023-11-13 10:19:37 +00:00
6322718144 更改主机名 2023-11-13 15:09:59 +08:00
60ef6a9893 --setenv IS_ACE_ENV=1 2023-11-12 22:24:55 +08:00
722efa9726 update src/opt/apps/cn.flamescion.bookworm-compatibility-mod
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2023-11-12 11:07:14 +00:00
54 changed files with 1019 additions and 346 deletions

2
.gitignore vendored
View File

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

View File

@@ -1,31 +1,56 @@
# 书虫兼容模式
书虫兼容模式,是`琥珀兼容环境(ACE)`的一部分
琥珀兼容环境是一款基于bubblewrap的容器化应用打包和分发方案。
书虫兼容模式用极为轻量的容器方案让你可以在几乎任何的Linux发行版上运行一个`Debian 12`容器。在`Appimage`应用无法启动或者打包的时候,使用书虫兼容模式来打包可以让你在使用最新的环境的同时在更多的发行版上运行,是一个很好的选择
书虫兼容模式让你可以在deepin或UOS上使用Debian 12的应用为你带来更好的使用体验
请使用 `git clone --recurse-submodules` 来获取
## 构建指南
先构建容器再打包,容器位置在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
# Bookworm compatibility mode
# [中文](README.zh.md)
Bookworm compatibility mode is a part of `Amber Compatability Environment(ACE)`
Amber Compatability Environment is a container app packaging and distributing solution.
With the help of bubblewrap, a super tiny container solution, you can run a `Debian 12` container in almost every linux distrobution. When you can not launch or pack an `Appimage` App, using Bookworm compatibility mode can allow you to pack the app in a newer environment and also be able to run on more distrobutions. It is a good choice!
Bookworm compatibility mode allows you to use Debian 12 applications on deepin or UniontechOS using bwrap containers, providing you with a better user experience!
**You need to logout or reboot your computer to show the entries in launcher app list if it's your first time using ACE.**
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)
https://pan.huang1111.cn/s/jR1GdUy
### 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
### Debian
Build the container first then build the package. Container at `src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
Here are the details:
1. Install dependencies: sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
2. Enter the terminal at `src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files` and execute `./build-container.sh amd64`.[for amd,other arch please change]
3. Wait for the container to complete.
4.Get in to `amber-ce-bookworm` dir,run`fakeroot dpkg-deb -b src .`
5.Wating for complete.
### Fedora
See https://gitee.com/amber-ce/ace-rpm
### Arch
`yay -S amber-ce-bookworm`

54
README.zh.md Normal file
View File

@@ -0,0 +1,54 @@
# 书虫兼容模式
# [English](README.md)
琥珀兼容环境是一款基于bubblewrap的容器化应用打包和分发方案。
书虫兼容模式用极为轻量的容器方案让你可以在几乎任何的Linux发行版上运行一个`Debian 12`容器。在`Appimage`应用无法启动或者打包的时候,使用书虫兼容模式来打包可以让你在使用最新的环境的同时在更多的发行版上运行,是一个很好的选择
**首次安装后请注销或重启以展示启动器入口**
请使用 `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)
https://pan.huang1111.cn/s/jR1GdUy
### Amber-CE x86
利用 LAT 运行的x86容器可安装和运行x86的deb
https://pan.huang1111.cn/s/P63D6Cm
## 构建指南
### Debian
先构建容器再打包,容器位置在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
下面是详细步骤:
1. 安装依赖sudo apt-get install arch-test debootstrap libnss-mymachines systemd-container
2.`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`位置进入终端,执行`./build-container.sh amd64`[amd架构其他架构同理]`
3. 等待容器打包完成
4. 进入`amber-ce-bookworm`目录,执行`fakeroot dpkg-deb -b src .`
5. 等待打包完成
### Fedora
请前往 https://gitee.com/amber-ce/ace-rpm
### Arch
`yay -S amber-ce-bookworm`
---

View File

@@ -1,8 +1,8 @@
Package: cn.flamescion.bookworm-compatibility-mode
Version: 12.3.4
Version: 12.4.13.1
Section: misc
Priority: optional
Depends: bubblewrap,flatpak,zenity
Depends: bubblewrap,flatpak,zenity,policykit-1 | pkexec | polkit-1 | polkit,systemd,procps
Maintainer: shenmo <shenmo@spark-app.store>
Architecture: arm64
Architecture: amd64
Description: bwrap wrapper for install and running debs inside a bookworm container

View File

@@ -1,8 +1,28 @@
#!/bin/bash
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
/opt/apps/$PACKAGE_NAME/files/bin/bookworm-init
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run /usr/bin/bookworm-run
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper /usr/bin/ace-uninstall-helper
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui /usr/bin/ace-uninstall-helper-gui
if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then
if [ -d /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env ];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
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
systemctl start ace-bookworm-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.conf ];then
sysctl -p /usr/lib/sysctl.d/amber-ce.conf
fi
fi
true

View File

@@ -1,11 +1,15 @@
#!/bin/bash
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
if [ "$PACKAGE_NAME" = "cn.flamescion.bookworm-compatibility-mode" ];then
unlink /usr/bin/bookworm-run
unlink /usr/bin/ace-uninstall-helper
unlink /usr/bin/ace-uninstall-helper-gui
if [ "${PACKAGE_NAME}" = "cn.flamescion.bookworm-compatibility-mode" ];then
systemctl stop ace-bookworm-auto-upgrade
systemctl disable ace-bookworm-auto-upgrade
fi
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
echo "清理卸载残留"
rm -rf /opt/apps/$PACKAGE_NAME
@@ -13,3 +17,5 @@ else
echo "非卸载,跳过清理"
fi

View File

@@ -0,0 +1,17 @@
# 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/amber-ce-bookworm/files/ace-env/flamescion-container-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi

View File

@@ -0,0 +1,16 @@
# 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/amber-ce-bookworm/files/ace-env/flamescion-container-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi

View File

@@ -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

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Name=bookworm.ace-gxde-fixer
Name[zh_CN]=bookworm.ace-gxde-fixer
Comment=bookworm.ace-gxde-fixer
Type=Application
Exec=/opt/apps/amber-ce-bookworm/files/bin/bookworm.ace-gxde-fixer
Icon=amber-ce-bookworm
Categories=System
# Generated from the DesktopGenerater component of the z-Tools toolkit

View File

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

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Name=ACE Bookworm Software Uninstaller
Name[zh_CN]=ACE Bookworm软件卸载器
Comment=用于卸载ACE容器的应用
Type=Application
Exec=/opt/apps/amber-ce-bookworm/files/bin/ace-bookworm-uninstall-helper-gui
Icon=ACE-bookworm-uninstaller
Categories=System
# Generated from the DesktopGenerater component of the z-Tools toolkit

View File

@@ -1,11 +0,0 @@
[Desktop Entry]
Version=1.0
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
Icon=ACE-uninstaller
Categories=AudioVideo
# Generated from the DesktopGenerater component of the z-Tools toolkit

View File

@@ -1,10 +1,11 @@
[Desktop Entry]
Categories=utils
Exec=bookworm-run %U
Icon=cn.flamescion.bookworm-compatibility-mode
Name=Amber CE
Name[zh_CN]=ACE
Icon=amber-ce-bookworm
Name=Amber CE Bookworm
Name[zh_CN]=ACE Bookworm
Keywords=BCM,ACE,ace,mode
StartupNotify=true
Type=Application
Terminal=true
Categories=System

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -8,7 +8,7 @@ fi
unset ABSOLUTE_PATH IN_CONTAINER_PATH PKGNAME_GUESS DPKG_LIST_FILE ACE_ENV_PATH
# 定义环境路径变量
ACE_ENV_PATH="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
ACE_ENV_PATH="/opt/apps/amber-ce-bookworm/files/ace-env"
# 检查参数个数
if [ "$#" -ne 1 ]; then
@@ -25,9 +25,14 @@ fi
# 验证是否为desktop文件
if [[ ! $ABSOLUTE_PATH == *.desktop ]]; then
if [ ! -e $ABSOLUTE_PATH ];then
echo "$ABSOLUTE_PATH does not exist. May have already been uninstalled. Ignore it."
exit
else
echo "Error: The file is not a desktop file."
exit 1
fi
fi
# 截取路径
IN_CONTAINER_PATH=${ABSOLUTE_PATH#"$ACE_ENV_PATH"}
@@ -42,7 +47,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 +58,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 +87,5 @@ else
done
echo "Error: No matching package found."
exit 1
fi

View File

@@ -1,10 +1,10 @@
#!/bin/bash
if [ "$UID" != "0" ];then
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $0
pkexec $0
exit
fi
# 定义应用列表文件路径
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
ACE_dir="/opt/apps/amber-ce-bookworm/files/ace-env"
# 读取所有.desktop文件并构造应用列表
app_list=()
@@ -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"
# 添加到应用列表数组
@@ -38,7 +44,7 @@ selected_apps=$(zenity --list --title "应用列表" --column "是否卸载" --c
if [ -n "$selected_apps" ]; then
# 卸载选中的应用
(for app_desktop_path in $selected_apps; do
ace-uninstall-helper "$app_desktop_path"
ace-bookworm-uninstall-helper "$app_desktop_path"
ret=$?
if [ "$ret" != "0" ];then
zenity --error --width 768 --text "$app_desktop_path 卸载失败,中止操作\n请手动执行\nsudo ace-uninstall-helper $app_desktop_path \n查看报错"

View File

@@ -0,0 +1,116 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "当前用户不是 root 用户,退出"
exit
fi
if [ "$PACKAGE_NAME" = "" ];then
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
else
PKGNAME=$PACKAGE_NAME
fi
chrootEnvPath=/opt/apps/$PKGNAME/files/ace-env
if [ ! -e $chrootEnvPath ];then
echo "Uncompress the env...."
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/$PKGNAME/files/
fi
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
function bookworm-run(){
bwrap --dev-bind $chrootEnvPath/ / \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--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-try /media /media \
--dev-bind-try /tmp /tmp \
--dev /dev \
--dev-bind-try /dev/dri /dev/dri \
--proc /proc \
--dev-bind / /host \
--dev-bind /sys /sys \
--dev-bind /run /run \
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
--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-try /etc/resolv.conf /etc/resolv.conf \
--dev-bind-try /home /home \
$@
}
echo "Update the flamescion container tools"
cp -r `dirname $chrootEnvPath`/flamescion-container-tools/ $chrootEnvPath
export container_user_gid="$(sudo -u $non_root_user id -rg)"
export container_user_home="/home/${non_root_user}"
export container_user_name="${non_root_user}"
export container_user_uid="$(sudo -u $non_root_user id -ru)"
#####init
bookworm-run bash /flamescion-container-tools/container-init/init.sh
rm $chrootEnvPath/etc/localtime
cp $(realpath /etc/localtime) $chrootEnvPath/etc/localtime
chmod 777 $chrootEnvPath/etc/localtime
bookworm-run cp /host/etc/locale.gen /etc/locale.gen && locale-gen
bookworm-run touch /finish.flag
bookworm-run apt clean
bookworm-run chown -R $(who | awk '{print $1}' | head -n 1) /usr/lib/locale/
sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ / \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--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-try /media /media \
--dev-bind-try /tmp /tmp \
--dev /dev \
--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 \
--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-try /etc/resolv.conf /etc/resolv.conf \
--dev-bind-try /home /home \
locale-gen
bookworm-run update-locale LANG=$LANG
chown -R root $chrootEnvPath
chmod 777 -R $chrootEnvPath/usr/share/icons

View File

@@ -6,20 +6,14 @@ pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
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
chrootEnvPath=/opt/apps/$PKGNAME/files/ace-env
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/bookworm-init
`dirname $chrootEnvPath`/bin/ace-init
else
pkexec `dirname $chrootEnvPath`/bin/bookworm-init
pkexec `dirname $chrootEnvPath`/bin/ace-init
fi
@@ -40,38 +34,127 @@ for arg in "$@"; do
container_command="${container_command} '${arg}'"
done
fi
#########################################################################################
##########合成bwrap 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令
EXEC_COMMAND="bwrap --dev-bind / / bwrap"
# add_command 函数定义
function add_command() {
# 参数拼接,考虑到转义和空格的处理
for arg in "$@"; do
EXEC_COMMAND="${EXEC_COMMAND} ${arg}"
done
}
function add_env_var() {
local var_name="${1}"
local var_value="${2}"
if [ "$var_value" != "" ]; then
add_command "--setenv $var_name $var_value"
fi
}
##########合成bwrap 2. 特殊需求函数配置段
function cursor_theme_dir_integration() {
local directory=""
if [ "$(id -u)" = "0" ]; then #####We don't want bother root to install themes,but will try to fix the unwriteable issue
mkdir -p $chrootEnvPath/usr/share/icons
chmod 777 -R $chrootEnvPath/usr/share/icons
return
fi
for directory in "/usr/share/icons"/*; do
# 检查是否为目录
if [ -d "$directory" ]; then
# 检查目录中是否存在 cursors 文件
if [ -d "$directory/cursors" ]; then
if [ -w $chrootEnvPath/usr/share/icons ];then
add_command "--ro-bind-try $directory $directory"
fi
fi
fi
done
bwrap --dev-bind / / \
bwrap \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--setenv LC_ALL "$LC_ALL" \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
--dev-bind $chrootEnvPath/ / \
--dev-bind /media /media \
--dev-bind /tmp /tmp \
--dev /dev \
--dev-bind /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 \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--cap-add CAP_SYS_ADMIN \
--dev-bind /home /home \
bash -c "${container_command}"
}
##########合成bwrap 3. 环境变量和目录绑定配置段
# 添加环境变量和其他初始设置
ENV_VARS=(
"LANG $LANG"
"LC_COLLATE $LC_COLLATE"
"LC_CTYPE $LC_CTYPE"
"LC_MONETARY $LC_MONETARY"
"LC_MESSAGES $LC_MESSAGES"
"LC_NUMERIC $LC_NUMERIC"
"LC_TIME $LC_TIME"
"LC_ALL $LC_ALL"
"PULSE_SERVER /run/user/\$uid/pulse/native"
"PATH /flamescion-container-tools/bin-override:\$PATH"
"IS_ACE_ENV 1"
"XDG_DATA_DIRS /flamescion-container-tools/additional-data-dir-in-container:\$XDG_DATA_DIRS"
)
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"
"--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-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"
"--dev-bind-try /etc/resolv.conf /etc/resolv.conf"
"--dev-bind-try /home /home"
)
EXTRA_ARGS=(
"--hostname Amber-CE-Bookworm"
"--unshare-uts"
"--cap-add CAP_SYS_ADMIN"
)
EXTRA_SCRIPTS=(
cursor_theme_dir_integration
)
##########合成bwrap 4. 合成并执行指令
# 逐一添加到 EXEC_COMMAND
for var in "${ENV_VARS[@]}"; do
add_env_var $var
done
for var in "${BIND_DIRS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_ARGS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_SCRIPTS[@]}"; do
$var
done
# 添加最终的 bash 命令
add_command "bash -c \"${container_command}\""
# 输出完整的 EXEC_COMMAND 以查看
# echo "${EXEC_COMMAND}"
# 注意: 实际执行时,请确保所有变量(如 $uid, $chrootEnvPath 等)都已正确定义
eval ${EXEC_COMMAND}

View File

@@ -0,0 +1,161 @@
#!/bin/bash
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
export PACKAGE_NAME=$PKGNAME
chrootEnvPath=/opt/apps/$PKGNAME/files/ace-env
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/ace-init
else
pkexec `dirname $chrootEnvPath`/bin/ace-init
fi
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 1. 基础函数配置段
# 初始化 EXEC_COMMAND 为 bwrap 基础指令
EXEC_COMMAND="bwrap --dev-bind / / bwrap"
# add_command 函数定义
function add_command() {
# 参数拼接,考虑到转义和空格的处理
for arg in "$@"; do
EXEC_COMMAND="${EXEC_COMMAND} ${arg}"
done
}
function add_env_var() {
local var_name="${1}"
local var_value="${2}"
if [ "$var_value" != "" ]; then
add_command "--setenv $var_name $var_value"
fi
}
##########合成bwrap 2. 特殊需求函数配置段
function cursor_theme_dir_integration() {
local directory=""
if [ "$(id -u)" = "0" ]; then #####We don't want bother root to install themes,but will try to fix the unwriteable issue
mkdir -p $chrootEnvPath/usr/share/icons
chmod 777 -R $chrootEnvPath/usr/share/icons
return
fi
for directory in "/usr/share/icons"/*; do
# 检查是否为目录
if [ -d "$directory" ]; then
# 检查目录中是否存在 cursors 文件
if [ -d "$directory/cursors" ]; then
if [ -w $chrootEnvPath/usr/share/icons ];then
add_command "--ro-bind-try $directory $directory"
fi
fi
fi
done
}
##########合成bwrap 3. 环境变量和目录绑定配置段
# 添加环境变量和其他初始设置
ENV_VARS=(
"LANG $LANG"
"LC_COLLATE $LC_COLLATE"
"LC_CTYPE $LC_CTYPE"
"LC_MONETARY $LC_MONETARY"
"LC_MESSAGES $LC_MESSAGES"
"LC_NUMERIC $LC_NUMERIC"
"LC_TIME $LC_TIME"
"LC_ALL $LC_ALL"
"PULSE_SERVER /run/user/\$uid/pulse/native"
"PATH /flamescion-container-tools/bin-override:\$PATH"
"IS_ACE_ENV 1"
"XDG_DATA_DIRS /flamescion-container-tools/additional-data-dir-in-container:\$XDG_DATA_DIRS"
)
BIND_DIRS=(
"--dev-bind $chrootEnvPath/ /"
"--dev-bind-try /media /media"
"--dev-bind-try /tmp /tmp"
"--dev-bind-try /data /data"
"--dev /dev"
"--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-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"
"--unshare-uts"
# "--cap-add CAP_SYS_ADMIN"
)
EXTRA_SCRIPTS=(
cursor_theme_dir_integration
)
##########合成bwrap 4. 合成并执行指令
# 逐一添加到 EXEC_COMMAND
for var in "${ENV_VARS[@]}"; do
add_env_var $var
done
for var in "${BIND_DIRS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_ARGS[@]}"; do
add_command "$var"
done
for var in "${EXTRA_SCRIPTS[@]}"; do
$var
done
# 添加最终的 bash 命令
add_command "bash -c \"/usr/bin/bwrap ${container_command}\""
# 输出完整的 EXEC_COMMAND 以查看
# echo "${EXEC_COMMAND}"
# 注意: 实际执行时,请确保所有变量(如 $uid, $chrootEnvPath 等)都已正确定义
eval ${EXEC_COMMAND}

View File

@@ -1,77 +0,0 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "当前用户不是 root 用户,退出"
exit
fi
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
export PACKAGE_NAME=$PKGNAME
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
if [ ! -e $chrootEnvPath/finish.flag ];then
if [ "$(id -u)" = "0" ]; then
`dirname $chrootEnvPath`/bin/bookworm-init
else
pkexec `dirname $chrootEnvPath`/bin/bookworm-init
fi
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 / / \
bwrap \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--setenv LC_ALL "$LC_ALL" \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
--dev-bind $chrootEnvPath/ / \
--dev-bind /media /media \
--dev-bind /tmp /tmp \
--dev /dev \
--dev-bind /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 \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--cap-add CAP_SYS_ADMIN \
--dev-bind /home /home \
bash -c "${container_command}"

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [ "$UID" != "0" ];then
pkexec $0
exit
fi
bookworm-run /opt/ace-host-integration/ace-host-integration

View File

@@ -14,22 +14,29 @@ fi
if [ "$1" = "amd64" ] || [ "$1" = "x64" ];then
ARCH="amd64"
ARCH_ANOTHERWAY="x64"
cd "`dirname $0`"
sudo debootstrap --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,gnupg2,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1-mesa,libgl1-mesa-glx,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} bookworm ./ace-env https://mirrors.ustc.edu.cn/debian/
elif [ "$1" = "arm64" ] || [ "$1" = "arm" ];then
ARCH="arm64"
ARCH_ANOTHERWAY="arm64"
else
echo "Invalid architecture! Exit"
exit 1
fi
cd "`dirname $0`"
sudo debootstrap --include=apt-utils,bc,curl,dialog,diffutils,findutils,gnupg2,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1-mesa,libgl1-mesa-glx,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} bookworm ./bookworm-env https://mirrors.ustc.edu.cn/debian/
sudo debootstrap --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,gnupg2,less,libnss-myhostname,libvte-common,lsof,ncurses-base,passwd,pinentry-curses,procps,sudo,time,util-linux,wget,libegl1-mesa,libgl1-mesa-glx,libvulkan1,mesa-vulkan-drivers,locales,libglib2.0-bin --arch=${ARCH} bookworm ./ace-env https://mirrors.ustc.edu.cn/debian/
elif [ "$1" = "loong" ] || [ "$1" = "loong64" ];then
ARCH="loong64"
ARCH_ANOTHERWAY="loong64"
sudo debootstrap --no-check-gpg --include=libnotify-bin,apt-utils,bash-completion,bc,curl,dialog,diffutils,findutils,gnupg2,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 http://lauosc.cn:11232/debian
else
echo "Need to point out architecture"
exit
fi
sudo rm -rf bookworm-env/var/cache/apt/archives/*.deb
sudo rm -rf ace-env/var/cache/apt/archives/*.deb
sudo tar -I 'xz -T0' -cvf bookworm-env.tar.xz bookworm-env/*
sudo rm -rf bookworm-env
sudo tar -I 'xz -T0' -cvf ace-env.tar.xz ace-env/*
sudo rm -rf ace-env
pushd flamescion-container-tools/ace-host-integration

View File

@@ -1,5 +1,5 @@
Package: ace-host-integration
Version: 1.2
Version: 1.2.2
Section: misc
Priority: optional
Depends: bash

View File

@@ -1,29 +1,45 @@
#!/bin/bash
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
function linkDir() {
ensureTargetDir() {
targetFile=$1
t=$(dirname "$targetFile")
mkdir -p "$t"
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
source=$1
target=$2
sourceDir=$(dirname "$source")
targetDir=$(dirname "$target")
find "$source" -type f | while read sourceFile; do
targetFile="$targetDir/${sourceFile#$sourceDir/}"
if [ -L "$targetFile" ] && [ "$(readlink "$targetFile")" = "$sourceFile" ]; then
continue
else
rm -f "$targetFile"
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
ensureTargetDir "$targetFile"
ln -s "$sourceFile" "$targetFile"
done
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }
function do_integrate(){
local file=$1
if [ -f "$file" ]; then
@@ -33,34 +49,39 @@ local file=$1
echo "$file is detected. Processing host system integration..."
sed -i 's|^Exec=\(.*\)|Exec=bookworm-run \1|' "$file"
sed -i '/^TryExec=/d' "$file"
sed -i '/^Name=/ s/$/ (ACE-Integration)/' "$file"
sed -i "/^Name\[${LANGUAGE}\]=/ s/\$/ (ACE-Integration)/" "$file"
sed -i '/^Name=/ s/$/ (Bookworm)/' "$file"
sed -i "/^Name\[${LANGUAGE}\]=/ s/\$/ (Bookworm)/" "$file"
icon_line=$(grep "^Icon=" "$file")
if [[ "$icon_line" == "Icon=/"* ]]; then
# 如果Icon=后面接的是/,则添加前缀
sed -i 's|^Icon=/|Icon=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/|' "$file"
sed -i 's|^Icon=/|Icon=/opt/apps/amber-ce-bookworm/files/bookworm-env/|' "$file"
fi
fi
fi
chmod +x $file
}
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
do_integrate $file
DESKTOP_FILE_NAME=$(basename $file)
ln -sf "../../../opt/apps/$app_dir/entries/applications/$DESKTOP_FILE_NAME" "/usr/share/applications/"
linkDir "../../../opt/apps/$app_dir/entries/icons" "/usr/share/icons/"
done
done
else
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
else
log.error "DO NOT run me on host OS"
fi

View File

@@ -0,0 +1,178 @@
#!/bin/bash
export LANGUAGE=en_US
#############################################################
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }
# 发送通知
function notify-send() {
# Detect user using the display
local user=$(who | awk '{print $1}' | head -n 1)
# Detect uid of the user
local uid=$(id -u $user)
log.debug "User is $user and the uid of it is $uid"
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/${uid}/bus notify-send $@
}
# 检测网络链接畅通
function network-check()
{
# 超时时间
local timeout=15
# 目标网站
local target=www.baidu.com
# 获取响应状态码
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
if [ "x$ret_code" = "x200" ] ; then
# 网络畅通
return 0
else
# 网络不畅通
return 1
fi
}
###############################################################
if [ "$(id -u)" != "0" ]; then
log.error "Nope we need root to run"
exit -1
fi
network-check
if [ $? -ne 0 ] ; then
log.error "NETWORK_FAIL"
exit -1
fi
# The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
if [ $(which aptss) ];then
APT_COMMAND=aptss
/usr/bin/apt update
log.info "Using aptss to operate the upgrade process since we detect it."
elif [ -e /usr/bin/apt ];then
APT_COMMAND=/usr/bin/apt
log.info "Using apt to operate the upgrade process."
else
log.error "Nope we support debian only now"
exit -1
fi
${APT_COMMAND} clean
${APT_COMMAND} update
updatetext=`${APT_COMMAND} update 2>&1`
until [ "`echo $updatetext | grep E: `" = "" ];do
log.info "UPDATE_ERROR_AND_WAIT_15_SEC"
sleep 15
updatetext=`${APT_COMMAND} update 2>&1`
done
isupdate=`echo ${updatetext: -5}`
if [ "$isupdate" = "date." ] ; then
log.info "No need to upgrade. exit"
exit 0
fi
## 从这里开始,只有检测到了更新才会进行
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串`
update_app_number=`echo ${update_app_number##*information...}`
# 获取用户选择的要更新的应用
PKG_LIST="$(env LANGUAGE=en_US /usr/bin/apt list --upgradable | awk NR\>1)"
# 指定分隔符为 \n
IFS_OLD="$IFS"
IFS=$'\n'
for line in $PKG_LIST ; do
PKG_NAME=$(echo $line | awk -F ' ' '{print $1}')
PKG_NEW_VER=$(echo $line | awk -F ' ' '{print $2}')
PKG_CUR_VER=$(echo $line | awk -F ' ' '{print $3}')
dpkg --compare-versions $PKG_NEW_VER le $PKG_CUR_VER
if [ $? -eq 0 ] ; then
let update_app_number=$update_app_number-1
continue
fi
## 检测是否是 hold 状态
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
if [ "$PKG_STA" = "hold" ] ; then
let update_app_number=$update_app_number-1
fi
done
# 还原分隔符
IFS="$IFS_OLD"
if [ $update_app_number -le 0 ] ; then
log.info "No package need to upgrade after ignoring those holded ones. exit"
exit 0
fi
## 如果都是hold或者版本一致的那就直接退出否则把剩余的给提醒了
user=$(who | awk '{print $1}' | head -n 1)
log.info "ACE Bookworm环境中有 $update_app_number 个软件包可升级,正在自动升级"
notify-send -a amber-ce-bookworm "ACE兼容环境" "ACE环境中有${update_app_number}个软件包可升级,执行自动升级..."
${APT_COMMAND} clean
${APT_COMMAND} full-upgrade -y
${APT_COMMAND} clean
notify-send -a amber-ce-bookworm "ACE兼容环境" "自动升级结束"

View File

@@ -0,0 +1 @@
# File in this dir will be seen as one of XDG_DATA_DIRS in ACE container.

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Exec=xdg-open %U
MimeType=inode/directory;application/x-mimearchive;x-scheme-handler/http;x-scheme-handler/https;application/msword;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/x-gzip;application/zip;application/rar;application/x-tar;application/pdf;application/rtf;image/gif;image/jpeg;image/jp2;image/png;image/tiff;image/bmp;image/svg+xml;image/webp;image/x-icon;application/kswps;application/kset;application/ksdps;application/x-photoshop;application/x-coreldraw;application/x-shockwave-flash;text/plain;application/x-javascript;text/javascript;text/css;text/html;application/xhtml+xml;text/xml;text/x-vcard;application/x-httpd-php;application/java-archive;application/vnd.android.package-archive;application/octet-stream;application/x-x509-user-cert;audio/mpeg;audio/midi;audio/x-wav;audio/x-mpegurl;audio/x-m4a;audio/ogg;audio/x-realaudio;video/mp4;video/mpeg;video/quicktime;video/x-m4v;video/x-ms-wmv;video/x-msvideo;video/webm;video/x-flv;application/xhtml_xml;
Name=ace-run-in-host-os
NoDisplay=true
Terminal=false
TryExec=
Type=Application
Version=1.0

View File

@@ -1,3 +1,4 @@
#!/bin/bash
### We do not want users to install ACE in ACE. Run inside this container instead
${@}
### We do not want users to install ACE in ACE.
echo "Running ACE in ACE is NOT Tested or recommended. Exit"
exit 1

View File

@@ -0,0 +1,2 @@
#!/bin/bash
host-spawn /opt/apps/amber-ce-bookworm/files/bin/bookworm-run-bwrap $@

View File

@@ -1,6 +1,6 @@
#!/bin/bash
if [ "$UID" = "0" ];then
pkexec $@
$@
else
host-spawn pkexec bookworm-run $@
fi

View File

@@ -1,80 +1,12 @@
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "当前用户不是 root 用户,退出"
if [ "$IS_ACE_ENV" != "1" ];then
echo "ONLY RUN ME IN ACE"
exit
fi
if [ "$PACKAGE_NAME" = "" ];then
curdir=`realpath $0`
parent_dir=`dirname $curdir`
pparent_dir=`dirname $parent_dir`
ppparent_dir=`dirname $pparent_dir`
PKGNAME=`basename $ppparent_dir`
else
PKGNAME=$PACKAGE_NAME
fi
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
if [ ! -e $chrootEnvPath ];then
echo "Uncompress the env...."
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/$PKGNAME/files/
fi
non_root_user=$(who | awk '{print $1}' | head -n 1)
uid=$(id -u $non_root_user)
function bookworm-run(){
bwrap --dev-bind $chrootEnvPath/ / \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--setenv LC_ALL "$LC_ALL" \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
--dev-bind $chrootEnvPath/ / \
--dev-bind /media /media \
--dev-bind /tmp /tmp \
--dev /dev \
--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 \
--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 \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--dev-bind /home /home \
$@
}
# Move the package init work to build stage
#bookworm-run apt update
#bookworm-run apt install apt-utils bc curl dialog diffutils findutils gnupg2 less libnss-myhostname libvte-2.9*-common libvte-common lsof ncurses-base passwd pinentry-curses procps sudo time util-linux wget libegl1-mesa libgl1-mesa-glx libvulkan1 mesa-vulkan-drivers locales libglib2.0-bin -y
echo "Update the flamescion container tools"
cp -r `dirname $chrootEnvPath`/flamescion-container-tools/ $chrootEnvPath
rm -rf $chrootEnvPath/usr/lib/`gcc -dumpmachine`/dri/dri
# 之前错误的多复制了一个,这里删掉
container_user_gid="$(sudo -u $non_root_user id -rg)"
container_user_home="/home/${non_root_user}"
container_user_name="${non_root_user}"
container_user_uid="$(sudo -u $non_root_user id -ru)"
cat << EOFFFFFF > $chrootEnvPath/init.sh
#!/bin/bash
printf "bookworm-cm: Setting up sudo...\n"
printf "ACE: Setting up sudo...\n"
mkdir -p /etc/sudoers.d
# Do not check fqdn when doing sudo, it will not work anyways
if ! grep -q 'Defaults !fqdn' /etc/sudoers.d/sudoers; then
@@ -86,7 +18,9 @@ cat << EOFFFFFF > $chrootEnvPath/init.sh
fi
printf "bookworm-cm: Setting up groups...\n"
printf "ACE: Setting up groups...\n"
# If not existing, ensure we have a group for our user.
if ! grep -q "^${container_user_name}:" /etc/group; then
if ! groupadd --force --gid "${container_user_gid}" "${container_user_name}"; then
@@ -96,7 +30,7 @@ if ! grep -q "^${container_user_name}:" /etc/group; then
fi
fi
printf "bookworm-cm: Setting up users...\n"
printf "ACE: Setting up users...\n"
# Setup kerberos integration with the host
if [ -d "/run/host/var/kerberos" ] &&
@@ -177,55 +111,22 @@ 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
apt install --reinstall /flamescion-container-tools/ace-host-integration.deb
EOFFFFFF
#####init
chmod +x $chrootEnvPath/init.sh
bookworm-run bash /init.sh
bookworm-run rm /init.sh
bookworm-run cp /host/etc/locale.gen /etc/locale.gen && locale-gen
bookworm-run touch /finish.flag
bookworm-run apt clean
bookworm-run chown -R $(who | awk '{print $1}' | head -n 1) /usr/lib/locale/
sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ / \
--setenv LANG "$LANG" \
--setenv LC_COLLATE "$LC_COLLATE" \
--setenv LC_CTYPE "$LC_CTYPE" \
--setenv LC_MONETARY "$LC_MONETARY" \
--setenv LC_MESSAGES "$LC_MESSAGES" \
--setenv LC_NUMERIC "$LC_NUMERIC" \
--setenv LC_TIME "$LC_TIME" \
--setenv LC_ALL "$LC_ALL" \
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
--dev-bind $chrootEnvPath/ / \
--dev-bind /media /media \
--dev-bind /tmp /tmp \
--dev /dev \
--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 \
--unshare-uts \
--dev-bind /etc/resolv.conf /etc/resolv.conf \
--dev-bind /home /home \
locale-gen
chown -R root $chrootEnvPath
cd /flamescion-container-tools/data-dir/
ln -sfv ../../usr/share/applications/ .
ln -sfv ../../usr/share/icons/ .
ln -svf ../../usr/share/mime .
update-desktop-database /usr/share/applications || true
update-mime-database /usr/share/mime || true

View File

@@ -0,0 +1 @@
# App in this dir will be integrated to host os. Will create symbol link when installing

View File

@@ -1,5 +1,5 @@
{
"appid": "cn.flamescion.bookworm-compatibility-mode",
"appid": "amber-ce-bookworm",
"name": "cn.flamescion.bookworm-compatibility-mode",
"version": "12.1.4",
"arch": ["amd64"],

View File

@@ -0,0 +1 @@
../../opt/apps/amber-ce-bookworm/files/bin/ace-bookworm-uninstall-helper

View File

@@ -0,0 +1 @@
../../opt/apps/amber-ce-bookworm/files/bin/ace-bookworm-uninstall-helper-gui

1
src/usr/bin/bookworm-run Symbolic link
View File

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

View File

@@ -0,0 +1,6 @@
# ACE app runs in a container, need privileges within user namespace, so we need to set it
kernel.unprivileged_userns_clone=1
# Ubuntu 24.04 has more limitation on unprivileged user namespace,so we have to disable them.
# refer to https://ubuntu.com/blog/ubuntu-23-10-restricted-unprivileged-user-namespaces
kernel.apparmor_restrict_unprivileged_unconfined=0
kernel.apparmor_restrict_unprivileged_userns=0

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Amber CE Auto upgrade
After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
[Service]
Type=simple
RemainAfterExit=yes
ExecStart=bookworm-run /flamescion-container-tools/ace-upgrader/ace-upgrader
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,17 @@
#!/bin/bash
# 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/amber-ce-bookworm/files/ace-env/flamescion-container-tools/data-dir/"
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
export XDG_DATA_DIRS="${XDG_DATA_DIRS}:${ACE_path}"
fi

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Name=ACE Bookworm Software Uninstaller
Name[zh_CN]=ACE Bookworm软件卸载器
Comment=用于卸载ACE容器的应用
Type=Application
Exec=/opt/apps/amber-ce-bookworm/files/bin/ace-bookworm-uninstall-helper-gui
Icon=ACE-bookworm-uninstaller
Categories=System
# Generated from the DesktopGenerater component of the z-Tools toolkit

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Categories=utils
Exec=bookworm-run %U
Icon=amber-ce-bookworm
Name=Amber CE Bookworm
Name[zh_CN]=ACE Bookworm兼容环境
Keywords=BCM,ACE,ace,mode
StartupNotify=true
Type=Application
Terminal=true
Categories=System

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@@ -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>bookworm.ace-gxde-fixer</vendor>
<icon_name>x-package-repository</icon_name>
<action id="bookworm.ace-gxde-fixer">
<description>运行bookworm.ace-gxde-fixer需要权限</description>
<message>要使用bookworm.ace-gxde-fixer需要权限</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/amber-ce-bookworm/files/bin/bookworm.ace-gxde-fixer</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -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>amber-ce-bookworm.ace-uninstaller</vendor>
<icon_name>x-package-repository</icon_name>
<action id="amber-ce-bookworm.ace-uninstaller">
<description>运行amber-ce-bookworm.ace-uninstaller需要权限</description>
<message>要使用amber-ce-bookworm.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/amber-ce-bookworm/files/bin/ace-bookworm-uninstall-helper-gui</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -8,3 +8,5 @@ rm -rf /var/cache/apt/
rm -rf /var/lib/aptss/lists/*
rm -rf /usr/share/doc
#apt install ace-integration in init
#tools只保留gio hostspawn和xdg-open