lxc/debian/lxc-pve.preinst
Fabian Grünbichler 39840a317e replace AA's feature-set with custom one
Debian's apparmor package introduced feature-set pinning in Debian
Stretch 9.4 to prevent problems with AA profiles packaged in Debian
Stretch which target Debian Stretch's 4.9 based kernel.

Since our LXC profiles rely on features not included in this feature
set, we need to replace the pinned feature-set with our own.

The features file is not a conf-file, so it is possible to just
dpkg-divert it on installation/upgrades.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2018-03-05 14:45:13 +01:00

26 lines
523 B
Bash

#! /bin/sh
set -e
# divert apparmor feature pinning file
# Debian 9.4+ pins to a kernel 4.9 feature set which breaks mount
# mediation, among other things
aa_feature_add_diversion() {
dpkg-divert --package lxc-pve --add --rename \
--divert /usr/share/apparmor-features/features.stock \
/usr/share/apparmor-features/features
}
case "$1" in
upgrade)
if dpkg --compare-versions "$2" 'lt' '2.1.1-3'; then
aa_feature_add_diversion
fi
;;
*)
aa_feature_add_diversion
;;
esac
exit 0