Skip to content

Commit bce962f

Browse files
committed
donotmerge: IBX changes
Some (trash, temporary) changes I had to perform on bootc to get IBX to work - `./Containerfile` builds a bootable image from an existing normal IBX seed - `./build_seed.sh` is just a helper script To install on recipient ``` sudo podman run --privileged -v $PWD/authkeys:/authkeys --env RUST_LOG=trace -v /var/tmp:/var/tmp -v /var/lib/containers/storage:/var/lib/containers/storage --pid=host -it quay.io/otuchfel/bootc:seed bootc install to-existing-root --acknowledge-destructive --stateroot omeroot --root-ssh-authorized-keys /authkeys --bound-images pull ``` This PR only exists to start discussions around concrete issues, it's not meant to be merged.
1 parent df879ed commit bce962f

File tree

6 files changed

+43
-7
lines changed

6 files changed

+43
-7
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ target
44
# These directories don't contribute to our container build
55
docs/
66
plans/
7+
Containerfile
8+
build_seed.sh

Containerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM quay.io/centos/centos:stream9 as build
2+
COPY hack/build.sh /build.sh
3+
RUN /build.sh && rm -v /build.sh
4+
COPY . /build
5+
WORKDIR /build
6+
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
7+
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
8+
# We aren't using the full recommendations there, just the simple bits.
9+
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar /out
10+
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
11+
12+
FROM quay.io/otuchfel/ostbackup:serv1 as seed
13+
14+
# ____________________________________________________________________________
15+
16+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:5b1124faf4b73753b4679085604dd8cb810c4a7a2e659978f5c80183bb165f94
17+
18+
LABEL com.openshift.lifecycle-agent.seed_format_version=3
19+
20+
RUN mkdir -p /usr/lib/bootc/install
21+
22+
COPY --from=seed --exclude=ostree.tgz / /var/tmp/seed
23+
24+
COPY --from=build /out/bootc.tar /tmp
25+
RUN tar -C / -xvf /tmp/bootc.tar && rm -vrf /tmp/*

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ install-all: install install-ostree-hooks
5151
install -D -m 0755 target/release/tests-integration $(DESTDIR)$(prefix)/bin/bootc-integration-tests
5252

5353
bin-archive: all
54-
$(MAKE) install DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) --zstd -C tmp-install -cf target/bootc.tar.zst . && rm tmp-install -rf
54+
$(MAKE) install DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) -C tmp-install -cf target/bootc.tar . && rm tmp-install -rf
5555

5656
test-bin-archive: all
57-
$(MAKE) install-all DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) --zstd -C tmp-install -cf target/bootc.tar.zst . && rm tmp-install -rf
57+
$(MAKE) install-all DESTDIR=tmp-install && $(TAR_REPRODUCIBLE) -C tmp-install -cf target/bootc.tar . && rm tmp-install -rf
5858

5959
test-tmt:
6060
cargo xtask test-tmt

build_seed.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR=$(dirname $0)
4+
5+
cd $SCRIPT_DIR
6+
7+
podman build -t bootcseed -f Containerfile .
8+
podman tag bootcseed:latest quay.io/otuchfel/bootc:seed
9+
podman push quay.io/otuchfel/bootc:seed

hack/Containerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ WORKDIR /build
1717
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
1818
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
1919
# We aren't using the full recommendations there, just the simple bits.
20-
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar.zst /out
20+
RUN --mount=type=cache,target=/build/target --mount=type=cache,target=/var/roothome make test-bin-archive && mkdir -p /out && cp target/bootc.tar /out
2121

2222
FROM $base
2323
# We support e.g. adding cloud-init
@@ -29,8 +29,8 @@ COPY hack/install-test-configs/* /usr/lib/bootc/install/
2929
# And some test kargs
3030
COPY hack/test-kargs /usr/lib/bootc/kargs.d/
3131
# Inject our built code
32-
COPY --from=build /out/bootc.tar.zst /tmp
33-
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
32+
COPY --from=build /out/bootc.tar /tmp
33+
RUN tar -C / -xvf /tmp/bootc.tar && rm -vrf /tmp/*
3434
# Also copy over arbitrary bits from the target root
3535
COPY --from=build /build/target/dev-rootfs/ /
3636
# Test our own linting

lib/src/install.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,8 @@ fn ensure_var() -> Result<()> {
11121112
/// will traverse the link.
11131113
#[context("Linking tmp mounts to host")]
11141114
pub(crate) fn setup_tmp_mounts() -> Result<()> {
1115-
let st = rustix::fs::statfs("/tmp")?;
1116-
if st.f_type == libc::TMPFS_MAGIC {
1115+
let slash_tmp_statfs = rustix::fs::statfs("/tmp")?;
1116+
if slash_tmp_statfs.f_type == libc::TMPFS_MAGIC {
11171117
tracing::trace!("Already have tmpfs /tmp")
11181118
} else {
11191119
// Note we explicitly also don't want a "nosuid" tmp, because that

0 commit comments

Comments
 (0)