mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-06-10 09:05:59 +08:00
Up-to-latest
This commit is contained in:
parent
363f45d6cd
commit
68a5d36e4c
@ -1,19 +1,19 @@
|
||||
# 书虫兼容环境
|
||||
书虫兼容环境,使用bwrap容器在deepin或UOS上使用Debian 12的应用,为你带来更好的使用体验!
|
||||
|
||||
兼容环境内不允许提权,若要在容器内使用root,请使用 sudo /opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-run
|
||||
兼容环境内不允许提权,若要在容器内使用root,请使用 sudo bookworm-run
|
||||
|
||||
## 构建指南
|
||||
|
||||
先构建容器再打包,容器位置在`src/opt/apps/store.spark-app.bookworm-compatibility-mode/files/`
|
||||
先构建容器再打包,容器位置在`src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
|
||||
|
||||
|
||||
# Bookworm compatibility mode
|
||||
|
||||
Bookworm compatibility mode allows you to use Debian 12 applications on deepin or UniontechOS using bwrap containers, providing you with a better user experience!
|
||||
|
||||
It is not allowed to gain root privileges within the compatible environment. If you need to use root within the container, please use "sudo /opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-run"
|
||||
It is not allowed to gain root privileges within the compatible environment. If you need to use root within the container, please use "sudo bookworm-run"
|
||||
|
||||
## Build Guide
|
||||
|
||||
Build the container first then build the package. Container at `src/opt/apps/store.spark-app.bookworm-compatibility-mode/files/`
|
||||
Build the container first then build the package. Container at `src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files`
|
||||
|
@ -1,5 +1,5 @@
|
||||
Package: store.spark-app.bookworm-compatibility-mode
|
||||
Version: 12.0
|
||||
Package: cn.flamescion.bookworm-compatibility-mode
|
||||
Version: 12.1.1
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Depends: bubblewrap
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
/opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
ln -sf /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run /usr/bin/bookworm-run
|
||||
|
@ -3,7 +3,8 @@
|
||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||
|
||||
echo "清理卸载残留"
|
||||
rm -rf /opt/apps/store.spark-app.bookworm-compatibility-mode/
|
||||
unlink /usr/bin/bookworm-run
|
||||
rm -rf /opt/apps/cn.flamescion.bookworm-compatibility-mode/
|
||||
else
|
||||
echo "非卸载,跳过清理"
|
||||
fi
|
||||
|
@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Categories=utils
|
||||
Exec=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run %U
|
||||
Icon=cn.flamescion.bookworm-compatibility-mode
|
||||
Name=Bookworm CM
|
||||
Name[zh_CN]=书虫兼容环境
|
||||
StartupNotify=true
|
||||
Type=Application
|
||||
Terminal=true
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@ -4,13 +4,16 @@ if [ "$(id -u)" != "0" ]; then
|
||||
echo "当前用户不是 root 用户,退出"
|
||||
exit
|
||||
fi
|
||||
chrootEnvPath=/opt/apps/store.spark-app.bookworm-compatibility-mode/files/bookworm-env
|
||||
chrootEnvPath=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env
|
||||
if [ ! -e $chrootEnvPath ];then
|
||||
echo "Uncompress the env...."
|
||||
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/store.spark-app.bookworm-compatibility-mode/files/
|
||||
chown -R $(who | awk '{print $1}' | head -n 1) $chrootEnvPath
|
||||
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/
|
||||
fi
|
||||
|
||||
echo "Update the flamescion container tools"
|
||||
tar -xvf `dirname $chrootEnvPath`flamescion-container-tools.tar.xz -C $chrootEnvPath
|
||||
chown -R $(who | awk '{print $1}' | head -n 1) $chrootEnvPath
|
||||
|
||||
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||
uid=$(id -u $non_root_user)
|
||||
|
||||
@ -25,14 +28,14 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
--setenv LC_TIME "$LC_TIME" \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--dev-bind $chrootEnvPath/etc /etc \
|
||||
--dev-bind $chrootEnvPath/opt /opt \
|
||||
--dev-bind $chrootEnvPath/usr /usr \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev /dev \
|
||||
--proc /proc \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /run /run \
|
||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||
--dev-bind $chrootEnvPath/var /var \
|
||||
--dev-bind / /run/host \
|
||||
--hostname bookworm-compatibility-mode \
|
||||
--unshare-uts \
|
||||
@ -41,11 +44,13 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /home /home \
|
||||
$@
|
||||
|
||||
|
||||
}
|
||||
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 -y
|
||||
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
|
||||
|
||||
|
||||
cp -r /usr/lib/x86_64-linux-gnu/dri $chrootEnvPath/usr/lib/x86_64-linux-gnu/dri
|
||||
cp -r /usr/lib/`gcc -dumpmachine`/dri $chrootEnvPath/usr/lib/`gcc -dumpmachine`/dri
|
||||
|
||||
container_user_gid="$(id -rg)"
|
||||
container_user_home="${HOME:-"/"}"
|
||||
@ -175,14 +180,14 @@ sudo -u $(who | awk '{print $1}' | head -n 1) bwrap --dev-bind $chrootEnvPath/ /
|
||||
--setenv LC_TIME "$LC_TIME" \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--dev-bind $chrootEnvPath/etc /etc \
|
||||
--dev-bind $chrootEnvPath/opt /opt \
|
||||
--dev-bind $chrootEnvPath/usr /usr \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev /dev \
|
||||
--proc /proc \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /run /run \
|
||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||
--dev-bind $chrootEnvPath/var /var \
|
||||
--dev-bind / /run/host \
|
||||
--hostname bookworm-compatibility-mode \
|
||||
--unshare-uts \
|
@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
if [ ! -e /opt/apps/store.spark-app.bookworm-compatibility-mode/files/bookworm-env/finish.flag ];then
|
||||
if [ ! -e /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/finish.flag ];then
|
||||
|
||||
if [ "$(id -u)" = "0" ]; then
|
||||
/opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
else
|
||||
pkexec /opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
pkexec /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||
fi
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ OPTIONS="bash"
|
||||
else
|
||||
OPTIONS="$@"
|
||||
fi
|
||||
chrootEnvPath=/opt/apps/store.spark-app.bookworm-compatibility-mode/files/bookworm-env
|
||||
chrootEnvPath=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env
|
||||
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||
uid=$(id -u $non_root_user)
|
||||
|
||||
@ -29,14 +29,14 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
--setenv LC_TIME "$LC_TIME" \
|
||||
--setenv LC_ALL "$LC_ALL" \
|
||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||
--dev-bind $chrootEnvPath/etc /etc \
|
||||
--dev-bind $chrootEnvPath/opt /opt \
|
||||
--dev-bind $chrootEnvPath/usr /usr \
|
||||
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||
--dev-bind $chrootEnvPath/ / \
|
||||
--dev-bind /media /media \
|
||||
--dev /dev \
|
||||
--proc /proc \
|
||||
--dev-bind /sys /sys \
|
||||
--dev-bind /run /run \
|
||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||
--dev-bind $chrootEnvPath/var /var \
|
||||
--dev-bind / /run/host \
|
||||
--hostname bookworm-compatibility-mode \
|
||||
--unshare-uts \
|
||||
@ -47,3 +47,4 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
{
|
||||
"appid": "store.spark-app.bookworm-compatibility-mode",
|
||||
"name": "store.spark-app.bookworm-compatibility-mode",
|
||||
"version": "12.0",
|
||||
"appid": "cn.flamescion.bookworm-compatibility-mode",
|
||||
"name": "cn.flamescion.bookworm-compatibility-mode",
|
||||
"version": "12.1.1",
|
||||
"arch": ["amd64"],
|
||||
"permissions": {
|
||||
"autostart": true,
|
@ -1,9 +0,0 @@
|
||||
[Desktop Entry]
|
||||
Categories=utils
|
||||
Exec=/opt/apps/store.spark-app.bookworm-compatibility-mode/files/bin/bookworm-run %U
|
||||
Icon=store.spark-app.bookworm-compatibility-mode
|
||||
Name=Bookworm CM
|
||||
Name[zh_CN]=书虫兼容环境
|
||||
StartupNotify=true
|
||||
Type=Application
|
||||
Terminal=true
|
Loading…
x
Reference in New Issue
Block a user