Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f33d2fff7 | |||
| b93199bb05 | |||
| 6b0942d2d5 | |||
| de2d84e13a | |||
| 8fca595000 | |||
| ceb863717f | |||
| f489876185 | |||
| 1e47004eef | |||
|
|
4afbfab976 | ||
| 866a866d5b | |||
| 2bdfe5c177 | |||
| 6b27103c18 | |||
| 00c2772152 | |||
| a8463e9152 | |||
| 0f293864b6 | |||
| 6c853b2bec | |||
| 8ce2c31380 | |||
|
|
f57e80c61a | ||
|
|
8140e49602 |
@@ -1,8 +1,8 @@
|
|||||||
Package: cn.flamescion.bookworm-compatibility-mode
|
Package: cn.flamescion.bookworm-compatibility-mode
|
||||||
Version: 12.4
|
Version: 12.4.7
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bubblewrap,xdg-desktop-portal | flatpak,zenity,policykit-1,gcc
|
Depends: bubblewrap,flatpak,zenity,policykit-1,gcc
|
||||||
Maintainer: shenmo <shenmo@spark-app.store>
|
Maintainer: shenmo <shenmo@spark-app.store>
|
||||||
Architecture: arm64
|
Architecture: amd64
|
||||||
Description: bwrap wrapper for install and running debs inside a bookworm container
|
Description: bwrap wrapper for install and running debs inside a bookworm container
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
export PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
||||||
/opt/apps/$PACKAGE_NAME/files/bin/bookworm-init
|
/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
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
PACKAGE_NAME="$DPKG_MAINTSCRIPT_PACKAGE"
|
||||||
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
|
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
|
|
||||||
fi
|
|
||||||
echo "清理卸载残留"
|
echo "清理卸载残留"
|
||||||
|
|
||||||
rm -rf /opt/apps/$PACKAGE_NAME
|
rm -rf /opt/apps/$PACKAGE_NAME
|
||||||
|
|||||||
17
src/etc/X11/Xsession.d/20ACE-Bookworm
Executable 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/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share/"
|
||||||
|
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
|
||||||
|
export XDG_DATA_DIRS="${ACE_path}:${XDG_DATA_DIRS}"
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
# shellcheck shell=sh
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -190,6 +190,126 @@ ln -sfv /flamescion-container-tools/bin-override/host-spawn-$(uname -m) /flamesc
|
|||||||
|
|
||||||
apt install --reinstall /flamescion-container-tools/ace-host-integration.deb
|
apt install --reinstall /flamescion-container-tools/ace-host-integration.deb
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Do NVIDIA Integration
|
||||||
|
|
||||||
|
echo "ACE: NVIDIA Integration"
|
||||||
|
|
||||||
|
ensureTargetDir() {
|
||||||
|
targetFile=$1
|
||||||
|
t=$(dirname "$targetFile")
|
||||||
|
mkdir -p "$t"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lib32_dir="/usr/lib/"
|
||||||
|
lib64_dir="/usr/lib/"
|
||||||
|
if [ -e "/usr/lib/x86_64-linux-gnu" ]; then
|
||||||
|
lib64_dir="/usr/lib/x86_64-linux-gnu/"
|
||||||
|
elif [ -e "/usr/lib64" ]; then
|
||||||
|
lib64_dir="/usr/lib64/"
|
||||||
|
fi
|
||||||
|
if [ -e "/usr/lib/i386-linux-gnu" ]; then
|
||||||
|
lib32_dir="/usr/lib/i386-linux-gnu/"
|
||||||
|
elif [ -e "/usr/lib32" ]; then
|
||||||
|
lib32_dir="/usr/lib32/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# First we find all non-lib files we need, this includes
|
||||||
|
# - binaries
|
||||||
|
# - confs
|
||||||
|
# - egl files
|
||||||
|
# - icd files
|
||||||
|
# Excluding here the libs, we will threat them later specifically
|
||||||
|
NVIDIA_FILES="$(find /host/etc/ /host/usr/ \
|
||||||
|
-path "/host/usr/lib/i386-linux-gnu/*" -prune -o \
|
||||||
|
-path "/host/usr/lib/x86_64-linux-gnu/*" -prune -o \
|
||||||
|
-path "/host/usr/lib32/*" -prune -o \
|
||||||
|
-path "/host/usr/lib64/*" -prune -o \
|
||||||
|
-iname "*nvidia*" -not -type d -print 2> /dev/null || :)"
|
||||||
|
for nvidia_file in ${NVIDIA_FILES}; do
|
||||||
|
dest_file="$(printf "%s" "${nvidia_file}" | sed 's|/host||g')"
|
||||||
|
ensureTargetDir ${dest_file}
|
||||||
|
cp -r "${nvidia_file}" "${dest_file}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Then we find all directories with nvidia in the name and just mount them
|
||||||
|
NVIDIA_DIRS="$(find /host/etc /host/usr -iname "*nvidia*" -type d 2> /dev/null || :)"
|
||||||
|
for nvidia_dir in ${NVIDIA_DIRS}; do
|
||||||
|
# /usr/lib64 is common in Arch or RPM based distros, while /usr/lib/x86_64-linux-gnu is
|
||||||
|
# common on Debian derivatives, so we need to adapt between the two nomenclatures.
|
||||||
|
if printf "%s" "${nvidia_dir}" | grep -Eq "lib32|lib64|x86_64-linux-gnu|i386-linux-gnu"; then
|
||||||
|
|
||||||
|
# Remove origin so we plug our own
|
||||||
|
dest_dir="$(printf "%s" "${nvidia_dir}" |
|
||||||
|
sed "s|/host/usr/lib/x86_64-linux-gnu/|${lib64_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib/i386-linux-gnu/|${lib32_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib64/|${lib64_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib32/|${lib32_dir}|g")"
|
||||||
|
else
|
||||||
|
dest_dir="$(printf "%s" "${nvidia_dir}" | sed 's|/host||g')"
|
||||||
|
fi
|
||||||
|
ensureTargetDir ${dest_file}
|
||||||
|
cp -r "${nvidia_dir}" "${dest_file}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Then we find all the ".so" libraries, there are searched separately
|
||||||
|
# because we need to extract the relative path to mount them in the
|
||||||
|
# correct path based on the guest's setup
|
||||||
|
#
|
||||||
|
# /usr/lib64 is common in Arch or RPM based distros, while /usr/lib/x86_64-linux-gnu is
|
||||||
|
# common on Debian derivatives, so we need to adapt between the two nomenclatures.
|
||||||
|
NVIDIA_LIBS="$(find \
|
||||||
|
/host/usr/lib/i386-linux-gnu/ \
|
||||||
|
/host/usr/lib/x86_64-linux-gnu/ \
|
||||||
|
/host/usr/lib32/ \
|
||||||
|
/host/usr/lib64/ \
|
||||||
|
-iname "*nvidia*.so*" \
|
||||||
|
-o -iname "libcuda*.so*" \
|
||||||
|
-o -iname "libnvcuvid*.so*" \
|
||||||
|
-o -iname "libnvoptix*.so*" 2> /dev/null || :)"
|
||||||
|
for nvidia_lib in ${NVIDIA_LIBS}; do
|
||||||
|
dest_file="$(printf "%s" "${nvidia_lib}" |
|
||||||
|
sed "s|/host/usr/lib/x86_64-linux-gnu/|${lib64_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib/i386-linux-gnu/|${lib32_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib64/|${lib64_dir}|g" |
|
||||||
|
sed "s|/host/usr/lib32/|${lib32_dir}|g")"
|
||||||
|
|
||||||
|
# If file exists, just continue
|
||||||
|
# this may happen for directories like /usr/lib/nvidia/xorg/foo.so
|
||||||
|
# where the directory is already bind mounted (ro) and we don't need
|
||||||
|
# to mount further files in it.
|
||||||
|
if [ -e "${dest_file}" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
type="file"
|
||||||
|
if [ -L "${nvidia_lib}" ]; then
|
||||||
|
type="link"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${type}" = "link" ]; then
|
||||||
|
mkdir -p "$(dirname "${dest_file}")"
|
||||||
|
cp -d "${nvidia_lib}" "${dest_file}"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
ensureTargetDir ${dest_file}
|
||||||
|
cp -r "${nvidia_lib}" "${dest_file}"
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
# Refresh ldconfig cache, also detect if there are empty files remaining
|
||||||
|
# and clean them.
|
||||||
|
# This could happen when upgrading drivers and changing versions.
|
||||||
|
empty_libs="$(ldconfig 2>&1 | grep -Eo "File.*is empty" | cut -d' ' -f2)"
|
||||||
|
if [ -n "${empty_libs}" ]; then
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
find ${empty_libs} -delete 2> /dev/null || :
|
||||||
|
find /usr/ /etc/ -empty -iname "*nvidia*" -delete 2> /dev/null || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
EOFFFFFF
|
EOFFFFFF
|
||||||
|
|
||||||
#####init
|
#####init
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ bwrap --dev-bind / / \
|
|||||||
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
|
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
--dev-bind / /host \
|
--dev-bind / /host \
|
||||||
--ro-bind-try /usr/share/themes /usr/local/share/themes \
|
--ro-bind-try /usr/share/themes /usr/local/share/themes \
|
||||||
--ro-bind-try /usr/share/icons /usr/share/icons \
|
--ro-bind-try /usr/share/icons /usr/local/share/icons \
|
||||||
--ro-bind-try /usr/share/fonts /usr/local/share/fonts \
|
--ro-bind-try /usr/share/fonts /usr/local/share/fonts \
|
||||||
--hostname Amber-CE-Bookworm \
|
--hostname Amber-CE-Bookworm \
|
||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ exit 1
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd "`dirname $0`"
|
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=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 ./bookworm-env https://mirrors.ustc.edu.cn/debian/
|
||||||
|
|
||||||
|
|
||||||
sudo rm -rf bookworm-env/var/cache/apt/archives/*.deb
|
sudo rm -rf bookworm-env/var/cache/apt/archives/*.deb
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Package: ace-host-integration
|
Package: ace-host-integration
|
||||||
Version: 1.2
|
Version: 1.2.1
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bash
|
Depends: bash
|
||||||
|
|||||||
@@ -1,28 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
|
ACE_dir="/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env"
|
||||||
function linkDir() {
|
|
||||||
ensureTargetDir() {
|
|
||||||
targetFile=$1
|
|
||||||
t=$(dirname "$targetFile")
|
|
||||||
mkdir -p "$t"
|
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
|
||||||
fi
|
|
||||||
|
|
||||||
ensureTargetDir "$targetFile"
|
|
||||||
ln -s "$sourceFile" "$targetFile"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function do_integrate(){
|
function do_integrate(){
|
||||||
local file=$1
|
local file=$1
|
||||||
@@ -44,6 +22,7 @@ local file=$1
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
chmod +x $file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -51,9 +30,7 @@ local file=$1
|
|||||||
for app_dir in $(ls /opt/apps/); do
|
for app_dir in $(ls /opt/apps/); do
|
||||||
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
|
for file in /opt/apps/$app_dir/entries/applications/*.desktop;do
|
||||||
do_integrate $file
|
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
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ "$UID" = "0" ];then
|
if [ "$UID" = "0" ];then
|
||||||
pkexec $@
|
$@
|
||||||
else
|
else
|
||||||
host-spawn pkexec bookworm-run $@
|
host-spawn pkexec bookworm-run $@
|
||||||
fi
|
fi
|
||||||
|
|||||||
1
src/usr/bin/ace-uninstall-helper
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper
|
||||||
1
src/usr/bin/ace-uninstall-helper-gui
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
||||||
1
src/usr/bin/bookworm-init
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-init
|
||||||
1
src/usr/bin/bookworm-run
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/bookworm-run
|
||||||
17
src/usr/lib/systemd/user-environment-generators/60-ACE-Bookworm
Executable 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/cn.flamescion.bookworm-compatibility-mode/files/bookworm-env/usr/share/"
|
||||||
|
if [ -n "${XDG_DATA_DIRS##*${ACE_path}}" ] && [ -n "${XDG_DATA_DIRS##*${ACE_path}:*}" ]; then
|
||||||
|
export XDG_DATA_DIRS="${ACE_path}:${XDG_DATA_DIRS}"
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -6,6 +6,6 @@ Comment=用于卸载ACE容器的应用
|
|||||||
Type=Application
|
Type=Application
|
||||||
Exec=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
Exec=/opt/apps/cn.flamescion.bookworm-compatibility-mode/files/bin/ace-uninstall-helper-gui
|
||||||
Icon=ACE-uninstaller
|
Icon=ACE-uninstaller
|
||||||
Categories=AudioVideo
|
Categories=System
|
||||||
|
|
||||||
# Generated from the DesktopGenerater component of the z-Tools toolkit
|
# Generated from the DesktopGenerater component of the z-Tools toolkit
|
||||||
@@ -8,3 +8,4 @@ Keywords=BCM,ACE,ace,mode
|
|||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Type=Application
|
Type=Application
|
||||||
Terminal=true
|
Terminal=true
|
||||||
|
Categories=System
|
||||||
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 118 KiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 134 KiB |
@@ -8,3 +8,5 @@ rm -rf /var/cache/apt/
|
|||||||
rm -rf /var/lib/aptss/lists/*
|
rm -rf /var/lib/aptss/lists/*
|
||||||
rm -rf /usr/share/doc
|
rm -rf /usr/share/doc
|
||||||
|
|
||||||
|
#apt install ace-integration in init
|
||||||
|
#tools只保留gio hostspawn和xdg-open
|
||||||