From 0a2efe7fee000966a9cdbfa55edd81061d7be8bb Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Fri, 24 Feb 2023 20:38:48 +0000 Subject: [PATCH] feat: add initial support for Ubuntu Core. --- configure | 24 +++++++++++++----------- dists/core/systemd-udevd.service | 2 ++ dists/flags/core.flags | 22 ++++++++++++++++++++++ dists/ignore/core.ignore | 13 +++++++++++++ 4 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 dists/core/systemd-udevd.service create mode 100644 dists/flags/core.flags create mode 100644 dists/ignore/core.ignore diff --git a/configure b/configure index f0c41eb7..753762e0 100755 --- a/configure +++ b/configure @@ -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/" ;; diff --git a/dists/core/systemd-udevd.service b/dists/core/systemd-udevd.service new file mode 100644 index 00000000..544fb7da --- /dev/null +++ b/dists/core/systemd-udevd.service @@ -0,0 +1,2 @@ +[Unit] +After=apparmor.service diff --git a/dists/flags/core.flags b/dists/flags/core.flags new file mode 100644 index 00000000..c491729d --- /dev/null +++ b/dists/flags/core.flags @@ -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 diff --git a/dists/ignore/core.ignore b/dists/ignore/core.ignore new file mode 100644 index 00000000..910e5942 --- /dev/null +++ b/dists/ignore/core.ignore @@ -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* +