Merge branch 'partial-install' of https://github.com/monsieuremre/apparmor.d into monsieuremre-partial-install
* 'partial-install' of https://github.com/monsieuremre/apparmor.d: dont try abstractions names even more fix fix partial install partial.sh
This commit is contained in:
commit
0c239e788a
2 changed files with 45 additions and 6 deletions
7
Makefile
7
Makefile
|
|
@ -57,12 +57,7 @@ $(P):
|
||||||
@for file in ${TUNABLES}; do \
|
@for file in ${TUNABLES}; do \
|
||||||
install -Dm0644 "${BUILD}/apparmor.d/tunables/$${file}" "${DESTDIR}/etc/apparmor.d/tunables/$${file}"; \
|
install -Dm0644 "${BUILD}/apparmor.d/tunables/$${file}" "${DESTDIR}/etc/apparmor.d/tunables/$${file}"; \
|
||||||
done;
|
done;
|
||||||
@echo "Warning: profile dependencies fallback to unconfined."
|
@bash dists/partial.sh ${@}
|
||||||
@for file in ${@}; do \
|
|
||||||
grep 'rPx' "${BUILD}/apparmor.d/$${file}"; \
|
|
||||||
sed -i -e "s/rPx/rPUx/g" "${BUILD}/apparmor.d/$${file}"; \
|
|
||||||
install -Dvm0644 "${BUILD}/apparmor.d/$${file}" "${DESTDIR}/etc/apparmor.d/$${file}"; \
|
|
||||||
done;
|
|
||||||
@systemctl restart apparmor || systemctl status apparmor
|
@systemctl restart apparmor || systemctl status apparmor
|
||||||
|
|
||||||
dist ?= archlinux
|
dist ?= archlinux
|
||||||
|
|
|
||||||
44
dists/partial.sh
Normal file
44
dists/partial.sh
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
BUILD=.build
|
||||||
|
DESTDIR=/
|
||||||
|
|
||||||
|
for profile in "$@"
|
||||||
|
do
|
||||||
|
if [ ! -f "${BUILD}/apparmor.d/${profile}" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "Installing profile $profile"
|
||||||
|
cp $BUILD/apparmor.d/$profile $DESTDIR/etc/apparmor.d/
|
||||||
|
grep "rPx," "${BUILD}/apparmor.d/${profile}" | while read line
|
||||||
|
do
|
||||||
|
if [[ -z "$line" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
dep=$(echo "$line" | awk '{print $1}')
|
||||||
|
dep=$(echo $dep | awk -F"/" '{print $NF}')
|
||||||
|
dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
|
||||||
|
for i in $dep
|
||||||
|
do
|
||||||
|
i=$(echo $i | awk -F"/" '{print $NF}')
|
||||||
|
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
|
||||||
|
bash "$0" "$i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
grep "rPx -> " "${BUILD}/apparmor.d/${profile}" | while read line
|
||||||
|
do
|
||||||
|
if [[ -z "$line" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
dep=${line%%#*}
|
||||||
|
dep=$(echo $dep | awk '{print $NF}')
|
||||||
|
dep=${dep::-1}
|
||||||
|
dep=$(eval "ls ${BUILD}/apparmor.d/${dep} 2>/dev/null")
|
||||||
|
for i in $dep
|
||||||
|
do
|
||||||
|
i=$(echo $i | awk -F"/" '{print $NF}')
|
||||||
|
if [ ! -f "$DESTDIR/etc/apparmor.d/$i" ]; then
|
||||||
|
bash "$0" "$i"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
done
|
||||||
Loading…
Add table
Add a link
Reference in a new issue