Skip to content

Commit e728957

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 dc7d4cf commit e728957

File tree

6 files changed

+43
-7
lines changed

6 files changed

+43
-7
lines changed

.dockerignore

+2
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

+25
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ install-all: install install-ostree-hooks
5050
install -D -m 0755 target/release/tests-integration $(DESTDIR)$(prefix)/bin/bootc-integration-tests
5151

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

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

5858
test-tmt:
5959
cargo xtask test-tmt

build_seed.sh

+9
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

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ WORKDIR /build
1414
RUN mkdir -p /build/target/dev-rootfs # This can hold arbitrary extra content
1515
# See https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
1616
# We aren't using the full recommendations there, just the simple bits.
17-
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
17+
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
1818

1919
FROM $base
2020
# We support e.g. adding cloud-init
@@ -26,8 +26,8 @@ COPY hack/install-test-configs/* /usr/lib/bootc/install/
2626
# And some test kargs
2727
COPY hack/test-kargs /usr/lib/bootc/kargs.d/
2828
# Inject our built code
29-
COPY --from=build /out/bootc.tar.zst /tmp
30-
RUN tar -C / --zstd -xvf /tmp/bootc.tar.zst && rm -vrf /tmp/*
29+
COPY --from=build /out/bootc.tar /tmp
30+
RUN tar -C / -xvf /tmp/bootc.tar && rm -vrf /tmp/*
3131
# Also copy over arbitrary bits from the target root
3232
COPY --from=build /build/target/dev-rootfs/ /
3333
# Test our own linting

lib/src/install.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1054,8 +1054,8 @@ fn ensure_var() -> Result<()> {
10541054
/// will traverse the link.
10551055
#[context("Linking tmp mounts to host")]
10561056
pub(crate) fn setup_tmp_mounts() -> Result<()> {
1057-
let st = rustix::fs::statfs("/tmp")?;
1058-
if st.f_type == libc::TMPFS_MAGIC {
1057+
let slash_tmp_statfs = rustix::fs::statfs("/tmp")?;
1058+
if slash_tmp_statfs.f_type == libc::TMPFS_MAGIC {
10591059
tracing::trace!("Already have tmpfs /tmp")
10601060
} else {
10611061
// Note we explicitly also don't want a "nosuid" tmp, because that

0 commit comments

Comments
 (0)