Skip to content

Commit 9ab1f1b

Browse files
committed
Merge branch 'master' into deploy
2 parents ff12ebc + 0fefa31 commit 9ab1f1b

97 files changed

Lines changed: 1758 additions & 183 deletions

File tree

Some content is hidden

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

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
help:
22
@echo "See README.md for help"
33

4-
prep:
5-
@$(MAKE) -C root-disks
4+
SUBDIRS := root-disks external tests
5+
6+
$(SUBDIRS):
7+
@$(MAKE) --no-print-directory -C $@ $(MAKECMDGOALS) 2>&1 | sed 's/^/$@: /'
8+
9+
download: $(SUBDIRS)
10+
11+
prepare: $(SUBDIRS)
12+
13+
build: external
14+
15+
clean: $(SUBDIRS)
16+
17+
distclean: $(SUBDIRS)
18+
19+
.PHONY: download prepare build clean distclean help $(SUBDIRS)

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Clone this repo.
2020
```
2121
$ cd ci-scripts
2222
$ cd build
23-
$ make pull-image@ppc64le@ubuntu@21.10
24-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
23+
$ make pull-image@ppc64le@ubuntu
24+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu JFACTOR=$(nproc)
2525
```
2626

27-
This will build you a `ppc64le_defconfig` using the Ubuntu 21.10 toolchain.
27+
This will build you a `ppc64le_defconfig` using the latest Ubuntu toolchain.
2828

29-
The kernel will be in `output/ppc64le@ubuntu@21.10/ppc64le_defconfig/vmlinux`.
29+
The kernel will be in `output/ppc64le@ubuntu/ppc64le_defconfig/vmlinux`.
3030

3131
For more help try `make help`.
3232

@@ -36,14 +36,14 @@ Building different defconfigs
3636
You can specify a defconfig with `DEFCONFIG`.
3737

3838
```
39-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 DEFCONFIG=powernv_defconfig JFACTOR=$(nproc)
39+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu DEFCONFIG=powernv_defconfig JFACTOR=$(nproc)
4040
```
4141

4242
Note that the subarch (eg. `ppc64le`) needs to match the defconfig, so to build
4343
`ppc64_defconfig`, use `ppc64`.
4444

4545
```
46-
$ make SRC=~/src/linux kernel@ppc64@ubuntu@21.10 DEFCONFIG=ppc64_defconfig JFACTOR=$(nproc)
46+
$ make SRC=~/src/linux kernel@ppc64@ubuntu DEFCONFIG=ppc64_defconfig JFACTOR=$(nproc)
4747
```
4848

4949
Different toolchains
@@ -56,9 +56,9 @@ There are images for various toolchains, they are encoded in the distro name/ver
5656
- kernel.org gcc 9.3.0 `korg@9.3.0`
5757
- kernel.org gcc 8.1.0 `korg@8.1.0`
5858
- kernel.org gcc 5.5.0 `korg@5.5.0`
59+
- Ubuntu 22.04 `ubuntu@22.04`
5960
- Ubuntu 21.10 `ubuntu@21.10`
6061
- Ubuntu 21.04 `ubuntu@21.04`
61-
- Ubuntu 20.10 `ubuntu@20.10`
6262
- Ubuntu 20.04 `ubuntu@20.04`
6363
- Ubuntu 18.04 `ubuntu@18.04`
6464
- Ubuntu 16.04 `ubuntu@16.04`
@@ -75,13 +75,13 @@ Building selftests
7575
To build the kernel selftests:
7676

7777
```
78-
$ make SRC=~/src/linux selftests@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
78+
$ make SRC=~/src/linux selftests@ppc64le@ubuntu JFACTOR=$(nproc)
7979
```
8080

8181
Or just the powerpc selftests:
8282

8383
```
84-
$ make SRC=~/src/linux ppctests@ppc64le@ubuntu@21.10 JFACTOR=$(nproc)
84+
$ make SRC=~/src/linux ppctests@ppc64le@ubuntu JFACTOR=$(nproc)
8585
```
8686

