Skip to content

Commit 17af7ba

Browse files
committed
x
Signed-off-by: Pedro Tammela <[email protected]>
1 parent 2c0250f commit 17af7ba

File tree

2 files changed

+49
-8
lines changed

2 files changed

+49
-8
lines changed

ci/docker/x86_64-unknown-linux-musl/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ubuntu:23.10
22

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

77
COPY install-musl.sh /
88
RUN sh /install-musl.sh x86_64

ci/install-musl.sh

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,53 @@ cd ..
6565
rm -rf $MUSL
6666

6767
# Download, configure, build, and install musl-sanitized kernel headers:
68-
KERNEL_HEADER_VER="4.19.88"
69-
curl --retry 5 -L \
70-
"https://github.com/sabotage-linux/kernel-headers/archive/v${KERNEL_HEADER_VER}.tar.gz" | \
71-
tar xzf -
68+
#KERNEL_HEADER_VER="4.19.88"
69+
#curl --retry 5 -L \
70+
# "https://github.com/sabotage-linux/kernel-headers/archive/v${KERNEL_HEADER_VER}.tar.gz" | \
71+
# tar xzf -
72+
#(
73+
# cd kernel-headers-${KERNEL_HEADER_VER}
74+
# make ARCH="${kernel_arch}" prefix="/musl-${musl_arch}" install -j4
75+
#)
76+
#rm -rf kernel-headers-${KERNEL_HEADER_VER}
77+
78+
git clone -n --depth=1 --filter=tree:0 -b 3.20-stable https://gitlab.alpinelinux.org/alpine/aports
7279
(
73-
cd kernel-headers-${KERNEL_HEADER_VER}
74-
make ARCH="${kernel_arch}" prefix="/musl-${musl_arch}" install -j4
80+
cd aports
81+
git sparse-checkout set --no-cone main/linux-headers
82+
git checkout
83+
cd main/linux-headers
84+
cp APKBUILD APKBUILD.source
85+
cp APKBUILD APKBUILD.sha512
86+
echo 'printf "$source"' >> APKBUILD.source
87+
echo 'printf "$_kernver\n"' >> APKBUILD.source
88+
echo 'printf "$pkgver\n"' >> APKBUILD.source
89+
echo 'printf "$sha512sums"' >> APKBUILD.sha512
90+
KERNEL_VER=$(bash APKBUILD.source | tail -2 | head -1 | tr -d "[:space:]")
91+
PKGVER=$(bash APKBUILD.source | tail -1 | tr -d "[:space:]")
92+
urls=$(bash APKBUILD.source | grep -o https.*)
93+
kernel=""
94+
patch=""
95+
for url in $urls; do
96+
base=$(basename $url)
97+
curl --retry 5 -L $url > $base
98+
case $base in
99+
linux-*) kernel=$base;;
100+
patch-*) patch=$base;;
101+
esac
102+
done
103+
bash APKBUILD.sha512 | grep $kernel >> sha-check
104+
bash APKBUILD.sha512 | grep $patch >> sha-check
105+
sha512sum -c sha-check
106+
tar -xf $kernel
107+
cd linux-$KERNEL_VER
108+
if [ $PKGVER != $KERNEL_VER ]; then
109+
unxz -c < ../$patch | patch -p1
110+
fi
111+
for p in ../*.patch; do
112+
patch -p1 < $p
113+
done
114+
make headers_install ARCH="${kernel_arch}" INSTALL_HDR_PATH="/musl-${musl_arch}"
75115
)
76-
rm -rf kernel-headers-${KERNEL_HEADER_VER}
116+
117+
rm -rf aports

0 commit comments

Comments
 (0)