Patchwork [2/2] util-linux: install issue fix for sdk build

login
register
mail settings
Submitter Kim Bøndergaard
Date Jan. 31, 2013, 10:35 a.m.
Message ID <eac9ce9e355b2c52fda3bf8bce02a13e995e19f5.1359628173.git.kibo@prevas.dk>
Download mbox | patch
Permalink /patch/217150/
State RFC
Delegated to: Esben Haabendal
Headers show

Comments

Kim Bøndergaard - Jan. 31, 2013, 10:35 a.m.
---
 recipes/util-linux/util-linux.inc | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
Esben Haabendal - March 4, 2013, 8:54 a.m.
Kim Bøndergaard <kibo@prevas.dk> writes:

> ---
>  recipes/util-linux/util-linux.inc | 27 ++++++++++++++++++++++++++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/recipes/util-linux/util-linux.inc b/recipes/util-linux/util-linux.inc
> index 961c5a4..78479bb 100644
> --- a/recipes/util-linux/util-linux.inc
> +++ b/recipes/util-linux/util-linux.inc
> @@ -46,7 +46,9 @@ EXTRA_OEMAKE += "V=1"
>  # Grrrr... at least some versions of util-linux insists on having
>  # an sbin dir even though it is told to put everything in bin.  At
>  # least it seems to respect requests on dropping usr prefix
> -do_install[postfuncs] += "do_install_sbin_fixup"
> +INSTALL_POSTFUNC = "do_install_sbin_fixup"
> +INSTALL_POSTFUNC:sdk = "do_install_sdk_fixup"
> +do_install[postfuncs] += "${INSTALL_POSTFUNC}"

Why not just replace the original do_install_sbin_fixup with the code in
do_install_sdk_fixup?

>  do_install_sbin_fixup () {
>          if [ ${base_sbindir} != "/sbin" ] ; then
>  		if [ -d ${D}/sbin ] ; then
> @@ -56,6 +58,28 @@ do_install_sbin_fixup () {
>  	fi
>  }
>  
> +do_install_sdk_fixup () {
> +	if [ ${base_sbindir} != "/sbin" ] ; then
> +		if [ -d ${D}/sbin ] ; then
> +			cp -ar ${D}/sbin/. ${D}${bindir}/. \
> +				&& rm -rf ${D}/sbin
> +		fi
> +	fi
> +	if [ ${sbindir} != "/usr/sbin" ] ; then
> +		if [ -d ${D}/usr/sbin ] ; then
> +			cp -ar ${D}/usr/sbin/. ${D}${bindir}/. \
> +				&& rm -rf ${D}/usr/sbin
> +		fi
> +	fi
> +	if [ ${bindir} != "/usr/bin" ] ; then
> +		if [ -d ${D}/usr/bin ] ; then
> +			cp -ar ${D}/usr/bin/. ${D}${bindir}/. \
> +				&& rm -rf ${D}/usr/bin
> +		fi
> +	fi
> +
> +}
> +
>  FILES_${PN}-doc += "${datadir}/getopt/"
>  
>  inherit auto-package-utils auto-package-libs
> @@ -70,3 +94,4 @@ FILES_${PN}-libmount-dev += "${includedir}/libmount"
>  FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 ${bindir}/ppc \
>  	${bindir}/ppc32 ${bindir}/ppc64"
>  FILES_${PN}-swapon = "${sbindir}/swapoff"
> +

Stray white-space change, please remove from patch.

/Esben

Patch

diff --git a/recipes/util-linux/util-linux.inc b/recipes/util-linux/util-linux.inc
index 961c5a4..78479bb 100644
--- a/recipes/util-linux/util-linux.inc
+++ b/recipes/util-linux/util-linux.inc
@@ -46,7 +46,9 @@  EXTRA_OEMAKE += "V=1"
 # Grrrr... at least some versions of util-linux insists on having
 # an sbin dir even though it is told to put everything in bin.  At
 # least it seems to respect requests on dropping usr prefix
-do_install[postfuncs] += "do_install_sbin_fixup"
+INSTALL_POSTFUNC = "do_install_sbin_fixup"
+INSTALL_POSTFUNC:sdk = "do_install_sdk_fixup"
+do_install[postfuncs] += "${INSTALL_POSTFUNC}"
 do_install_sbin_fixup () {
         if [ ${base_sbindir} != "/sbin" ] ; then
 		if [ -d ${D}/sbin ] ; then
@@ -56,6 +58,28 @@  do_install_sbin_fixup () {
 	fi
 }
 
+do_install_sdk_fixup () {
+	if [ ${base_sbindir} != "/sbin" ] ; then
+		if [ -d ${D}/sbin ] ; then
+			cp -ar ${D}/sbin/. ${D}${bindir}/. \
+				&& rm -rf ${D}/sbin
+		fi
+	fi
+	if [ ${sbindir} != "/usr/sbin" ] ; then
+		if [ -d ${D}/usr/sbin ] ; then
+			cp -ar ${D}/usr/sbin/. ${D}${bindir}/. \
+				&& rm -rf ${D}/usr/sbin
+		fi
+	fi
+	if [ ${bindir} != "/usr/bin" ] ; then
+		if [ -d ${D}/usr/bin ] ; then
+			cp -ar ${D}/usr/bin/. ${D}${bindir}/. \
+				&& rm -rf ${D}/usr/bin
+		fi
+	fi
+
+}
+
 FILES_${PN}-doc += "${datadir}/getopt/"
 
 inherit auto-package-utils auto-package-libs
@@ -70,3 +94,4 @@  FILES_${PN}-libmount-dev += "${includedir}/libmount"
 FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 ${bindir}/ppc \
 	${bindir}/ppc32 ${bindir}/ppc64"
 FILES_${PN}-swapon = "${sbindir}/swapoff"
+