From 63ff50df13d3e767755f0f8a33167d13ed6c543c Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Sun, 16 May 2021 21:15:34 +0100 Subject: [PATCH] Rewrite the configure process. - Install all - Ignore a few - Set flags on specific profile. --- configure | 32 ++-- profiles.manifest => profiles.flags | 248 ++-------------------------- profiles.ignore | 0 3 files changed, 30 insertions(+), 250 deletions(-) rename profiles.manifest => profiles.flags (59%) create mode 100644 profiles.ignore diff --git a/configure b/configure index cc628375..3e76a740 100755 --- a/configure +++ b/configure @@ -49,24 +49,34 @@ initialise() { _init remove_files - mkdir "${ROOT:?}/apparmor.d/profiles" - mv "${ROOT:?}/apparmor.d/groups/"*/* "${ROOT:?}/apparmor.d/profiles/" + echo "Ignore profiles in profiles.ignore." + while read -r profile; do + [[ "$profile" =~ ^\# ]] && continue + if [[ "$profile" == */ ]]; then + find "$ROOT/apparmor.d" -iname "${profile////}" -type d -exec rm -r {} \; + else + find "$ROOT/apparmor.d" -iname "$profile" -type f -exec rm {} \; + fi + done