Skip to content

Commit

Permalink
Add podman-sysext mangle script
Browse files Browse the repository at this point in the history
  • Loading branch information
JeWe37 committed Apr 29, 2024
1 parent a974f71 commit c66f25a
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions build_library/sysext_mangle_flatcar-podman
Original file line number Diff line number Diff line change
@@ -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 <<EOF >>./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 <<EOF >>./usr/lib/systemd/network/50-podman.network
[Match]
Type=bridge
Name=podman*
[Link]
Unmanaged=yes
EOF

cat <<EOF >>./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 <<EOF >>./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

0 comments on commit c66f25a

Please sign in to comment.