blob: 3fe414fb3d46f14ab2b35221de64be4975213d8e (
plain)
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
|
#!/bin/bash
##############################################################################
# parabola-riscv64-bootstrap #
# #
# Copyright (C) 2018 Andreas Grapentin #
# #
# This program 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 program 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 program. If not, see <http://www.gnu.org/licenses/>. #
##############################################################################
set -euo pipefail
# target options
export CARCH=riscv64
export CHOST=riscv64-linux-gnu
export LINUX_ARCH=riscv
export GCC_MARCH=rv64gc
export GCC_MABI=lp64d
# common directories
export startdir="$(pwd)"
export topbuilddir="$startdir"/build
export topsrcdir="$startdir"/src
# output control
. src/feedback.sh
[ $(id -u) -ne 0 ] && die "must be root"
[ -z "${SUDO_USER:-}" ] && die "SUDO_USER must be set in environment"
mkdir -p "$topbuilddir"
chown $SUDO_USER "$topbuilddir"
# Stage 1: prepare cross toolchain
./src/stage1/stage1.sh 2>&1 | tee "$topbuilddir"/stage1.log
# Stage 2: cross-compile base-devel
./src/stage2/stage2.sh 2>&1 | tee "$topbuilddir"/stage2.log
msg "all done."
|