2024-02-09 07:30:28 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV VERSION=1.36.1
|
2024-01-23 23:46:02 +00:00
|
|
|
ENV SRC_HASH=b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_FILE=busybox-${VERSION}.tar.bz2
|
|
|
|
ENV SRC_SITE=https://busybox.net/downloads/${SRC_FILE}
|
2023-11-09 10:13:20 +00:00
|
|
|
|
2023-12-12 17:45:39 +00:00
|
|
|
FROM base as fetch
|
2024-02-09 07:30:28 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2023-12-12 17:45:39 +00:00
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/stage3 . /
|
2023-12-12 17:45:39 +00:00
|
|
|
RUN tar -xjf ${SRC_FILE}
|
2024-02-09 07:30:28 +00:00
|
|
|
WORKDIR busybox-${VERSION}
|
|
|
|
ENV KCONFIG_NOTIMESTAMP=1
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
setConfs='
|
|
|
|
CONFIG_LAST_SUPPORTED_WCHAR=0
|
|
|
|
CONFIG_STATIC=y
|
|
|
|
'
|
|
|
|
unsetConfs='
|
|
|
|
CONFIG_FEATURE_SYNC_FANCY
|
|
|
|
CONFIG_FEATURE_HAVE_RPC
|
|
|
|
CONFIG_FEATURE_INETD_RPC
|
|
|
|
CONFIG_FEATURE_UTMP
|
|
|
|
CONFIG_FEATURE_WTMP
|
|
|
|
'
|
|
|
|
make defconfig
|
|
|
|
for conf in $unsetConfs; do
|
|
|
|
sed -i \
|
|
|
|
-e "s!^$conf=.*\$!# $conf is not set!" \
|
|
|
|
.config
|
|
|
|
done
|
|
|
|
for confV in $setConfs; do
|
|
|
|
conf="${confV%=*}"
|
|
|
|
sed -i \
|
|
|
|
-e "s!^$conf=.*\$!$confV!" \
|
|
|
|
-e "s!^# $conf is not set\$!$confV!" \
|
|
|
|
.config
|
|
|
|
if ! grep -q "^$confV\$" .config; then
|
|
|
|
echo "$confV" >> .config
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
make oldconfig
|
|
|
|
for conf in $unsetConfs; do
|
|
|
|
! grep -q "^$conf=" .config
|
|
|
|
done
|
|
|
|
for confV in $setConfs; do
|
|
|
|
grep -q "^$confV\$" .config
|
|
|
|
done
|
|
|
|
make
|
|
|
|
EOF
|
2023-11-09 10:13:20 +00:00
|
|
|
|
2023-12-16 23:50:40 +00:00
|
|
|
FROM build as install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
2024-03-01 18:30:23 +00:00
|
|
|
mkdir -p /rootfs/usr/bin
|
|
|
|
cp busybox /rootfs/usr/bin
|
|
|
|
cp busybox /usr/bin
|
2024-02-09 07:30:28 +00:00
|
|
|
cd /rootfs
|
2024-03-01 18:30:23 +00:00
|
|
|
/usr/bin/busybox --install -s usr/bin
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2023-11-09 10:13:20 +00:00
|
|
|
|
2024-03-01 18:30:23 +00:00
|
|
|
FROM stagex/filesystem as package
|
|
|
|
COPY --from=install /rootfs/. /
|
2023-11-09 10:13:20 +00:00
|
|
|
ENTRYPOINT ["/bin/sh"]
|