-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup-kernel-toolchain.sh
More file actions
executable file
·60 lines (47 loc) · 1.5 KB
/
setup-kernel-toolchain.sh
File metadata and controls
executable file
·60 lines (47 loc) · 1.5 KB
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
#!/bin/bash
# SPDX-FileCopyrightText: 2023 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
arch=$(uname -m)
case ${arch} in
"x86_64")
tcarch="x86_64"
;;
"aarch64")
tcarch="arm64"
;;
esac
# Bump version here
gcc_ver=14.2.0
llvm_ver=20.1.3
gcc_old_ver=11.5.0
###
gcc_base=gcc-${gcc_ver}-nolibc
gcc_old_base=gcc-${gcc_old_ver}-nolibc
llvm_dir=llvm-${llvm_ver}-${arch}
mkdir /opt || true
cd /opt
llvm=${llvm_dir}.tar.xz
curl -O https://mirrors.edge.kernel.org/pub/tools/llvm/files/${llvm}
tar xf ${llvm}
gcc=${tcarch}-${gcc_base}-riscv64-linux.tar.xz
curl -O https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${tcarch}/${gcc_ver}/${gcc}
tar xf ${gcc}
gcc_old=${tcarch}-${gcc_old_base}-riscv64-linux.tar.xz
curl -O https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${tcarch}/${gcc_old_ver}/${gcc_old}
tar xf ${gcc_old}
mv ${gcc_old_base} gcc-old
rm *.xz
export PIPX_HOME=/root/.local/pipx/venvs
export PIPX_BIN_DIR=/root/.local/bin
pipx install tuxmake
pipx install dtschema
echo 'export PATH=${PATH}:/root/.local/bin' >> /etc/profile
echo "export PATH=/opt/${gcc_base}/riscv64-linux/bin:/opt/${llvm_dir}/bin:\${PATH}" >> /etc/profile
echo 'export CCACHE_DIR=/build/ccache' >> /etc/profile
echo 'export CCACHE_MAXSIZE="50G"' >> /etc/profile
echo 'export KBUILD_BUILD_TIMESTAMP=@1621270510' >> /etc/profile
echo 'export KBUILD_BUILD_USER=tuxmake' >> /etc/profile
echo 'export KBUILD_BUILD_HOST=tuxmake' >> /etc/profile
git config --global --add safe.directory '*'