Skip to content

Commit 4e0223b

Browse files
committed
beware of the monster - this commit unifies the separate porting efforts into one source tree
1 parent c9d45d2 commit 4e0223b

File tree

337 files changed

+2975
-1191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+2975
-1191
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
# build dirs
33
build/
4+
sources/
45

56
# built packages and signatures
67
*.pkg.tar.xz

README

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@ parabola-riscv64-bootstrap
99
---------------
1010

1111
This project is an attempt to bootstrap a self-contained parabola
12-
GNU/Linux-libre system for the riscv64 architecture. The scripts are created
13-
with the goal to be as architectur agnostic as possible, to make future porting
14-
efforts easier.
12+
GNU/Linux-libre system for the following architectures:
13+
14+
- riscv64 (HiFive)
15+
- riscv32 (PULP)
16+
- sparc (OpenSparc)
17+
- powerpc64le (TalosII)
18+
19+
The scripts are created with the goal to be as architecture agnostic as
20+
possible, to make future porting efforts easier.
1521

1622
The build process is split into four stages, the rationale of which is outlined
1723
in section 2 below.
1824

1925
To initiate a complete build of all stages, run:
20-
$> sudo ./create
26+
$> sudo ./create [CARCH]
2127

2228
The builds can be configured to keep going if the build of a single package
2329
fails, by creating the file `build/.KEEP_GOING`. Otherwise, the build will stop
2430
once an error is encountered. This is useful for getting as much work done as
2531
possible unattended, but will make debugging harder in the later stages,
26-
because temporary build fragments and filesystem trees will be overwritten by
27-
the next package.
32+
because temporary build fragments and filesystem trees in the build chroots
33+
will be overwritten by the next package.
2834

2935
The complete console output of a package build process can be found in the
3036
corresponding .MAKEPKGLOG file in the build directory of that package.
@@ -62,9 +68,9 @@ can email me at <[email protected]>, or find me as <oaken-source> in
6268
1.3. Current state of the project
6369
---------------------------------
6470

65-
All four stages are complete and this repository is now closed. A pointer where
66-
to find future development efforts for the parabola RISC-V port will be added
67-
here in due time.
71+
All four stages of the riscv64 bootstrap are complete, and efforts to add
72+
additional architectures has begun. A pointer where to find future development
73+
efforts for the parabola RISC-V port will be added here in due time.
6874

6975
2. Build Stages
7076
---------------

config/config.powerpc64le.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
2020
##############################################################################
2121

22+
# this configuration targets the TalosII systems
23+
2224
# the target host triplet
2325
export CARCH=powerpc64le
2426
export CHOST="$CARCH-unknown-linux-gnu"
@@ -39,9 +41,9 @@ export GCC_CONFIG_FLAGS=("--with-long-double-128" "--enable-vsx")
3941
#export PLATFORM32_CFLAGS=()
4042

4143
# configure build directories
42-
export TOPBUILDDIR="$startdir/build/$CHOST"
44+
export TOPBUILDDIR="$startdir/build/$CARCH"
4345
export TOPSRCDIR="$startdir"/src
44-
export SRCDEST="$startdir"/build/sources
46+
export SRCDEST="$startdir"/sources
4547

4648
# build options
4749
export REGEN_CONFIG_FRAGMENTS=yes

config/config.riscv32.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
##############################################################################
3+
# parabola-riscv64-bootstrap #
4+
# #
5+
# Copyright (C) 2018 Andreas Grapentin #
6+
# #
7+
# This program is free software: you can redistribute it and/or modify #
8+
# it under the terms of the GNU General Public License as published by #
9+
# the Free Software Foundation, either version 3 of the License, or #
10+
# (at your option) any later version. #
11+
# #
12+
# This program is distributed in the hope that it will be useful, #
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15+
# GNU General Public License for more details. #
16+
# #
17+
# You should have received a copy of the GNU General Public License #
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19+
##############################################################################
20+
21+
# this configuration targets the PULP platform
22+
23+
# the target host triplet
24+
export CARCH=riscv32
25+
export CHOST="$CARCH-unknown-linux-gnu"
26+
27+
# the equivalent architecture name used by the linux kernel
28+
export LINUX_ARCH=riscv
29+
30+
# flags added to the default CFLAGS in makepkg.conf
31+
export PLATFORM_CFLAGS=("-march=rv32g" "-mabi=ilp32d")
32+
33+
# flags added to the gcc PKGBUILD configure call
34+
export GCC_CONFIG_FLAGS=("--with-arch=rv32g" "--with-abi=ilp32d")
35+
36+
# multilib configuration, uncomment if applicable
37+
#export MULTILIB=enable
38+
#export CARCH32=""
39+
#export CHOST32=""
40+
#export PLATFORM32_CFLAGS=()
41+
42+
# configure build directories
43+
export TOPBUILDDIR="$startdir/build/$CARCH"
44+
export SRCDEST="$startdir"/sources
45+
46+
# regenerate config.sub / config.guess during builds
47+
export REGEN_CONFIG_FRAGMENTS=yes
48+

config/config.riscv64.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
1919
##############################################################################
2020

21+
# this configuration targets the HiFive boards
22+
2123
# the target host triplet
2224
export CARCH=riscv64
2325
export CHOST="$CARCH-unknown-linux-gnu"
@@ -38,9 +40,9 @@ export GCC_CONFIG_FLAGS=("--with-arch=rv64gc" "--with-abi=lp64d")
3840
#export PLATFORM32_CFLAGS=()
3941

