diff --git a/build_library/sysext_mangle_flatcar-podman b/build_library/sysext_mangle_flatcar-podman new file mode 100755 index 00000000000..386d49ad817 --- /dev/null +++ b/build_library/sysext_mangle_flatcar-podman @@ -0,0 +1,54 @@ +#!/bin/bash + +set -euo pipefail +rootfs="${1}" + +pushd "${rootfs}" + +rm -rf ./usr/{lib/debug/,lib64/cmake/,lib64/pkgconfig,include/,share/fish,share/aclocal,share/SLSA} + +mkdir -p ./usr/share/podman/etc +cp -a ./etc/{fuse.conf,containers} ./usr/share/podman/etc/ + +cat <>./usr/lib/tmpfiles.d/podman.conf +C /etc/containers - - - - /usr/share/podman/etc/containers +C /etc/fuse.conf - - - - /usr/share/podman/etc/fuse.conf +w /etc/subuid - - - - core:1065536:65536 +w /etc/subgid - - - - core:1065536:65536 +EOF + +mkdir -p ./usr/lib/systemd/network + +cat <>./usr/lib/systemd/network/50-podman.network +[Match] +Type=bridge +Name=podman* + +[Link] +Unmanaged=yes +EOF + +cat <>./usr/lib/systemd/user/dbus.service +[Unit] +Description=D-Bus User Message Bus +Documentation=man:dbus-daemon(1) +Requires=dbus.socket + +[Service] +ExecStart=/usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only +ExecReload=/usr/bin/dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig +EOF + +cat <>./usr/lib/systemd/user/dbus.socket +[Unit] +Description=D-Bus User Message Bus Socket + +[Socket] +ListenStream=%t/bus +ExecStartPost=-/bin/systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus +EOF + +mkdir -p ./usr/lib/systemd/user/sockets.target.wants +ln -s ../dbus.socket ./usr/lib/systemd/user/sockets.target.wants/dbus.socket + +popd