Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update musl headers to 6.6 #3921

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/docker/aarch64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:23.10

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-aarch64-linux-gnu qemu-user
gcc-aarch64-linux-gnu qemu-user xz-utils patch rsync

COPY install-musl.sh /
RUN sh /install-musl.sh aarch64
Expand Down
3 changes: 2 additions & 1 deletion ci/docker/arm-unknown-linux-musleabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM ubuntu:23.10

RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-arm-linux-gnueabihf qemu-user
gcc-arm-linux-gnueabihf qemu-user \
xz-utils patch rsync

COPY install-musl.sh /
RUN sh /install-musl.sh arm
Expand Down
3 changes: 2 additions & 1 deletion ci/docker/i686-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ FROM ubuntu:23.10
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib make libc6-dev git curl ca-certificates libc6-i386
gcc-multilib make libc6-dev git curl ca-certificates libc6-i386 \
xz-utils patch rsync

COPY install-musl.sh /
RUN sh /install-musl.sh i686
Expand Down
3 changes: 2 additions & 1 deletion ci/docker/s390x-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl ca-certificates \
gcc \
gcc-s390x-linux-gnu \
qemu-user
qemu-user \
xz-utils patch rsync

COPY install-musl.sh /
RUN sh /install-musl.sh s390x
Expand Down
3 changes: 2 additions & 1 deletion ci/docker/x86_64-unknown-linux-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM ubuntu:23.10

RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates
gcc make libc6-dev git curl ca-certificates \
xz-utils patch rsync

COPY install-musl.sh /
RUN sh /install-musl.sh x86_64
Expand Down
53 changes: 45 additions & 8 deletions ci/install-musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,50 @@ esac
cd ..
rm -rf $MUSL

# Download, configure, build, and install musl-sanitized kernel headers:
KERNEL_HEADER_VER="4.19.88"
curl --retry 5 -L \
"https://github.com/sabotage-linux/kernel-headers/archive/v${KERNEL_HEADER_VER}.tar.gz" | \
tar xzf -
# Download, configure, build, and install musl-sanitized kernel headers.
# This routine piggybacks on: https://git.alpinelinux.org/aports/tree/main/linux-headers?h=3.20-stable
# Alpine follows stable kernel releases, 3.20 uses Linux 6.6 headers.
git clone -n --depth=1 --filter=tree:0 -b 3.20-stable https://gitlab.alpinelinux.org/alpine/aports
(
cd kernel-headers-${KERNEL_HEADER_VER}
make ARCH="${kernel_arch}" prefix="/musl-${musl_arch}" install -j4
cd aports
git sparse-checkout set --no-cone main/linux-headers
git checkout
cd main/linux-headers
cp APKBUILD APKBUILD.source
cp APKBUILD APKBUILD.sha512
{
echo "printf \"\$source\""
# shellcheck disable=SC2028
echo "printf \"\$_kernver\n\""
# shellcheck disable=SC2028
echo "printf \"\$pkgver\n\""
} >> APKBUILD.source
echo "printf \"\$sha512sums\"" >> APKBUILD.sha512
KERNEL_VER=$(bash APKBUILD.source | tail -2 | head -1 | tr -d "[:space:]")
PKGVER=$(bash APKBUILD.source | tail -1 | tr -d "[:space:]")
urls=$(bash APKBUILD.source | grep -o 'https.*')
kernel=""
patch=""
for url in $urls; do
base=$(basename "$url")
curl --retry 5 -L "$url" > "$base"
case $base in
linux-*) kernel=$base;;
patch-*) patch=$base;;
esac
done
bash APKBUILD.sha512 | grep "$kernel" >> sha-check
bash APKBUILD.sha512 | grep "$patch" >> sha-check
sha512sum -c sha-check
tar -xf "$kernel"
cd "linux-$KERNEL_VER"
if [ "$PKGVER" != "$KERNEL_VER" ]; then
unxz -c < "../$patch" | patch -p1
fi
for p in ../*.patch; do
patch -p1 < "$p"
done
make headers_install ARCH="${kernel_arch}" INSTALL_HDR_PATH="/musl-${musl_arch}"
)
rm -rf kernel-headers-${KERNEL_HEADER_VER}

rm -rf aports
Loading