8787
You can also build the powerpc selftests with all available toolchains using:
@@ -95,17 +95,21 @@ Other options
9595

9696
As mentioned above you pass the make -j factor with `JFACTOR=n`.
9797

98-
To run sparse use the `ubuntu@21.10` image and pass `SPARSE=1`.
98+
To run sparse use the `ubuntu` image and pass `SPARSE=2`.
9999

100100
```
101-
$ make SRC=~/src/linux kernel@ppc64le@ubuntu@21.10 SPARSE=1 JFACTOR=$(nproc)
101+
$ make SRC=~/src/linux kernel@ppc64le@ubuntu SPARSE=2 JFACTOR=$(nproc)
102102
```
103103

104-
The log will be in eg. `output/ppc64le@ubuntu@21.10/ppc64le_defconfig/sparse.log`.
104+
The log will be in eg. `output/ppc64le@ubuntu/ppc64le_defconfig/sparse.log`.
105+
106+
To only run sparse on files being recompiled, pass `SPARSE=1`.
105107

106108
To build modules pass `MODULES=1`
107109

108-
To build with clang pass `CLANG=1`, only works using the Ubuntu `21.10` images.
110+
To convert all modules to builtin, pass `MOD2YES=1`.
111+
112+
To build with clang pass `CLANG=1`, only works using the latest Ubuntu image.
109113

110114
For a quiet build pass `QUIET=1`, for verbose pass `VERBOSE=1`.
111115

@@ -127,7 +131,7 @@ Building your own image
127131
If you don't want to pull an untrusted image, you can build it yourself with:
128132

129133
```
130-
$ make rebuild-image@ppc64le@ubuntu@21.10
134+
$ make rebuild-image@ppc64le@ubuntu
131135
```
132136

133137
Note that the build mounts the source tree read-only, so nothing it does can

bootstrap.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
#
3+
set -euo pipefail
4+
5+
. /etc/os-release
6+
7+
echo "########################################"
8+
echo "# Installing basic packages ..."
9+
echo "########################################"
10+
11+
sudo=""
12+
if [[ $(id -u) != 0 ]]; then
13+
sudo="sudo"
14+
fi
15+
16+
if [[ "$ID" == "fedora" ]]; then
17+
(set -x;
18+
$sudo dnf -y install \
19+
expect \
20+
make \
21+
wget \
22+
python3-pexpect \
23+
tar \
24+
xz
25+
)
26+
elif [[ "$ID_LIKE" == "debian" ]]; then
27+
export DEBIAN_FRONTEND=noninteractive
28+
(set -x;
29+
$sudo apt-get -y install \
30+
expect \
31+
make \
32+
wget \
33+
python3-pexpect \
34+
python-is-python3 \
35+
tar \
36+
xz-utils
37+
)
38+
else
39+
echo "Unsupported distro!" >&2
40+
exit 1
41+
fi
42+
43+
nproc=$(nproc)
44+
45+
echo "########################################"
46+
echo "# Downloading external dependencies ..."
47+
echo "########################################"
48+
make -j $nproc download
49+
50+
echo "########################################"
51+
echo "# Installing additional packages ..."
52+
echo "########################################"
53+
54+
# No -j because apt/dnf don't like being run in parallel
55+
make prepare
56+
57+
echo "########################################"
58+
echo "# Building tools ..."
59+
echo "########################################"
60+
make -j $nproc build
61+
62+
echo "########################################"
63+
echo "# Bootstrap completed"
64+
echo "########################################"

build/Makefile

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
all: help
22

