Skip to contentSkip to conversation

README: add git-config tips

PATCH In review Ross Burton 2 participants 12 messages Jan 14, 2019 – Jan 17, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 README: add git-config tips

---
 README | 7 +++++++
 1 file changed, 7 insertions(+)
README +7 -0
index e238271..c15fea9 100644
@@ -57,6 +57,13 @@ Send pull requests, patches, comments or questions to [email protected]
 When sending single patches, please using something like:
 'git send-email -1 --to [email protected] --subject-prefix=meta-security][PATCH'
 
+These values can be set as defaults for this repository:
+
+$ git config sendemail.to [email protected]
+$ git config format.subjectPrefix meta-security][PATCH
+
+Now you can just do 'git send-email origin/master' to send all local patches.
+
 Maintainers:    Armin Kuster <[email protected]>
                 Saul Wold <[email protected]>
 
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/11 README: remove Saul from maintainers

---
 README | 1 -
 1 file changed, 1 deletion(-)
README +0 -1
index c15fea9..5abb0e2 100644
@@ -65,7 +65,6 @@ $ git config format.subjectPrefix meta-security][PATCH
 Now you can just do 'git send-email origin/master' to send all local patches.
 
 Maintainers:    Armin Kuster <[email protected]>
-                Saul Wold <[email protected]>
 
 
 License
Signature · 1 line
2.11.0
#2 lore raw

PATCH 3/11 apparmor: add missing bash dependency

In reply to Ross Burton

testsuite/parser/tst/minimize.sh is a bash script, so until it is reviewed add a bash dependency to apparmor-ptest.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-security/AppArmor/apparmor_2.12.bb +1 -1
index e3f8dc9..2cf5b7d 100644
@@ -156,4 +156,4 @@ ALLOW_EMPTY_${PN} = "1"
 RDEPENDS_${PN} += "bash lsb"
 RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}"
 RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}"
-RDEPENDS_${PN}-ptest += "perl coreutils dbus-lib"
+RDEPENDS_${PN}-ptest += "perl coreutils dbus-lib bash"
Signature · 1 line
2.11.0
#3 lore raw

PATCH 4/11 apparmor: enable static libraries neatly

In reply to Ross Burton

No need to fiddle with the configure arguments as we can just neuter disable-static.inc.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
recipes-security/AppArmor/apparmor_2.12.bb +1 -2
index 2cf5b7d..303d5c7 100644
@@ -50,8 +50,7 @@ python() {
         raise bb.parse.SkipRecipe('Requires meta-webserver to be present.')
 }
 
-CONFIGUREOPTS_remove = "--disable-static"
-EXTRA_OECONF_append = " --enable-static"
+DISABLE_STATIC = ""
 
 do_configure() {
 	cd ${S}/libraries/libapparmor
Signature · 1 line
2.11.0
#4 lore raw

PATCH 5/11 apparmor: remove redundant S

In reply to Ross Burton

This is the default value, so remove it.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 2 --
 1 file changed, 2 deletions(-)
recipes-security/AppArmor/apparmor_2.12.bb +0 -2
index 303d5c7..6434e42 100644
@@ -32,8 +32,6 @@ PARALLEL_MAKE = ""
 inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan
 inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
 
-S = "${WORKDIR}/apparmor-${PV}"
-
 PACKAGECONFIG ?="man python perl"
 PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages"
 PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native"
Signature · 1 line
2.11.0
#5 lore raw

PATCH 6/11 apparmor: use manpages class

In reply to Ross Burton

The manpages class handles enabling/disabling the man pages based on the api-documentation DISTRO_FEATURE, and ensures that mandb is called.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
recipes-security/AppArmor/apparmor_2.12.bb +3 -3
index 6434e42..529414f 100644
@@ -29,11 +29,11 @@ SRC_URI[sha256sum] = "8a2b0cd083faa4d0640f579024be3a629faa7db3b99540798a1a050e2e
 
 PARALLEL_MAKE = ""
 
-inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan
+inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan manpages
 inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
 
-PACKAGECONFIG ?="man python perl"
-PACKAGECONFIG[man] = "--enable-man-pages, --disable-man-pages"
+PACKAGECONFIG ??= "python perl"
+PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages"
 PACKAGECONFIG[python] = "--with-python, --without-python, python3 swig-native"
 PACKAGECONFIG[perl] = "--with-perl, --without-perl, perl perl-native swig-native"
 PACKAGECONFIG[apache2] = ",,apache2,"
Signature · 1 line
2.11.0
#6 lore raw

PATCH 7/11 apparmor: no need to conditionalise PACKAGES

In reply to Ross Burton

A package with no content is not generated, so there's no need to conditionalise assignments to PACKAGES.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-security/AppArmor/apparmor_2.12.bb +1 -1
index 529414f..b5ac613 100644
@@ -143,7 +143,7 @@ SYSTEMD_PACKAGES = "${PN}"
 SYSTEMD_SERVICE_${PN} = "apparmor.service"
 SYSTEMD_AUTO_ENABLE = "disable"
 
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'mod-${PN}', '', d)}"
+PACKAGES += "mod-${PN}"
 
 FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}"
 FILES_mod-${PN} = "${libdir}/apache2/modules/*"
