From 7cd5887b06d36445b8f881b7c5543afbcd860fb4 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Sat, 23 Dec 2023 03:42:53 -0800 Subject: [PATCH] wip live-bootstrap attempt --- src/bootstrap/build.mk | 4 +-- src/bootstrap/live/Dockerfile | 44 +++++++++++++++++++++++++++++++++ src/bootstrap/stage0/Dockerfile | 19 +++++++------- 3 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 src/bootstrap/live/Dockerfile diff --git a/src/bootstrap/build.mk b/src/bootstrap/build.mk index c55927a..7073d93 100644 --- a/src/bootstrap/build.mk +++ b/src/bootstrap/build.mk @@ -9,5 +9,5 @@ out/bootstrap.tgz: out/stage0.tgz: $(call build,bootstrap,stage0) -out/mes.tgz: out/stage0.tgz - $(call build,bootstrap,mes) +out/live.tgz: out/stage0.tgz + $(call build,bootstrap,live) diff --git a/src/bootstrap/live/Dockerfile b/src/bootstrap/live/Dockerfile new file mode 100644 index 0000000..7e8618c --- /dev/null +++ b/src/bootstrap/live/Dockerfile @@ -0,0 +1,44 @@ +ARG REGISTRY=local +ARG VERSION=55ad47acd764a909e0f337bce322abd346d963fa +ARG SRC_SITE=https://codeload.github.com/fosslinux/live-bootstrap/legacy.tar.gz +ARG SRC_HASH=4f0f9103a1a333b1174ca16e584e7a3c849a56383018e1ced175033292b24014 +FROM debian@sha256:bac353db4cc04bc672b14029964e686cd7bad56fe34b51f432c1a1304b9928da as debian +FROM ${REGISTRY}/stage0 as stage0 + +FROM debian as fetch +ARG VERSION +ENV VERSION=${VERSION} +ARG SRC_SITE +ENV SRC_SITE=${SRC_SITE} +ARG SRC_HASH +ENV SRC_HASH=${SRC_HASH} +RUN apt update && apt install -y curl gcc +RUN set -eux; \ + curl ${SRC_SITE}/${VERSION} -o live-bootstrap.tar.gz; \ + echo "${SRC_HASH} live-bootstrap.tar.gz" | sha256sum -c; \ + tar -xvf live-bootstrap.tar.gz; \ + mv fosslinux-live-bootstrap-* live-bootstrap +WORKDIR live-bootstrap +RUN ./download-distfiles.sh +RUN set -eux; \ + mkdir -p /rootfs; \ + mv steps distfiles seed/* /rootfs/ +RUN cat < /rootfs/steps/bootstrap.cfg +FORCE_TIMESTAMPS=False +CHROOT=False +CHROOT_ONLY_SYSA=False +UPDATE_CHECKSUMS=False +JOBS=2 +INTERNAL_CI=None +BARE_METAL=True +DISK=sdb +KERNEL_BOOTSTRAP=True +BUILD_KERNELS=False +EOF + +FROM busybox as build +COPY --from=stage0 / . +COPY --from=fetch /rootfs . +ENV ARCH_DIR=x86 +ENV ARCH=x86 +RUN ["/x86/bin/kaem","--verbose","--strict","--file","./after.kaem"] diff --git a/src/bootstrap/stage0/Dockerfile b/src/bootstrap/stage0/Dockerfile index 8287647..6043161 100644 --- a/src/bootstrap/stage0/Dockerfile +++ b/src/bootstrap/stage0/Dockerfile @@ -18,10 +18,10 @@ RUN set -eux; \ echo "${SRC_HASH} stage0-posix-${VERSION}.tar.gz" | sha256sum -c; \ tar -xf stage0-posix-${VERSION}.tar.gz WORKDIR stage0-posix-${VERSION} -RUN bootstrap-seeds/POSIX/AMD64/kaem-optional-seed -RUN mv AMD64/bin /rootfs/ +RUN bootstrap-seeds/POSIX/x86/kaem-optional-seed +RUN mkdir -p /rootfs && mv x86 M2libc /rootfs/ WORKDIR /rootfs -RUN sha256sum * > hashes.txt +RUN sha256sum x86/bin/* > hashes.txt FROM archlinux as build2 ARG VERSION @@ -36,10 +36,10 @@ RUN set -eux; \ echo "${SRC_HASH} stage0-posix-${VERSION}.tar.gz" | sha256sum -c; \ tar -xf stage0-posix-${VERSION}.tar.gz WORKDIR stage0-posix-${VERSION} -RUN bootstrap-seeds/POSIX/AMD64/kaem-optional-seed -RUN mv AMD64/bin /rootfs/ +RUN bootstrap-seeds/POSIX/x86/kaem-optional-seed +RUN mkdir -p /rootfs && mv x86 M2libc /rootfs/ WORKDIR /rootfs -RUN sha256sum * > hashes.txt +RUN sha256sum x86/bin/* > hashes.txt FROM alpine as build3 ARG VERSION @@ -54,10 +54,11 @@ RUN set -eux; \ echo "${SRC_HASH} stage0-posix-${VERSION}.tar.gz" | sha256sum -c; \ tar -xf stage0-posix-${VERSION}.tar.gz WORKDIR stage0-posix-${VERSION} -RUN bootstrap-seeds/POSIX/AMD64/kaem-optional-seed -RUN mv AMD64/bin /rootfs/ +RUN bootstrap-seeds/POSIX/x86/kaem-optional-seed +RUN mkdir -p /rootfs && mv x86 M2libc /rootfs/ WORKDIR /rootfs -RUN sha256sum * > hashes.txt +RUN sha256sum x86/bin/* > hashes.txt +RUN cat hashes.txt FROM scratch as compare COPY --from=build1 /rootfs/ /a