From 7b6a59ffe569304f090e9955674d5161789254bd Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Wed, 26 Mar 2025 12:54:19 +0800 Subject: [PATCH 1/3] Tidy up install & uninstall script - Also fixed a minor mistake in the uninstall script: `podman-system-generator` -> `podman-*-generator` --- Makefile | 21 +++++++-------------- README.md | 8 +++----- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index a93c047..9daf569 100644 --- a/Makefile +++ b/Makefile @@ -106,27 +106,20 @@ install: tar: .podman-from-container rm -f $(ASSET_DIR).tar.gz - mkdir -p $(ASSET_DIR)/usr/lib/systemd/system - mkdir -p $(ASSET_DIR)/usr/lib/systemd/user - cp -f conf/systemd/podman-restart.service $(ASSET_DIR)/usr/lib/systemd/system/podman-restart.service - cp -f conf/systemd/podman.service $(ASSET_DIR)/usr/lib/systemd/system/podman.service - cp -f conf/systemd/podman.socket $(ASSET_DIR)/usr/lib/systemd/system/podman.socket - cp -f conf/systemd/podman.service $(ASSET_DIR)/usr/lib/systemd/user/podman.service - cp -f conf/systemd/podman.socket $(ASSET_DIR)/usr/lib/systemd/user/podman.socket + install -Dm644 -t $(ASSET_DIR)/usr/lib/systemd/system \ + conf/systemd/{podman-restart.service,podman.service,podman.socket} + install -Dm644 -t $(ASSET_DIR)/usr/lib/systemd/user \ + conf/systemd/{podman-restart.service,podman.service,podman.socket} tar -C $(ASSET_DIR)/.. -czvf $(ASSET_DIR).tar.gz $(ASSET_NAME) .podman-from-container: IMAGE_ROOTFS = $(BUILD_DIR)/images/podman/linux_$(ARCH) .podman-from-container: podman-tar-image rm -rf $(ASSET_DIR) - mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/local - mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/lib/systemd/user-generators/ - mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/lib/systemd/system-generators/ - cp -r $(IMAGE_ROOTFS)/etc/containers $(ASSET_DIR)/etc/containers - cp -r $(IMAGE_ROOTFS)/usr/local/lib $(ASSET_DIR)/usr/local/lib - cp -r $(IMAGE_ROOTFS)/usr/local/libexec $(ASSET_DIR)/usr/local/libexec + mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/local $(ASSET_DIR)/usr/lib/systemd/{system,user}-generators + cp -rt $(ASSET_DIR)/etc $(IMAGE_ROOTFS)/etc/containers + cp -rt $(ASSET_DIR)/usr/local $(IMAGE_ROOTFS)/usr/local/{bin,lib,libexec} ln -s ../../../local/libexec/podman/quadlet $(ASSET_DIR)/usr/lib/systemd/user-generators/podman-user-generator ln -s ../../../local/libexec/podman/quadlet $(ASSET_DIR)/usr/lib/systemd/system-generators/podman-system-generator - cp -r $(IMAGE_ROOTFS)/usr/local/bin $(ASSET_DIR)/usr/local/bin cp README.md $(ASSET_DIR)/ signed-tar: tar .gpg diff --git a/README.md b/README.md index a0d743a..21f20bc 100644 --- a/README.md +++ b/README.md @@ -144,10 +144,8 @@ Next, remove all the copied binaries from the following folders: ```sh sudo rm -rf /etc/containers/* -sudo rm -rf /usr/lib/systemd/system/podman* -sudo rm -rf /usr/lib/systemd/user/podman* sudo rm -rf /usr/local/bin/{crun,fuse-overlayfs,fusermount3,pasta,pasta.avx2,podman,runc} -sudo rm -rf /usr/local/lib/podman -sudo rm -rf /usr/local/libexec/podman -sudo rm /usr/lib/systemd/{user,system}-generators/podman-user-generator +sudo rm -rf /usr/local/{lib,libexec}/podman +sudo rm -rf /usr/lib/systemd/{system,user}/podman* +sudo rm /usr/lib/systemd/{system,user}-generators/podman-*-generator ``` From 78bf0516482ec3c87076c313ccffc73ec2d81637 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Wed, 26 Mar 2025 13:23:33 +0800 Subject: [PATCH 2/3] Install systemd files to `/usr/local/` --- Makefile | 10 +++++----- README.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9daf569..9f99c07 100644 --- a/Makefile +++ b/Makefile @@ -106,20 +106,20 @@ install: tar: .podman-from-container rm -f $(ASSET_DIR).tar.gz - install -Dm644 -t $(ASSET_DIR)/usr/lib/systemd/system \ + install -Dm644 -t $(ASSET_DIR)/usr/local/lib/systemd/system \ conf/systemd/{podman-restart.service,podman.service,podman.socket} - install -Dm644 -t $(ASSET_DIR)/usr/lib/systemd/user \ + install -Dm644 -t $(ASSET_DIR)/usr/local/lib/systemd/user \ conf/systemd/{podman-restart.service,podman.service,podman.socket} tar -C $(ASSET_DIR)/.. -czvf $(ASSET_DIR).tar.gz $(ASSET_NAME) .podman-from-container: IMAGE_ROOTFS = $(BUILD_DIR)/images/podman/linux_$(ARCH) .podman-from-container: podman-tar-image rm -rf $(ASSET_DIR) - mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/local $(ASSET_DIR)/usr/lib/systemd/{system,user}-generators + mkdir -p $(ASSET_DIR)/etc $(ASSET_DIR)/usr/local/lib/systemd/{system,user}-generators cp -rt $(ASSET_DIR)/etc $(IMAGE_ROOTFS)/etc/containers cp -rt $(ASSET_DIR)/usr/local $(IMAGE_ROOTFS)/usr/local/{bin,lib,libexec} - ln -s ../../../local/libexec/podman/quadlet $(ASSET_DIR)/usr/lib/systemd/user-generators/podman-user-generator - ln -s ../../../local/libexec/podman/quadlet $(ASSET_DIR)/usr/lib/systemd/system-generators/podman-system-generator + ln -s ../../../libexec/podman/quadlet $(ASSET_DIR)/usr/local/lib/systemd/user-generators/podman-user-generator + ln -s ../../../libexec/podman/quadlet $(ASSET_DIR)/usr/local/lib/systemd/system-generators/podman-system-generator cp README.md $(ASSET_DIR)/ signed-tar: tar .gpg diff --git a/README.md b/README.md index 21f20bc..7ef7ae1 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,6 @@ Next, remove all the copied binaries from the following folders: sudo rm -rf /etc/containers/* sudo rm -rf /usr/local/bin/{crun,fuse-overlayfs,fusermount3,pasta,pasta.avx2,podman,runc} sudo rm -rf /usr/local/{lib,libexec}/podman -sudo rm -rf /usr/lib/systemd/{system,user}/podman* -sudo rm /usr/lib/systemd/{system,user}-generators/podman-*-generator +sudo rm -rf /usr/local/lib/systemd/{system,user}/podman* +sudo rm /usr/local/lib/systemd/{system,user}-generators/podman-*-generator ``` From 09e19a9ef211ac1bf0bf5c65325ea5e6aaffab68 Mon Sep 17 00:00:00 2001 From: cyqsimon <28627918+cyqsimon@users.noreply.github.com> Date: Thu, 27 Mar 2025 13:42:04 +0800 Subject: [PATCH 3/3] Force bash shell in `Makefile` to allow brace expansion --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 9f99c07..063200b 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +SHELL := /usr/bin/env bash + PODMAN_IMAGE_NAME ?= mgoltzsche/podman PODMAN_IMAGE ?= $(PODMAN_IMAGE_NAME):latest PODMAN_IMAGE_TARGET ?= podmanall