Signature · 1 line
2.11.0
#7 lore raw

PATCH 8/11 apparmor: remove pointless ALLOW_EMPTY

In reply to Ross Burton

${PN} has content, so there's no need to set ALLOW_EMPTY_${PN}.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 2 --
 1 file changed, 2 deletions(-)
recipes-security/AppArmor/apparmor_2.12.bb +0 -2
index b5ac613..39c45e5 100644
@@ -148,8 +148,6 @@ PACKAGES += "mod-${PN}"
 FILES_${PN} += "/lib/apparmor/ ${sysconfdir}/apparmor ${PYTHON_SITEPACKAGES_DIR}"
 FILES_mod-${PN} = "${libdir}/apache2/modules/*"
 
-ALLOW_EMPTY_${PN} = "1"
-
 RDEPENDS_${PN} += "bash lsb"
 RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','python','python3 python3-modules','', d)}"
 RDEPENDS_${PN}_remove += "${@bb.utils.contains('PACKAGECONFIG','perl','','perl', d)}"
Signature · 1 line
2.11.0
#8 lore raw

PATCH 9/11 apparmor: systemd.bbclas is useful even when disabled

In reply to Ross Burton

The systemd bbclass will remove any systemd files that have been installed if systemd is disabled, so always install the files and always inherit.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
recipes-security/AppArmor/apparmor_2.12.bb +3 -7
index 39c45e5..92602f3 100644
@@ -29,8 +29,7 @@ SRC_URI[sha256sum] = "8a2b0cd083faa4d0640f579024be3a629faa7db3b99540798a1a050e2e
 
 PARALLEL_MAKE = ""
 
-inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan manpages
-inherit ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
+inherit pkgconfig autotools-brokensep update-rc.d python3native perlnative ptest cpan manpages systemd
 
 PACKAGECONFIG ??= "python perl"
 PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages"
