Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 18e5103

Browse files
committed
refactor: switch to bootc and dnf5
1 parent e2a83e0 commit 18e5103

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

Containerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ FROM ${SOURCE_IMAGE_REFERENCE}
1010

1111
ARG SOURCE_IMAGE_NAME
1212

13-
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
14-
--mount=type=bind,from=ctx,source=/,target=/ctx \
13+
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
14+
--mount=type=bind,from=ctx,src=/,dst=/ctx \
1515
/ctx/build.sh && \
16+
bootc container lint && \
1617
ostree container commit

build.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
set -eu
44

5-
mkdir -p /usr/etc/containers \
6-
/etc/containers/registries.d \
5+
mkdir -p /etc/containers/registries.d \
76
/etc/pki/containers
87

98
cp -r /ctx/files/system/etc/* /etc
109
cp -r /ctx/files/system/usr/* /usr
11-
cp /ctx/files/signing/policy.json /usr/etc/containers/policy.json
10+
cp /ctx/files/signing/policy.json /etc/containers/policy.json
1211
cp /ctx/files/signing/registry-config.yaml /etc/containers/registries.d/ryanpz.yaml
1312
cp /ctx/cosign.pub /etc/pki/containers/ryanpz.pub
1413

@@ -21,11 +20,11 @@ exclude_list=$(package_list 'exclude')
2120
include_list=$(package_list 'include')
2221

2322
# shellcheck disable=SC2086
24-
[ -n "$exclude_list" ] && rpm-ostree override remove $exclude_list
23+
[ -n "$exclude_list" ] && dnf5 remove -y $exclude_list
2524
# shellcheck disable=SC2086
26-
[ -n "$include_list" ] && rpm-ostree install $include_list
25+
[ -n "$include_list" ] && dnf5 install -y $include_list
2726

28-
systemctl enable rpm-ostreed-automatic.timer
27+
systemctl enable bootc-fetch-apply-updates.timer
2928
systemctl enable flatpak-system-update.timer
3029
systemctl --global enable flatpak-user-update.timer
3130

@@ -47,3 +46,21 @@ xz --check=crc32 /tmp/mediatek-firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin
4746
xz --check=crc32 /tmp/mediatek-firmware/WIFI_RAM_CODE_MT7922_1.bin
4847
mv -vf /tmp/mediatek-firmware/* /usr/lib/firmware/mediatek/
4948
rm -rf /tmp/mediatek-firmware
49+
50+
# cleanup
51+
rm -rfv /tmp/*
52+
rm -rfv /usr/etc
53+
# shellcheck disable=SC2115
54+
rm -rfv /boot/*
55+
56+
for d in /var/*; do
57+
if [ "$d" != '/var/cache' ]; then
58+
rm -rfv "$d"/*
59+
fi
60+
done
61+
62+
for d in /var/cache/*; do
63+
if [ "$d" != '/var/cache/libdnf5' ]; then
64+
rm -rfv "$d"/*
65+
fi
66+
done

files/system/etc/rpm-ostreed.conf

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

files/system/etc/systemd/system/rpm-ostreed-automatic.service.d/override.conf renamed to files/system/etc/systemd/system/bootc-fetch-apply-updates.service.d/override.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ StartLimitBurst=5
77
[Service]
88
Restart=on-failure
99
RestartSec=2m
10+
ExecStart=
11+
ExecStart=/usr/bin/bootc update --quiet
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[Timer]
22
OnBootSec=
33
OnUnitInactiveSec=
4+
RandomizedDelaySec=
45
RandomizedDelaySec=10m
56
OnCalendar=*-*-* 05:30:00 UTC
67
Persistent=true

0 commit comments

Comments
 (0)