From 629433d3c409d637c6c223f1b615d4d352b99743 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti de Araujo Date: Tue, 15 Jul 2014 17:35:28 -0300 Subject: [PATCH] Precompiling apparmor policies on touch --- debian/changelog | 6 +++ .../90-precompile-apparmor-policies.chroot | 9 ++++ .../var/cache/apparmor/.features | 48 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100755 live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot create mode 100644 live-build/ubuntu-touch/includes.chroot/var/cache/apparmor/.features diff --git a/debian/changelog b/debian/changelog index 6607ef0a..ba517ecd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.222) UNRELEASED; urgency=medium + + * Precompiling apparmor policies on touch + + -- Ricardo Salveti de Araujo Tue, 15 Jul 2014 17:34:38 -0300 + livecd-rootfs (2.221) utopic; urgency=medium * Adding android_nvram group to the touch image diff --git a/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot new file mode 100755 index 00000000..36779203 --- /dev/null +++ b/live-build/ubuntu-touch/hooks/90-precompile-apparmor-policies.chroot @@ -0,0 +1,9 @@ +#!/bin/sh + +FEATURES=/var/cache/apparmor/.features + +echo "I: precompiling click apparmor policies" +/sbin/apparmor_parser -M ${FEATURES} -Q --write-cache --cache-loc=/var/cache/apparmor/ `find /var/lib/apparmor/profiles/ -maxdepth 1 -type f -not -path '*/\.*'` + +echo "I: precompiling deb apparmor policies" +/sbin/apparmor_parser -M ${FEATURES} -Q --write-cache --cache-loc=/etc/apparmor.d/cache/ `find /etc/apparmor.d/ -maxdepth 1 -type f -not -path '*/\.*'` diff --git a/live-build/ubuntu-touch/includes.chroot/var/cache/apparmor/.features b/live-build/ubuntu-touch/includes.chroot/var/cache/apparmor/.features new file mode 100644 index 00000000..652f78d9 --- /dev/null +++ b/live-build/ubuntu-touch/includes.chroot/var/cache/apparmor/.features @@ -0,0 +1,48 @@ +dbus {mask {acquire send receive +} +} +signal {mask {hup int quit ill trap abrt bus fpe kill usr1 segv usr2 pipe alrm term stkflt chld cont stop stp ttin ttou urg xcpu xfsz vtalrm prof winch io pwr sys emt lost +} +} +ptrace {mask {read trace +} +} +caps {mask {chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_module sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease audit_write audit_control setfcap mac_override mac_admin syslog wake_alarm epollwakeup +} +} +rlimit {mask {cpu fsize data stack core rss nproc nofile memlock as locks sigpending msgqueue nice rtprio rttime +} +} +capability {0xffffff +} +namespaces {pivot_root {yes +} +profile {yes +} +} +mount {mask {mount umount +} +} +network {af_mask {unspec unix local inet ax25 ipx appletalk netrom bridge atmpvc x25 inet6 rose netbeui security key netlink packet ash econet atmsvc rds sna irda pppox wanpipe llc can tipc bluetooth iucv rxrpc isdn phonet ieee802154 caif alg nfc max +} +} +file {mask {create read write exec append mmap_exec link lock +} +} +domain {change_profile {yes +} +change_onexec {yes +} +change_hatv {yes +} +change_hat {yes +} +} +policy {set_load {yes +} +versions {v6 {yes +} +v5 {yes +} +} +}