4042
# configure build directories
41-
export TOPBUILDDIR="$startdir/build/$CHOST"
43+
export TOPBUILDDIR="$startdir/build/$CARCH"
4244
export TOPSRCDIR="$startdir"/src
43-
export SRCDEST="$startdir"/build/sources
45+
export SRCDEST="$startdir"/sources
4446

4547
# build options
4648
export REGEN_CONFIG_FRAGMENTS=yes

config/config.sparc.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
##############################################################################
3+
# parabola-riscv64-bootstrap #
4+
# #
5+
# Copyright (C) 2018 Andreas Grapentin #
6+
# #
7+
# This program is free software: you can redistribute it and/or modify #
8+
# it under the terms of the GNU General Public License as published by #
9+
# the Free Software Foundation, either version 3 of the License, or #
10+
# (at your option) any later version. #
11+
# #
12+
# This program is distributed in the hope that it will be useful, #
13+
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15+
# GNU General Public License for more details. #
16+
# #
17+
# You should have received a copy of the GNU General Public License #
18+
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19+
##############################################################################
20+
21+
# this configuration targets the OpenSPARC platform
22+
23+
# the target host triplet
24+
export CARCH=sparc
25+
export CHOST="$CARCH-unknown-linux-gnu"
26+
27+
# the equivalent architecture name used by the linux kernel
28+
export LINUX_ARCH=sparc
29+
30+
# flags added to the default CFLAGS in makepkg.conf
31+
export PLATFORM_CFLAGS=("-mcpu=v9")
32+
33+
# flags added to the gcc PKGBUILD configure call
34+
export GCC_CONFIG_FLAGS=("--with-cpu=v9")
35+
36+
# multilib configuration, uncomment if applicable
37+
#export MULTILIB=enable
38+
#export CARCH32=""
39+
#export CHOST32=""
40+
#export PLATFORM32_CFLAGS=()
41+
42+
# configure build directories
43+
export TOPBUILDDIR="$startdir/build/$CARCH"
44+
export SRCDEST="$startdir"/sources
45+
46+
# regenerate config.sub / config.guess during builds
47+
export REGEN_CONFIG_FRAGMENTS=yes
48+

config/config.template.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export GCC_CONFIG_FLAGS=()
3838
#export PLATFORM32_CFLAGS=()
3939

4040
# configure build directories
41-
export TOPBUILDDIR="$startdir/build/$CHOST"
42-
export SRCDEST="$startdir"/build/sources
41+
export TOPBUILDDIR="$startdir/build/$CARCH"
42+
export SRCDEST="$startdir"/sources
4343

4444
# regenerate config.sub / config.guess during builds
4545
export REGEN_CONFIG_FRAGMENTS=yes

create.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ if [ -z "${SUDO_USER:-}" ]; then
3838
fi
3939

4040
# shellcheck source=config/config.template.sh
41-
. "$CONFIGDIR/config.$1.sh" || die -e "$ERROR_INVOCATION" "usage: $0 CARCH (see config/config.*.sh)"
41+
. "$CONFIGDIR/config.$1.sh" || die -e "$ERROR_INVOCATION" \
42+
"usage: $0 CARCH (see config/config.*.sh)"
4243

4344
mkdir -p "$TOPBUILDDIR" "$SRCDEST"
4445
chown "$SUDO_USER" "$TOPBUILDDIR"

src/shared/deptree.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ build_deptree() {
3737
# add the packages listed in the given groups
3838
local g p r
3939
for g in "$@"; do
40-
for p in $(pacman -Sg "$g" | awk '{print $2}'); do
41-
r=$(make_realpkg "$p") || return "$ERROR_MISSING"
42-
deptree_add_entry "$r" "$g"
43-
done
40+
if pacman -Si "$g" &>/dev/null; then
41+
deptree_add_entry "$g" "<immediate>"
42+
else
43+
for p in $(pacman -Sg "$g" | awk '{print $2}'); do
44+
r=$(make_realpkg "$p") || return "$ERROR_MISSING"
45+
deptree_add_entry "$r" "$g"
46+
done
47+
fi
4448
done
4549

4650
return 0
@@ -107,15 +111,15 @@ deptree_check_depend() {
107111
}
108112

109113
deptree_add_entry() {
110-
local r="${2:-<cmdline>}"
114+
local r="${2:-<immediate>}"
111115

112116
if grep -q "^$1 :" "$DEPTREE".FULL; then
113117
# if pkg is in deptree, append requestee to list
114118
sed -i "/#.* $r\\(\$\\|[ ,]\\)/! s/^$1 : \\[.*/&, $r/" "$DEPTREE"*
115119
elif grep -q "^$r :" "$DEPTREE".FULL; then
116120
# elif requestee is in deptree, insert after requestee
117121
sed -i "/^$r :/a $1 : [ ] # $r" "$DEPTREE"*
118-
elif [ "x$r" == "x<cmdline>" ]; then
122+
elif [ "x$r" == "x<immediate>" ]; then
119123
# elif requested directly, add to top of file
120124
sed -i "1i $1 : [ ] # $r" "$DEPTREE"*
121125
else

src/shared/feedback.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ export ERROR_KEYFAIL=5
2727

2828
# messaging functions
2929
notify() {
30-
# useful if running notify_telegram
31-
local recipient=-211578786
3230
if type -p notify-send >/dev/null; then
3331
machinectl -q shell --uid="$SUDO_USER" .host \
34-
"$(which notify-send)" -h string:recipient:$recipient "$@" >/dev/null
32+
"$(which notify-send)" "$@" >/dev/null
3533
fi
3634
}
3735

0 commit comments

Comments
 (0)