support-host-integration

This commit is contained in:
shenmo 2023-11-09 14:35:27 +08:00
parent fdd72fc110
commit 0242c4e62a
2 changed files with 29 additions and 5 deletions

View File

@ -1,5 +1,5 @@
Package: cn.flamescion.bookworm-compatibility-mode
Version: 12.2.1
Version: 12.3
Section: misc
Priority: optional
Depends: bubblewrap

View File

@ -3,6 +3,13 @@ if [ `which debootstrap` = "" ];then
echo "Need to install debootstrap!"
exit
fi
if [ `which systemd-nspawn` = "" ];then
echo "Need to install systemd-container!"
exit
fi
if [ "$1" = "amd64" ] || [ "$1" = "x64" ];then
ARCH="amd64"
ARCH_ANOTHERWAY="x64"
@ -15,8 +22,25 @@ exit 1
fi
cd "`dirname $0`"
sudo debootstrap --arch=`${ARCH}` bookworm ./bookworm-env https://mirrors.ustc.edu.cn/debian/
sudo chown -R `whoami` ./bookworm-env
rm -rf bookworm-env/var/cache/apt/archives/*.deb
tar -I 'xz -T0' -cvf bookworm-env.tar.xz bookworm-env/*
sudo debootstrap --arch=${ARCH} bookworm ./bookworm-env https://mirrors.ustc.edu.cn/debian/
pushd bookworm-env
gitee_api_url="https://gitee.com/api/v5/repos/amber-compatability-environment/ace-host-integration/releases/latest"
resp="$(curl -s $gitee_api_url)"
VERSION_GITEE="$(jq -r '.tag_name' <<<$resp | sed "s/.*V\([^_]*\).*/\1/g")"
echo "$VERSION_GITEE"
sudo wget https://gitee.com/amber-compatability-environment/ace-host-integration/releases/download/0.1/ace-host-integration_${VERSION_GITEE}_all.deb
popd
sudo systemd-nspawn -D bookworm-env apt install /ace-host-integration_${VERSION_GITEE}_all.deb -y
sudo rm bookworm-env/ace-host-integration_${VERSION_GITEE}_all.deb
sudo rm -rf bookworm-env/var/cache/apt/archives/*.deb
sudo tar -I 'xz -T0' -cvf bookworm-env.tar.xz bookworm-env/*
sudo rm -rf bookworm-env