支持构建多种架构

This commit is contained in:
2023-11-03 12:19:37 +08:00
parent bb5ff5afb4
commit 0d0085187f

View File

@@ -3,9 +3,19 @@ if [ `which debootstrap` = "" ];then
echo "Need to install debootstrap!"
exit
fi
if [ "$1" = "amd64" ] || [ "$1" = "x64" ];then
ARCH="amd64"
ARCH_ANOTHERWAY="x64"
elif [ "$1" = "arm64" ] || [ "$1" = "arm" ];then
ARCH="arm64"
ARCH_ANOTHERWAY="arm64"
else
echo "Invalid architecture! Exit"
exit 1
fi
cd "`dirname $0`"
sudo debootstrap bookworm ./bookworm-env https://mirrors.ustc.edu.cn/debian/
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/*