mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-07-14 17:42:23 +08:00
Up-to-latest
This commit is contained in:
parent
363f45d6cd
commit
68a5d36e4c
@ -1,19 +1,19 @@
|
|||||||
# 书虫兼容环境
|
# 书虫兼容环境
|
||||||
书虫兼容环境,使用bwrap容器在deepin或UOS上使用Debian 12的应用,为你带来更好的使用体验!
|
书虫兼容环境,使用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
|
||||||
|
|
||||||
Bookworm compatibility mode allows you to use Debian 12 applications on deepin or UniontechOS using bwrap containers, providing you with a better user experience!
|
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 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
|
Package: cn.flamescion.bookworm-compatibility-mode
|
||||||
Version: 12.0
|
Version: 12.1.1
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bubblewrap
|
Depends: bubblewrap
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/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
|
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
||||||
|
|
||||||
echo "清理卸载残留"
|
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
|
else
|
||||||
echo "非卸载,跳过清理"
|
echo "非卸载,跳过清理"
|
||||||
fi
|
fi
|
||||||
|
9
src/opt/apps/cn.flamescion.bookworm-compatibility-mode/entries/applications/cn.flamescion.bookworm-compatibility-mode.desktop
Normal file
9
src/opt/apps/cn.flamescion.bookworm-compatibility-mode/entries/applications/cn.flamescion.bookworm-compatibility-mode.desktop
Normal file
@ -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 (image error) Size: 6.7 KiB After (image error) Size: 6.7 KiB |
@ -4,13 +4,16 @@ if [ "$(id -u)" != "0" ]; then
|
|||||||
echo "当前用户不是 root 用户,退出"
|
echo "当前用户不是 root 用户,退出"
|
||||||
exit
|
exit
|
||||||
fi
|
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
|
if [ ! -e $chrootEnvPath ];then
|
||||||
echo "Uncompress the env...."
|
echo "Uncompress the env...."
|
||||||
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/store.spark-app.bookworm-compatibility-mode/files/
|
tar -xvf $chrootEnvPath.tar.xz -C /opt/apps/cn.flamescion.bookworm-compatibility-mode/files/
|
||||||
chown -R $(who | awk '{print $1}' | head -n 1) $chrootEnvPath
|
|
||||||
fi
|
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)
|
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||||
uid=$(id -u $non_root_user)
|
uid=$(id -u $non_root_user)
|
||||||
|
|
||||||
@ -25,14 +28,14 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--setenv LC_TIME "$LC_TIME" \
|
--setenv LC_TIME "$LC_TIME" \
|
||||||
--setenv LC_ALL "$LC_ALL" \
|
--setenv LC_ALL "$LC_ALL" \
|
||||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||||
--dev-bind $chrootEnvPath/etc /etc \
|
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||||
--dev-bind $chrootEnvPath/opt /opt \
|
--dev-bind $chrootEnvPath/ / \
|
||||||
--dev-bind $chrootEnvPath/usr /usr \
|
|
||||||
--dev-bind /media /media \
|
--dev-bind /media /media \
|
||||||
--dev /dev \
|
--dev /dev \
|
||||||
--proc /proc \
|
--proc /proc \
|
||||||
|
--dev-bind /sys /sys \
|
||||||
|
--dev-bind /run /run \
|
||||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
--dev-bind $chrootEnvPath/var /var \
|
|
||||||
--dev-bind / /run/host \
|
--dev-bind / /run/host \
|
||||||
--hostname bookworm-compatibility-mode \
|
--hostname bookworm-compatibility-mode \
|
||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
@ -41,11 +44,13 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--dev-bind /home /home \
|
--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_gid="$(id -rg)"
|
||||||
container_user_home="${HOME:-"/"}"
|
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_TIME "$LC_TIME" \
|
||||||
--setenv LC_ALL "$LC_ALL" \
|
--setenv LC_ALL "$LC_ALL" \
|
||||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||||
--dev-bind $chrootEnvPath/etc /etc \
|
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||||
--dev-bind $chrootEnvPath/opt /opt \
|
--dev-bind $chrootEnvPath/ / \
|
||||||
--dev-bind $chrootEnvPath/usr /usr \
|
|
||||||
--dev-bind /media /media \
|
--dev-bind /media /media \
|
||||||
--dev /dev \
|
--dev /dev \
|
||||||
--proc /proc \
|
--proc /proc \
|
||||||
|
--dev-bind /sys /sys \
|
||||||
|
--dev-bind /run /run \
|
||||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
--dev-bind $chrootEnvPath/var /var \
|
|
||||||
--dev-bind / /run/host \
|
--dev-bind / /run/host \
|
||||||
--hostname bookworm-compatibility-mode \
|
--hostname bookworm-compatibility-mode \
|
||||||
--unshare-uts \
|
--unshare-uts \
|
@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/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
|
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
|
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ OPTIONS="bash"
|
|||||||
else
|
else
|
||||||
OPTIONS="$@"
|
OPTIONS="$@"
|
||||||
fi
|
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)
|
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||||
uid=$(id -u $non_root_user)
|
uid=$(id -u $non_root_user)
|
||||||
|
|
||||||
@ -29,14 +29,14 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--setenv LC_TIME "$LC_TIME" \
|
--setenv LC_TIME "$LC_TIME" \
|
||||||
--setenv LC_ALL "$LC_ALL" \
|
--setenv LC_ALL "$LC_ALL" \
|
||||||
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
--setenv PULSE_SERVER /run/user/$uid/pulse/native \
|
||||||
--dev-bind $chrootEnvPath/etc /etc \
|
--setenv PATH /flamescion-container-tools/bin-override:$PATH \
|
||||||
--dev-bind $chrootEnvPath/opt /opt \
|
--dev-bind $chrootEnvPath/ / \
|
||||||
--dev-bind $chrootEnvPath/usr /usr \
|
|
||||||
--dev-bind /media /media \
|
--dev-bind /media /media \
|
||||||
--dev /dev \
|
--dev /dev \
|
||||||
--proc /proc \
|
--proc /proc \
|
||||||
|
--dev-bind /sys /sys \
|
||||||
|
--dev-bind /run /run \
|
||||||
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
--dev-bind /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
--dev-bind $chrootEnvPath/var /var \
|
|
||||||
--dev-bind / /run/host \
|
--dev-bind / /run/host \
|
||||||
--hostname bookworm-compatibility-mode \
|
--hostname bookworm-compatibility-mode \
|
||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
@ -47,3 +47,4 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/flamescion-container-tools.tar.xz
Normal file
BIN
src/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/flamescion-container-tools.tar.xz
Normal file
Binary file not shown.
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"appid": "store.spark-app.bookworm-compatibility-mode",
|
"appid": "cn.flamescion.bookworm-compatibility-mode",
|
||||||
"name": "store.spark-app.bookworm-compatibility-mode",
|
"name": "cn.flamescion.bookworm-compatibility-mode",
|
||||||
"version": "12.0",
|
"version": "12.1.1",
|
||||||
"arch": ["amd64"],
|
"arch": ["amd64"],
|
||||||
"permissions": {
|
"permissions": {
|
||||||
"autostart": true,
|
"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