[Buildroot] [PATCH v2, 1/1] package/apparmor: fix per-package build with apache
Yann E. MORIN
yann.morin.1998 at free.fr
Sun Sep 6 08:07:18 UTC 2020
Fabrice, All,
On 2020-09-05 23:47 +0200, Fabrice Fontaine spake thusly:
> Per-package build of apparmor with apache fails on:
>
> /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apparmor/host/x86_64-buildroot-linux-musl/sysroot/usr/bin/apxs -c mod_apparmor.c -L/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apparmor/host/bin/../x86_64-buildroot-linux-musl/sysroot/usr/lib -lapparmor
>
> /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/bin/../../usr/build-1/libtool --silent --mode=compile /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/bin/x86_64-linux-gcc -prefer-pic -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g2 -I/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/include -I/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/bin/../../usr/include/apr-1 -I/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/bin/../../usr/include/apr-1 -I/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/bin/../../../../x86_64-buildroot-lin
> ux-musl/sysroot/usr/include -c -o mod_apparmor.lo mod_apparmor.c && touch mod_apparmor.slo
> mod_apparmor.c:28:10: fatal error: sys/apparmor.h: No such file or directory
> #include <sys/apparmor.h>
> ^~~~~~~~~~~~~~~~
>
> The issue is that sys/appamor.h is not installed in the apache
> per-package directory which is mangled by
> APACHE_FIX_STAGING_APACHE_CONFIG, i.e.
> /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output-1/per-package/apache/host/x86_64-buildroot-linux-musl/sysroot/usr/include
>
> So implement the same workaround made on apache to replace those wrong
> apache paths by apparmor paths in apxs binary and its configuration file
> (i.e. config_vars.mk) as suggested by Thomas Petazzoni and Yann E. Morin
> during review of the first iteration of this patch
>
> Fixes:
> - http://autobuild.buildroot.org/results/ef1fcd57e0c09a2806bf2272bb21df6d3300b45b
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> Changes v1 -> v2 (after review of Yann E. Morin and Thomas Petazzoni):
> - Patch apxs and config_vars.mk
>
> package/apparmor/apparmor.mk | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/package/apparmor/apparmor.mk b/package/apparmor/apparmor.mk
> index f667966082..51820999eb 100644
> --- a/package/apparmor/apparmor.mk
> +++ b/package/apparmor/apparmor.mk
> @@ -53,6 +53,15 @@ ifeq ($(BR2_PACKAGE_APACHE),y)
> APPARMOR_DEPENDENCIES += apache
> APPARMOR_TOOLS += changehat/mod_apparmor
> APPARMOR_MAKE_OPTS += APXS=$(STAGING_DIR)/usr/bin/apxs
> +
> +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
> +define APPARMOR_FIXUP_APXS
> + $(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apparmor/@g" \
> + $(STAGING_DIR)/usr/bin/apxs \
> + $(STAGING_DIR)/usr/build/config_vars.mk
> +endef
> +APPARMOR_POST_CONFIGURE_HOOKS += APPARMOR_FIXUP_APXS
> +endif
> endif
>
> define APPARMOR_BUILD_CMDS
> --
> 2.28.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| 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. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list