Skip to contentSkip to conversation

package/apparmor: new package (branch yem/apparmor)

PATCH Superseded Yann E. MORIN 2 participants 21 messages Mar 29, 2020 – Apr 20, 2020

lore
Share & tools
lore
#0 lore raw

v5 cover package/apparmor: new package (branch yem/apparmor)

Hello All!

This series is reworked of the previous work from Angelo:

    http://lists.busybox.net/pipermail/buildroot/2020-March/278308.html
    http://lists.busybox.net/pipermail/buildroot/2020-March/278307.html

Fundamentally, (almost) all the code is from Angelo, and it has jsut been spread across two packages.

The way the apparmor package is laid out is not very amenable at doing a single package that builds everything: all the tools and utils depend on libapparmor, and that is better installed before the build of the tools is attempted.

So, we split the packaging in two:

- libapparmor, which is siolely responsible for installing libapparmor and its python3 bindings,

- apparmor per-se, which is responsible for installing all the tools and utilities.

To be noted: most of the tools' Makefiles hard-code linking to the static libapparmor (without explanations), so rather than go against the tide, we just enforce building the static library (note also that we do not forbid building the shared one).

The only major part that was dropped from the initial series, is support for writign the cache on read-write filesystems. The codition was based on BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW, but that does not prevent building an actually read-only filesystem at all (e.g. squashfs). So, more thoughts will have to be poured into this caching feature in a subsequent series.

Chage v4 -> v5: (adopted by Yann)
- split in two packages, one for the lib, ione for the utils
- reword all the commit logs
- fix dependencies (threads, mmu...)
- re-organise the conditions to install utils (python3 vs others)
- drop the cache writing for read-write filesystems

Regards,
Yann E. MORIN.

The following changes since commit d0f5a5551ab86f6272f13deaa16dcdf4b07a524f

