2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-17 20:42:53 +00:00
|
|
|
ENV VERSION=2.39.3
|
|
|
|
ENV SRC_HASH=d3315ff701890f4fa1dd38ea387767fcb9e1aaeb763eb904677c03d2a7a5bdc1
|
|
|
|
ENV SRC_FILE=util-linux-${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://codeload.github.com/util-linux/util-linux/legacy.tar.gz/v${VERSION}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-17 20:42:53 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-17 20:42:53 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/perl . /
|
|
|
|
COPY --from=stagex/pkgconf . /
|
|
|
|
COPY --from=stagex/autoconf . /
|
|
|
|
COPY --from=stagex/automake . /
|
|
|
|
COPY --from=stagex/gettext . /
|
|
|
|
COPY --from=stagex/bison . /
|
|
|
|
COPY --from=stagex/libtool . /
|
|
|
|
COPY --from=stagex/linux-headers . /
|
|
|
|
COPY --from=stagex/m4 . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
RUN mkdir util-linux
|
|
|
|
RUN tar -xvf $SRC_FILE --strip-components=1 -C util-linux
|
|
|
|
WORKDIR util-linux
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
./autogen.sh
|
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
|
|
|
--prefix=/usr \
|
2024-03-01 18:30:23 +00:00
|
|
|
--exec-prefix=/usr \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--libdir=/usr/lib \
|
2024-02-17 20:42:53 +00:00
|
|
|
--with-vendordir=/usr/lib \
|
|
|
|
--enable-fs-paths-extra=/usr/sbin \
|
2024-03-01 18:30:23 +00:00
|
|
|
--disable-nls \
|
2024-02-17 20:42:53 +00:00
|
|
|
--disable-silent-rules \
|
|
|
|
--disable-gtk-doc \
|
|
|
|
--enable-newgrp
|
2024-03-14 07:16:26 +00:00
|
|
|
make -j "$(nproc)"
|
2024-02-17 20:42:53 +00:00
|
|
|
EOF
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN --network=none make DESTDIR=/rootfs install
|
2024-02-17 20:42:53 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|