forked from parazyd/arm-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·86 lines (70 loc) · 2.62 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
# Copyright (c) 2016-2017 Dyne.org Foundation
# arm-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
#
# This file is part of arm-sdk
#
# This source code is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
## This script will setup arm-sdk and make it ready for usage.
git submodule update --init --recursive --checkout
mkdir -p gcc
#cd lib/libdevuansdk && git checkout next && cd -
## =================
## linaro toolchains
## =================
gettc() {
cd gcc
[ -d "linaro-$2" ] && return 0
echo "Downloading $1" && \
wget -q -O "$(basename $1)" "$1" && \
echo "Extracting $(basename $1)" && \
tar xfp "$(basename $1)" && \
mv "$(basename -s .tar.xz $1)" "linaro-${2}" || \
return 1
cd -
}
_hostarch="$(uname -m)"
armeltc=arm-linux-gnueabi
armhftc=arm-linux-gnueabihf
arm64tc=aarch64-linux-gnu
linarover="7.1.1-2017.08"
linarourl="https://releases.linaro.org/components/toolchain/binaries/7.1-2017.08"
tc="${linarourl}/${armeltc}/gcc-linaro-${linarover}-${_hostarch}_${armeltc}.tar.xz"
gettc "$tc" "armel" || {
echo "Something went wrong while downloading the armel toolchain."
exit 1
}
tc="${linarourl}/${armhftc}/gcc-linaro-${linarover}-${_hostarch}_${armhftc}.tar.xz"
gettc "$tc" "armhf" || {
echo "Something went wrong while downloading the armhf toolchain."
exit 1
}
tc="${linarourl}/${arm64tc}/gcc-linaro-${linarover}-${_hostarch}_${arm64tc}.tar.xz"
gettc "$tc" "arm64" || {
echo "Something went wrong while downloading the arm64 toolchain."
exit 1
}
damnunicorncompanyver="4.9.4-2017.01"
damnunicorncompanyurl="https://releases.linaro.org/components/toolchain/binaries/4.9-2017.01"
tc="${damnunicorncompanyurl}/${armhftc}/gcc-linaro-${damnunicorncompanyver}-${_hostarch}_${armhftc}.tar.xz"
gettc "$tc" "armhf-unicorns" || {
echo "Something went wrong while downloading the toolchain for the damn
unicorn company kernels."
exit 1
}
cat <<EOM
All done! Make sure you also install the required dependencies listed in
README.md. You can use the following oneliner as well:
$ grep '^curl ' README.md | xargs sudo apt --yes --force-yes install
EOM