package/sysstat: bump to version 12.2.1 (2020-03-29 15:50:36 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 8b4415dad37fa81cf2d4adb09b27119b233bcd8a

package/apparmor: enable apache integration (2020-03-29 16:01:18 +0200)

----------------------------------------------------------------
Angelo Compagnucci (4):
package/libapparmor: new package
linux: enable AppArmor-related options if needed package/apparmor: new package package/apparmor: add option to install binutils

Yann E. MORIN (5):
package/apparmor: add options to install utils package/apparmor: add option to install generic profiles package/libapparmor: enable python bindings package/apparmor: enable PAM integration package/apparmor: enable apache integration

 DEVELOPERS                                         |  1 +
 linux/linux.mk                                     |  5 ++
 package/Config.in                                  |  2 +
 package/apparmor/Config.in                         | 71 ++++++++++++++++
 package/apparmor/apparmor.hash                     |  4 +
 package/apparmor/apparmor.mk                       | 81 ++++++++++++++++++
 ...n_devel-fixing-for-crosscompiling-environ.patch | 96 ++++++++++++++++++++++
 ...-fixing-setup.py-call-when-crosscompiling.patch | 30 +++++++
 package/libapparmor/Config.in                      | 16 ++++
 package/libapparmor/libapparmor.hash               |  4 +
 package/libapparmor/libapparmor.mk                 | 41 +++++++++
 11 files changed, 351 insertions(+)
 create mode 100644 package/apparmor/Config.in
 create mode 100644 package/apparmor/apparmor.hash
 create mode 100644 package/apparmor/apparmor.mk
 create mode 100644 package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch
 create mode 100644 package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch
 create mode 100644 package/libapparmor/Config.in
 create mode 100644 package/libapparmor/libapparmor.hash
 create mode 100644 package/libapparmor/libapparmor.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH v5 1/9 package/libapparmor: new package

From: Angelo Compagnucci <[email protected]>

The layout of the package is not amenable to building both the library and the utilities at once, so this package will only install the libarary.

The other apparmor-related tools however will almost all want to always link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also force the build of the static library.

The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.

We need to force the C standard to gnu99, otherwise:

- autoconf uses wchar_t in C99 test, so considers it to be missing on toolchains without wchar, but wchar is not otherwise needed for libapparmor;

- c99 is not enough, otherwise the build fails with errors like:

        kernel.c:503:15: error: expected declaration specifiers or ?...? before ?(? token
         extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
                       ^
[yann.morin.1998 at free.fr: strip down the patch to only build the lib]
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/libapparmor/Config.in        | 16 ++++++++++++++++
 package/libapparmor/libapparmor.hash |  4 ++++
 package/libapparmor/libapparmor.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 49 insertions(+)
 create mode 100644 package/libapparmor/Config.in
 create mode 100644 package/libapparmor/libapparmor.hash
 create mode 100644 package/libapparmor/libapparmor.mk
DEVELOPERS +1 -0
index f67ef86e6c..142f3b406d 100644
@@ -196,6 +196,7 @@ N:	Angelo Compagnucci <[email protected]>
 F:	package/corkscrew/
 F:	package/fail2ban/
 F:	package/i2c-tools/
+F:	package/libapparmor/
 F:	package/mender/
 F:	package/mender-artifact/
 F:	package/mono/
package/Config.in +1 -0
index 7b73198d50..ae1bc2294d 100644
@@ -1882,6 +1882,7 @@ endif
 endmenu
 
 menu "Security"
+	source "package/libapparmor/Config.in"
 	source "package/libselinux/Config.in"
 	source "package/libsemanage/Config.in"
 	source "package/libsepol/Config.in"
package/libapparmor/Config.in new file +16 -0
new file mode 100644
index 0000000000..a444a5708b
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_LIBAPPARMOR
+	bool "libapparmor"
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
+	help
+	  AppArmor is an effective and easy-to-use Linux application
+	  security system. AppArmor proactively protects the operating
+	  system and applications from external or internal threats,
+	  even zero-day attacks, by enforcing good behavior and
+	  preventing even unknown application flaws from being
+	  exploited.
+
+	  This package installs only the library.
+
+	  http://wiki.apparmor.net
package/libapparmor/libapparmor.hash new file +4 -0
new file mode 100644
index 0000000000..3bff2bc853
@@ -0,0 +1,4 @@
+# locally computed
+sha256  267053234c68cdb122c5294d7c276b6e2f5fa7e75c6c2d23e3ce69f95d9a7639  apparmor-2.13.3.tar.gz
+sha256  a7e0cdcbea5c14927cedfc600d46526bdcbb1eb0a4d951e2ea53c2a6de159cb4  LICENSE
+sha256  6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  libraries/libapparmor/COPYING.LGPL
package/libapparmor/libapparmor.mk new file +27 -0
new file mode 100644
index 0000000000..12efd4335a
@@ -0,0 +1,27 @@
+################################################################################
+#
+# libapparmor
+#
+################################################################################
+
+LIBAPPARMOR_VERSION_MAJOR = 2.13
+LIBAPPARMOR_VERSION = $(LIBAPPARMOR_VERSION_MAJOR).3
+LIBAPPARMOR_SOURCE = apparmor-$(LIBAPPARMOR_VERSION).tar.gz
+LIBAPPARMOR_SITE = https://launchpad.net/apparmor/$(LIBAPPARMOR_VERSION_MAJOR)/$(LIBAPPARMOR_VERSION)/+download
+LIBAPPARMOR_LICENSE = LGPL-2.1
+LIBAPPARMOR_LICENSE_FILES = LICENSE libraries/libapparmor/COPYING.LGPL
+
+LIBAPPARMOR_DEPENDENCIES = host-bison host-flex host-pkgconf
+LIBAPPARMOR_SUBDIR = libraries/libapparmor
+LIBAPPARMOR_INSTALL_STAGING = YES
+
+# Most AppArmor tools will want to link to the static lib.
+# ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
+# provided by autoconf relies on wchar_t.
+LIBAPPARMOR_CONF_OPTS = \
+	ac_cv_prog_cc_c99=-std=gnu99 \
+	--enable-static \
+	--enable-man-pages=no \
+	--without-python
+
+$(eval $(autotools-package))
Signature · 1 line
2.20.1
#2 lore raw

PATCH v5 1/9 package/libapparmor: new package

Quoted 20 lines · Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

The layout of the package is not amenable to building both the library and the utilities at once, so this package will only install the libarary.

The other apparmor-related tools however will almost all want to always link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also force the build of the static library.

The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.

We need to force the C standard to gnu99, otherwise:

- autoconf uses wchar_t in C99 test, so considers it to be missing on toolchains without wchar, but wchar is not otherwise needed for libapparmor;

Quoted 8 lines

- c99 is not enough, otherwise the build fails with errors like:

        kernel.c:503:15: error: expected declaration specifiers or ?...? before ?(? token
         extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
                       ^
[yann.morin.1998 at free.fr: strip down the patch to only build the lib]
Quoted 103 lines
---
 DEVELOPERS                           |  1 +
 package/Config.in                    |  1 +
 package/libapparmor/Config.in        | 16 ++++++++++++++++
 package/libapparmor/libapparmor.hash |  4 ++++
 package/libapparmor/libapparmor.mk   | 27 +++++++++++++++++++++++++++
 5 files changed, 49 insertions(+)
 create mode 100644 package/libapparmor/Config.in
 create mode 100644 package/libapparmor/libapparmor.hash
 create mode 100644 package/libapparmor/libapparmor.mk
DEVELOPERS +1 -0
index f67ef86e6c..142f3b406d 100644
@@ -196,6 +196,7 @@ N:  Angelo Compagnucci <[email protected]>
 F:     package/corkscrew/
 F:     package/fail2ban/
 F:     package/i2c-tools/
+F:     package/libapparmor/
 F:     package/mender/
 F:     package/mender-artifact/
 F:     package/mono/
package/Config.in +1 -0
index 7b73198d50..ae1bc2294d 100644
@@ -1882,6 +1882,7 @@ endif
 endmenu
 
 menu "Security"
+       source "package/libapparmor/Config.in"
        source "package/libselinux/Config.in"
        source "package/libsemanage/Config.in"
        source "package/libsepol/Config.in"
package/libapparmor/Config.in new file +16 -0
new file mode 100644
index 0000000000..a444a5708b
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_LIBAPPARMOR
+       bool "libapparmor"
+       depends on BR2_TOOLCHAIN_HAS_SYNC_4
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16
+       help
+         AppArmor is an effective and easy-to-use Linux application
+         security system. AppArmor proactively protects the operating
+         system and applications from external or internal threats,
+         even zero-day attacks, by enforcing good behavior and
+         preventing even unknown application flaws from being
+         exploited.
+
+         This package installs only the library.
+
+         http://wiki.apparmor.net
package/libapparmor/libapparmor.hash new file +4 -0
new file mode 100644
index 0000000000..3bff2bc853
@@ -0,0 +1,4 @@
+# locally computed
+sha256  267053234c68cdb122c5294d7c276b6e2f5fa7e75c6c2d23e3ce69f95d9a7639  apparmor-2.13.3.tar.gz
+sha256  a7e0cdcbea5c14927cedfc600d46526bdcbb1eb0a4d951e2ea53c2a6de159cb4  LICENSE
+sha256  6095e9ffa777dd22839f7801aa845b31c9ed07f3d6bf8a26dc5d2dec8ccc0ef3  libraries/libapparmor/COPYING.LGPL
package/libapparmor/libapparmor.mk new file +27 -1
new file mode 100644
index 0000000000..12efd4335a
@@ -0,0 +1,27 @@
+################################################################################
+#
+# libapparmor
+#
+################################################################################
+
+LIBAPPARMOR_VERSION_MAJOR = 2.13
+LIBAPPARMOR_VERSION = $(LIBAPPARMOR_VERSION_MAJOR).3
+LIBAPPARMOR_SOURCE = apparmor-$(LIBAPPARMOR_VERSION).tar.gz
+LIBAPPARMOR_SITE = https://launchpad.net/apparmor/$(LIBAPPARMOR_VERSION_MAJOR)/$(LIBAPPARMOR_VERSION)/+download
+LIBAPPARMOR_LICENSE = LGPL-2.1
+LIBAPPARMOR_LICENSE_FILES = LICENSE libraries/libapparmor/COPYING.LGPL
+
+LIBAPPARMOR_DEPENDENCIES = host-bison host-flex host-pkgconf
+LIBAPPARMOR_SUBDIR = libraries/libapparmor
+LIBAPPARMOR_INSTALL_STAGING = YES
+
+# Most AppArmor tools will want to link to the static lib.
+# ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
+# provided by autoconf relies on wchar_t.
+LIBAPPARMOR_CONF_OPTS = \
+       ac_cv_prog_cc_c99=-std=gnu99 \
+       --enable-static \
+       --enable-man-pages=no \
+       --without-python
+
+$(eval $(autotools-package))
--

2.20.1

#3 lore raw

PATCH v5 2/9 linux: enable AppArmor-related options if needed

In reply to Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

Using AppArmor requires support in the kernel, so do for AppArmor what we did for SElinux, and enabled the necessary options.

Note that a single LSM can be the default one, so as of today, SELinux wins, by virtue of being the last to be enabled.

[yann.morin.1998 at free.fr:
- don't force DEFAULT_SECURITY_APPARMOR, it does not exist in all kernel versions
- move closer to SELinux
- split into its own patch, write a commit log
]

---
 linux/linux.mk | 5 +++++
 1 file changed, 5 insertions(+)
linux/linux.mk +5 -0
index b2ceeecafb..9403612d27 100644
@@ -408,6 +408,11 @@ define LINUX_KCONFIG_FIXUP_CMDS
 		$(call KCONFIG_ENABLE_OPT,CONFIG_FB,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))
+	$(if $(BR2_PACKAGE_LIBAPPARMOR),
+		$(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_APPARMOR,$(@D)/.config)
+		$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_APPARMOR,$(@D)/.config))
 	$(if $(BR2_PACKAGE_LIBSELINUX),
 		$(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)
 		$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_SELINUX,$(@D)/.config)
Signature · 1 line
2.20.1
#4 lore raw

PATCH v5 2/9 linux: enable AppArmor-related options if needed

Quoted 9 lines · Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

Using AppArmor requires support in the kernel, so do for AppArmor what we did for SElinux, and enabled the necessary options.

Note that a single LSM can be the default one, so as of today, SELinux wins, by virtue of being the last to be enabled.

Quoted 8 lines

[yann.morin.1998 at free.fr:
- don't force DEFAULT_SECURITY_APPARMOR, it does not exist in all kernel versions
- move closer to SELinux
- split into its own patch, write a commit log
]

Quoted 23 lines
---
 linux/linux.mk | 5 +++++
 1 file changed, 5 insertions(+)
linux/linux.mk +5 -1
index b2ceeecafb..9403612d27 100644
@@ -408,6 +408,11 @@ define LINUX_KCONFIG_FIXUP_CMDS
                $(call KCONFIG_ENABLE_OPT,CONFIG_FB,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_LOGO_LINUX_CLUT224,$(@D)/.config))