3+
export FEDORA_LATEST := 35
4+
export UBUNTU_LATEST := 22.04
5+
6+
# If we're on ppc64le
7+
ifeq ($(shell uname -m),ppc64le)
8+
# And we don't see ISA v3.0
9+
ifeq ($(shell LD_SHOW_AUXV=1 /bin/true | grep "AT_HWCAP2:.*\barch_3_00\b"),)
10+
# Then we can't use 22.04
11+
UBUNTU_LATEST := 21.10
12+
endif
13+
endif
14+
15+
FEDORA_DISTROS := fedora@${FEDORA_LATEST} fedora@34 fedora@33 fedora@31 fedora
16+
# Sort is to elimiate duplicates if UBUNTU_LATEST == 21.10
17+
UBUNTU_DISTROS := $(sort ubuntu@${UBUNTU_LATEST} ubuntu@21.10 ubuntu@21.04 ubuntu@20.04 ubuntu@18.04 ubuntu@16.04 ubuntu)
18+
KORG_DISTROS := korg@11.1.0 korg@10.3.0 korg@9.3.0 korg@8.1.0 korg@5.5.0
19+
ALL_DISTROS := ${UBUNTU_DISTROS} ${KORG_DISTROS} ${FEDORA_DISTROS}
20+
DOCS_DISTRO := docs@${UBUNTU_LATEST}
21+
X86_DISTRO := ubuntu@${UBUNTU_LATEST}
22+
ALIAS_DISTROS := ubuntu fedora
23+
SUBARCHES := ppc64le ppc64 ppc
24+
325
VERSION:
426
@(git describe --always --long --dirty --abbrev=40) > VERSION
527

@@ -26,7 +48,7 @@ kernel@${1}@${2}: image@${1}@${2}
2648
clean-kernel@${1}@${2}:
2749
@./scripts/clean.sh $$@
2850

29-
KERNEL += kernel@${1}@${2}
51+
KERNEL += $(if $(filter-out ${ALIAS_DISTROS},${2}), kernel@${1}@${2})
3052
endef
3153

3254
define SELFTESTS_TEMPLATE =
@@ -36,8 +58,8 @@ ppctests@${1}@${2} selftests@${1}@${2}: image@${1}@${2}
3658
clean-selftests@${1}@${2}:
3759
@./scripts/clean.sh $$@
3860

39-
PPCTESTS += ppctests@${1}@${2}
40-
SELFTESTS += selftests@${1}@${2}
61+
PPCTESTS += $(if $(filter-out ${ALIAS_DISTROS},${2}), ppctests@${1}@${2})
62+
SELFTESTS += $(if $(filter-out ${ALIAS_DISTROS},${2}), selftests@${1}@${2})
4163
endef
4264

4365
define PERF_TEMPLATE =
@@ -47,7 +69,7 @@ perf@${1}@${2}: image@${1}@${2}
4769
clean-perf@${1}@${2}:
4870
@./scripts/clean.sh $$@
4971

50-
PERF += perf@${1}@${2}
72+
PERF += $(if $(filter-out ${ALIAS_DISTROS},${2}), perf@${1}@${2})
5173
endef
5274

5375
define DOCS_TEMPLATE =
@@ -57,14 +79,6 @@ docs@${1}@${2}: image@${1}@${2}
5779
DOCS += docs@${1}@${2}
5880
endef
5981

60-
FEDORA_DISTROS := fedora@35 fedora@34 fedora@33 fedora@31
61-
UBUNTU_DISTROS := ubuntu@21.10 ubuntu@21.04 ubuntu@20.10 ubuntu@20.04 ubuntu@18.04 ubuntu@16.04
62-
KORG_DISTROS := korg@11.1.0 korg@10.3.0 korg@9.3.0 korg@8.1.0 korg@5.5.0
63-
ALL_DISTROS := ${UBUNTU_DISTROS} ${KORG_DISTROS} ${FEDORA_DISTROS}
64-
DOCS_DISTRO := docs@21.10
65-
X86_DISTRO := ubuntu@21.10
66-
SUBARCHES := ppc64le ppc64
67-
6882
$(eval $(call MAIN_TEMPLATE,ppc64le,${DOCS_DISTRO}))
6983
$(eval $(call DOCS_TEMPLATE,ppc64le,${DOCS_DISTRO}))
7084

