Attempt to repair maple_upload for non-dpkg systems

This commit is contained in:
Ellie
2026-06-11 14:15:32 +02:00
committed by GitHub
parent 558c942697
commit ff49ad926f

View File

@@ -2,19 +2,42 @@
#set -e
architecture="unknow"
have_dpkg="no"
dpkg --version > /dev/null 2>&1
if [ "x$?" = x0 ]; then
have_dpkg="yes"
fi
dpkg_indicates_arm64="no"
if [ "$have_dpkg" = "yes" ]; then
dpkg_arch_output="`dpkg --print architecture`"
echo "$dpkg_arch_output" | grep -q "arm64"
if [ "x$?" = x0 ]; then
dpkg_indicates_arm64="yes"
fi
fi
architecture="unknown"
case $(uname -m) in
x86_64) architecture="amd64" ;;
armv7l) dpkg --print-architecture | grep -q "arm64" && architecture="aarch64" || architecture="armhf" ;;
arm) dpkg --print-architecture | grep -q "arm64" && architecture="aarch64" || architecture="armhf" ;;
armv7l)
if [ "$dpkg_indicates_arm64" = "yes" ]; then
architecture="aarch64"
else
architecture="armhf"
fi;;
arm)
if [ "$dpkg_indicates_arm64" = "yes" ]; then
architecture="aarch64"
else
architecture="armhf"
fi;;
aarch64) architecture="aarch64";;
riscv64) architecture="riscv64";;
esac
if [ $architecture = "unknow" ]; then
echo "unknow architecture,exiting..."
exit
if [ $architecture = "unknown" ]; then
echo "unknown architecture,exiting..."
exit
fi
@@ -62,7 +85,9 @@ echo "${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
echo -n Waiting for ${dummy_port_fullpath} serial...
dpkg --print-architecture
if [ "$have_dpkg" = "yes" ]; then
dpkg --print-architecture
fi
COUNTER=0
while [ ! -c ${dummy_port_fullpath} ] && ((COUNTER++ < 40)); do
sleep 0.2