Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned
@ 2019-09-24  6:00 changqing.li
  2019-09-24 11:31 ` Ross Burton
  2019-10-08  3:16 ` Changqing Li
  0 siblings, 2 replies; 5+ messages in thread
From: changqing.li @ 2019-09-24  6:00 UTC (permalink / raw)
  To: openembedded-core

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_install 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 639382e..18cc87b 100644
--- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
+++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
@@ -23,6 +23,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
 	   file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \
            file://include_sysmacros.patch \
            file://0001-mdadm-skip-test-11spare-migration.patch \
+           file://0001-mdadm-support-usrmerge.patch \
            "
 
 SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598"
@@ -43,13 +44,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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned
  2019-09-24  6:00 [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned changqing.li
@ 2019-09-24 11:31 ` Ross Burton
  2019-10-08  3:16 ` Changqing Li
  1 sibling, 0 replies; 5+ messages in thread
From: Ross Burton @ 2019-09-24 11:31 UTC (permalink / raw)
  To: openembedded-core

On 24/09/2019 07:00, changqing.li@windriver.com wrote:
> 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_install 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
> +
> @@ -43,13 +44,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}"'

Can't you just pass BINDIR=${base_sbindir} MANDIR=${docdir}/man 
UDEVDIR=${nonarch_base_libdir}/udev etc, instead of patching the makefile?

Ross


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned
  2019-09-24  6:00 [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned changqing.li
  2019-09-24 11:31 ` Ross Burton
@ 2019-10-08  3:16 ` Changqing Li
  2019-10-28 22:05   ` Ross Burton
  1 sibling, 1 reply; 5+ messages in thread
From: Changqing Li @ 2019-10-08  3:16 UTC (permalink / raw)
  To: openembedded-core

Ping

On 9/24/19 2:00 PM, changqing.li@windriver.com wrote:
> 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_install 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 639382e..18cc87b 100644
> --- a/meta/recipes-extended/mdadm/mdadm_4.1.bb
> +++ b/meta/recipes-extended/mdadm/mdadm_4.1.bb
> @@ -23,6 +23,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
>   	   file://0001-mdadm-add-option-y-for-use-syslog-to-recive-event-re.patch \
>              file://include_sysmacros.patch \
>              file://0001-mdadm-skip-test-11spare-migration.patch \
> +           file://0001-mdadm-support-usrmerge.patch \
>              "
>   
>   SRC_URI[md5sum] = "51bf3651bd73a06c413a2f964f299598"
> @@ -43,13 +44,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}"
>   }
>   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned
  2019-10-08  3:16 ` Changqing Li
@ 2019-10-28 22:05   ` Ross Burton
  2019-10-29  9:52     ` Changqing Li
  0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2019-10-28 22:05 UTC (permalink / raw)
  To: openembedded-core

On 08/10/2019 04:16, Changqing Li wrote:
> Ping

My previous comment still stands:

Can't you just pass BINDIR=${base_sbindir} MANDIR=${docdir}/man 
UDEVDIR=${nonarch_base_libdir}/udev etc, instead of patching the makefile?

Ross



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned
  2019-10-28 22:05   ` Ross Burton
@ 2019-10-29  9:52     ` Changqing Li
  0 siblings, 0 replies; 5+ messages in thread
From: Changqing Li @ 2019-10-29  9:52 UTC (permalink / raw)
  To: Ross Burton, openembedded-core


On 10/29/19 6:05 AM, Ross Burton wrote:
> On 08/10/2019 04:16, Changqing Li wrote:
>> Ping
>
> My previous comment still stands:
>
> Can't you just pass BINDIR=${base_sbindir} MANDIR=${docdir}/man 
> UDEVDIR=${nonarch_base_libdir}/udev etc, instead of patching the 
> makefile?
>
> Ross
>
Oh,  I missed your last comments.  Thanks for remind.     I have send a 
V3 for this.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-29  9:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24  6:00 [PATCH V2] mdadm: fix do_package failed when changed local.conf but not cleaned changqing.li
2019-09-24 11:31 ` Ross Burton
2019-10-08  3:16 ` Changqing Li
2019-10-28 22:05   ` Ross Burton
2019-10-29  9:52     ` Changqing Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox