Skip to content

Commit 1113767

Browse files
committed
fix(os): remove privilege-dependent runtime state
1 parent 032dfa3 commit 1113767

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

os/mkosi/scripts/prune-rootfs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ for path in \
2121
rm -rf "${ROOTFS:?}/$path"
2222
done
2323

24+
# mkosi's final systemd setup may recreate these only for privileged builds.
25+
# They belong to volatile runtime state and must not enter the immutable image.
26+
rm -f "$ROOTFS/var/lib/dbus/machine-id"
27+
find "$ROOTFS/var/log" -mindepth 1 -delete
28+
2429
# Static archives and libtool metadata are build inputs. All production
2530
# consumers use the corresponding shared objects.
2631
find "$ROOTFS/usr" -type f \( -name '*.a' -o -name '*.la' \) -delete

0 commit comments

Comments
 (0)