toolchain: dl_toolchain: add support for aarch64 host

This commit is contained in:
hanwckf
2022-01-18 01:05:31 +08:00
parent fd16708c69
commit b5a2cf66ac
2 changed files with 27 additions and 7 deletions

View File

@ -60,14 +60,16 @@ This project is based on original rt-n56u with latest mtk 4.4.198 kernel, which
```sh
cd padavan-4.4/toolchain-mipsel
# (Recommend) Download prebuilt toolchain for x86_64 host
sh dl_toolchain.sh
# (Recommend) Download prebuilt toolchain for x86_64 or aarch64 host
./dl_toolchain.sh
# or build toolchain with crosstool-ng
# ./build_toolchain
```
- Modify template file and start compiling
```sh
cd padavan-4.4
# (Optional) Modify template file
# nano configs/templates/K2P.config

View File

@ -1,14 +1,32 @@
#!/bin/sh
DIR="toolchain-4.4.x"
DL_NAME="mipsel-linux-uclibc.tar.xz"
DL_URL="https://github.com/hanwckf/padavan-toolchain/releases/download/linux-4.4-v1.0/$DL_NAME"
DL_URL="https://github.com/hanwckf/padavan-toolchain/releases/download/linux-4.4-v1.0"
dl() {
[ -z "$1" ] && return
echo "Download toolchain: $1"
curl -O -L "${DL_URL}/$1" && \
mkdir -p $DIR && \
tar -xf "${1}" -C $DIR
}
if [ -d $DIR ]; then
echo "$DIR exists!"
exit
fi
curl -O -L $DL_URL && \
mkdir -p $DIR && \
tar -xvf $DL_NAME -C $DIR
ARCH="$(uname -m)"
case $ARCH in
aarch64)
dl "aarch64_mipsel-linux-uclibc.tar.xz"
;;
x86_64)
dl "mipsel-linux-uclibc.tar.xz"
;;
*)
echo "Unknown ARCH: $ARCH"
exit 1
esac