feat: add initial support for Ubuntu Core.

This commit is contained in:
Alexandre Pujol 2023-02-24 20:38:48 +00:00
parent 11458251c7
commit 0a2efe7fee
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
4 changed files with 50 additions and 11 deletions

24
configure vendored
View File

@ -82,17 +82,20 @@ configure() {
_msg "Configure libexec."
LIBEXEC="/{usr/,}lib"
sed -i -e '/Debian/d' "$ROOT/apparmor.d/tunables/extend"
;;
debian|ubuntu|whonix)
if [[ "$DISTRIBUTION" != "ubuntu" ]]; then
_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
cp -a dists/debian/tunables/* $ROOT/apparmor.d/tunables
fi
debian|ubuntu|whonix|core)
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)
_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
cp -a dists/debian/tunables/* $ROOT/apparmor.d/tunables ;;
esac
_msg "Configure libexec."
LIBEXEC="/{usr/,}libexec"
@ -101,7 +104,6 @@ configure() {
_msg "Displace overwritten files."
_displace_files apparmor.d/tunables/global \
apparmor.d/tunables/xdg-user-dirs apparmor.d/abstractions/trash
;;
opensuse)
@ -229,7 +231,7 @@ full() {
cp -r root/usr/lib/initcpio root/usr/lib/systemd/ "$ROOT/root/usr/lib/"
;;
debian|ubuntu|whonix)
debian|ubuntu|whonix|core)
cp -r root/usr/share/initramfs-tools "$ROOT/root/usr/share/"
;;

View File

@ -0,0 +1,2 @@
[Unit]
After=apparmor.service

22
dists/flags/core.flags Normal file
View File

@ -0,0 +1,22 @@
apport-checkreports complain
apport-gtk complain
apt-esm-hook complain
apt-esm-json-hook complain
check-new-release-gtk complain
do-release-upgrade complain
hwe-support-status complain
list-oem-metapackages complain
livepatch-notification complain
notify-reboot-required complain
package-system-locked attach_disconnected,complain
pro complain
release-upgrade-motd complain
software-properties-gtk complain
ubuntu-advantage complain
ubuntu-advantage-notification complain
ubuntu-distro-info complain
ubuntu-report complain
update-manager attach_disconnected,complain
update-motd-fsck-at-reboot complain
update-motd-updates-available complain
update-notifier complain

13
dists/ignore/core.ignore Normal file
View File

@ -0,0 +1,13 @@
# Archlinux specific
apparmor.d/groups/pacman
root/etc/xdg/autostart/apparmor-notify.desktop
root/usr/share/libalpm
# Software not included in Ubuntu Core
apparmor.d/groups/browsers
apparmor.d/groups/gnome
apparmor.d/groups/gvfs
apparmor.d/groups/virt
apparmor.d/profiles-a-f/flatpak*
apparmor.d/profiles-s-z/steam*