@@ -101,11 +100,8 @@ do_install () {
 
 	install ${WORKDIR}/apparmor ${D}/${INIT_D_DIR}/apparmor
 	install ${WORKDIR}/functions ${D}/lib/apparmor
-	if [ "${VIRTUAL-RUNTIME_init_manager}" = "systemd" ]; then
-		install -d ${D}${systemd_system_unitdir}
-		install ${WORKDIR}/apparmor.service \
-			${D}${systemd_system_unitdir}
-	fi
+	install -d ${D}${systemd_system_unitdir}
+	install ${WORKDIR}/apparmor.service ${D}${systemd_system_unitdir}
 }
 
 do_compile_ptest () {
Signature · 1 line
2.11.0
#9 lore raw

PATCH 10/11 apparmor: if Perl is disabled remove perl-using scripts

In reply to Ross Burton

aa-notify uses the Perl bindings, so isn't usable when perl is disabled.

---
 recipes-security/AppArmor/apparmor_2.12.bb | 5 +++++
 1 file changed, 5 insertions(+)
recipes-security/AppArmor/apparmor_2.12.bb +5 -0
index 92602f3..ac03a56 100644
@@ -86,6 +86,11 @@ do_install () {
 	oe_runmake -C ${B}/parser DESTDIR="${D}" install
 	oe_runmake -C ${B}/profiles DESTDIR="${D}" install
 
+	# If perl is disabled this script won't be any good
+	if ! ${@bb.utils.contains('PACKAGECONFIG','perl','true','false', d)}; then
+		rm -f ${D}${sbindir}/aa-notify
+	fi
+
 	if test -z "${HTTPD}" ; then
 		oe_runmake -C ${B}/changehat/mod_apparmor DESTDIR="${D}" install
 	fi
Signature · 1 line
2.11.0
#10 lore raw

PATCH 11/11 apparmor: backport a patch to fix tool paths instead of sedding

In reply to Ross Burton

Sedding is ugly, and as upstream have already fixed this cherry-pick the patch instead.

---
 recipes-security/AppArmor/apparmor_2.12.bb       |  3 +-
 recipes-security/AppArmor/files/tool-paths.patch | 37 ++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 recipes-security/AppArmor/files/tool-paths.patch
recipes-security/AppArmor/apparmor_2.12.bb +1 -2
index ac03a56..efa93e6 100644
@@ -17,6 +17,7 @@ SRC_URI = " \
 	http://archive.ubuntu.com/ubuntu/pool/main/a/${BPN}/${BPN}_${PV}.orig.tar.gz \
 	file://disable_perl_h_check.patch \
 	file://crosscompile_perl_bindings.patch \
+	file://tool-paths.patch \
 	file://apparmor.rc \
 	file://functions \
 	file://apparmor \
@@ -56,8 +57,6 @@ do_configure() {
 	libtoolize --automake -c --force
 	automake -ac
 	./configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
-	sed -i -e 's#^YACC.*#YACC := bison#' ${S}/parser/Makefile
-	sed -i -e 's#^LEX.*#LEX := flex#' ${S}/parser/Makefile
 }
 
 do_compile () {
recipes-security/AppArmor/files/tool-paths.patch new file +37 -0
new file mode 100644
index 0000000..aaf08da
@@ -0,0 +1,37 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <[email protected]>
+
+From e7edd937adcbf1b3c8d38a31de5bacb2029b1965 Mon Sep 17 00:00:00 2001
+From: John Johansen <[email protected]>
+Date: Thu, 4 Oct 2018 23:15:28 -0700
+Subject: [PATCH] parser: fix Makefile hardcoded paths to flex and bison
+
+The hardcoded paths for flex and python can break builds on systems
+where those tools are stored in an alternate location. Use which
+to lookup where flex and bison are available.
+
+This fixes issue #4
+
+Signed-off-by: John Johansen <[email protected]>
+---
+ parser/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/parser/Makefile b/parser/Makefile
+index 4d370c36..015c218d 100644
+--- a/parser/Makefile
++++ b/parser/Makefile
+@@ -27,9 +27,9 @@ INSTALL_CONFDIR=${DESTDIR}${CONFDIR}
+ LOCALEDIR=/usr/share/locale
+ MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5
+ 
+-YACC	:= /usr/bin/bison
++YACC	:= bison
+ YFLAGS	:= -d
+-LEX	:= /usr/bin/flex
++LEX	:= flex
+ LEXFLAGS = -B -v
+ WARNINGS = -Wall
+ EXTRA_WARNINGS = -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter
+-- 
+2.11.0
Signature · 1 line
2.11.0
#11 lore raw
In reply to Ross Burton
Quoted 4 lines · Ross Burton
---
 README | 7 +++++++
 1 file changed, 7 insertions(+)

series merged.

thanks

Quoted 19 lines
README +7 -0
index e238271..c15fea9 100644
@@ -57,6 +57,13 @@ Send pull requests, patches, comments or questions to [email protected]
 When sending single patches, please using something like:
 'git send-email -1 --to [email protected] --subject-prefix=meta-security][PATCH'
 
+These values can be set as defaults for this repository:
+
+$ git config sendemail.to [email protected]
+$ git config format.subjectPrefix meta-security][PATCH
+
+Now you can just do 'git send-email origin/master' to send all local patches.
+
 Maintainers:    Armin Kuster <[email protected]>
                 Saul Wold <[email protected]>