mdadm: fix do_package failed when changed local.conf but not cleaned
PATCH 1/1 mdadm: fix do_package failed when changed local.conf but not cleaned
From: Changqing Li <[email protected]>
reproduce steps:
1. add DISTRO_FEATURE_append = 'usrmerge' in local.conf
2. bitbake mdadm --success
3. remove DISTRO_FEATURE_append = 'usrmerge' from local.conf
4. bitbake mdadm -- failed when do_package
it is not proper to change source Makefile during do_compile by sed, change to add patch for it.
[YOCTO: #13493]
--- .../mdadm/files/0001-mdadm-support-usrmerge.patch | 46 ++++++++++++++++++++++ meta/recipes-extended/mdadm/mdadm_4.1.bb | 7 ++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-extended/mdadm/files/0001-mdadm-support-usrmerge.patch
meta/recipes-extended/mdadm/files/0001-mdadm-support-usrmerge.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 2c7ccea05d7cf9dde48d735faa511d1b06c14878 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Thu, 5 Sep 2019 18:03:11 +0800 +Subject: [PATCH] mdadm: support usrmerge + +Upstream-Status: Inappropriate[oe-specific] + +Signed-off-by: Changqing Li <[email protected]> +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 4839001..466e960 100644 +--- a/Makefile ++++ b/Makefile +@@ -88,7 +88,7 @@ MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(RUN_DIR) + # place for autoreplace cookies + FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots +-SYSTEMD_DIR=/lib/systemd/system ++SYSTEMD_DIR=${SYSTEMD_UNITDIR}/system + LIB_DIR=/usr/libexec/mdadm + + COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] || echo -DNO_COROSYNC) +@@ -120,7 +120,7 @@ LDLIBS=-ldl + + INSTALL = /usr/bin/install + DESTDIR = +-BINDIR = /sbin ++BINDIR = ${BASE_SBINDIR} + MANDIR = /usr/share/man + MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 +@@ -128,7 +128,7 @@ MAN8DIR = $(MANDIR)/man8 + + UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null) + ifndef UDEVDIR +- UDEVDIR = /lib/udev ++ UDEVDIR = ${NONARCH_BASE_LIBDIR}/udev + endif + + ifeq (,$(findstring s,$(MAKEFLAGS))) +-- +2.7.4 +
meta/recipes-extended/mdadm/mdadm_4.1.bb +4 -3
@@ -22,6 +22,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ file://mdadm.init \ file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ file://include_sysmacros.patch \ + ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','file://0001-mdadm-support-usrmerge.patch','',d)} \ " SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598" SRC_URI[sha256sum] = "ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a"
@@ -41,13 +42,13 @@ CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' -EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' +EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" BASE_SBINDIR="${base_sbindir}" \ + NONARCH_BASE_LIBDIR="${nonarch_base_libdir}" \ + SYSTEMD_UNITDIR="${systemd_unitdir}"' DEBUG_OPTIMIZATION_append = " -Wno-error" do_compile() { - # Point to right sbindir - sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" -e "s;SYSTEMD_DIR=/lib/systemd/system;SYSTEMD_DIR=${systemd_unitdir}/system;" ${S}/Makefile oe_runmake SYSROOT="${STAGING_DIR_TARGET}" }
Signature · 1 line
2.7.4
✗ patchtest: failure for mdadm: fix do_package failed when changed local.conf but not cleaned
== Series Details ==
Series: mdadm: fix do_package failed when changed local.conf but not cleaned
Revision: 1
URL : https://patchwork.openembedded.org/series/19720/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:
* Patch mdadm: fix do_package failed when changed local.conf but not cleaned Issue Yocto Project bugzilla tag is not correctly formatted [test_bugzilla_entry_format] Suggested fix Specify bugzilla ID in commit description with format: "[YOCTO #<bugzilla ID>]"
If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
Quoted 93 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of [email protected]
Sent: den 5 september 2019 13:19
To: [email protected]
Subject: [OE-core] [PATCH] mdadm: fixdo_packagefailed when changed local.conf but not cleanedFrom: Changqing Li <[email protected]>
reproduce steps:
1. addDISTRO_FEATURE_append= 'usrmerge' in local.conf
2. bitbake mdadm --success
3. removeDISTRO_FEATURE_append= 'usrmerge' from local.conf
4. bitbake mdadm -- failed whendo_packageit is not proper to change source
Makefileduringdo_compileby sed, change to add patch for it.[YOCTO: #13493]
Signed-off-by Changqing Li <[email protected]>--- .../mdadm/files/0001-mdadm-support-usrmerge.patch | 46 ++++++++++++++++++++++ meta/recipes-extended/mdadm/mdadm_4.1.bb | 7 ++-- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-extended/mdadm/files/0001-mdadm-support-usrmerge.patch
(quoted diff) +0
-0usrmerge.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-support- usrmerge.patch
new file mode 100644
index 0000000..f1aa119meta/recipes-extended/mdadm/files/0001-mdadm-support- new file +0
-0usrmerge.patch
meta/recipes-extended/mdadm/files/0001-mdadm-support- new file +25
-0@@ -0,0 +1,46 @@ +From 2c7ccea05d7cf9dde48d735faa511d1b06c14878 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Thu, 5 Sep 2019 18:03:11 +0800 +Subject: [PATCH] mdadm: support usrmerge + +Upstream-Status: Inappropriate[oe-specific] + +Signed-off-by: Changqing Li <[email protected]> +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 4839001..466e960 100644 +--- a/Makefile ++++ b/Makefile +@@ -88,7 +88,7 @@ MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(RUN_DIR) + # place for autoreplace cookies + FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots +-SYSTEMD_DIR=/lib/systemd/system ++SYSTEMD_DIR=${SYSTEMD_UNITDIR}/system + LIB_DIR=/usr/libexec/mdadm + + COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] ||echo -DNO_COROSYNC)
+@@ -120,7 +120,7 @@ LDLIBS=-ldlmeta/recipes-extended/mdadm/files/0001-mdadm-support- new file +20
-0+ + INSTALL = /usr/bin/install + DESTDIR = +-BINDIR = /sbin ++BINDIR = ${BASE_SBINDIR} + MANDIR = /usr/share/man + MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 +@@ -128,7 +128,7 @@ MAN8DIR = $(MANDIR)/man8 + + UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null) + ifndef UDEVDIR +- UDEVDIR = /lib/udev ++ UDEVDIR = ${NONARCH_BASE_LIBDIR}/udev + endif + + ifeq (,$(findstring s,$(MAKEFLAGS))) +-- +2.7.4 +meta/recipes- renamed from meta/recipes-extended/mdadm/mdadm_4.1.bb +0
-0extended/mdadm/mdadm_4.1.bb
index 74c94f6..efeb09d 100644
meta/recipes-extended/mdadm/mdadm_4.1.bb SRC_URI = · line 26
Quoted 5 lines
meta/recipes-extended/mdadm/mdadm_4.1.bb +1
-0@@ -22,6 +22,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ file://mdadm.init \ file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ file://include_sysmacros.patch \ + ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','file://0001-mdadm-support-usrmerge.patch','',d)} \
Since the patch will work regardless of whether usrmerge is enabled or not, I think it is better to always apply it. The same goes for the corresponding path for bootchart2.
Quoted 21 lines
meta/recipes-extended/mdadm/mdadm_4.1.bb +0
-0" SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598"SRC_URI[sha256sum] = "
ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a"meta/recipes-extended/mdadm/mdadm_4.1.bb +3
-4@@ -41,13 +42,13 @@ CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' -EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' +EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" BASE_SBINDIR="${base_sbindir}" \ + NONARCH_BASE_LIBDIR="${nonarch_base_libdir}" \ + SYSTEMD_UNITDIR="${systemd_unitdir}"' DEBUG_OPTIMIZATION_append = " -Wno-error" do_compile() { - # Point to right sbindir - sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" -e "s;SYSTEMD_DIR=/lib/systemd/system;SYSTEMD_DIR=${systemd_unitdir}/system;" ${S}/Makefile oe_runmake SYSROOT="${STAGING_DIR_TARGET}" } --
Quoted 1 line
2.7.4
//Peter
Quoted 93 lines · Peter Kjellerstedt
Quoted 93 lines
-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of [email protected]
Sent: den 5 september 2019 13:19
To: [email protected]
Subject: [OE-core] [PATCH] mdadm: fixdo_packagefailed when changed local.conf but not cleanedFrom: Changqing Li <[email protected]>
reproduce steps:
1. addDISTRO_FEATURE_append= 'usrmerge' in local.conf
2. bitbake mdadm --success
3. removeDISTRO_FEATURE_append= 'usrmerge' from local.conf
4. bitbake mdadm -- failed whendo_packageit is not proper to change source
Makefileduringdo_compileby sed, change to add patch for it.[YOCTO: #13493]
Signed-off-by Changqing Li <[email protected]>--- .../mdadm/files/0001-mdadm-support-usrmerge.patch | 46 ++++++++++++++++++++++ meta/recipes-extended/mdadm/mdadm_4.1.bb | 7 ++-- 2 files changed, 50 insertions(+), 3 deletions(-)create mode 100644 meta/recipes-extended/mdadm/files/0001-mdadm-
support-usrmerge.patch(quoted diff) +0
-0usrmerge.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-support- usrmerge.patch
new file mode 100644
index 0000000..f1aa119meta/recipes-extended/mdadm/files/0001-mdadm-support- new file +0
-0usrmerge.patch
meta/recipes-extended/mdadm/files/0001-mdadm-support- new file +25
-0@@ -0,0 +1,46 @@ +From 2c7ccea05d7cf9dde48d735faa511d1b06c14878 Mon Sep 17 00:00:00 2001 +From: Changqing Li <[email protected]> +Date: Thu, 5 Sep 2019 18:03:11 +0800 +Subject: [PATCH] mdadm: support usrmerge + +Upstream-Status: Inappropriate[oe-specific] + +Signed-off-by: Changqing Li <[email protected]> +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Makefile b/Makefile +index 4839001..466e960 100644 +--- a/Makefile ++++ b/Makefile +@@ -88,7 +88,7 @@ MAP_PATH = $(MAP_DIR)/$(MAP_FILE) + MDMON_DIR = $(RUN_DIR) + # place for autoreplace cookies + FAILED_SLOTS_DIR = $(RUN_DIR)/failed-slots +-SYSTEMD_DIR=/lib/systemd/system ++SYSTEMD_DIR=${SYSTEMD_UNITDIR}/system + LIB_DIR=/usr/libexec/mdadm + + COROSYNC:=$(shell [ -f $(SYSROOT)/usr/include/corosync/cmap.h ] ||echo -DNO_COROSYNC)
+@@ -120,7 +120,7 @@ LDLIBS=-ldlmeta/recipes-extended/mdadm/files/0001-mdadm-support- new file +20
-0+ + INSTALL = /usr/bin/install + DESTDIR = +-BINDIR = /sbin ++BINDIR = ${BASE_SBINDIR} + MANDIR = /usr/share/man + MAN4DIR = $(MANDIR)/man4 + MAN5DIR = $(MANDIR)/man5 +@@ -128,7 +128,7 @@ MAN8DIR = $(MANDIR)/man8 + + UDEVDIR := $(shell $(PKG_CONFIG) --variable=udevdir udev 2>/dev/null) + ifndef UDEVDIR +- UDEVDIR = /lib/udev ++ UDEVDIR = ${NONARCH_BASE_LIBDIR}/udev + endif + + ifeq (,$(findstring s,$(MAKEFLAGS))) +-- +2.7.4 +meta/recipes- renamed from meta/recipes-extended/mdadm/mdadm_4.1.bb +0
-0extended/mdadm/mdadm_4.1.bb
index 74c94f6..efeb09d 100644meta/recipes-extended/mdadm/mdadm_4.1.bb +0
-0@@ -22,6 +22,7 @@ SRC_URI =
Quoted 8 lines
meta/recipes-extended/mdadm/mdadm_4.1.bb SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ · line 25
Quoted 5 lines
meta/recipes-extended/mdadm/mdadm_4.1.bb +1
-0"${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \ file://mdadm.init \ file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \ file://include_sysmacros.patch \ + ${@bb.utils.contains('DISTRO_FEATURES','usrmerge','file://0001-mdadm-support-usrmerge.patch','',d)} \Since the patch will work regardless of whether usrmerge is enabled or not, I think it is better to always apply it. The same goes for the corresponding path for bootchart2.
yes, I will send V2 as recommanded.
Quoted 26 lines
Quoted 22 lines
meta/recipes-extended/mdadm/mdadm_4.1.bb +0
-0" SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598"SRC_URI[sha256sum] = "
ab7688842908d3583a704d491956f31324c3a5fc9f6a04653cb75d19f1934f4a"meta/recipes-extended/mdadm/mdadm_4.1.bb +3
-4@@ -41,13 +42,13 @@ CFLAGS_append_powerpc64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn64 = ' -D__SANE_USERSPACE_TYPES__' CFLAGS_append_mipsarchn32 = ' -D__SANE_USERSPACE_TYPES__' -EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' +EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}" BASE_SBINDIR="${base_sbindir}" \ + NONARCH_BASE_LIBDIR="${nonarch_base_libdir}" \ + SYSTEMD_UNITDIR="${systemd_unitdir}"' DEBUG_OPTIMIZATION_append = " -Wno-error" do_compile() { - # Point to right sbindir - sed -i -e "s;BINDIR = /sbin;BINDIR = $base_sbindir;" -e "s;UDEVDIR = /lib;UDEVDIR = $nonarch_base_libdir;" -e "s;SYSTEMD_DIR=/lib/systemd/system;SYSTEMD_DIR=${systemd_unitdir}/system;" ${S}/Makefile oe_runmake SYSROOT="${STAGING_DIR_TARGET}" } --Quoted 1 line
2.7.4
//Peter
Signature · 3 lines
BRs Sandy(Li Changqing)