From da599d319654cb5f5c1f27705190f32ffa92f0ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=90=D0=B7=D0=B0=D0=BB=D0=B8=D1=8F=20=D0=A1=D0=BC=D0=B0?= =?utf8?q?=D1=80=D0=B0=D0=B3=D0=B4=D0=BE=D0=B2=D0=B0?= Date: Sun, 13 Nov 2022 02:08:54 +0500 Subject: [PATCH] * Makefile adjustments * AppArmor profile texts have been moved into a dedicated directory --- Makefile | 20 ++++++++++--------- data/configs/{ => apparmor_profiles}/adbd | 0 .../{ => apparmor_profiles}/android_app | 0 .../{ => apparmor_profiles}/lxc-waydroid | 0 4 files changed, 11 insertions(+), 9 deletions(-) rename data/configs/{ => apparmor_profiles}/adbd (100%) rename data/configs/{ => apparmor_profiles}/android_app (100%) rename data/configs/{ => apparmor_profiles}/lxc-waydroid (100%) diff --git a/Makefile b/Makefile index 4652ea5..1fb7905 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,14 @@ BIN_DIR := $(PREFIX)/bin APPS_DIR := $(PREFIX)/share/applications METAINFO_DIR := $(PREFIX)/share/metainfo SYSD_DIR := $(PREFIX)/lib/systemd/system +APPARMOR_DIR := /etc/apparmor.d INSTALL_WAYDROID_DIR := $(DESTDIR)$(WAYDROID_DIR) INSTALL_BIN_DIR := $(DESTDIR)$(BIN_DIR) INSTALL_APPS_DIR := $(DESTDIR)$(APPS_DIR) INSTALL_METAINFO_DIR := $(DESTDIR)$(METAINFO_DIR) INSTALL_SYSD_DIR := $(DESTDIR)$(SYSD_DIR) +INSTALL_APPARMOR_DIR := $(DESTDIR)$(APPARMOR_DIR) build: @echo "Nothing to build, run 'make install' to copy the files!" @@ -32,13 +34,13 @@ install: sed '/LXC_USE_NFT=/ s/false/true/' -i $(INSTALL_WAYDROID_DIR)/data/scripts/waydroid-net.sh; \ fi -apparmor: - cp -f data/configs/adbd /etc/apparmor.d/adbd - apparmor_parser -r /etc/apparmor.d/adbd - cp -f data/configs/android_app /etc/apparmor.d/android_app - apparmor_parser -r /etc/apparmor.d/android_app - cp -f data/configs/lxc-waydroid /etc/apparmor.d/lxc/lxc-waydroid - apparmor_parser -r /etc/apparmor.d/lxc/lxc-waydroid - sed --sandbox -i "s/lxc.aa_profile = unconfined/lxc.aa_profile = lxc-waydroid/g;" /var/lib/waydroid/lxc/waydroid/config - sed --sandbox -i "s/lxc.apparmor.profile = unconfined/lxc.apparmor.profile = lxc-waydroid/g;" /var/lib/waydroid/lxc/waydroid/config +install_apparmor: + cp -f data/configs/apparmor_profiles/adbd $(INSTALL_APPARMOR_DIR)/adbd + apparmor_parser -r $(INSTALL_APPARMOR_DIR)/adbd + cp -f data/configs/apparmor_profiles/android_app $(INSTALL_APPARMOR_DIR)/android_app + apparmor_parser -r $(INSTALL_APPARMOR_DIR)/android_app + cp -f data/configs/apparmor_profiles/lxc-waydroid $(INSTALL_APPARMOR_DIR)/lxc/lxc-waydroid + apparmor_parser -r $(INSTALL_APPARMOR_DIR)/lxc/lxc-waydroid + sed --sandbox -i "/lxc.aa_profile/ s/unconfined/lxc-waydroid/g" $(DESTDIR)$(WAYDROID_DIR)/data/configs/config_1 + sed --sandbox -i "/lxc.apparmor.profile/ s/unconfined/lxc-waydroid/g" $(DESTDIR)$(WAYDROID_DIR)/data/configs/config_2 diff --git a/data/configs/adbd b/data/configs/apparmor_profiles/adbd similarity index 100% rename from data/configs/adbd rename to data/configs/apparmor_profiles/adbd diff --git a/data/configs/android_app b/data/configs/apparmor_profiles/android_app similarity index 100% rename from data/configs/android_app rename to data/configs/apparmor_profiles/android_app diff --git a/data/configs/lxc-waydroid b/data/configs/apparmor_profiles/lxc-waydroid similarity index 100% rename from data/configs/lxc-waydroid rename to data/configs/apparmor_profiles/lxc-waydroid -- 2.47.3