Skip to content

Commit

Permalink
Bootstrap sabotage
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar committed Jun 26, 2024
1 parent cfcb89f commit 2bc08a2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FROM davidar/bootsh:stage1 AS build-stage2
FROM build-$TAG AS build
COPY tarballs /src/tarballs
WORKDIR /tmp
COPY configure bootsh/
COPY configure Makefile bootsh/
COPY scripts bootsh/scripts
COPY src bootsh/src
COPY lib bootsh/lib
Expand All @@ -45,6 +45,6 @@ COPY --from=kernel /bzImage /

FROM scratch AS bootsh
COPY --from=build /dest /
ENTRYPOINT [ "/sbin/init" ]
ENTRYPOINT [ "/bin/init" ]
CMD [ "/bin/sh" ]
SHELL [ "/sbin/init", "/bin/sh", "-c" ]
SHELL [ "/bin/init", "/bin/sh", "-c" ]
18 changes: 18 additions & 0 deletions Dockerfile.sabotage
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM davidar/bootsh:latest AS stage0
ADD https://github.com/sabotage-linux/sabotage.git /src
RUN /src/utils/boot-stage0.sh

FROM stage0 AS stage0-amd64
SHELL [ "/bin/linux64", "/bin/sh", "-c" ]
FROM stage0 AS stage0-386
SHELL [ "/bin/linux32", "/bin/sh", "-c" ]
FROM stage0-$TARGETARCH AS stage1

RUN butch install stage1
RUN /src/utils/clean-stage1.sh
RUN /src/utils/rebuild-stage1.sh
RUN rm -rf /src/build /src/logs /src/tarballs

FROM scratch
COPY --from=stage1 / /
CMD [ "/bin/sh" ]
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ src/samu/samu:

clean:
rm -rf build lib/toybox/generated
$(MAKE) -C src/samu clean

install: all
scripts/install.sh
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ R="$DESTDIR$PREFIX"

install -D -m 755 build/bootsh "$R/bin/sh"
install -D -m 755 scripts/configure-musl.sh "$R/bin/configure-musl.sh"
install -D -m 755 scripts/init.sh "$R/sbin/init"
install -D -m 755 scripts/init.sh "$R/bin/init"
install -D -m 755 scripts/wak.c "$R/bin/awk"

0 comments on commit 2bc08a2

Please sign in to comment.