mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-01-18 00:48:10 +01:00
chore: cosmetic.
This commit is contained in:
parent
b43c3fe0c9
commit
78a1d2b26c
1 changed files with 47 additions and 47 deletions
24
configure
vendored
24
configure
vendored
|
@ -23,13 +23,13 @@ process() {
|
|||
mapfile -t files < <(find "${ROOT:?}/apparmor.d" -type f)
|
||||
len="${#files[@]}"
|
||||
nproc=$(nproc)
|
||||
(( nprof = len/nproc + 1 ))
|
||||
((nprof = len / nproc + 1))
|
||||
start=0
|
||||
end=$nprof
|
||||
for ((ii = 0 ; ii < nproc ; ii++)); do
|
||||
for ((ii = 0; ii < nproc; ii++)); do
|
||||
$fct $start $end "${files[@]}" &
|
||||
(( start = end + 1 ))
|
||||
(( end = end + nprof ))
|
||||
((start = end + 1))
|
||||
((end = end + nprof))
|
||||
done
|
||||
wait
|
||||
}
|
||||
|
@ -70,20 +70,20 @@ synchronise() {
|
|||
# Set the distribution specificities
|
||||
configure() {
|
||||
case "$DISTRIBUTION" in
|
||||
arch|endeavouros|cachyos|manjarolinux)
|
||||
arch | endeavouros | cachyos | manjarolinux)
|
||||
_msg "Configure libexec."
|
||||
LIBEXEC="/{usr/,}lib"
|
||||
sed -i -e '/Debian/d' "$ROOT/apparmor.d/tunables/etc.d/apparmor.d"
|
||||
;;
|
||||
|
||||
debian|ubuntu|whonix|core)
|
||||
debian | ubuntu | whonix | core)
|
||||
mv "$ROOT/apparmor.d/abstractions/trash.d/complete" "$ROOT/apparmor.d/abstractions/trash"
|
||||
case "$DISTRIBUTION" in
|
||||
core)
|
||||
mkdir -p $ROOT/root/usr/lib/systemd/system/systemd-udevd.service.d/
|
||||
cp -a dists/core/systemd-udevd.service $ROOT/root/usr/lib/systemd/system/systemd-udevd.service.d/apparmor.conf
|
||||
cp -a apparmor.d/groups/_full/systemd $ROOT/apparmor.d/systemd ;;
|
||||
debian|whonix)
|
||||
debian | whonix)
|
||||
_msg "$DISTRIBUTION does not support abi 3.0 yet."
|
||||
find "$ROOT/apparmor.d" -type f -exec sed -e '/abi /d' -i {} \;
|
||||
cp -a dists/debian/abstractions/* $ROOT/apparmor.d/abstractions
|
||||
|
@ -163,7 +163,7 @@ _resolve_attachments() {
|
|||
entrypoint="${entrypoint# }"
|
||||
|
||||
# If needed nest the attachments
|
||||
IFS=" " read -r -a attachments <<< "$entrypoint"
|
||||
IFS=" " read -r -a attachments <<<"$entrypoint"
|
||||
if [[ "${#attachments[@]}" -ge 2 ]]; then
|
||||
res="/{"
|
||||
for aare in "${attachments[@]}"; do
|
||||
|
@ -181,7 +181,7 @@ _userspace() {
|
|||
ii="$start"
|
||||
while [[ $ii -le $end && $ii -lt $len ]]; do
|
||||
path="${files[$ii]}"
|
||||
(( ii = ii + 1 ))
|
||||
((ii = ii + 1))
|
||||
[[ -f "$path" ]] || continue
|
||||
entrypoint="$(_resolve_attachments "$path")"
|
||||
[[ -z "$entrypoint" ]] && continue
|
||||
|
@ -198,7 +198,7 @@ _complain() {
|
|||
ii="$start"
|
||||
while [[ $ii -le $end && $ii -lt $len ]]; do
|
||||
path="${files[$ii]}"
|
||||
(( ii = ii + 1 ))
|
||||
((ii = ii + 1))
|
||||
[[ -f "$path" ]] || continue
|
||||
mapfile -t flags < <(grep -o -m 1 'flags=(.*)' "$path" | cut -d '(' -f2 | cut -d ')' -f1)
|
||||
[[ "${flags[*]}" =~ complain ]] && continue
|
||||
|
@ -216,11 +216,11 @@ full() {
|
|||
cp -a apparmor.d/groups/_full/init "$ROOT/apparmor.d/"
|
||||
cp -a apparmor.d/groups/_full/systemd "$ROOT/apparmor.d/"
|
||||
case "$DISTRIBUTION" in
|
||||
arch|endeavouros|cachyos|manjarolinux)
|
||||
arch | endeavouros | cachyos | manjarolinux)
|
||||
cp -r root/usr/lib/initcpio root/usr/lib/systemd/ "$ROOT/root/usr/lib/"
|
||||
;;
|
||||
|
||||
debian|ubuntu|whonix|core)
|
||||
debian | ubuntu | whonix | core)
|
||||
cp -r root/usr/share/initramfs-tools "$ROOT/root/usr/share/"
|
||||
;;
|
||||
|
||||
|
|
Loading…
Reference in a new issue