From d285203f516257fa6e6e84bc922b121d39dc88a5 Mon Sep 17 00:00:00 2001 From: Black-Hole1 Date: Fri, 24 Nov 2023 15:11:22 +0800 Subject: [PATCH] feat(podman): support auto port forwarding The built-in libpod has automatic port forwarding, but it only enables it when the `/etc/containers/podman-machine` file exists. Ref: https://github.com/containers/podman/discussions/20757 Signed-off-by: Black-Hole1 --- initrd/config/init.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/initrd/config/init.sh b/initrd/config/init.sh index fdcc6c8..623f890 100644 --- a/initrd/config/init.sh +++ b/initrd/config/init.sh @@ -50,5 +50,8 @@ fi # mount data device to /var/lib/containers echo "/dev/vdc /var/lib/containers btrfs defaults 0 0" >> /mnt/overlay/etc/fstab +mkdir -p /mnt/overlay/etc/containers +echo "qemu" > /mnt/overlay/etc/containers/podman-machine + umount -n /dev /sys /proc exec /bin/busybox switch_root /mnt/overlay "${init:-/sbin/init}"