Skip to content

Commit 07d7791

Browse files
jeckersbclaude
andcommitted
examples/bootc*: Migrate from cfsctl to bootc internals cfs
Update bootc examples to use the new unified bootc command interface: - Replace cfsctl binary with bootc and use 'bootc internals cfs' subcommands - Rename composefs-setup-root to bootc-initramfs-setup - Update dracut module from 37composefs to 37bootc - Remove sudo requirement from podman build commands - Update service and module configuration files accordingly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 83e2db1 commit 07d7791

File tree

11 files changed

+61
-60
lines changed

11 files changed

+61
-60
lines changed

examples/bootc-bls/Containerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
FROM quay.io/fedora/fedora-bootc:42
22
COPY extra /
3-
COPY cfsctl /usr/bin
3+
COPY bootc /usr/bin
44

55
RUN passwd -d root
66

7-
# need to have composefs setup root in the initramfs so we need this
7+
# need to have bootc-initramfs-setup in the initramfs so we need this
88
RUN set -x; \
99
kver=$(cd /usr/lib/modules && echo *); \
1010
dracut -vf --install "/etc/passwd /etc/group" /usr/lib/modules/$kver/initramfs.img $kver;

examples/bootc-bls/build

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ set -eux
44

55
cd "${0%/*}"
66

7-
cargo build --release --features=pre-6.15 --bin cfsctl --bin composefs-setup-root
7+
cargo build --release --bin bootc --bin bootc-initramfs-setup
88

9-
cp ../../target/release/cfsctl .
10-
cp ../../target/release/composefs-setup-root extra/usr/lib/dracut/modules.d/37composefs/
9+
cp ../../target/release/bootc .
10+
cp ../../target/release/bootc-initramfs-setup extra/usr/lib/dracut/modules.d/37bootc/
1111

1212
mkdir -p tmp
1313

14-
sudo podman build \
14+
podman build \
1515
-t quay.io/fedora/fedora-bootc-bls:42 \
1616
-f Containerfile \
1717
--iidfile=tmp/iid \
18+
.

examples/bootc-bls/extra/usr/lib/dracut/modules.d/37composefs/composefs-setup-root.service renamed to examples/bootc-bls/extra/usr/lib/dracut/modules.d/37bootc/bootc-initramfs-setup.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OnFailureJobMode=isolate
2727

2828
[Service]
2929
Type=oneshot
30-
ExecStart=/usr/bin/composefs-setup-root
30+
ExecStart=/usr/bin/bootc-initramfs-setup
3131
StandardInput=null
3232
StandardOutput=journal
3333
StandardError=journal+console
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/bash
2+
3+
check() {
4+
return 0
5+
}
6+
7+
depends() {
8+
return 0
9+
}
10+
11+
install() {
12+
inst \
13+
"${moddir}/bootc-initramfs-setup" /usr/bin/bootc-initramfs-setup
14+
inst \
15+
"${moddir}/bootc-initramfs-setup.service" \
16+
"${systemdsystemunitdir}/bootc-initramfs-setup.service"
17+
18+
$SYSTEMCTL -q --root "${initdir}" add-wants \
19+
'initrd-root-fs.target' 'bootc-initramfs-setup.service'
20+
}

examples/bootc-bls/extra/usr/lib/dracut/modules.d/37composefs/module-setup.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/bootc-uki/Containerfile.stage1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM quay.io/fedora/fedora-bootc:42
22
COPY extra /
3-
COPY cfsctl /usr/bin
3+
COPY bootc /usr/bin
44

55
RUN passwd -d root
66

examples/bootc-uki/build.base

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ set -eux
44

55
cd "${0%/*}"
66

7-
cargo build --release --features=pre-6.15 --bin cfsctl --bin composefs-setup-root
7+
cargo build --release --bin bootc --bin bootc-initramfs-setup
88

