Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] apparmor: load profiles in parallel
@ 2021-02-14 21:41 thypon
  2021-02-14 21:44 ` [PR PATCH] [Updated] " thypon
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: thypon @ 2021-02-14 21:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 389 bytes --]

There is a new pull request by thypon against master on the void-packages repository

https://github.com/thypon/void-packages apparmor-parallel
https://github.com/void-linux/void-packages/pull/28766

apparmor: load profiles in parallel
Just a quick mod for parallelizing apparmor profiles on load.

A patch file from https://github.com/void-linux/void-packages/pull/28766.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-apparmor-parallel-28766.patch --]
[-- Type: text/x-diff, Size: 1724 bytes --]

From 0585ebbc1ec27087f3e1d90f910d24c44c244aec Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <abc@pompel.me>
Date: Sun, 14 Feb 2021 21:39:38 +0000
Subject: [PATCH] apparmor: load profiles in parallel

---
 srcpkgs/apparmor/template               |  2 +-
 srcpkgs/runit-void/files/09-apparmor.sh | 12 +++---------
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/apparmor/template b/srcpkgs/apparmor/template
index 6e7300cff1e..dfbd3ef472f 100644
--- a/srcpkgs/apparmor/template
+++ b/srcpkgs/apparmor/template
@@ -1,7 +1,7 @@
 # Template file for 'apparmor'
 pkgname=apparmor
 version=3.0.1
-revision=2
+revision=3
 wrksrc="${pkgname}-v${version}"
 build_wrksrc=libraries/libapparmor
 build_style=gnu-configure
diff --git a/srcpkgs/runit-void/files/09-apparmor.sh b/srcpkgs/runit-void/files/09-apparmor.sh
index 7d8d09ee80f..e5ce9e9af72 100644
--- a/srcpkgs/runit-void/files/09-apparmor.sh
+++ b/srcpkgs/runit-void/files/09-apparmor.sh
@@ -18,15 +18,9 @@ if [ -n "$APPARMOR" ]; then
 	[ "$APPARMOR" = "complain" ] && AACOMPLAIN="-C"
 
 	if [ -d /etc/apparmor.d -a -x /usr/bin/apparmor_parser ]; then
-		for profile in /etc/apparmor.d/*; do
-		case "$profile" in
-			*.new-*_*) continue ;;
-		esac
-		if [ -f "$profile" ]; then
-			printf '* Load profile %s: %s\n' "($APPARMOR)" "$profile"
-			apparmor_parser -a $AACOMPLAIN "$profile"
-		fi
-		done
+		find /etc/apparmor.d -maxdepth 1 -type f ! -name '*.new-*_*' |\
+			xargs -d"\n" -I{} --max-procs="$(grep -c ^processor /proc/cpuinfo)" \
+				bash -c "printf '* Load profile %s: %s\n' '($APPARMOR)' '{}'; apparmor_parser -a $AACOMPLAIN '{}'"
 	else
 		printf '! AppArmor installation problem - ensure you have installed apparmor package\n'
 	fi

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-02-15 22:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 21:41 [PR PATCH] apparmor: load profiles in parallel thypon
2021-02-14 21:44 ` [PR PATCH] [Updated] " thypon
2021-02-14 21:49 ` [PR REVIEW] " ericonr
2021-02-14 21:51 ` thypon
2021-02-14 21:54 ` [PR PATCH] [Updated] " thypon
2021-02-14 21:58 ` [PR REVIEW] " Gottox
2021-02-14 22:10 ` CameronNemo
2021-02-14 22:28 ` [PR REVIEW] " thypon
2021-02-14 22:29 ` thypon
2021-02-14 22:31 ` Duncaen
2021-02-14 22:38 ` Duncaen
2021-02-14 22:38 ` Duncaen
2021-02-14 23:05 ` [PR PATCH] [Updated] " thypon
2021-02-14 23:06 ` thypon
2021-02-14 23:19 ` [PR PATCH] [Updated] " thypon
2021-02-14 23:21 ` thypon
2021-02-15 22:52 ` [PR PATCH] [Merged]: " thypon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).