build/fedora/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN dnf -y install \
88
ccache \
99
cpio \
1010
diffutils \
11+
dwarves \
1112
elfutils-libelf-devel \
1213
findutils \
1314
flex \

build/korg/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ RUN apt-get -q -y update && \
1515
ccache \
1616
cpio \
1717
curl \
18+
dwarves \
1819
file \
1920
flex \
2021
gcc \

build/scripts/build.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ script_base="$(realpath "$dir")"
1717

1818
IFS=@ read -r task subarch distro version <<< "$1"
1919

20-
image="linuxppc/build:$distro-$version"
21-
2220
SRC="${SRC/#\~/$HOME}"
2321
SRC=$(realpath "$SRC")
2422

@@ -105,6 +103,10 @@ if [[ "$task" == "kernel" ]]; then
105103
cmd+="-e MERGE_CONFIG=$MERGE_CONFIG "
106104
fi
107105

106+
if [[ -n "$MOD2YES" ]]; then
107+
cmd+="-e MOD2YES=1 "
108+
fi
109+
108110
if [[ -n "$CLANG" ]]; then
109111
cmd+="-e CLANG=1 "
110112
fi
@@ -144,6 +146,13 @@ fi
144146

145147
cmd+="$PODMAN_OPTS "
146148

149+
if [[ -z "$version" ]]; then
150+
# NB, after we passed $version to get_output_dir()
151+
version=$(get_default_version $distro)
152+
fi
153+
154+
image="docker.io/linuxppc/build:$distro-$version"
155+
147156
cmd+="$image "
148157
cmd+="/bin/container-build.sh $task"
149158

build/scripts/container-build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ if [[ "$1" == "kernel" ]]; then
7878

7979
rc=$?
8080

81+
if [[ -n "$MOD2YES" ]]; then
82+
(set -x; make $verbose $quiet "$cc" mod2yesconfig)
83+
fi
84+
8185
if [[ $rc -eq 0 ]]; then
8286
if [[ -n "$SPARSE" ]]; then
8387
rm -f /output/sparse.log
8488
touch /output/sparse.log
85-
(set -x; make C=2 CF=">> /output/sparse.log 2>&1" $verbose $quiet "$cc" -j $JFACTOR)
89+
(set -x; make C=$SPARSE CF=">> /output/sparse.log 2>&1" $verbose $quiet "$cc" -j $JFACTOR)
8690

8791
rc=$?
8892

build/scripts/image.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ script_base="$(realpath "$dir")"
1111

1212
IFS=@ read -r task subarch distro version <<< "$1"
1313

14-
image="linuxppc/build:$distro-$version"
14+
if [[ -z "$version" ]]; then
15+
version=$(get_default_version $distro)
16+
fi
17+
18+
image="docker.io/linuxppc/build:$distro-$version"
1519

1620
if [[ "$task" == "image" ]]; then
1721
cmd="$DOCKER images -q --filter=reference=$image"
@@ -64,10 +68,10 @@ if [[ -z "$GID" ]]; then
6468
GID=$(id -g)
6569
fi
6670

67-
from="$distro:$version"
71+
from="docker.io/$distro:$version"
6872

6973
if [[ "$distro" == "docs" ]]; then
70-
from="ubuntu:$version"
74+
from="docker.io/ubuntu:$version"
7175
elif [[ "$distro" == "korg" ]]; then
7276
cmd+="--build-arg compiler_version=$version "
7377

@@ -78,9 +82,9 @@ elif [[ "$distro" == "korg" ]]; then
7882

7983
# Use an older distro for the 5.x toolchains.
8084
if [[ "$version" == 5.* ]]; then
81-
from="ubuntu:16.04"
85+
from="docker.io/ubuntu:16.04"
8286
else
83-
from="ubuntu:20.04"
87+
from="docker.io/ubuntu:20.04"
8488
fi
8589
fi
8690

0 commit comments

Comments
 (0)