-
Notifications
You must be signed in to change notification settings - Fork 33
/
consts.sh
92 lines (77 loc) · 2.37 KB
/
consts.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
87
88
89
90
91
92
#!/usr/bin/sh
if [ -f /etc/os-release ]; then
. /etc/os-release
fi
# Dependency list
DEP_LIST_arch="riscv64-linux-gnu-gcc swig cpio"
DEP_LIST_debian="gcc-riscv64-linux-gnu bison flex python3-dev libssl-dev"
export CROSS_COMPILE='riscv64-linux-gnu-'
export ARCH='riscv'
PWD="$(pwd)"
NPROC="$(nproc)"
export PWD
export NPROC
export ROOT_FS='archriscv-2024-03-30.tar.zst'
export ROOT_FS_DL="https://archriscv.felixc.at/images/${ROOT_FS}"
# select 'arch', 'defconfig'
export KERNEL='defconfig'
# export KERNEL='arch'
# Device Tree:
# In the current pinned U-Boot Commit the following device trees are available
# for the D1:
# sun20i-d1-clockworkpi-v3.14
# sun20i-d1-devterm-v3.14
# sun20i-d1-dongshan-nezha-stu
# sun20i-d1-lichee-rv-86-panel-480p
# sun20i-d1-lichee-rv-86-panel-720p
# sun20i-d1-lichee-rv-dock
# sun20i-d1-lichee-rv
# sun20i-d1-mangopi-mq-pro
# sun20i-d1-nezha
export DEVICE_TREE=sun20i-d1-lichee-rv-dock
# folder to mount rootfs
export MNT="${PWD}/mnt"
# folder to store compiled artifacts
export OUT_DIR="${PWD}/output"
# run as root
export SUDO='sudo'
# use arch-chroot?
export USE_CHROOT=1
# use extlinux ('extlinux') or boot.scr ('script') for loading the kernel?
export BOOT_METHOD='extlinux'
export VERSION_OPENSBI='1.4'
export VERSION_KERNEL='6.8'
export SOURCE_OPENSBI="https://github.com/riscv-software-src/opensbi/releases/download/v${VERSION_OPENSBI}/opensbi-${VERSION_OPENSBI}-rv-bin.tar.xz"
export SOURCE_UBOOT='https://github.com/smaeul/u-boot'
export SOURCE_KERNEL="https://github.com/torvalds/linux/archive/refs/tags/v${VERSION_KERNEL}.tar.gz"
export SOURCE_RTL8723='https://github.com/lwfinger/rtl8723ds.git'
# https://github.com/karabek/xradio
# pinned commits (no notice when things change)
export COMMIT_UBOOT='329e94f16ff84f9cf9341f8dfdff7af1b1e6ee9a' # equals d1-2022-10-31
export TAG_UBOOT='d1-2022-10-31'
# use this (set to something != 0) to override the check
export IGNORE_COMMITS=0
export DEBUG='n'
check_deps() {
case $ID in
arch)
if ! pacman -Qi "${1}" >/dev/null; then
echo "Please install '${1}'"
exit 1
fi
;;
debian)
if ! dpkg -l "${1}" >/dev/null; then
echo "Please install '${1}'"
exit 1
fi
;;
*)
echo "This script is running on not supported distro!"
exit 1
;;
esac
}
if [ -n "${CI_BUILD}" ]; then
export USE_CHROOT=0
fi