Skip to content

Commit 2e296ca

Browse files
committed
fix: make syslinux download resilient (try multiple locations)
1 parent 76f4af2 commit 2e296ca

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

Dockerfile

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,25 @@ RUN --mount=type=cache,target=/build/cache \
9595
# Download and extract Syslinux
9696
# Note: Using alternative download locations due to mirror availability
9797
WORKDIR /build/sources
98-
RUN curl -fsSL -o syslinux.tar.gz \
99-
"https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz" || \
100-
curl -fsSL -o syslinux.tar.gz \
101-
"https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.03.tar.gz" && \
102-
tar xzf syslinux.tar.gz && \
103-
rm syslinux.tar.gz && \
104-
mv syslinux-* syslinux
98+
RUN set -eux; \
99+
tried=0; \
100+
for url in \
101+
"https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/syslinux-${SYSLINUX_VERSION}.tar.gz" \
102+
"https://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-${SYSLINUX_VERSION}.tar.gz" \
103+
"https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/Testing/${SYSLINUX_VERSION}/syslinux-${SYSLINUX_VERSION}.tar.gz"; do \
104+
echo "Trying $url"; \
105+
if curl -fsSL -o syslinux.tar.gz "$url"; then \
106+
tried=1; \
107+
break; \
108+
else \
109+
echo "Failed to download from $url"; \
110+
fi; \
111+
done; \
112+
if [ "$tried" -ne 1 ]; then \
113+
echo "ERROR: Unable to download syslinux ${SYSLINUX_VERSION}" >&2; \
114+
exit 22; \
115+
fi; \
116+
tar xzf syslinux.tar.gz && rm syslinux.tar.gz && mv "syslinux-${SYSLINUX_VERSION}" syslinux
105117

106118
# -----------------------------------------------------------------------------
107119
# Stage 3: Build Linux kernel

0 commit comments

Comments
 (0)