Skip to content

Commit e131df5

Browse files
committed
Merge branch 'master' into deploy
2 parents 62fddd2 + 65c7184 commit e131df5

132 files changed

Lines changed: 18230 additions & 338 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.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ There are images for various toolchains, they are encoded in the distro name/ver
6969
- `ubuntu@20.04`: Ubuntu 20.04, gcc 9.4.0, binutils 2.34
7070
- `ubuntu@18.04`: Ubuntu 18.04, gcc 7.5.0, binutils 2.30
7171
- `ubuntu@16.04`: Ubuntu 16.04, gcc 5.4.0, binutils 2.26.1
72+
- `fedora@39`: Fedora 39, gcc 13.2.1, binutils 2.40-14, clang 17.0.6
7273
- `fedora@38`: Fedora 38, gcc 12.2.1, binutils 2.39-3, clang 16.0.2
7374
- `fedora@37`: Fedora 37, gcc 12.2.1, binutils 2.38-5, clang 15.0.7
7475
- `fedora@36`: Fedora 36, gcc 12.1.1, binutils 2.37-7, clang 14.0.5

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if [[ "$ID" == "fedora" ]]; then
2323
tar \
2424
xz
2525
)
26-
elif [[ "$ID_LIKE" == "debian" ]]; then
26+
elif [[ "${ID_LIKE:-$ID}" == "debian" ]]; then
2727
export DEBIAN_FRONTEND=noninteractive
2828
(set -x;
2929
$sudo apt-get -y install \

build/Makefile

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
all: help
22

3-
export FEDORA_LATEST := 38
3+
export FEDORA_LATEST := 39
44

55
x86 = $(filter x86_64,$(shell uname -m))
66
isa_3 = $(filter arch_3_00,$(shell LD_SHOW_AUXV=1 /bin/true))
@@ -16,14 +16,14 @@ endif
1616

1717
UBUNTU_DISTROS += ubuntu@20.04 ubuntu@18.04 ubuntu@16.04 ubuntu
1818

19-
FEDORA_DISTROS := fedora@${FEDORA_LATEST} fedora@37 fedora@36 fedora@35 fedora@34 fedora@33 fedora@31 fedora
19+
FEDORA_DISTROS := fedora@${FEDORA_LATEST} fedora@38 fedora@37 fedora@36 fedora@35 fedora@34 fedora@33 fedora@31 fedora
2020
KORG_DISTROS := korg@13.1.0 korg@12.3.0 korg@12.2.0 korg@12.1.0 korg@11.3.0 korg@11.1.0 korg@10.3.0 korg@9.4.0 korg@9.3.0 korg@8.5.0 korg@8.1.0 korg@5.5.0
2121
ALL_DISTROS := ${UBUNTU_DISTROS} ${KORG_DISTROS} ${FEDORA_DISTROS}
2222
DOCS_DISTRO := docs@${UBUNTU_LATEST}
2323
X86_DISTROS := ubuntu@${UBUNTU_LATEST} ubuntu
24-
ALIAS_DISTROS := ubuntu ubuntu-allcross fedora
25-
ALLCROSS_DISTROS := ubuntu-allcross@${UBUNTU_LATEST} ubuntu-allcross
26-
ALL_ARCHES := alpha arm arm64 i686 m68k mips mips64 riscv s390 sh sparc x86_64
24+
ALIAS_DISTROS := ubuntu allcross fedora
25+
ALLCROSS_DISTROS := allcross@sid allcross
26+
ALL_ARCHES := alpha arc arm arm64 i686 m68k mips mips64 parisc riscv s390 sh sparc x86_64
2727
SUBARCHES := ppc64le ppc64 ppc
2828

2929
VERSION:
@@ -32,7 +32,7 @@ VERSION:
3232
define MAIN_TEMPLATE =
3333
image@${1}@${2} rebuild-image@${1}@${2}: VERSION
3434

35-
image@${1}@${2} rebuild-image@${1}@${2} pull-image@${1}@${2} push-image@${1}@${2}:
35+
image@${1}@${2} rebuild-image@${1}@${2} pull-image@${1}@${2} push-image@${1}@${2} pull-base-image@${1}@${2}:
3636
@./scripts/image.sh $$@
3737

3838
clean@${1}@${2}:
@@ -43,6 +43,7 @@ IMAGES += image@${1}@${2}
4343
PULL_IMAGES += pull-image@${1}@${2}
4444
REBUILD_IMAGES += rebuild-image@${1}@${2}
4545
PUSH_IMAGES += push-image@${1}@${2}
46+
PULL_BASE_IMAGES += pull-base-image@${1}@${2}
4647
endef
4748

4849
define KERNEL_TEMPLATE =
@@ -52,6 +53,9 @@ kernel@${1}@${2}: image@${1}@${2}
5253
clean-kernel@${1}@${2}:
5354
@./scripts/clean.sh $$@
5455

56+
prune-kernel@${1}@${2}:
57+
@./scripts/prune.sh $$@
58+
5559
KERNEL += $(if $(filter-out ${ALIAS_DISTROS},${2}), kernel@${1}@${2})
5660
endef
5761

@@ -62,6 +66,9 @@ ppctests@${1}@${2} selftests@${1}@${2}: image@${1}@${2}
6266
clean-selftests@${1}@${2}:
6367
@./scripts/clean.sh $$@
6468

69+
prune-selftests@${1}@${2}:
70+
@./scripts/prune.sh $$@
71+
6572
PPCTESTS += $(if $(filter-out ${ALIAS_DISTROS},${2}), ppctests@${1}@${2})
6673
SELFTESTS += $(if $(filter-out ${ALIAS_DISTROS},${2}), selftests@${1}@${2})
6774
endef
@@ -141,9 +148,10 @@ images: ${IMAGES}
141148
pull-images: ${PULL_IMAGES}
142149
rebuild-images: ${REBUILD_IMAGES}
143150
push-images: ${PUSH_IMAGES}
151+
pull-base-images: ${PULL_BASE_IMAGES}
144152
docs: ${DOCS}
145153

146-
ALL_TARGETS = ${KERNEL} ${PPCTESTS} ${SELFTESTS} ${IMAGES} ${PULL_IMAGES} ${DOCS} ${CLEAN}
154+
ALL_TARGETS = ${KERNEL} ${PPCTESTS} ${SELFTESTS} ${PERF} ${IMAGES} ${PULL_IMAGES} ${REBUILD_IMAGES} ${PUSH_IMAGES} ${PULL_BASE_IMAGES} ${DOCS} ${CLEAN}
147155
.PHONY: ${ALL_TARGETS} VERSION
148156

149157
empty:=

build/allcross/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
ARG from
2+
FROM ${from}
3+
ARG from
4+
5+
RUN apt-get -q -y update && \
6+
DEBIAN_FRONTEND=noninteractive \
7+
apt-get -q -y install --no-install-recommends \
8+
bc \
9+
bison \
10+
bsdmainutils \
11+
bzip2 \
12+
ca-certificates \
13+
ccache \
14+
cpio \
15+
crossbuild-essential-powerpc \
16+
gcc-multilib-powerpc-linux-gnu \
17+
dwarves \
18+
file \
19+
flex \
20+
gcc \
21+
gcc-powerpc-linux-gnu g++-powerpc-linux-gnu \
22+
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
23+
gcc-alpha-linux-gnu g++-alpha-linux-gnu \
24+
gcc-arc-linux-gnu g++-arc-linux-gnu \
25+
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
26+
gcc-hppa-linux-gnu g++-hppa-linux-gnu \
27+
gcc-i686-linux-gnu g++-i686-linux-gnu \
28+
gcc-m68k-linux-gnu g++-m68k-linux-gnu \
29+
gcc-mips64el-linux-gnuabi64 g++-mips64el-linux-gnuabi64 \
30+
gcc-mipsel-linux-gnu g++-mipsel-linux-gnu \
31+
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
32+
gcc-s390x-linux-gnu g++-s390x-linux-gnu \
33+
gcc-sh4-linux-gnu g++-sh4-linux-gnu \
34+
gcc-sparc64-linux-gnu g++-sparc64-linux-gnu \
35+
gcc-x86-64-linux-gnu g++-x86-64-linux-gnu \
36+
git \
37+
kmod \
38+
libc-dev \
39+
libelf-dev \
40+
libfuse-dev \
41+
liblz4-tool \
42+
libssl-dev \
43+
lzop \
44+
make \
45+
openssl \
46+
python3 \
47+
python3-dev \
48+
u-boot-tools \
49+
rename \
50+
rsync \
51+
sparse \
52+
xz-utils && \
53+
rm -rf /var/lib/apt/lists/* /tmp/packages.sh /var/cache/* /var/log/dpkg.log
54+
55+
ARG uid
56+
ARG gid
57+
58+
RUN groupadd --gid $gid linuxppc
59+
RUN useradd --uid $uid --gid $gid linuxppc
60+
USER linuxppc
61+
62+
COPY scripts/container-build.sh /bin/container-build.sh
63+
COPY VERSION /VERSION

build/scripts/build.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ alternate_binds=$(get_alternate_binds)
2525
arch=$subarch
2626
if [[ "$subarch" == "alpha" ]]; then
2727
cross="alpha-linux-gnu-"
28+
elif [[ "$subarch" == "arc" ]]; then
29+
cross="arc-linux-gnu-"
2830
elif [[ "$subarch" == "arm" ]]; then
2931
cross="arm-linux-gnueabihf-"
3032
elif [[ "$subarch" == "arm64" ]]; then
3133
cross="aarch64-linux-gnu-"
34+
elif [[ "$subarch" == "parisc" ]]; then
35+
cross="hppa-linux-gnu-"
3236
elif [[ "$subarch" == "i686" ]]; then
3337
cross="i686-linux-gnu-"
3438
arch=x86
@@ -135,7 +139,22 @@ fi
135139

136140
if [[ "$task" == "kernel" ]]; then
137141
if [[ -z "$DEFCONFIG" ]]; then
138-
DEFCONFIG="${subarch}_defconfig"
142+
case "$subarch" in
143+
alpha) ;&
144+
arm64) ;&
145+
riscv) ;&
146+
s390) DEFCONFIG=defconfig ;;
147+
arc) DEFCONFIG=axs103_smp_defconfig ;;
148+
arm) DEFCONFIG=versatile_defconfig ;;
149+
i686) DEFCONFIG=i386_defconfig ;;
150+
m68k) DEFCONFIG=multi_defconfig ;;
151+
mips) DEFCONFIG=32r6_defconfig ;;
152+
mips64) DEFCONFIG=64r6_defconfig ;;
153+
parisc) DEFCONFIG=generic-32bit_defconfig ;;
154+
sh) DEFCONFIG=shx3_defconfig ;;
155+
sparc) DEFCONFIG=sparc64_defconfig ;;
156+
*) DEFCONFIG="${subarch}_defconfig" ;;
157+
esac
139158
fi
140159
cmd+="-e DEFCONFIG=$DEFCONFIG "
141160

build/scripts/clean.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ IFS=@ read -r task subarch distro version <<< "$1"
1313

1414
output_dir=$(get_output_dir "$script_base" "$subarch" "$distro" "$version" "$task" "$DEFCONFIG" "$TARGETS" "$CLANG" "")
1515

16-
(set -x ; rm -rf "$output_dir")
16+
if [[ -n $QUIET ]]; then
17+
rm -rf "$output_dir"
18+
else
19+
(set -x ; rm -rf "$output_dir")
20+
fi

build/scripts/image.sh

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,23 @@ fi
1717

1818
image="linuxppc/build:$distro-$version"
1919

20+
from="docker.io/$distro:$version"
21+
22+
if [[ "$distro" == "docs" ]]; then
23+
from="docker.io/ubuntu:$version"
24+
elif [[ "$distro" == "allcross" ]]; then
25+
from="docker.io/debian:$version"
26+
elif [[ "$distro" == "korg" ]]; then
27+
# Use an older distro for the 5.x toolchains.
28+
if [[ "$version" == 5.* ]]; then
29+
from="docker.io/ubuntu:16.04"
30+
elif [[ "$version" == 13.* ]]; then
31+
from="docker.io/ubuntu:23.04"
32+
else
33+
from="docker.io/ubuntu:20.04"
34+
fi
35+
fi
36+
2037
if [[ "$task" == "image" ]]; then
2138
cmd="$DOCKER images -q --filter=reference=$image"
2239
echo "+ $cmd" # fake set -x display
@@ -82,14 +99,14 @@ elif [[ "$task" == "push-image" ]]; then
8299
fi
83100

84101
exit 0
102+
elif [[ "$task" == "pull-base-image" ]]; then
103+
cmd="$DOCKER pull $from"
104+
(set -x; $cmd)
105+
exit $?
85106
fi
86107

87108
cmd="$DOCKER build -f $distro/Dockerfile "
88109

89-
if [[ "$distro" != "ubuntu-allcross" ]]; then
90-
cmd+="--pull "
91-
fi
92-
93110
if [[ -n "$http_proxy" ]]; then
94111
cmd+="--build-arg http_proxy=$http_proxy "
95112
fi
@@ -106,28 +123,11 @@ if [[ -z "$GID" ]]; then
106123
GID=$(id -g)
107124
fi
108125

109-
from="docker.io/$distro:$version"
110-
111-
if [[ "$distro" == "docs" ]]; then
112-
from="docker.io/ubuntu:$version"
113-
elif [[ "$distro" == "ubuntu-allcross" ]]; then
114-
from="linuxppc/build:ubuntu-$version"
115-
elif [[ "$distro" == "korg" ]]; then
126+
if [[ "$distro" == "korg" ]]; then
116127
cmd+="--build-arg compiler_version=$version "
117-
118128
arch=$(uname -m)
119-
120129
cmd+="--build-arg base_url=https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${arch}/${version}/ "
121130
cmd+="--build-arg tar_file=${arch}-gcc-${version}-nolibc-powerpc64-linux.tar.xz "
122-
123-
# Use an older distro for the 5.x toolchains.
124-
if [[ "$version" == 5.* ]]; then
125-
from="docker.io/ubuntu:16.04"
126-
elif [[ "$version" == 13.* ]]; then
127-
from="docker.io/ubuntu:23.04"
128-
else
129-
from="docker.io/ubuntu:20.04"
130-
fi
131131
fi
132132

133133
cmd+="--build-arg uid=$UID "

build/scripts/lib.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function get_output_dir()
4141

4242
case "$task" in
4343
kernel) ;&
44+
prune-kernel) ;&
4445
clean-kernel)
4546
if [[ -n "$symlink" ]]; then
4647
echo "$d/latest-kernel"
@@ -53,6 +54,7 @@ function get_output_dir()
5354
;;
5455
ppctests) ;&
5556
selftests) ;&
57+
prune-selftests) ;&
5658
clean-selftests)
5759
if [[ -n "$symlink" ]]; then
5860
echo "$d/latest-selftests"
@@ -89,7 +91,7 @@ function get_output_dir()
8991
d="$d@$version"
9092
fi
9193

92-
d=$(realpath $d)
94+
d=$(realpath -q $d)
9395
echo "$d"
9496

9597
return 0
@@ -102,7 +104,7 @@ function get_default_version()
102104

103105
case "$distro" in
104106
ubuntu) latest="$UBUNTU_LATEST" ;;
105-
ubuntu-allcross) latest="$UBUNTU_LATEST" ;;
107+
allcross) latest="sid" ;;
106108
fedora) latest="$FEDORA_LATEST" ;;
107109
esac
108110

build/scripts/prune.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/bash
2+
3+
if [[ -z "$1" ]]; then
4+
echo "Usage: $0 <target>" >&2
5+
exit 1
6+
fi
7+
8+
dir="$(dirname "$0")"
9+
script_base="$(realpath "$dir")"
10+
. "$script_base/lib.sh"
11+
12+
IFS=@ read -r task subarch distro version <<< "$1"
13+
14+
output_dir=$(get_output_dir "$script_base" "$subarch" "$distro" "$version" "$task" "$DEFCONFIG" "$TARGETS" "$CLANG")
15+
16+
case "$task" in
17+
prune-kernel)
18+
if [[ ! -e "$output_dir/Makefile" ]]; then
19+
# Assume it's already been pruned
20+
exit 0
21+
fi
22+
23+
echo "Pruning non-outputs in $output_dir"
24+
25+
set -euo pipefail
26+
cd "$output_dir"
27+
mkdir -p "artifacts"
28+
for path in .config vmlinux System.map arch/powerpc/boot/zImage include/config/kernel.release \
29+
arch/powerpc/kernel/asm-offsets.s arch/powerpc/boot/uImage modules.tar.bz2 \
30+
sparse.log log.txt
31+
do
32+
if [[ -e "$path" ]]; then
33+
mv "$path" artifacts/
34+
fi
35+
done
36+
find . -not -path "./artifacts*" -delete
37+
mv artifacts/.config config
38+
mv artifacts/* .
39+
rmdir artifacts
40+
;;
41+
prune-selftests)
42+
if [[ ! -e "$output_dir/kselftest" ]]; then
43+
# Assume it's already been pruned
44+
exit 0
45+
fi
46+
47+
echo "Pruning non-outputs in $output_dir"
48+
49+
set -euo pipefail
50+
cd "$output_dir"
51+
if [[ -d install ]]; then
52+
mv install selftests
53+
tar -czf selftests.tar.gz selftests
54+
fi
55+
find . -not -path "./selftests.tar.gz" -delete
56+
;;
57+
*)
58+
(set -x ; rm -rf "$output_dir")
59+
;;
60+
esac

0 commit comments

Comments
 (0)