+       $(if $(BR2_PACKAGE_LIBAPPARMOR),
+               $(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_APPARMOR,$(@D)/.config)
+               $(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_APPARMOR,$(@D)/.config))
        $(if $(BR2_PACKAGE_LIBSELINUX),
                $(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT,$(@D)/.config)
                $(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_SELINUX,$(@D)/.config)
--

2.20.1

#5 lore raw

PATCH v5 3/9 package/apparmor: new package

In reply to Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

The various AppArmor utilities are spread in a few sub-directories of the apparmor source tree. For now, we build only the parser, but we'll soon introduce support for a few other utilities, so we prepare the package to be able to build more than just the parser, hence the slightly convoluted build and install commands, and the use of the APPARMOR_TOOLS and APPARMOR_MAKE_OPTS variables, which will come handy in the following commits.

We must ensure the version matches that of libapparmor, but there is not much we can do to enforce that, so as we do for various other packages, we just add a comment to that effect.

[yann.morin.1998 at free.fr:
- make it a separate package
- split into its own patch, write a commit log
]

---
 package/Config.in                  |  1 +
 package/apparmor/Config.in         | 19 ++++++++++++
 package/apparmor/apparmor.hash     |  4 +++
 package/apparmor/apparmor.mk       | 48 ++++++++++++++++++++++++++++++
 package/libapparmor/libapparmor.mk |  1 +
 5 files changed, 73 insertions(+)
 create mode 100644 package/apparmor/Config.in
 create mode 100644 package/apparmor/apparmor.hash
 create mode 100644 package/apparmor/apparmor.mk
package/Config.in +1 -0
index ae1bc2294d..759c21f994 100644
@@ -2244,6 +2244,7 @@ menu "Real-Time"
 endmenu
 
 menu "Security"
+	source "package/apparmor/Config.in"
 	source "package/checkpolicy/Config.in"
 	source "package/ima-evm-utils/Config.in"
 	source "package/optee-benchmark/Config.in"
package/apparmor/Config.in new file +19 -0
new file mode 100644
index 0000000000..d35740ca73
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_APPARMOR
+	bool "apparmor"
+	depends on BR2_USE_MMU # fork()
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libapparmor
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libapparmor
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # libapparmor
+	select BR2_PACKAGE_LIBAPPARMOR
+	help
+	  AppArmor is an effective and easy-to-use Linux application
+	  security system. AppArmor proactively protects the operating
+	  system and applications from external or internal threats,
+	  even zero-day attacks, by enforcing good behavior and
+	  preventing even unknown application flaws from being
+	  exploited.
+
+	  This package builds the parser (which can load profiles).
+
+	  http://wiki.apparmor.net
package/apparmor/apparmor.hash new file +4 -0
new file mode 100644
index 0000000000..91ab51f6ab
@@ -0,0 +1,4 @@
+# locally computed
+sha256  267053234c68cdb122c5294d7c276b6e2f5fa7e75c6c2d23e3ce69f95d9a7639  apparmor-2.13.3.tar.gz
+sha256  a7e0cdcbea5c14927cedfc600d46526bdcbb1eb0a4d951e2ea53c2a6de159cb4  LICENSE
+sha256  dd54950fa69a3096fe907a466a454d217ccca9bca77398d5232704766d5a0040  parser/COPYING.GPL
package/apparmor/apparmor.mk new file +48 -0

48 lines not on this page · raw message

package/libapparmor/libapparmor.mk +1 -0
index 12efd4335a..8173d138d6 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When updating the version here, please also update the apparmor package
 LIBAPPARMOR_VERSION_MAJOR = 2.13
 LIBAPPARMOR_VERSION = $(LIBAPPARMOR_VERSION_MAJOR).3
 LIBAPPARMOR_SOURCE = apparmor-$(LIBAPPARMOR_VERSION).tar.gz
Signature · 1 line
2.20.1
#6 lore raw

PATCH v5 3/9 package/apparmor: new package

Quoted 15 lines · Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

The various AppArmor utilities are spread in a few sub-directories of the apparmor source tree. For now, we build only the parser, but we'll soon introduce support for a few other utilities, so we prepare the package to be able to build more than just the parser, hence the slightly convoluted build and install commands, and the use of the APPARMOR_TOOLS and APPARMOR_MAKE_OPTS variables, which will come handy in the following commits.

We must ensure the version matches that of libapparmor, but there is not much we can do to enforce that, so as we do for various other packages, we just add a comment to that effect.

Quoted 6 lines

[yann.morin.1998 at free.fr:
- make it a separate package
- split into its own patch, write a commit log
]

Quoted 127 lines
---
 package/Config.in                  |  1 +
 package/apparmor/Config.in         | 19 ++++++++++++
 package/apparmor/apparmor.hash     |  4 +++
 package/apparmor/apparmor.mk       | 48 ++++++++++++++++++++++++++++++
 package/libapparmor/libapparmor.mk |  1 +
 5 files changed, 73 insertions(+)
 create mode 100644 package/apparmor/Config.in
 create mode 100644 package/apparmor/apparmor.hash
 create mode 100644 package/apparmor/apparmor.mk
package/Config.in +1 -0
index ae1bc2294d..759c21f994 100644
@@ -2244,6 +2244,7 @@ menu "Real-Time"
 endmenu
 
 menu "Security"
+       source "package/apparmor/Config.in"
        source "package/checkpolicy/Config.in"
        source "package/ima-evm-utils/Config.in"
        source "package/optee-benchmark/Config.in"
package/apparmor/Config.in new file +19 -0
new file mode 100644
index 0000000000..d35740ca73
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_APPARMOR
+       bool "apparmor"
+       depends on BR2_USE_MMU # fork()
+       depends on BR2_INSTALL_LIBSTDCPP
+       depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libapparmor
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libapparmor
+       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_16 # libapparmor
+       select BR2_PACKAGE_LIBAPPARMOR
+       help
+         AppArmor is an effective and easy-to-use Linux application
+         security system. AppArmor proactively protects the operating
+         system and applications from external or internal threats,
+         even zero-day attacks, by enforcing good behavior and
+         preventing even unknown application flaws from being
+         exploited.
+
+         This package builds the parser (which can load profiles).
+
+         http://wiki.apparmor.net
package/apparmor/apparmor.hash new file +4 -0
new file mode 100644
index 0000000000..91ab51f6ab
@@ -0,0 +1,4 @@
+# locally computed
+sha256  267053234c68cdb122c5294d7c276b6e2f5fa7e75c6c2d23e3ce69f95d9a7639  apparmor-2.13.3.tar.gz
+sha256  a7e0cdcbea5c14927cedfc600d46526bdcbb1eb0a4d951e2ea53c2a6de159cb4  LICENSE
+sha256  dd54950fa69a3096fe907a466a454d217ccca9bca77398d5232704766d5a0040  parser/COPYING.GPL
package/apparmor/apparmor.mk new file +48 -0
new file mode 100644
index 0000000000..cab37d06a6
@@ -0,0 +1,48 @@
+################################################################################
+#
+# apparmor
+#
+################################################################################
+
+# When updating the version here, please also update the libapparmor package
+APPARMOR_VERSION_MAJOR = 2.13
+APPARMOR_VERSION = $(APPARMOR_VERSION_MAJOR).3
+APPARMOR_SITE = https://launchpad.net/apparmor/$(APPARMOR_VERSION_MAJOR)/$(APPARMOR_VERSION)/+download
+APPARMOR_DL_SUBDIR = libapparmor
+APPARMOR_LICENSE = GPL-2.0
+APPARMOR_LICENSE_FILES = LICENSE parser/COPYING.GPL
+
+APPARMOR_DEPENDENCIES = libapparmor
+
+APPARMOR_TOOLS = parser
+APPARMOR_MAKE_OPTS = USE_SYSTEM=1
+
+define APPARMOR_BUILD_CMDS
+       $(foreach tool,$(APPARMOR_TOOLS),\
+               $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
+               $(MAKE) -C $(@D)/$(tool) $(APPARMOR_MAKE_OPTS)
+       )
+endef
+
+define APPARMOR_INSTALL_TARGET_CMDS
+       $(foreach tool,$(APPARMOR_TOOLS),\
+               $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
+               $(MAKE) -C $(@D)/$(tool) $(APPARMOR_MAKE_OPTS) \
+                       DESTDIR=$(TARGET_DIR) install
+       )
+endef
+
+# Despite its name, apparmor.systemd is a sysv-init compatible startup script
+define APPARMOR_INSTALL_INIT_SYSV
+       $(INSTALL) -D -m 0755 $(@D)/parser/apparmor.systemd \
+               $(TARGET_DIR)/etc/init.d/S00apparmor
+endef
+
+define APPARMOR_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 0755 $(@D)/parser/apparmor.systemd \
+               $(TARGET_DIR)/lib/apparmor/apparmor.systemd
+       $(INSTALL) -D -m 0755 $(@D)/parser/apparmor.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/apparmor.service
+endef
+
+$(eval $(generic-package))
package/libapparmor/libapparmor.mk +1 -1
index 12efd4335a..8173d138d6 100644
@@ -4,6 +4,7 @@
 #
 ################################################################################
 
+# When updating the version here, please also update the apparmor package
 LIBAPPARMOR_VERSION_MAJOR = 2.13
 LIBAPPARMOR_VERSION = $(LIBAPPARMOR_VERSION_MAJOR).3
 LIBAPPARMOR_SOURCE = apparmor-$(LIBAPPARMOR_VERSION).tar.gz
--

2.20.1

#7 lore raw

PATCH v5 4/9 package/apparmor: add option to install binutils

In reply to Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

[yann.morin.1998 at free.fr: split off to its own patch]
---
 package/apparmor/Config.in   | 10 ++++++++++
 package/apparmor/apparmor.mk |  4 ++++
 2 files changed, 14 insertions(+)
package/apparmor/Config.in +10 -0
index d35740ca73..d3941200c6 100644
@@ -17,3 +17,13 @@ config BR2_PACKAGE_APPARMOR
 	  This package builds the parser (which can load profiles).
 
 	  http://wiki.apparmor.net
+
+if BR2_PACKAGE_APPARMOR
+
+config BR2_PACKAGE_APPARMOR_BINUTILS
+	bool "binutils"
+	help
+	  A set of utilities (written in C):
+	    aa-enabled    aa-exec
+
+endif
package/apparmor/apparmor.mk +4 -0
index cab37d06a6..9ee5304a16 100644
@@ -17,6 +17,10 @@ APPARMOR_DEPENDENCIES = libapparmor
 APPARMOR_TOOLS = parser
 APPARMOR_MAKE_OPTS = USE_SYSTEM=1
 
+ifeq ($(BR2_PACKAGE_APPARMOR_BINUTILS),y)
+APPARMOR_TOOLS += binutils
+endif
+
 define APPARMOR_BUILD_CMDS
 	$(foreach tool,$(APPARMOR_TOOLS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
2.20.1
#8 lore raw

PATCH v5 4/9 package/apparmor: add option to install binutils

Quoted 6 lines · Yann E. MORIN

From: Angelo Compagnucci <[email protected]>

[yann.morin.1998 at free.fr: split off to its own patch]
Quoted 41 lines
---
 package/apparmor/Config.in   | 10 ++++++++++
 package/apparmor/apparmor.mk |  4 ++++
 2 files changed, 14 insertions(+)
package/apparmor/Config.in +10 -0
index d35740ca73..d3941200c6 100644
@@ -17,3 +17,13 @@ config BR2_PACKAGE_APPARMOR
          This package builds the parser (which can load profiles).
 
          http://wiki.apparmor.net
+
+if BR2_PACKAGE_APPARMOR
+
+config BR2_PACKAGE_APPARMOR_BINUTILS
+       bool "binutils"
+       help
+         A set of utilities (written in C):
+           aa-enabled    aa-exec
+
+endif
package/apparmor/apparmor.mk +4 -1
index cab37d06a6..9ee5304a16 100644
@@ -17,6 +17,10 @@ APPARMOR_DEPENDENCIES = libapparmor
 APPARMOR_TOOLS = parser
 APPARMOR_MAKE_OPTS = USE_SYSTEM=1
 
+ifeq ($(BR2_PACKAGE_APPARMOR_BINUTILS),y)
+APPARMOR_TOOLS += binutils
+endif
+
 define APPARMOR_BUILD_CMDS
        $(foreach tool,$(APPARMOR_TOOLS),\
                $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
--

2.20.1

#9 lore raw

PATCH v5 5/9 package/apparmor: add options to install utils

In reply to Yann E. MORIN

Most utilities are written in python3, except a few that are written in a mixture of POSIX shell, bash, perl and awk.

The Makefile does not allow isntalling parts of it, but requiring all of python3, bash, and perl to install the utils is too much of a requirement.

Instead, we split the set in two, on one hand the puthin ones, which we install when python3 is enabled, and on the other hand, the rest of the script which we call 'extras', and which we install when all the extra requirements (bash, perl, and busybox or gawk) are met; if not, then we remove these extras utils as a post-install hook.

Note about the order of the comments: they are in reverse-order of the associated config symbols, so that they are properly displayed.

[yann.morin.1998 at free.fr:
- split into its own patch
- re-arrange the conditions
]

---
 package/apparmor/Config.in   | 36 ++++++++++++++++++++++++++++++++++++
 package/apparmor/apparmor.mk | 14 ++++++++++++++
 2 files changed, 50 insertions(+)
package/apparmor/Config.in +36 -0
index d3941200c6..714888c583 100644
@@ -26,4 +26,40 @@ config BR2_PACKAGE_APPARMOR_BINUTILS
 	  A set of utilities (written in C):
 	    aa-enabled    aa-exec
 
+config BR2_PACKAGE_APPARMOR_UTILS
+	bool "utils"
+	depends on BR2_PACKAGE_PYTHON3
+	select BR2_PACKAGE_PYTHON3_READLINE
+	help
+	  A set of utilities (written in pyhon):
+	    aa-audit          aa-disable      aa-logprof
+	    aa-autodep        aa-easyprof     aa-mergeprof
+	    aa-cleanprof      aa-enforce      aa-status
+	    aa-complain       aa-genprof      aa-unconfined
+
+config BR2_PACKAGE_APPARMOR_UTILS_EXTRA
+	bool "utils (extras)"
+	depends on BR2_PACKAGE_APPARMOR_UTILS
+	depends on BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_GAWK
+	depends on BR2_PACKAGE_BASH
+	depends on BR2_PACKAGE_PERL
+	help
+	  An extra set of utilities (written in a mixture of sh,
+	  bash, perl, and awk):
+	    aa-decode          (bash + perl)
+	    aa-notify          (perl)
+	    aa-remove-unknown  (sh + awk)
+
+comment "utils (extras) need bash and perl, and busybox or gawk"
+	depends on BR2_PACKAGE_APPARMOR_UTILS
+	depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_PERL \
+		|| !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_GAWK)
+
+comment "utils need python3"
+	depends on BR2_USE_MMU
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_STATIC_LIBS
+	depends on !BR2_PACKAGE_PYTHON3
+
 endif
package/apparmor/apparmor.mk +14 -0
index 9ee5304a16..1805628de4 100644
@@ -21,6 +21,20 @@ ifeq ($(BR2_PACKAGE_APPARMOR_BINUTILS),y)
 APPARMOR_TOOLS += binutils
 endif
 
+ifeq ($(BR2_PACKAGE_APPARMOR_UTILS),y)
+APPARMOR_DEPENDENCIES += $(BR2_PYTHON3_HOST_DEPENDENCY) python3
+APPARMOR_TOOLS += utils
+APPARMOR_MAKE_OPTS += PYTHON=$(HOST_DIR)/bin/python3
+
+ifeq ($(BR2_PACKAGE_APPARMOR_UTILS_EXTRA),)
+define APPARMOR_UTILS_NO_EXTRA
+	$(Q)rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,aa-decode aa-notify aa-remove-unknown)
+endef
+APPARMOR_POST_INSTALL_TARGET_HOOKS += APPARMOR_UTILS_NO_EXTRA
+endif # BR2_PACKAGE_APPARMOR_UTILS_EXTRA
+
+endif # BR2_PACKAGE_APPARMOR_UTILS
+
 define APPARMOR_BUILD_CMDS
 	$(foreach tool,$(APPARMOR_TOOLS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
2.20.1
#10 lore raw

PATCH v5 5/9 package/apparmor: add options to install utils

Quoted 5 lines · Yann E. MORIN

Most utilities are written in python3, except a few that are written in a mixture of POSIX shell, bash, perl and awk.

The Makefile does not allow isntalling

installing

Quoted 5 lines

parts of it, but requiring all of
python3, bash, and perl to install the utils is too much of a requirement.

Instead, we split the set in two, on one hand the puthin

python

Quoted 9 lines

ones, which we
install when python3 is enabled, and on the other hand, the rest of the script which we call 'extras', and which we install when all the extra requirements (bash, perl, and busybox or gawk) are met; if not, then we remove these extras utils as a post-install hook.

Note about the order of the comments: they are in reverse-order of the associated config symbols, so that they are properly displayed.

Quoted 6 lines

[yann.morin.1998 at free.fr:
- split into its own patch
- re-arrange the conditions
]

Quoted 78 lines
---
 package/apparmor/Config.in   | 36 ++++++++++++++++++++++++++++++++++++
 package/apparmor/apparmor.mk | 14 ++++++++++++++
 2 files changed, 50 insertions(+)
package/apparmor/Config.in +36 -0
index d3941200c6..714888c583 100644
@@ -26,4 +26,40 @@ config BR2_PACKAGE_APPARMOR_BINUTILS
          A set of utilities (written in C):
            aa-enabled    aa-exec
 
+config BR2_PACKAGE_APPARMOR_UTILS
+       bool "utils"
+       depends on BR2_PACKAGE_PYTHON3
+       select BR2_PACKAGE_PYTHON3_READLINE
+       help
+         A set of utilities (written in pyhon):
+           aa-audit          aa-disable      aa-logprof
+           aa-autodep        aa-easyprof     aa-mergeprof
+           aa-cleanprof      aa-enforce      aa-status
+           aa-complain       aa-genprof      aa-unconfined
+
+config BR2_PACKAGE_APPARMOR_UTILS_EXTRA
+       bool "utils (extras)"
+       depends on BR2_PACKAGE_APPARMOR_UTILS
+       depends on BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_GAWK
+       depends on BR2_PACKAGE_BASH
+       depends on BR2_PACKAGE_PERL
+       help
+         An extra set of utilities (written in a mixture of sh,
+         bash, perl, and awk):
+           aa-decode          (bash + perl)
+           aa-notify          (perl)
+           aa-remove-unknown  (sh + awk)
+
+comment "utils (extras) need bash and perl, and busybox or gawk"
+       depends on BR2_PACKAGE_APPARMOR_UTILS
+       depends on !BR2_PACKAGE_BASH || !BR2_PACKAGE_PERL \
+               || !(BR2_PACKAGE_BUSYBOX || BR2_PACKAGE_GAWK)
+
+comment "utils need python3"
+       depends on BR2_USE_MMU
+       depends on BR2_USE_WCHAR
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       depends on !BR2_STATIC_LIBS
+       depends on !BR2_PACKAGE_PYTHON3
+
 endif
package/apparmor/apparmor.mk +14 -1
index 9ee5304a16..1805628de4 100644
@@ -21,6 +21,20 @@ ifeq ($(BR2_PACKAGE_APPARMOR_BINUTILS),y)
 APPARMOR_TOOLS += binutils
 endif
 
+ifeq ($(BR2_PACKAGE_APPARMOR_UTILS),y)
+APPARMOR_DEPENDENCIES += $(BR2_PYTHON3_HOST_DEPENDENCY) python3
+APPARMOR_TOOLS += utils
+APPARMOR_MAKE_OPTS += PYTHON=$(HOST_DIR)/bin/python3
+
+ifeq ($(BR2_PACKAGE_APPARMOR_UTILS_EXTRA),)
+define APPARMOR_UTILS_NO_EXTRA
+       $(Q)rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,aa-decode aa-notify aa-remove-unknown)
+endef
+APPARMOR_POST_INSTALL_TARGET_HOOKS += APPARMOR_UTILS_NO_EXTRA
+endif # BR2_PACKAGE_APPARMOR_UTILS_EXTRA
+
+endif # BR2_PACKAGE_APPARMOR_UTILS
+
 define APPARMOR_BUILD_CMDS
        $(foreach tool,$(APPARMOR_TOOLS),\
                $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
--

2.20.1

#11 lore raw

PATCH v5 6/9 package/apparmor: add option to install generic profiles

In reply to Yann E. MORIN

The apparmor packages comes with a set of profiles for a class of usual, mostly server-class programs and daemons.

Even though an embedded device will mostly require custom profiles, the generic ones may come handy, as they also provide "abstractions", that can serve as templates for custom profiles.

[yann.morin.1998 at free.fr: split off into its own patch]
---
 package/apparmor/Config.in   | 6 ++++++
 package/apparmor/apparmor.mk | 4 ++++
 2 files changed, 10 insertions(+)
package/apparmor/Config.in +6 -0
index 714888c583..77a20f6faa 100644
@@ -62,4 +62,10 @@ comment "utils need python3"
 	depends on !BR2_STATIC_LIBS
 	depends on !BR2_PACKAGE_PYTHON3
 
+config BR2_PACKAGE_APPARMOR_PROFILES
+	bool "profiles"
+	help
+	  Installs server-class profiles for a wide range of
+	  usual programs and daemons.
+
 endif
package/apparmor/apparmor.mk +4 -0
index 1805628de4..26a09d2ff5 100644
@@ -35,6 +35,10 @@ endif # BR2_PACKAGE_APPARMOR_UTILS_EXTRA
 
 endif # BR2_PACKAGE_APPARMOR_UTILS
 
+ifeq ($(BR2_PACKAGE_APPARMOR_PROFILES),y)
+APPARMOR_TOOLS += profiles
+endif
+
 define APPARMOR_BUILD_CMDS
 	$(foreach tool,$(APPARMOR_TOOLS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
2.20.1
#12 lore raw

PATCH v5 6/9 package/apparmor: add option to install generic profiles

Quoted 2 lines · Yann E. MORIN

The apparmor packages come

come

Quoted 10 lines

with a set of profiles for a class of usual,
mostly server-class programs and daemons.

Even though an embedded device will mostly require custom profiles, the generic ones may come handy, as they also provide "abstractions", that can serve as templates for custom profiles.

[yann.morin.1998 at free.fr: split off into its own patch]
Quoted 38 lines
---
 package/apparmor/Config.in   | 6 ++++++
 package/apparmor/apparmor.mk | 4 ++++
 2 files changed, 10 insertions(+)
package/apparmor/Config.in +6 -0
index 714888c583..77a20f6faa 100644
@@ -62,4 +62,10 @@ comment "utils need python3"
        depends on !BR2_STATIC_LIBS
        depends on !BR2_PACKAGE_PYTHON3
 
+config BR2_PACKAGE_APPARMOR_PROFILES
+       bool "profiles"
+       help
+         Installs server-class profiles for a wide range of
+         usual programs and daemons.
+
 endif
package/apparmor/apparmor.mk +4 -1
index 1805628de4..26a09d2ff5 100644
@@ -35,6 +35,10 @@ endif # BR2_PACKAGE_APPARMOR_UTILS_EXTRA
 
 endif # BR2_PACKAGE_APPARMOR_UTILS
 
+ifeq ($(BR2_PACKAGE_APPARMOR_PROFILES),y)
+APPARMOR_TOOLS += profiles
+endif
+
 define APPARMOR_BUILD_CMDS
        $(foreach tool,$(APPARMOR_TOOLS),\
                $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
--

2.20.1

#13 lore raw

PATCH v5 7/9 package/libapparmor: enable python bindings

In reply to Yann E. MORIN
[yann.morin.1998 at free.fr: split off into its own patch]
---
 ...el-fixing-for-crosscompiling-environ.patch | 96 +++++++++++++++++++
 ...ng-setup.py-call-when-crosscompiling.patch | 30 ++++++
 package/libapparmor/libapparmor.mk            | 17 +++-
 3 files changed, 141 insertions(+), 2 deletions(-)
 create mode 100644 package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch
 create mode 100644 package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch
package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch new file +96 -0
new file mode 100644
index 0000000000..7b902d5970
@@ -0,0 +1,96 @@
+From 235ce271f3fee53b918317ebb73a47b3c6a7ae03 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <[email protected]>
+Date: Tue, 24 Mar 2020 22:53:37 +0100
+Subject: [PATCH] m4: ac_python_devel: fixing for crosscompiling environments
+
+In a crosscompiling environment it's common to have a python executable
+running for the host system with a python-config reporting the host
+configuration and a second python-config reporting the target configuration.
+In such cases, relying on the default oython-config is wrong and breaks
+the cross compilation.
+
+This patch adds a PYTHON_CONFIG variable that can be pointed to the second
+python-config and fixes the rest of the m4 accordingly.
+
+Signed-off-by: Angelo Compagnucci <[email protected]>
+---
+ libraries/libapparmor/m4/ac_python_devel.m4 | 25 ++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 6 deletions(-)
+
+diff --git a/libraries/libapparmor/m4/ac_python_devel.m4 b/libraries/libapparmor/m4/ac_python_devel.m4
+index 2ea7dc77..6454e2d8 100644
+--- a/libraries/libapparmor/m4/ac_python_devel.m4
++++ b/libraries/libapparmor/m4/ac_python_devel.m4
+@@ -13,6 +13,11 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
+            PYTHON_VERSION=""
+         fi
+ 
++        AC_PATH_PROG([PYTHON_CONFIG],[`basename [$PYTHON]-config`])
++        if test -z "$PYTHON_CONFIG"; then
++           AC_MSG_ERROR([Cannot find python$PYTHON_VERSION-config in your system path])
++        fi
++
+         #
+         # Check for a version of Python >= 2.1.0
+         #
+@@ -79,8 +84,8 @@ $ac_distutils_result])
+         # Check for Python include path
+         #
+         AC_MSG_CHECKING([for Python include path])
+-        if type $PYTHON-config; then
+-                PYTHON_CPPFLAGS=`$PYTHON-config --includes`
++        if type $PYTHON_CONFIG; then
++                PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes`
+         fi
+         if test -z "$PYTHON_CPPFLAGS"; then
+                 python_path=`$PYTHON -c "import sys; import distutils.sysconfig;\
+@@ -97,8 +102,8 @@ sys.stdout.write('%s\n' % distutils.sysconfig.get_python_inc());"`
+         # Check for Python library path
+         #
+         AC_MSG_CHECKING([for Python library path])
+-        if type $PYTHON-config; then
+-                PYTHON_LDFLAGS=`$PYTHON-config --ldflags`
++        if type $PYTHON_CONFIG; then
++                PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+         fi
+         if test -z "$PYTHON_LDFLAGS"; then
+                 # (makes two attempts to ensure we've got a version number
+@@ -136,10 +141,14 @@ sys.stdout.write('%s\n' % distutils.sysconfig.get_python_lib(0,0));"`
+         # libraries which must be linked in when embedding
+         #
+         AC_MSG_CHECKING(python extra libraries)
++        if type $PYTHON_CONFIG; then
++                PYTHON_EXTRA_LIBS=`$PYTHON_CONFIG --libs --embed` || \
++                        PYTHON_EXTRA_LIBS=''
++        fi
+         if test -z "$PYTHON_EXTRA_LIBS"; then
+            PYTHON_EXTRA_LIBS=`$PYTHON -c "import sys; import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+-sys.stdout.write('%s %s\n' % (conf('LOCALMODLIBS'), conf('LIBS')))"`
++sys.stdout.write('%s %s %s\n' % (conf('BLDLIBRARY'), conf('LOCALMODLIBS'), conf('LIBS')))"`
+         fi
+         AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
+         AC_SUBST(PYTHON_EXTRA_LIBS)
+@@ -148,6 +157,10 @@ sys.stdout.write('%s %s\n' % (conf('LOCALMODLIBS'), conf('LIBS')))"`
+         # linking flags needed when embedding
+         #
+         AC_MSG_CHECKING(python extra linking flags)
++        if type $PYTHON_CONFIG; then
++                PYTHON_EXTRA_LDFLAGS=`$PYTHON_CONFIG --ldflags --embed` || \
++                        PYTHON_EXTRA_LDFLAGS=''
++        fi
+         if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+                 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import sys; import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+@@ -164,7 +177,7 @@ sys.stdout.write('%s\n' % conf('LINKFORSHARED'))"`
+         # save current global flags
+         ac_save_LIBS="$LIBS"
+         ac_save_CPPFLAGS="$CPPFLAGS"
+-        LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
++        LIBS="$ac_save_LIBS $PYTHON_EXTRA_LIBS $PYTHON_LDFLAGS"
+         CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
+         AC_TRY_LINK([
+                 #include <Python.h>
+-- 
+2.17.1
+
package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch new file +30 -0
new file mode 100644
index 0000000000..8d6ca86e47
@@ -0,0 +1,30 @@
+From cf61d1257b9a5f12fdf6f4dd6a2746f77b23a8a0 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <[email protected]>
+Date: Tue, 24 Mar 2020 23:02:08 +0100
+Subject: [PATCH] libapparmor: fixing setup.py call when crosscompiling
+
+When crosscompiling, setupy.py should be called passing the settings
+discovered by ac_python_devel.m4 and not using the default system
+settings.
+
+Signed-off-by: Angelo Compagnucci <[email protected]>
+---
+ libraries/libapparmor/swig/python/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libraries/libapparmor/swig/python/Makefile.am b/libraries/libapparmor/swig/python/Makefile.am
+index 421acba9..6c60181e 100644
+--- a/libraries/libapparmor/swig/python/Makefile.am
++++ b/libraries/libapparmor/swig/python/Makefile.am
+@@ -11,7 +11,7 @@ MOSTLYCLEANFILES=libapparmor_wrap.c LibAppArmor.py
+ 
+ all-local: libapparmor_wrap.c setup.py
+ 	if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
+-	$(PYTHON) setup.py build
++	CC="$(CC)" CFLAGS="$(PYTHON_CPPFLAGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(PYTHON_LDFLAGS)" $(PYTHON) setup.py build
+ 
+ install-exec-local:
+ 	$(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+-- 
+2.17.1
+
package/libapparmor/libapparmor.mk +15 -2
index 8173d138d6..4d6bb6d82b 100644
@@ -16,13 +16,26 @@ LIBAPPARMOR_DEPENDENCIES = host-bison host-flex host-pkgconf
 LIBAPPARMOR_SUBDIR = libraries/libapparmor
 LIBAPPARMOR_INSTALL_STAGING = YES
 
+# Patches 0001 and 0002 touch Makefile.am and an m4 file
+LIBAPPARMOR_AUTORECONF = YES
+
 # Most AppArmor tools will want to link to the static lib.
 # ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
 # provided by autoconf relies on wchar_t.
 LIBAPPARMOR_CONF_OPTS = \
 	ac_cv_prog_cc_c99=-std=gnu99 \
 	--enable-static \
-	--enable-man-pages=no \
-	--without-python
+	--enable-man-pages=no
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+LIBAPPARMOR_DEPENDENCIES += host-python3 host-swig python3
+LIBAPPARMOR_CONF_OPTS += \
+	--with-python \
+	PYTHON=$(HOST_DIR)/usr/bin/python3 \
+	PYTHON_CONFIG=$(STAGING_DIR)/usr/bin/python3-config \
+	SWIG=$(SWIG)
+else
+LIBAPPARMOR_CONF_OPTS += --without-python
+endif
 
 $(eval $(autotools-package))
Signature · 1 line
2.20.1
#14 lore raw

PATCH v5 7/9 package/libapparmor: enable python bindings

Quoted 4 lines · Yann E. MORIN
[yann.morin.1998 at free.fr: split off into its own patch]
Quoted 182 lines
---
 ...el-fixing-for-crosscompiling-environ.patch | 96 +++++++++++++++++++
 ...ng-setup.py-call-when-crosscompiling.patch | 30 ++++++
 package/libapparmor/libapparmor.mk            | 17 +++-
 3 files changed, 141 insertions(+), 2 deletions(-)
 create mode 100644 package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch
 create mode 100644 package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch
package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch new file +96 -0
new file mode 100644
index 0000000000..7b902d5970
@@ -0,0 +1,96 @@
+From 235ce271f3fee53b918317ebb73a47b3c6a7ae03 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <[email protected]>
+Date: Tue, 24 Mar 2020 22:53:37 +0100
+Subject: [PATCH] m4: ac_python_devel: fixing for crosscompiling environments
+
+In a crosscompiling environment it's common to have a python executable
+running for the host system with a python-config reporting the host
+configuration and a second python-config reporting the target configuration.
+In such cases, relying on the default oython-config is wrong and breaks
+the cross compilation.
+
+This patch adds a PYTHON_CONFIG variable that can be pointed to the second
+python-config and fixes the rest of the m4 accordingly.
+
+Signed-off-by: Angelo Compagnucci <[email protected]>
+---
+ libraries/libapparmor/m4/ac_python_devel.m4 | 25 ++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 6 deletions(-)
+
+diff --git a/libraries/libapparmor/m4/ac_python_devel.m4 b/libraries/libapparmor/m4/ac_python_devel.m4
+index 2ea7dc77..6454e2d8 100644
+--- a/libraries/libapparmor/m4/ac_python_devel.m4
++++ b/libraries/libapparmor/m4/ac_python_devel.m4
+@@ -13,6 +13,11 @@ AC_DEFUN([AC_PYTHON_DEVEL],[
+            PYTHON_VERSION=""
+         fi
+
++        AC_PATH_PROG([PYTHON_CONFIG],[`basename [$PYTHON]-config`])
++        if test -z "$PYTHON_CONFIG"; then
++           AC_MSG_ERROR([Cannot find python$PYTHON_VERSION-config in your system path])
++        fi
++
+         #
+         # Check for a version of Python >= 2.1.0
+         #
+@@ -79,8 +84,8 @@ $ac_distutils_result])
+         # Check for Python include path
+         #
+         AC_MSG_CHECKING([for Python include path])
+-        if type $PYTHON-config; then
+-                PYTHON_CPPFLAGS=`$PYTHON-config --includes`
++        if type $PYTHON_CONFIG; then
++                PYTHON_CPPFLAGS=`$PYTHON_CONFIG --includes`
+         fi
+         if test -z "$PYTHON_CPPFLAGS"; then
+                 python_path=`$PYTHON -c "import sys; import distutils.sysconfig;\
+@@ -97,8 +102,8 @@ sys.stdout.write('%s\n' % distutils.sysconfig.get_python_inc());"`
+         # Check for Python library path
+         #
+         AC_MSG_CHECKING([for Python library path])
+-        if type $PYTHON-config; then
+-                PYTHON_LDFLAGS=`$PYTHON-config --ldflags`
++        if type $PYTHON_CONFIG; then
++                PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+         fi
+         if test -z "$PYTHON_LDFLAGS"; then
+                 # (makes two attempts to ensure we've got a version number
+@@ -136,10 +141,14 @@ sys.stdout.write('%s\n' % distutils.sysconfig.get_python_lib(0,0));"`
+         # libraries which must be linked in when embedding
+         #
+         AC_MSG_CHECKING(python extra libraries)
++        if type $PYTHON_CONFIG; then
++                PYTHON_EXTRA_LIBS=`$PYTHON_CONFIG --libs --embed` || \
++                        PYTHON_EXTRA_LIBS=''
++        fi
+         if test -z "$PYTHON_EXTRA_LIBS"; then
+            PYTHON_EXTRA_LIBS=`$PYTHON -c "import sys; import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+-sys.stdout.write('%s %s\n' % (conf('LOCALMODLIBS'), conf('LIBS')))"`
++sys.stdout.write('%s %s %s\n' % (conf('BLDLIBRARY'), conf('LOCALMODLIBS'), conf('LIBS')))"`
+         fi
+         AC_MSG_RESULT([$PYTHON_EXTRA_LIBS])
+         AC_SUBST(PYTHON_EXTRA_LIBS)
+@@ -148,6 +157,10 @@ sys.stdout.write('%s %s\n' % (conf('LOCALMODLIBS'), conf('LIBS')))"`
+         # linking flags needed when embedding
+         #
+         AC_MSG_CHECKING(python extra linking flags)
++        if type $PYTHON_CONFIG; then
++                PYTHON_EXTRA_LDFLAGS=`$PYTHON_CONFIG --ldflags --embed` || \
++                        PYTHON_EXTRA_LDFLAGS=''
++        fi
+         if test -z "$PYTHON_EXTRA_LDFLAGS"; then
+                 PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import sys; import distutils.sysconfig; \
+ conf = distutils.sysconfig.get_config_var; \
+@@ -164,7 +177,7 @@ sys.stdout.write('%s\n' % conf('LINKFORSHARED'))"`
+         # save current global flags
+         ac_save_LIBS="$LIBS"
+         ac_save_CPPFLAGS="$CPPFLAGS"
+-        LIBS="$ac_save_LIBS $PYTHON_LDFLAGS"
++        LIBS="$ac_save_LIBS $PYTHON_EXTRA_LIBS $PYTHON_LDFLAGS"
+         CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS"
+         AC_TRY_LINK([
+                 #include <Python.h>
+--
+2.17.1
+
package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch new file +30 -0
new file mode 100644
index 0000000000..8d6ca86e47
@@ -0,0 +1,30 @@
+From cf61d1257b9a5f12fdf6f4dd6a2746f77b23a8a0 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <[email protected]>
+Date: Tue, 24 Mar 2020 23:02:08 +0100
+Subject: [PATCH] libapparmor: fixing setup.py call when crosscompiling
+
+When crosscompiling, setupy.py should be called passing the settings
+discovered by ac_python_devel.m4 and not using the default system
+settings.
+
+Signed-off-by: Angelo Compagnucci <[email protected]>
+---
+ libraries/libapparmor/swig/python/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libraries/libapparmor/swig/python/Makefile.am b/libraries/libapparmor/swig/python/Makefile.am
+index 421acba9..6c60181e 100644
+--- a/libraries/libapparmor/swig/python/Makefile.am
++++ b/libraries/libapparmor/swig/python/Makefile.am
+@@ -11,7 +11,7 @@ MOSTLYCLEANFILES=libapparmor_wrap.c LibAppArmor.py
+
+ all-local: libapparmor_wrap.c setup.py
+       if test ! -f libapparmor_wrap.c; then cp $(srcdir)/libapparmor_wrap.c . ; fi
+-      $(PYTHON) setup.py build
++      CC="$(CC)" CFLAGS="$(PYTHON_CPPFLAGS)" LDSHARED="$(CC) -shared" LDFLAGS="$(PYTHON_LDFLAGS)" $(PYTHON) setup.py build
+
+ install-exec-local:
+       $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
+--
+2.17.1
+
package/libapparmor/libapparmor.mk +15 -3
index 8173d138d6..4d6bb6d82b 100644
@@ -16,13 +16,26 @@ LIBAPPARMOR_DEPENDENCIES = host-bison host-flex host-pkgconf
 LIBAPPARMOR_SUBDIR = libraries/libapparmor
 LIBAPPARMOR_INSTALL_STAGING = YES
 
+# Patches 0001 and 0002 touch Makefile.am and an m4 file
+LIBAPPARMOR_AUTORECONF = YES
+
 # Most AppArmor tools will want to link to the static lib.
 # ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
 # provided by autoconf relies on wchar_t.
 LIBAPPARMOR_CONF_OPTS = \
        ac_cv_prog_cc_c99=-std=gnu99 \
        --enable-static \
-       --enable-man-pages=no \
-       --without-python
+       --enable-man-pages=no
+
+ifeq ($(BR2_PACKAGE_PYTHON3),y)
+LIBAPPARMOR_DEPENDENCIES += host-python3 host-swig python3
+LIBAPPARMOR_CONF_OPTS += \
+       --with-python \
+       PYTHON=$(HOST_DIR)/usr/bin/python3 \
+       PYTHON_CONFIG=$(STAGING_DIR)/usr/bin/python3-config \
+       SWIG=$(SWIG)
+else
+LIBAPPARMOR_CONF_OPTS += --without-python
+endif
 
 $(eval $(autotools-package))
--

2.20.1

#15 lore raw

PATCH v5 8/9 package/apparmor: enable PAM integration

In reply to Yann E. MORIN
[yann.morin.1998 at free.fr: split off to its own patch]
---
 package/apparmor/apparmor.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/apparmor/apparmor.mk +5 -0
index 26a09d2ff5..8a25cd4466 100644
@@ -39,6 +39,11 @@ ifeq ($(BR2_PACKAGE_APPARMOR_PROFILES),y)
 APPARMOR_TOOLS += profiles
 endif
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+APPARMOR_DEPENDENCIES += linux-pam
+APPARMOR_TOOLS += changehat/pam_apparmor
+endif
+
 define APPARMOR_BUILD_CMDS
 	$(foreach tool,$(APPARMOR_TOOLS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
2.20.1
#16 lore raw

PATCH v5 8/9 package/apparmor: enable PAM integration

Quoted 4 lines · Yann E. MORIN
[yann.morin.1998 at free.fr: split off to its own patch]
Quoted 23 lines
---
 package/apparmor/apparmor.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/apparmor/apparmor.mk +5 -1
index 26a09d2ff5..8a25cd4466 100644
@@ -39,6 +39,11 @@ ifeq ($(BR2_PACKAGE_APPARMOR_PROFILES),y)
 APPARMOR_TOOLS += profiles
 endif
 
+ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
+APPARMOR_DEPENDENCIES += linux-pam
+APPARMOR_TOOLS += changehat/pam_apparmor
+endif
+
 define APPARMOR_BUILD_CMDS
        $(foreach tool,$(APPARMOR_TOOLS),\
                $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
--

2.20.1

#17 lore raw

PATCH v5 9/9 package/apparmor: enable apache integration

In reply to Yann E. MORIN
[yann.morin.1998 at free.fr: split off to its own patch]
---
 package/apparmor/apparmor.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/apparmor/apparmor.mk +6 -0
index 8a25cd4466..a4900397f2 100644
@@ -44,6 +44,12 @@ APPARMOR_DEPENDENCIES += linux-pam
 APPARMOR_TOOLS += changehat/pam_apparmor
 endif
 
+ifeq ($(BR2_PACKAGE_APACHE),y)
+APPARMOR_DEPENDENCIES += apache
+APPARMOR_TOOLS += changehat/mod_apparmor
+APPARMOR_MAKE_OPTS += APXS=$(STAGING_DIR)/usr/bin/apxs
+endif
+
 define APPARMOR_BUILD_CMDS
 	$(foreach tool,$(APPARMOR_TOOLS),\
 		$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
Signature · 1 line
2.20.1
#18 lore raw

PATCH v5 9/9 package/apparmor: enable apache integration

Quoted 4 lines · Yann E. MORIN
[yann.morin.1998 at free.fr: split off to its own patch]
Quoted 24 lines
---
 package/apparmor/apparmor.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/apparmor/apparmor.mk +6 -1
index 8a25cd4466..a4900397f2 100644
@@ -44,6 +44,12 @@ APPARMOR_DEPENDENCIES += linux-pam
 APPARMOR_TOOLS += changehat/pam_apparmor
 endif
 
+ifeq ($(BR2_PACKAGE_APACHE),y)
+APPARMOR_DEPENDENCIES += apache
+APPARMOR_TOOLS += changehat/mod_apparmor
+APPARMOR_MAKE_OPTS += APXS=$(STAGING_DIR)/usr/bin/apxs
+endif
+
 define APPARMOR_BUILD_CMDS
        $(foreach tool,$(APPARMOR_TOOLS),\
                $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
--

2.20.1

#19 lore raw

v5 cover package/apparmor: new package (branch yem/apparmor)

In reply to Yann E. MORIN

Angelo, All,

On 2020-03-29 16:01 +0200, Yann E. MORIN spake thusly:

Quoted 3 lines

This series is reworked of the previous work from Angelo:

    http://lists.busybox.net/pipermail/buildroot/2020-March/278308.html
    http://lists.busybox.net/pipermail/buildroot/2020-March/278307.html

Angelo, did you have the opportunity to have a look at this series?

Regards,
Yann E. MORIN.

Quoted 96 lines

Fundamentally, (almost) all the code is from Angelo, and it has jsut been spread across two packages.

The way the apparmor package is laid out is not very amenable at doing a single package that builds everything: all the tools and utils depend on libapparmor, and that is better installed before the build of the tools is attempted.

So, we split the packaging in two:

- libapparmor, which is siolely responsible for installing libapparmor and its python3 bindings,

- apparmor per-se, which is responsible for installing all the tools and utilities.

To be noted: most of the tools' Makefiles hard-code linking to the static libapparmor (without explanations), so rather than go against the tide, we just enforce building the static library (note also that we do not forbid building the shared one).

The only major part that was dropped from the initial series, is support for writign the cache on read-write filesystems. The codition was based on BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW, but that does not prevent building an actually read-only filesystem at all (e.g. squashfs). So, more thoughts will have to be poured into this caching feature in a subsequent series.

Chage v4 -> v5: (adopted by Yann)
- split in two packages, one for the lib, ione for the utils
- reword all the commit logs
- fix dependencies (threads, mmu...)
- re-organise the conditions to install utils (python3 vs others)
- drop the cache writing for read-write filesystems

Regards,
Yann E. MORIN.

The following changes since commit d0f5a5551ab86f6272f13deaa16dcdf4b07a524f

package/sysstat: bump to version 12.2.1 (2020-03-29 15:50:36 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 8b4415dad37fa81cf2d4adb09b27119b233bcd8a

package/apparmor: enable apache integration (2020-03-29 16:01:18 +0200)

----------------------------------------------------------------
Angelo Compagnucci (4):
package/libapparmor: new package
linux: enable AppArmor-related options if needed package/apparmor: new package package/apparmor: add option to install binutils

Yann E. MORIN (5):
package/apparmor: add options to install utils package/apparmor: add option to install generic profiles package/libapparmor: enable python bindings package/apparmor: enable PAM integration package/apparmor: enable apache integration

 DEVELOPERS                                         |  1 +
 linux/linux.mk                                     |  5 ++
 package/Config.in                                  |  2 +
 package/apparmor/Config.in                         | 71 ++++++++++++++++
 package/apparmor/apparmor.hash                     |  4 +
 package/apparmor/apparmor.mk                       | 81 ++++++++++++++++++
 ...n_devel-fixing-for-crosscompiling-environ.patch | 96 ++++++++++++++++++++++
 ...-fixing-setup.py-call-when-crosscompiling.patch | 30 +++++++
 package/libapparmor/Config.in                      | 16 ++++
 package/libapparmor/libapparmor.hash               |  4 +
 package/libapparmor/libapparmor.mk                 | 41 +++++++++
 11 files changed, 351 insertions(+)
 create mode 100644 package/apparmor/Config.in
 create mode 100644 package/apparmor/apparmor.hash
 create mode 100644 package/apparmor/apparmor.mk
 create mode 100644 package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch
 create mode 100644 package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch
 create mode 100644 package/libapparmor/Config.in
 create mode 100644 package/libapparmor/libapparmor.hash
 create mode 100644 package/libapparmor/libapparmor.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#20 lore raw

v5 cover package/apparmor: new package (branch yem/apparmor)

In reply to Yann E. MORIN

Angelo, All,

On 2020-03-29 16:01 +0200, Yann E. MORIN spake thusly:

Quoted 3 lines

This series is reworked of the previous work from Angelo:

    http://lists.busybox.net/pipermail/buildroot/2020-March/278308.html
    http://lists.busybox.net/pipermail/buildroot/2020-March/278307.html

Series applied to master, after doign a few fixes noticed by Thomas P. on IRC. Thanks!

Regards,
Yann E. MORIN.

Quoted 95 lines

been spread across two packages.

The way the apparmor package is laid out is not very amenable at doing a single package that builds everything: all the tools and utils depend on libapparmor, and that is better installed before the build of the tools is attempted.

So, we split the packaging in two:

- libapparmor, which is siolely responsible for installing libapparmor and its python3 bindings,

- apparmor per-se, which is responsible for installing all the tools and utilities.

To be noted: most of the tools' Makefiles hard-code linking to the static libapparmor (without explanations), so rather than go against the tide, we just enforce building the static library (note also that we do not forbid building the shared one).

The only major part that was dropped from the initial series, is support for writign the cache on read-write filesystems. The codition was based on BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW, but that does not prevent building an actually read-only filesystem at all (e.g. squashfs). So, more thoughts will have to be poured into this caching feature in a subsequent series.

Chage v4 -> v5: (adopted by Yann)
- split in two packages, one for the lib, ione for the utils
- reword all the commit logs
- fix dependencies (threads, mmu...)
- re-organise the conditions to install utils (python3 vs others)
- drop the cache writing for read-write filesystems

Regards,
Yann E. MORIN.

The following changes since commit d0f5a5551ab86f6272f13deaa16dcdf4b07a524f

package/sysstat: bump to version 12.2.1 (2020-03-29 15:50:36 +0200)

are available in the git repository at:

git://git.buildroot.org/~ymorin/git/buildroot.git

for you to fetch changes up to 8b4415dad37fa81cf2d4adb09b27119b233bcd8a

package/apparmor: enable apache integration (2020-03-29 16:01:18 +0200)

----------------------------------------------------------------
Angelo Compagnucci (4):
package/libapparmor: new package
linux: enable AppArmor-related options if needed package/apparmor: new package package/apparmor: add option to install binutils

Yann E. MORIN (5):
package/apparmor: add options to install utils package/apparmor: add option to install generic profiles package/libapparmor: enable python bindings package/apparmor: enable PAM integration package/apparmor: enable apache integration

 DEVELOPERS                                         |  1 +
 linux/linux.mk                                     |  5 ++
 package/Config.in                                  |  2 +
 package/apparmor/Config.in                         | 71 ++++++++++++++++
 package/apparmor/apparmor.hash                     |  4 +
 package/apparmor/apparmor.mk                       | 81 ++++++++++++++++++
 ...n_devel-fixing-for-crosscompiling-environ.patch | 96 ++++++++++++++++++++++
 ...-fixing-setup.py-call-when-crosscompiling.patch | 30 +++++++
 package/libapparmor/Config.in                      | 16 ++++
 package/libapparmor/libapparmor.hash               |  4 +
 package/libapparmor/libapparmor.mk                 | 41 +++++++++
 11 files changed, 351 insertions(+)
 create mode 100644 package/apparmor/Config.in
 create mode 100644 package/apparmor/apparmor.hash
 create mode 100644 package/apparmor/apparmor.mk
 create mode 100644 package/libapparmor/0001-m4-ac_python_devel-fixing-for-crosscompiling-environ.patch
 create mode 100644 package/libapparmor/0002-libapparmor-fixing-setup.py-call-when-crosscompiling.patch
 create mode 100644 package/libapparmor/Config.in
 create mode 100644 package/libapparmor/libapparmor.hash
 create mode 100644 package/libapparmor/libapparmor.mk
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'