From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: "changqing.li@windriver.com" <changqing.li@windriver.com>,
"openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] mdadm: fix do_package failed when changed local.conf but not cleaned
Date: Thu, 5 Sep 2019 13:53:47 +0000 [thread overview]
Message-ID: <7e606b1fc76248459bdcc7b3d365ebcc@xbox06.axis.com> (raw)
In-Reply-To: <1567682351-87682-1-git-send-email-changqing.li@windriver.com>
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-bounces@lists.openembedded.org> On Behalf Of
> changqing.li@windriver.com
> Sent: den 5 september 2019 13:19
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH] mdadm: fix do_package failed when changed
> local.conf but not cleaned
>
> From: Changqing Li <changqing.li@windriver.com>
>
> 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]
>
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
> .../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
>
> diff --git a/meta/recipes-extended/mdadm/files/0001-mdadm-support-
> usrmerge.patch b/meta/recipes-extended/mdadm/files/0001-mdadm-support-
> usrmerge.patch
> new file mode 100644
> index 0000000..f1aa119
> --- /dev/null
> +++ b/meta/recipes-extended/mdadm/files/0001-mdadm-support-
> usrmerge.patch
> @@ -0,0 +1,46 @@
> +From 2c7ccea05d7cf9dde48d735faa511d1b06c14878 Mon Sep 17 00:00:00 2001
> +From: Changqing Li <changqing.li@windriver.com>
> +Date: Thu, 5 Sep 2019 18:03:11 +0800
> +Subject: [PATCH] mdadm: support usrmerge
> +
> +Upstream-Status: Inappropriate[oe-specific]
> +
> +Signed-off-by: Changqing Li <changqing.li@windriver.com>
> +---
> + 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
> +
> diff --git a/meta/recipes-extended/mdadm/mdadm_4.1.bb b/meta/recipes-
> extended/mdadm/mdadm_4.1.bb
> index 74c94f6..efeb09d 100644
> --- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
> +++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
> @@ -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.
> "
> 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}"
> }
>
> --
> 2.7.4
//Peter
next prev parent reply other threads:[~2019-09-05 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 11:19 [PATCH] mdadm: fix do_package failed when changed local.conf but not cleaned changqing.li
2019-09-05 11:32 ` ✗ patchtest: failure for " Patchwork
2019-09-05 13:53 ` Peter Kjellerstedt [this message]
2019-09-06 1:19 ` [PATCH] " Changqing Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e606b1fc76248459bdcc7b3d365ebcc@xbox06.axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=changqing.li@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.