wip live-bootstrap attempt

This commit is contained in:
Lance Vick 2023-12-23 03:42:53 -08:00
parent 5cc99f5692
commit 7cd5887b06
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
3 changed files with 56 additions and 11 deletions

View File

@ -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)

View File

@ -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 <<EOF > /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"]

View File

@ -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