9-
cp ../../target/release/cfsctl .
10-
cp ../../target/release/composefs-setup-root extra/usr/lib/dracut/modules.d/37composefs/
9+
cp ../../target/release/bootc .
10+
cp ../../target/release/bootc-initramfs-setup extra/usr/lib/dracut/modules.d/37bootc/
1111

1212
mkdir -p tmp
1313

14-
sudo podman build \
14+
podman build \
1515
-t quay.io/fedora/fedora-bootc-base-uki:42 \
1616
-f Containerfile.stage1 \
1717
--iidfile=tmp/iid \

examples/bootc-uki/build.final

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ set -eux
44

55
cd "${0%/*}"
66

7-
cargo build --release --features=pre-6.15 --bin cfsctl --bin composefs-setup-root
7+
cargo build --release --bin bootc
88

9-
cp ../../target/release/cfsctl .
9+
cp ../../target/release/bootc .
1010

1111
rm -rf tmp/sysroot
1212
mkdir -p tmp/sysroot/composefs
1313

1414
IMAGE_ID="$(sed s/sha256:// tmp/iid)"
15-
./cfsctl --repo tmp/sysroot/composefs oci pull containers-storage:"${IMAGE_ID}"
16-
COMPOSEFS_FSVERITY="$(./cfsctl --repo tmp/sysroot/composefs oci compute-id --bootable "${IMAGE_ID}")"
15+
./bootc internals cfs --repo tmp/sysroot/composefs oci pull containers-storage:"${IMAGE_ID}"
16+
COMPOSEFS_FSVERITY="$(./bootc internals cfs --repo tmp/sysroot/composefs oci compute-id --bootable "${IMAGE_ID}")"
1717

1818
# See: https://wiki.archlinux.org/title/Unified_Extensible_Firmware_Interface/Secure_Boot
1919
# Alternative to generate keys for testing: `sbctl create-keys`
@@ -42,6 +42,6 @@ sudo podman build \
4242

4343
rm -rf tmp/efi
4444
mkdir -p tmp/efi
45-
./cfsctl --repo tmp/sysroot/composefs oci pull containers-storage:"${IMAGE_ID}"
46-
./cfsctl --repo tmp/sysroot/composefs oci compute-id --bootable "${IMAGE_ID}"
47-
./cfsctl --repo tmp/sysroot/composefs oci prepare-boot "${IMAGE_ID}" --bootdir tmp/efi
45+
./bootc internals cfs --repo tmp/sysroot/composefs oci pull containers-storage:"${IMAGE_ID}"
46+
./bootc internals cfs --repo tmp/sysroot/composefs oci compute-id --bootable "${IMAGE_ID}"
47+
./bootc internals cfs --repo tmp/sysroot/composefs oci prepare-boot "${IMAGE_ID}" --bootdir tmp/efi

examples/bootc-uki/extra/usr/lib/dracut/modules.d/37composefs/composefs-setup-root.service renamed to examples/bootc-uki/extra/usr/lib/dracut/modules.d/37bootc/bootc-initramfs-setup.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ OnFailureJobMode=isolate
2727

2828
[Service]
2929
Type=oneshot
30-
ExecStart=/usr/bin/composefs-setup-root
30+
ExecStart=/usr/bin/bootc-initramfs-setup
3131
StandardInput=null
3232
StandardOutput=journal
3333
StandardError=journal+console
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/bash
2+
3+
check() {
4+
return 0
5+
}
6+
7+
depends() {
8+
return 0
9+
}
10+
11+
install() {
12+
inst \
13+
"${moddir}/bootc-initramfs-setup" /usr/bin/bootc-initramfs-setup
14+
inst \
15+
"${moddir}/bootc-initramfs-setup.service" \
16+
"${systemdsystemunitdir}/bootc-initramfs-setup.service"
17+
18+
$SYSTEMCTL -q --root "${initdir}" add-wants \
19+
'initrd-root-fs.target' 'bootc-initramfs-setup.service'
20+
}

0 commit comments

Comments
 (0)