[OE-core] [PATCH] libidn2: fix buildpaths qa warning

2019-01-16 Thread kai.kang
From: Kai Kang 

Fix buildpaths qa warning of libidn2:

| WARNING: libidn2-2.0.5-r0 do_package_qa: QA Issue: File
| 
/work/core2-64-poky-linux/libidn2/2.0.5-r0/packages-split/libidn2-dev/usr/lib/pkgconfig/libidn2.pc
| in package contained reference to tmpdir [buildpaths]

Signed-off-by: Kai Kang 
---
 meta/recipes-extended/libidn/libidn2_2.0.5.bb | 4 
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-extended/libidn/libidn2_2.0.5.bb 
b/meta/recipes-extended/libidn/libidn2_2.0.5.bb
index 0daf7a6877..da77c4402d 100644
--- a/meta/recipes-extended/libidn/libidn2_2.0.5.bb
+++ b/meta/recipes-extended/libidn/libidn2_2.0.5.bb
@@ -26,4 +26,8 @@ EXTRA_OECONF += "--disable-rpath \
 LICENSE_${PN} = "(GPLv2+ | LGPLv3)"
 LICENSE_${PN}-bin = "GPLv3+"
 
+do_install_append () {
+sed -i 's#${RECIPE_SYSROOT}##' ${D}${libdir}/pkgconfig/libidn2.pc
+}
+
 BBCLASSEXTEND = "native nativesdk"
-- 
2.20.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] bitbake.conf: reset default value of DEBUG_PREFIX_MAP

2019-01-16 Thread kai.kang
From: Kai Kang 

Reset default value of DEBUG_PREFIX_MAP with '-fdebug-prefix-map'.
Specifying -fdebug-prefix-map is equivalent to specifying all the
individual -f*-prefix-map options which means including
-fmacro-prefix-map and -fdebug-prefix-map currently. Option
-fmacro-prefix-map helps to avoid buildpaths qa warnings which caused
by __FILE__ macro expansion for packages such as llvm and librepo.

Signed-off-by: Kai Kang 
---
 meta/conf/bitbake.conf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 0bdcd04d74..d20460e845 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -599,9 +599,9 @@ EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} "
 # Optimization flags.
 ##
 # Beware: applied last to first
-DEBUG_PREFIX_MAP ?= 
"-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
- -fdebug-prefix-map=${STAGING_DIR_HOST}= \
- -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+DEBUG_PREFIX_MAP ?= 
"-ffile-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+ -ffile-prefix-map=${STAGING_DIR_HOST}= \
+ -ffile-prefix-map=${STAGING_DIR_NATIVE}= \
 "
 DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
 
-- 
2.20.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] extrausers.bbclass: Suggest to use IMAGE_CLASSES rather than INHERIT

2019-01-16 Thread Peter Kjellerstedt
Since this class is only useful for image recipes, it is better to
suggest adding it via IMAGE_CLASSES instead of INHERIT in the example.

Also make the example a bit more readable by indenting the variable
values.

Signed-off-by: Peter Kjellerstedt 
---
 meta/classes/extrausers.bbclass | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/meta/classes/extrausers.bbclass b/meta/classes/extrausers.bbclass
index 7709407b69..32569e97db 100644
--- a/meta/classes/extrausers.bbclass
+++ b/meta/classes/extrausers.bbclass
@@ -1,18 +1,17 @@
-# This bbclass is mainly used for image level user/group configuration.
+# This bbclass is used for image level user/group configuration.
 # Inherit this class if you want to make EXTRA_USERS_PARAMS effective.
 
 # Below is an example showing how to use this functionality.
-# INHERIT += "extrausers"
+# IMAGE_CLASSES += "extrausers"
 # EXTRA_USERS_PARAMS = "\
-# useradd -p '' tester; \
-# groupadd developers; \
-# userdel nobody; \
-# groupdel -g video; \
-# groupmod -g 1020 developers; \
-# usermod -s /bin/sh tester; \
+# useradd -p '' tester; \
+# groupadd developers; \
+# userdel nobody; \
+# groupdel -g video; \
+# groupmod -g 1020 developers; \
+# usermod -s /bin/sh tester; \
 # "
 
-
 inherit useradd_base
 
 PACKAGE_INSTALL_append = " ${@['', 'base-passwd 
shadow'][bool(d.getVar('EXTRA_USERS_PARAMS'))]}"
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] python3-manifest.json: add logging to rdepends

2019-01-16 Thread mingli.yu
From: Mingli Yu 

Add loggging to rdepends for python3-2to3
and python3-multiprocessing.

before patch:
 # python3
 Python 3.5.6 (default, Jan 15 2019, 03:09:16)
 [GCC 8.2.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from multiprocessing import util
 >>> util.get_logger()
 Traceback (most recent call last):
   File "", line 1, in 
   File "/usr/lib/python3.5/multiprocessing/util.py", line 65, in get_logger
 import logging
 ImportError: No module named 'logging'
 >>>

after patch:
 # python3
 Python 3.5.6 (default, Jan 15 2019, 09:26:38)
 [GCC 8.2.0] on linux
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from multiprocessing import util
 >>> util.get_logger()
 
 >>>

 Steps to reproduce:
 1, add below line to local.conf
 IMAGE_INSTALL_append += " python3-multiprocessing"
 2, bitbake core-image-base
 3, runqemu qemux86 slirp nographic core-image-base

Signed-off-by: Mingli Yu 
---
 meta/recipes-devtools/python/python3/python3-manifest.json | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/python/python3/python3-manifest.json 
b/meta/recipes-devtools/python/python3/python3-manifest.json
index 3641d5bd7b1..174eac63d0c 100644
--- a/meta/recipes-devtools/python/python3/python3-manifest.json
+++ b/meta/recipes-devtools/python/python3/python3-manifest.json
@@ -106,7 +106,8 @@
 "2to3": {
 "summary": "Python automated Python 2 to 3 code translator",
 "rdepends": [
-"core"
+"core",
+"logging"
 ],
 "files": [
 "${bindir}/2to3-*",
@@ -820,7 +821,8 @@
 "multiprocessing": {
 "summary": "Python multiprocessing support",
 "rdepends": [
-"core"
+"core",
+"logging"
 ],
 "files": [
 
"${libdir}/python${PYTHON_MAJMIN}/lib-dynload/_multiprocessing.*.so",
-- 
2.17.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/2] python2-manifest.json: add logging to rdepends

2019-01-16 Thread mingli.yu
From: Mingli Yu 

Add loggging to rdepends for python-2to3
and python-multiprocessing.

before patch:
 # python
 Python 2.7.15 (default, Jan 15 2019, 03:09:01)
 [GCC 8.2.0] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from multiprocessing import util
 >>> util.get_logger()
 Traceback (most recent call last):
   File "", line 1, in 
   File "/usr/lib/python2.7/multiprocessing/util.py", line 89, in get_logger
 import logging, atexit
 ImportError: No module named logging
 >>>

After patch:
 # python
 Python 2.7.15 (default, Jan 15 2019, 09:05:49)
 [GCC 8.2.0] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from multiprocessing import util
 >>> util.get_logger()
 
 >>>

 Steps to reproduce:
 1, add below line to local.conf
 IMAGE_INSTALL_append += " python-multiprocessing"
 2, bitbake core-image-base
 3, runqemu qemux86 slirp nographic core-image-base

Signed-off-by: Mingli Yu 
---
 meta/recipes-devtools/python/python/python2-manifest.json | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/python/python/python2-manifest.json 
b/meta/recipes-devtools/python/python/python2-manifest.json
index 4fff54a95bf..abaa10dbd2e 100644
--- a/meta/recipes-devtools/python/python/python2-manifest.json
+++ b/meta/recipes-devtools/python/python/python2-manifest.json
@@ -106,7 +106,8 @@
 "2to3": {
 "summary": "Python automated Python 2 to 3 code translator", 
 "rdepends": [
-"core"
+"core",
+"logging"
 ], 
 "files": [
 "${bindir}/2to3", 
@@ -728,6 +729,7 @@
 "core", 
 "fcntl", 
 "io", 
+"logging",
 "pickle", 
 "subprocess", 
 "threading"
-- 
2.17.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] cmake.bbclass: make cleaning of build directory on configure optional

2019-01-16 Thread Douglas Royds

On 17/01/19 12:01 PM, Richard Purdie wrote:


On Thu, 2019-01-17 at 11:51 +1300, Douglas Royds wrote:

From: Sam Nobs 

The do_configure task is sensitive to changes in recipes and
configuration files.
This can be time consuming because cmake.bbclass deletes the ${B}
directory
at the beginning of the do_configure task. CMake figures
out what to do when it's run again, so unless your cmake files are
buggy, there shouldn't
be any need to erase the build directory and start afresh.

This change allows you to turn this behaviour off, either globally or
on a per-recipe basis, e.g.

OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE_pn-yourrecipe = ""

Signed-off-by: Sam Nobs 
---
  meta/classes/cmake.bbclass | 23 ++-
  1 file changed, 18 insertions(+), 5 deletions(-)

This may give a speed boost for some cases but it does come at a
potential risk of determinism issues.

I appreciate you've made it configurable but that actually further
concerns me as we now have two code paths which potentially both have
to be tested.

Is this change really worth it?

Cheers,

Richard



For us, the benefit is beyond question - on our proprietary C++ 
component, the compile from scratch after a configure is punishing, 10s 
of minutes per MACHINE.


We are counting on binary reproducibility to flush out any determinism 
issues with the CMake code, that is, we will be comparing our 
incremental builds with our clean builds. Note also that we are deleting 
all the generated CMake artefacts, but leaving the object files behind. 
CMake will force a complete rebuild should there be any change in the 
CFLAGS and friends.




diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index fa7f68c99b..b9ec68ac9a 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -63,6 +63,11 @@ EXTRA_OECMAKE_BUILD_prepend_task-install =
"${PARALLEL_MAKEINST}"
  OECMAKE_TARGET_COMPILE ?= "all"
  OECMAKE_TARGET_INSTALL ?= "install"
  
+# Clean the build directory before configuring.

+# Some recipes don't want/need this as cmake is perfectly
+# capable of figuring out what to do, so we allow it to be turned
off
+OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE ??= "true"
+
  # CMake expects target architectures in the format of uname(2),
  # which do not always match TARGET_ARCH, so all the necessary
  # conversions should happen here.
@@ -133,12 +138,20 @@ cmake_do_configure() {
bbnote "cmake.bbclass no longer uses
OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds
with B=WORKDIR/build."
fi
  
-	if [ "${S}" != "${B}" ]; then

-   rm -rf ${B}
-   mkdir -p ${B}
-   cd ${B}
+   if [ ${@oe.types.boolean('${OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE
}')} = True ]; then
+   if [ "${S}" != "${B}" ]; then
+   rm -rf ${B}
+   mkdir -p ${B}
+   cd ${B}
+   else
+   # For an in-tree build, delete all object files
and CMake artefacts
+   find ${B} -name CMakeFiles -or -name Makefile
-or -name cmake_install.cmake -or -name CMakeCache.txt -delete
+   fi
else
-   find ${B} -name CMakeFiles -or -name Makefile -or -name
cmake_install.cmake -or -name CMakeCache.txt -delete
+   # Selectively delete CMake artefacts to ensure that -c
configure has a consistent result
+   rm -f CMakeCache.txt
+   cmake_version=$(cmake --version | head -1 | sed
's#^[^0-9]*\([0-9.]*\).*$#\1#' )
+   rm -fr CMakeFiles/$cmake_version/
fi
  
  	# Just like autotools cmake can use a site file to cache result

that need generated binaries to run
--
2.17.1



--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] libxpm: add explicit gettext-native dependency

2019-01-16 Thread Alistair Francis
In an issue similar to "atk: add explicit gettext-native dependency"
(964ea8bfc455f6017dc834104d96b8f5aa40a5bc) we need to add gettext-native
to DEPENDS explicitly as the gettext class reduces dependencies in
native builds.

Signed-off-by: Alistair Francis 
---
 meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb 
b/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
index 13a1b919ed..57b202cae3 100644
--- a/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
+++ b/meta/recipes-graphics/xorg-lib/libxpm_3.5.12.bb
@@ -12,7 +12,7 @@ protocol."
 
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
-DEPENDS += "libxext libsm libxt"
+DEPENDS += "libxext libsm libxt gettext-native"
 PE = "1"
 
 XORG_PN = "libXpm"
-- 
2.19.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] cmake.bbclass: make cleaning of build directory on configure optional

2019-01-16 Thread Richard Purdie
On Thu, 2019-01-17 at 11:51 +1300, Douglas Royds wrote:
> From: Sam Nobs 
> 
> The do_configure task is sensitive to changes in recipes and
> configuration files.
> This can be time consuming because cmake.bbclass deletes the ${B}
> directory
> at the beginning of the do_configure task. CMake figures
> out what to do when it's run again, so unless your cmake files are
> buggy, there shouldn't
> be any need to erase the build directory and start afresh.
> 
> This change allows you to turn this behaviour off, either globally or
> on a per-recipe basis, e.g.
> 
> OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE_pn-yourrecipe = ""
> 
> Signed-off-by: Sam Nobs 
> ---
>  meta/classes/cmake.bbclass | 23 ++-
>  1 file changed, 18 insertions(+), 5 deletions(-)

This may give a speed boost for some cases but it does come at a
potential risk of determinism issues.

I appreciate you've made it configurable but that actually further
concerns me as we now have two code paths which potentially both have
to be tested.

Is this change really worth it?

Cheers,

Richard

> diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
> index fa7f68c99b..b9ec68ac9a 100644
> --- a/meta/classes/cmake.bbclass
> +++ b/meta/classes/cmake.bbclass
> @@ -63,6 +63,11 @@ EXTRA_OECMAKE_BUILD_prepend_task-install =
> "${PARALLEL_MAKEINST} "
>  OECMAKE_TARGET_COMPILE ?= "all"
>  OECMAKE_TARGET_INSTALL ?= "install"
>  
> +# Clean the build directory before configuring.
> +# Some recipes don't want/need this as cmake is perfectly
> +# capable of figuring out what to do, so we allow it to be turned
> off
> +OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE ??= "true"
> +
>  # CMake expects target architectures in the format of uname(2),
>  # which do not always match TARGET_ARCH, so all the necessary
>  # conversions should happen here.
> @@ -133,12 +138,20 @@ cmake_do_configure() {
>   bbnote "cmake.bbclass no longer uses
> OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds
> with B=WORKDIR/build."
>   fi
>  
> - if [ "${S}" != "${B}" ]; then
> - rm -rf ${B}
> - mkdir -p ${B}
> - cd ${B}
> + if [ ${@oe.types.boolean('${OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE
> }')} = True ]; then
> + if [ "${S}" != "${B}" ]; then
> + rm -rf ${B}
> + mkdir -p ${B}
> + cd ${B}
> + else
> + # For an in-tree build, delete all object files
> and CMake artefacts
> + find ${B} -name CMakeFiles -or -name Makefile
> -or -name cmake_install.cmake -or -name CMakeCache.txt -delete
> + fi
>   else
> - find ${B} -name CMakeFiles -or -name Makefile -or -name
> cmake_install.cmake -or -name CMakeCache.txt -delete
> + # Selectively delete CMake artefacts to ensure that -c
> configure has a consistent result
> + rm -f CMakeCache.txt
> + cmake_version=$(cmake --version | head -1 | sed
> 's#^[^0-9]*\([0-9.]*\).*$#\1#' )
> + rm -fr CMakeFiles/$cmake_version/
>   fi
>  
>   # Just like autotools cmake can use a site file to cache result
> that need generated binaries to run
> -- 
> 2.17.1
> 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] mesa: Allow building the r600 driver

2019-01-16 Thread Alistair Francis
The r600 DRI driver does not require LLVM, so remove it from the LLVM
dependency PACKAGE_CONFIG.

Also remove the x86 requirement on the drivers as they are work on
non-x86 systems. This was tested on a RISC-V board.

Signed-off-by: Alistair Francis 
---
 meta/recipes-graphics/mesa/mesa.inc | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-graphics/mesa/mesa.inc 
b/meta/recipes-graphics/mesa/mesa.inc
index 0cc0a82de4..a21d933dd8 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -85,14 +85,18 @@ PACKAGECONFIG[imx] = ""
 GALLIUMDRIVERS = "swrast"
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'etnaviv', 
',etnaviv', '', d)}"
 GALLIUMDRIVERS_append ="${@bb.utils.contains('PACKAGECONFIG', 'imx', ',imx', 
'', d)}"
-GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 
'radeonsi,r600', '', d)}"
-PACKAGECONFIG[r600] = ""
+
+# radeonsi requires LLVM
+GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 
',radeonsi', '', d)}"
 GALLIUMDRIVERS_LLVM33_ENABLED = 
"${@oe.utils.version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, 
len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
 GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if 
${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
-GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 
'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 
'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
-GALLIUMDRIVERS_append_x86 = ",virgl"
-GALLIUMDRIVERS_append_x86-64 = ",virgl"
+
+PACKAGECONFIG[r600] = ""
+
+GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', 
',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS_append = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 
',r600', '', d)}"
+GALLIUMDRIVERS_append = ",virgl"
+
 # keep --with-gallium-drivers separate, because when only one of gallium 
versions is enabled, other 2 were adding --without-gallium-drivers
 PACKAGECONFIG[gallium]  = "--enable-texture-float 
--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
 MESA_LLVM_RELEASE ?= "6.0"
-- 
2.19.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] cmake.bbclass: make cleaning of build directory on configure optional

2019-01-16 Thread Douglas Royds
From: Sam Nobs 

The do_configure task is sensitive to changes in recipes and configuration 
files.
This can be time consuming because cmake.bbclass deletes the ${B} directory
at the beginning of the do_configure task. CMake figures
out what to do when it's run again, so unless your cmake files are buggy, there 
shouldn't
be any need to erase the build directory and start afresh.

This change allows you to turn this behaviour off, either globally or on a 
per-recipe basis, e.g.

OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE_pn-yourrecipe = ""

Signed-off-by: Sam Nobs 
---
 meta/classes/cmake.bbclass | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index fa7f68c99b..b9ec68ac9a 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -63,6 +63,11 @@ EXTRA_OECMAKE_BUILD_prepend_task-install = 
"${PARALLEL_MAKEINST} "
 OECMAKE_TARGET_COMPILE ?= "all"
 OECMAKE_TARGET_INSTALL ?= "install"
 
+# Clean the build directory before configuring.
+# Some recipes don't want/need this as cmake is perfectly
+# capable of figuring out what to do, so we allow it to be turned off
+OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE ??= "true"
+
 # CMake expects target architectures in the format of uname(2),
 # which do not always match TARGET_ARCH, so all the necessary
 # conversions should happen here.
@@ -133,12 +138,20 @@ cmake_do_configure() {
bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH.  The 
default behaviour is now out-of-tree builds with B=WORKDIR/build."
fi
 
-   if [ "${S}" != "${B}" ]; then
-   rm -rf ${B}
-   mkdir -p ${B}
-   cd ${B}
+   if [ ${@oe.types.boolean('${OECMAKE_CLEAN_BUILDDIR_ON_CONFIGURE}')} = 
True ]; then
+   if [ "${S}" != "${B}" ]; then
+   rm -rf ${B}
+   mkdir -p ${B}
+   cd ${B}
+   else
+   # For an in-tree build, delete all object files and 
CMake artefacts
+   find ${B} -name CMakeFiles -or -name Makefile -or -name 
cmake_install.cmake -or -name CMakeCache.txt -delete
+   fi
else
-   find ${B} -name CMakeFiles -or -name Makefile -or -name 
cmake_install.cmake -or -name CMakeCache.txt -delete
+   # Selectively delete CMake artefacts to ensure that -c 
configure has a consistent result
+   rm -f CMakeCache.txt
+   cmake_version=$(cmake --version | head -1 | sed 
's#^[^0-9]*\([0-9.]*\).*$#\1#' )
+   rm -fr CMakeFiles/$cmake_version/
fi
 
# Just like autotools cmake can use a site file to cache result that 
need generated binaries to run
-- 
2.17.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] ipk_write_pkg: add error output

2019-01-16 Thread Alejandro del Castillo
Signed-off-by: Alejandro del Castillo 
---
 meta/classes/package_ipk.bbclass | 21 -
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 508b7dcaff..5eec20a35b 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -224,15 +224,18 @@ def ipk_write_pkg(pkg, d):
 conffiles.close()
 
 os.chdir(basedir)
-subprocess.check_output("PATH=\"%s\" %s %s %s" % 
(localdata.getVar("PATH"),
-  
d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir),
-stderr=subprocess.STDOUT,
-shell=True)
-
-if d.getVar('IPK_SIGN_PACKAGES') == '1':
-ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
-ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, 
d.getVar('PACKAGE_ARCH'))
-sign_ipk(d, ipk_to_sign)
+try:
+subprocess.check_output("PATH=\"%s\" %s %s %s" % 
(localdata.getVar("PATH"),
+  
d.getVar("OPKGBUILDCMD"), pkg, pkgoutdir),
+stderr=subprocess.STDOUT,
+shell=True)
+except subprocess.CalledProcessError as e:
+bb.error("Failed to create package, opkg-build failed with: %s" % 
e.output.decode('utf-8'))
+else:
+if d.getVar('IPK_SIGN_PACKAGES') == '1':
+ipkver = "%s-%s" % (d.getVar('PKGV'), d.getVar('PKGR'))
+ipk_to_sign = "%s/%s_%s_%s.ipk" % (pkgoutdir, pkgname, ipkver, 
d.getVar('PACKAGE_ARCH'))
+sign_ipk(d, ipk_to_sign)
 
 finally:
 cleanupcontrol(root)
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Mis-generation of shell script (run.do_install)?

2019-01-16 Thread Richard Purdie
On Wed, 2019-01-16 at 15:20 -0500, Jason Andryuk wrote:
> On Wed, Jan 16, 2019 at 9:02 AM Richard Purdie
>  wrote:
> > On Wed, 2019-01-16 at 08:55 -0500, Jason Andryuk wrote:
> > > On Tue, Jan 8, 2019 at 1:26 PM <
> > > richard.pur...@linuxfoundation.org>
> > > wrote:
> > > OpenXT builds 8 or 9 different MACHINEs and images in sequence in
> > > the
> > > same build directory.  Maybe 6 are core2-32 and two are core2-64. 
> > > The
> > > 32bit ones run first.
> > 
> > The hash we don't have is from a core2-32 MACHINE. I'm wondering
> > which configurations you might have parsed for a core2-32 MACHINE
> > between October and December?
> 
> Which "configurations" are you asking about?

I mean the machine configurations. It sounds like it was just the
standard ones from OpenXT which most of your builds would loop through.
I did try and reproduce the hash using those but I could be missing
something.

> The standard OpenXT build loops through building all 8 images and
> packaging them up into an installer iso.  Often I run that build
> script, but sometimes I just build individual machines manually.
>
> I was mainly working on the core2-64 machines immediately prior to
> this event.  I was very surprised when it occured since 1) I didn't
> expect binutils to be re-built and 2) I wasn't working on the
> openxt-installer machine which failed.
> 
> > Was TMPDIR ever cleaned? If not, do you have the python-async
> > WORKDIR
> > for core2-32? The TMPDIR/logs directory may also have useful hints
> > about the configurations built...
> 
> Unfortunately, yes, I cleaned TMPDIR when I hit the build
> error.  Same with the sstate-cache.
> 
> In general, I don't see python-async in TMPDIR after running through
> the OpenXT build.  Would that be because an early machine builds
> python-async, but then it gets cleared out of TMPDIR when a later
> machine/image are built?
>
> > > 
[...]
> All the base OpenXT machines have "-mstackrealign" in their conf.  My
> new 64bit machines do not have it.  I don't recall working with
> core2-32 MACHINES at the time.  The new layer I pulled in only had a
> layer.conf and a 64bit machine.conf.
> 
> In my second container, I `rm -rf cache/ tmp-glibc/ sstate-cache/`.
> Running the build of the first OpenXT machine, bb_codeparse.dat gets
> populated with python-async:
> '3c6fe664c51d2f793f8fd0eb103d68cb': frozenset({'find', 'sed',
> 'install', 'mv', 'bbfatal_log', 'rmdir', '[', 'rm',
> '/home/build/openxt-compartments/build/tmp-glibc/work/core2-32-oe-
> linux/python-async/0.6.2-r0/recipe-sysroot-native/usr/bin/python-
> native/python',
> 'test'})
> 
> python-async is not in tmp-glibc/work and `grep -r tmp-glibc/log`
> doesn't turn up anything.  If I run `bitbake -g`, python-async
> doesn't
> appear in any of the output files.  Is bb_codeparser.data getting
> populated without building the recipe to be expected?

The data is in the codeparser cache which is first populated at parse
time so its enough just to parse the machine+recipe in question, not
build it. I think that explains the answer to a ew of your questions
above.

Sorry for asking so many questions btw, I'd just really love to be able
to reproduce this issue! Thanks for trying to help answer them too!

Is the bitbake-cookerdeamon.log file still there for this build (in the
top level build directory)?

Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Mis-generation of shell script (run.do_install)?

2019-01-16 Thread Jason Andryuk
On Wed, Jan 16, 2019 at 9:02 AM Richard Purdie
 wrote:
>
> On Wed, 2019-01-16 at 08:55 -0500, Jason Andryuk wrote:
> > On Tue, Jan 8, 2019 at 1:26 PM 
> > wrote:
> > > On Tue, 2018-12-18 at 12:45 -0500, Jason Andryuk wrote:
> > > > I can definitively state I have a hash in bb_codeparser.dat with
> > > > an
> > > > incorrect shellCacheLine entry and I don't know how it got there.
> > > >
> > > > The bad hash is 3df9018676de219bb3e46e88eea09c98.  I've attached
> > > > a
> > > > file with the binutils do_install() contents which hash to that
> > > > value.
> > > >
> > > > The bad 3df9018676de219bb3e46e88eea09c98 entry in the
> > > > bb_codeparser.dat returned
> > > > DEBUG: execs [
> > > > DEBUG: execs rm
> > > > DEBUG: execs install
> > > > DEBUG: execs test
> > > > DEBUG: execs sed
> > > > DEBUG: execs rmdir
> > > > DEBUG: execs bbfatal_log
> > > > DEBUG: execs mv
> > > > DEBUG: execs /home/build/openxt-compartments/build/tmp-
> > > > glibc/work/core2-32-oe-linux/python-async/0.6.2-r0/recipe-
> > > > sysroot-
> > > > native/usr/bin/python-native/python
> > > > DEBUG: execs find
> > >
> > > This is useful data (along with the attachment), thanks.
> > >
> > > I agree that this looks likely to have come from a core2-32 tuned
> > > machine (e.g. genericx86) from python-async do_install.
> > >
> > > How old was this build directory? Can you remember any details of
> > > the
> > > update history for it?
> >
> > I think the build directory was from the beginning of October 30th,
> > and I guess I hit the collision December 10th or so.
> >
> > > I'd be very interested to try and reproduce that hash. I locally
> > > blacklisted your collision from my cache and tried to reproduce
> > > this. I
> > > can generate a matching hash for the binutils do_install but I
> > > can't
> > > produce one matching the above.
> >
> > I tried around December 18th to generate the collision again.  I set
> > up a new container with an identical openxt path.  There, python-
> > async was built, but it did not have the colliding hash.  When core2-
> > 64 binutils was built, it had the expected hash.
> >
> > > Can you remember the history of this build directory and which
> > > updates
> > > it may have had? The python-async recipe is confined to OE-Core so
> > > its
> > > probably the revision history for the oe-core repo which is most
> > > interesting. Anything in the .git/logs directory for that which
> > > would
> > > help us replay the different versions you might have built?
> >
> > oe-core is checked out at 819aa151bd634122a46ffdd822064313c67f5ba5
> > It's a git submodule locked at a fixed revision, and it had not
> > changed in the build directory.
> >
> > OpenXT builds 8 or 9 different MACHINEs and images in sequence in the
> > same build directory.  Maybe 6 are core2-32 and two are core2-64. The
> > 32bit ones run first.
>
> The hash we don't have is from a core2-32 MACHINE. I'm wondering which
> configurations you might have parsed for a core2-32 MACHINE between
> October and December?

Which "configurations" are you asking about?

The standard OpenXT build loops through building all 8 images and
packaging them up into an installer iso.  Often I run that build
script, but sometimes I just build individual machines manually.

I was mainly working on the core2-64 machines immediately prior to
this event.  I was very surprised when it occured since 1) I didn't
expect binutils to be re-built and 2) I wasn't working on the
openxt-installer machine which failed.

> Was TMPDIR ever cleaned? If not, do you have the python-async WORKDIR
> for core2-32? The TMPDIR/logs directory may also have useful hints
> about the configurations built...

Unfortunately, yes, I cleaned TMPDIR when I hit the build error.  Same
with the sstate-cache.

In general, I don't see python-async in TMPDIR after running through
the OpenXT build.  Would that be because an early machine builds
python-async, but then it gets cleared out of TMPDIR when a later
machine/image are built?

> > I think the problem first manifest after I added an additional local
> > layer to BBLAYERS.  At that time, I started building an additional
> > MACHINE.  Along with the mis-generated run.do_install script, bitbake
> > was complaining about the binutils base hash mismatch which triggered
> > the re-build.  The first 64bit MACHINE included TUNE-CCARGS +=
> > "-mstackrealign" while the second did not.  Could that be a reason
> > why bitbake complained about the base hash mismatch?
>
> By the time the binutils error happens, the error is kind of lost in
> history and must have been added some time prior to that.
>
> We know its a build of python-async for a core2-32 MACHINE. Did you
> also try building those with the "-mstackrealign" option? Were there
> any other changes you can think of that would have applied to the
> core2-32 MACHINE builds?

All the base OpenXT machines have "-mstackrealign" in their conf.  My
new 64bit machines do not have it.  I don't recall working with

Re: [OE-core] Prelink problem

2019-01-16 Thread Mark Hatle
On 1/16/19 1:23 AM, Andrej Valek wrote:
> Hi all
> 
> Do we found some solution? As a workaround could be just add dependency
> to prelink native into rootfs if the command is really required.

If the image stuff needs prelink, there should be a dependency in place.  It
should only use prelink if the image-prelink is being used.

So really something probably needs to be added to image-prelink class that
activates unprelink behavior with opkg, and adds the necessary dependency.

--Mark

> Regards,
> Andrej
> 
> On 1/8/19 10:46 PM, Richard Purdie wrote:
>> On Tue, 2019-01-08 at 14:50 -0600, Mark Hatle wrote:
>>> On 1/8/19 2:37 PM, Burton, Ross wrote:
 On Tue, 8 Jan 2019 at 20:15, Mark Hatle 
 wrote:
>> No idea why the opkg rootfs code is doing prelink operations
>> when RPM
>> or dpkg don't.   CCing Mark who may have an idea here.  I
>> thought the
>> autobuilder exerised multilib-on-opkg, but maybe not.
>
> They all should be doing prelink operations.  The operation
> SHOULD be
> generically implemented as part of the image-prelink class, which
> is where I
> would have expected that copy to exist.
>
> If any of the package types of specifically doing something, that
> sounds
> broken...  but the generic ones (last I looked) said to copy in
> the config file
> [if it didn't exist], run prelink, remove the file [if it wasn't
> there to start
> with].

 Note that it's part of the incremental code, so needs to be in the
 rootfs code directly I suspect. Frankly I'd love to see incremental
 images removed.  It makes promises it can't keep (the moment a
 rootfs
 postprocess command is used, all bets are off) and massively
 complicates things.
>>>
>>> We assume the post process command is what an 'admin' would do.  So
>>> the various
>>> package managers should be able to deal with it in most
>>> cases.  (Note, obviously
>>> it's more freeform, but I wouldn't expect everything to work in you
>>> removed a
>>> large part of the filesystem for instance.)
>>>
>>> As for prelink, I'm surprised this is in the incremental code.  I'm
>>> not sure why
>>> it would be necessary unless the incremental work wants to UNPRELINK
>>> the rootfs
>>> before performing the upgrade?
>>>
>>> Prelink itself should still be run as a postprocess command that
>>> takes the
>>> output of the filesystem and reprocesses it.
>>>
>>> So something seems out of sync here.. (at a minimum probably should
>>> be better
>>> commented on why it's needed..)
>>
>> The code is there for incremental opkg multilib image support. Its
>> trying to compare whether binaries are identical. To make it work, it
>> has to "unprelink" the files first before comparing.
>>
>> I'm not convinced this is a good idea :/. I'm wondering if incremental
>> image generation makes sense at all in this context to be honest.
>>
>> Cheers,
>>
>> Richard
>>

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 1/1] ltp: Update to 20190115

2019-01-16 Thread Petr Vorel
Hi Richard, Khem,

> > Thanks for looking at this. Unfortunately it failed in testing on most
> > targets:

> > https://autobuilder.yoctoproject.org/typhoon/#/builders/46/builds/181/steps/7/logs/step1b

> > (one failure given as an example).

> > Warnings as errors are good during development but sometimes less
> > useful during release due to the variety of end user configurations.

> with glibc 2.29 in play
> http://errors.yoctoproject.org/Errors/Details/216829/

Thanks for your reports.
Is there any way I could easily reproduce it?
Some config I can download?
I'm testing with default config.
I'm sorry for dummy question, I'm more experienced with Buildroot.

Kind regards,
Petr
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 1/1] ltp: Update to 20190115

2019-01-16 Thread Khem Raj
On Wed, Jan 16, 2019 at 3:05 AM Richard Purdie
 wrote:
>
> On Wed, 2019-01-16 at 00:06 +0100, Petr Vorel wrote:
> > Updated patches
> > * 0004-build-Add-option-to-select-libc-implementation.patch
> > * 0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
> > * 0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch
> >
> > Removed patches (accepted in upstream)
> > * 0001-getcpu01-Rename-getcpu-to-avoid-conflict-with-glibc-.patch
> > * 0001-netns_helper.sh-use-ping-6-when-ping6-is-not-avaliab.patch
> > * 0001-setrlimit05-Use-another-method-to-get-bad-address.patch
> > * 0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch
> > * 0001-statx-fix-compile-errors.patch
> > * 0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch
> > (accepted v2 version, see
> > http://lists.linux.it/pipermail/ltp/2018-October/009691.html)
> >
> > Signed-off-by: Petr Vorel 
> > ---
> > Changes v1->v2:
> > * Update SRCREV (previous version used old version)
> > * Refresh patches
>
> Thanks for looking at this. Unfortunately it failed in testing on most
> targets:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/46/builds/181/steps/7/logs/step1b
>
> (one failure given as an example).
>
> Warnings as errors are good during development but sometimes less
> useful during release due to the variety of end user configurations.
>
with glibc 2.29 in play
http://errors.yoctoproject.org/Errors/Details/216829/


> Cheers,
>
> Richard
>
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Mis-generation of shell script (run.do_install)?

2019-01-16 Thread Richard Purdie
On Wed, 2019-01-16 at 08:55 -0500, Jason Andryuk wrote:
> On Tue, Jan 8, 2019 at 1:26 PM 
> wrote:
> > On Tue, 2018-12-18 at 12:45 -0500, Jason Andryuk wrote:
> > > I can definitively state I have a hash in bb_codeparser.dat with
> > > an
> > > incorrect shellCacheLine entry and I don't know how it got there.
> > > 
> > > The bad hash is 3df9018676de219bb3e46e88eea09c98.  I've attached
> > > a
> > > file with the binutils do_install() contents which hash to that
> > > value.
> > > 
> > > The bad 3df9018676de219bb3e46e88eea09c98 entry in the
> > > bb_codeparser.dat returned
> > > DEBUG: execs [
> > > DEBUG: execs rm
> > > DEBUG: execs install
> > > DEBUG: execs test
> > > DEBUG: execs sed
> > > DEBUG: execs rmdir
> > > DEBUG: execs bbfatal_log
> > > DEBUG: execs mv
> > > DEBUG: execs /home/build/openxt-compartments/build/tmp-
> > > glibc/work/core2-32-oe-linux/python-async/0.6.2-r0/recipe-
> > > sysroot-
> > > native/usr/bin/python-native/python
> > > DEBUG: execs find
> > 
> > This is useful data (along with the attachment), thanks.
> > 
> > I agree that this looks likely to have come from a core2-32 tuned
> > machine (e.g. genericx86) from python-async do_install.
> > 
> > How old was this build directory? Can you remember any details of
> > the
> > update history for it?
> 
> I think the build directory was from the beginning of October 30th,
> and I guess I hit the collision December 10th or so.
> 
> > I'd be very interested to try and reproduce that hash. I locally
> > blacklisted your collision from my cache and tried to reproduce
> > this. I
> > can generate a matching hash for the binutils do_install but I
> > can't
> > produce one matching the above.
> 
> I tried around December 18th to generate the collision again.  I set
> up a new container with an identical openxt path.  There, python-
> async was built, but it did not have the colliding hash.  When core2-
> 64 binutils was built, it had the expected hash.
> 
> > Can you remember the history of this build directory and which
> > updates
> > it may have had? The python-async recipe is confined to OE-Core so
> > its
> > probably the revision history for the oe-core repo which is most
> > interesting. Anything in the .git/logs directory for that which
> > would
> > help us replay the different versions you might have built?
> 
> oe-core is checked out at 819aa151bd634122a46ffdd822064313c67f5ba5
> It's a git submodule locked at a fixed revision, and it had not
> changed in the build directory.
> 
> OpenXT builds 8 or 9 different MACHINEs and images in sequence in the
> same build directory.  Maybe 6 are core2-32 and two are core2-64. The
> 32bit ones run first.

The hash we don't have is from a core2-32 MACHINE. I'm wondering which
configurations you might have parsed for a core2-32 MACHINE between
October and December?

Was TMPDIR ever cleaned? If not, do you have the python-async WORKDIR
for core2-32? The TMPDIR/logs directory may also have useful hints
about the configurations built...

> I think the problem first manifest after I added an additional local
> layer to BBLAYERS.  At that time, I started building an additional
> MACHINE.  Along with the mis-generated run.do_install script, bitbake
> was complaining about the binutils base hash mismatch which triggered
> the re-build.  The first 64bit MACHINE included TUNE-CCARGS +=
> "-mstackrealign" while the second did not.  Could that be a reason
> why bitbake complained about the base hash mismatch?

By the time the binutils error happens, the error is kind of lost in
history and must have been added some time prior to that.

We know its a build of python-async for a core2-32 MACHINE. Did you
also try building those with the "-mstackrealign" option? Were there
any other changes you can think of that would have applied to the
core2-32 MACHINE builds?

Cheers,

Richard



-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Mis-generation of shell script (run.do_install)?

2019-01-16 Thread Jason Andryuk
On Tue, Jan 8, 2019 at 1:26 PM  wrote:
>
> On Tue, 2018-12-18 at 12:45 -0500, Jason Andryuk wrote:
> > I can definitively state I have a hash in bb_codeparser.dat with an
> > incorrect shellCacheLine entry and I don't know how it got there.
> >
> > The bad hash is 3df9018676de219bb3e46e88eea09c98.  I've attached a
> > file with the binutils do_install() contents which hash to that
> > value.
> >
> > The bad 3df9018676de219bb3e46e88eea09c98 entry in the
> > bb_codeparser.dat returned
> > DEBUG: execs [
> > DEBUG: execs rm
> > DEBUG: execs install
> > DEBUG: execs test
> > DEBUG: execs sed
> > DEBUG: execs rmdir
> > DEBUG: execs bbfatal_log
> > DEBUG: execs mv
> > DEBUG: execs /home/build/openxt-compartments/build/tmp-
> > glibc/work/core2-32-oe-linux/python-async/0.6.2-r0/recipe-sysroot-
> > native/usr/bin/python-native/python
> > DEBUG: execs find
>
> This is useful data (along with the attachment), thanks.
>
> I agree that this looks likely to have come from a core2-32 tuned
> machine (e.g. genericx86) from python-async do_install.
>
> How old was this build directory? Can you remember any details of the
> update history for it?

I think the build directory was from the beginning of October 30th,
and I guess I hit the collision December 10th or so.

> I'd be very interested to try and reproduce that hash. I locally
> blacklisted your collision from my cache and tried to reproduce this. I
> can generate a matching hash for the binutils do_install but I can't
> produce one matching the above.

I tried around December 18th to generate the collision again.  I set
up a new container with an identical openxt path.  There, python-async
was built, but it did not have the colliding hash.  When core2-64
binutils was built, it had the expected hash.

> Can you remember the history of this build directory and which updates
> it may have had? The python-async recipe is confined to OE-Core so its
> probably the revision history for the oe-core repo which is most
> interesting. Anything in the .git/logs directory for that which would
> help us replay the different versions you might have built?

oe-core is checked out at 819aa151bd634122a46ffdd822064313c67f5ba5
It's a git submodule locked at a fixed revision, and it had not
changed in the build directory.

OpenXT builds 8 or 9 different MACHINEs and images in sequence in the
same build directory.  Maybe 6 are core2-32 and two are core2-64. The
32bit ones run first.

I think the problem first manifest after I added an additional local
layer to BBLAYERS.  At that time, I started building an additional
MACHINE.  Along with the mis-generated run.do_install script, bitbake
was complaining about the binutils base hash mismatch which triggered
the re-build.  The first 64bit MACHINE included TUNE-CCARGS +=
"-mstackrealign" while the second did not.  Could that be a reason why
bitbake complained about the base hash mismatch?

Without reproducing the hash, I'm more puzzled.

Regards,
Jason
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 14/15] util-linux: let -ptest package depend on all of util-linux

2019-01-16 Thread André Draszik
From: André Draszik 

ptest executes all the binaries, so they really need to be available
in the file system.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 47264028f2..458df5d047 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -290,7 +290,7 @@ python populate_packages_prepend() {
 }
 
 RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
-RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid 
util-linux-fsck btrfs-tools"
+RDEPENDS_${PN}-ptest = "bash grep coreutils which btrfs-tools ${PN}"
 
 do_compile_ptest() {
 oe_runmake buildtest-TESTS
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 15/15] utils-linux: final cleanup

2019-01-16 Thread André Draszik
From: André Draszik 

* use ${PN} instead of util-linux
* use PACKAGESPLITFUNCS for creating util-linux-lib* packages
  rather than an _append OVERRIDE
* sort ALTERNATIVE_LINK_NAME alphabetically
* Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use systemd_system_unitdir instead of open-coding
* inherit manpages so as to benefit from man-db processing (note
  that manpages are not generated here, we just want the
  automatic update of the package index caches
* use EXTRA_OEMAKE instead of duplicating command line arguments

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * use PACKAGESPLITFUNCS =+ rather than PACKAGESPLITFUNCS_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use systemd_system_unitdir instead of open-coding
* inherit manpages
* use EXTRA_OEMAKE instead of duplicating command line arguments
* also sort ALTERNATIVE_LINK_NAME for man pages
---
 meta/recipes-core/util-linux/util-linux.inc | 156 
 1 file changed, 65 insertions(+), 91 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 458df5d047..c5a8c4f41f 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -19,7 +19,7 @@ LIC_FILES_CHKSUM = 
"file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c
 
file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
 
 #gtk-doc is not enabled as it requires xmlto which requires util-linux
-inherit autotools gettext pkgconfig systemd update-alternatives python3-dir 
bash-completion ptest
+inherit autotools gettext manpages pkgconfig systemd update-alternatives 
python3-dir bash-completion ptest
 DEPENDS = "zlib ncurses virtual/crypt"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
@@ -28,8 +28,8 @@ MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-swaponoff"
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
+PACKAGES =+ "${PN}-swaponoff"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'${PN}-pylibmount', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -62,7 +62,16 @@ python util_linux_binpackages () {
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
 PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
 
-PACKAGES_DYNAMIC = "^util-linux-.*"
+python util_linux_libpackages() {
+do_split_packages(d, root='${base_libdir}', 
file_regex=r'^lib(.*)\.so\..*$',
+  output_pattern='${PN}-lib%s',
+  description='${PN} lib%s',
+  extra_depends='', prepend=True, allow_links=True)
+}
+
+PACKAGESPLITFUNCS =+ "util_linux_libpackages"
+
+PACKAGES_DYNAMIC = "^${PN}-.*"
 
 SHARED_EXTRA_OECONF = "--disable-use-tty-group \
--disable-makeinstall-chown \
@@ -76,49 +85,46 @@ SHARED_EXTRA_OECONF = "--disable-use-tty-group \
 "
 
 EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'"
 
 PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', 
d)}"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su 
--disable-runuser, libpam,"
-
 # Respect the systemd feature for uuidd
-PACKAGECONFIG[systemd] = "--with-systemd 
--with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemd 
--without-systemdsystemunitdir,systemd"
-
+PACKAGECONFIG[systemd] = "--with-systemd 
--with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd 
--without-systemdsystemunitdir,systemd"
 # Build setpriv requires libcap-ng
 PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
-
 # Build python bindings for libmount
 PACKAGECONFIG[pylibmount] = "--with-python=3 
--enable-pylibmount,--without-python --disable-pylibmount,python3"
-
 # Readline support
 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 
 ALLOW_EMPTY_${PN} = "1"
 FILES_${PN} = ""
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
-
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
-
 FILES_${PN}-last = "${bindir}/lastb"
 FILES_${PN}-mount = "${sysconfdir}/default/mountall"
-FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
-FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
-   ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
-  

Re: [OE-core] [PATCH] ptest-runner: pass libdir to DEFAULT_DIRECTORY when compiling

2019-01-16 Thread Burton, Ross
We maintain ptest-runner, so send a patch to that and just change the
srcrev in the recipe.

Ross

On Wed, 16 Jan 2019 at 08:34, Li Zhou  wrote:
>
> Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
> When libdir isn't "/usr/lib", it will cause "No ptests found" error
> when running "ptest-runner" command. Here pass libdir to
> DEFAULT_DIRECTORY when compiling to avoid that error.
>
> Signed-off-by: Li Zhou 
> ---
>  ...r-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch | 36 
> ++
>  .../ptest-runner/ptest-runner_2.3.bb   |  5 +--
>  2 files changed, 39 insertions(+), 2 deletions(-)
>  create mode 100644 
> meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
>
> diff --git 
> a/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
>  
> b/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
> new file mode 100644
> index 000..56e1f96
> --- /dev/null
> +++ 
> b/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
> @@ -0,0 +1,36 @@
> +From 6a663ac38c71108890e42f451f3a7b22afee0a40 Mon Sep 17 00:00:00 2001
> +From: Li Zhou 
> +Date: Wed, 16 Jan 2019 15:00:17 +0800
> +Subject: [PATCH] ptest-runner: remove DEFAULT_DIRECTORY's hard coded
> + initialization
> +
> +Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
> +Here make DEFAULT_DIRECTORY be able to be defined outside of c code,
> +in case libdir isn't "/usr/lib", which will cause "No ptests found"
> +error when running "ptest-runner" command. We will pass libdir to
> +DEFAULT_DIRECTORY when compiling to avoid that error.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Li Zhou 
> +---
> + main.c | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/main.c b/main.c
> +index 83600b7..e963efe 100644
> +--- a/main.c
>  b/main.c
> +@@ -37,7 +37,9 @@
> +
> + #include "utils.h"
> +
> ++#ifndef DEFAULT_DIRECTORY
> + #define DEFAULT_DIRECTORY "/usr/lib"
> ++#endif
> + #define DEFAULT_TIMEOUT 300
> +
> + static inline void
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb 
> b/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
> index 26add9b..9866d1a 100644
> --- a/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
> +++ b/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
> @@ -10,12 +10,13 @@ LIC_FILES_CHKSUM = 
> "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
>  SRCREV = "80712583732b4a809532f644fb09e7d2e812d7ba"
>  PV = "2.3+git${SRCPV}"
>
> -SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
> +SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \
> +   
> file://0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch"
>  S = "${WORKDIR}/git"
>
>  FILES_${PN} = "${bindir}/ptest-runner"
>
> -EXTRA_OEMAKE = "-e MAKEFLAGS="
> +EXTRA_OEMAKE = "-e MAKEFLAGS= CFLAGS="${CFLAGS} 
> -DDEFAULT_DIRECTORY=\\\"${libdir}\\\"""
>
>  do_compile () {
> oe_runmake
> --
> 1.9.1
>
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 13/15] util-linux: move /etc/default/mountall into -mount subpackage

2019-01-16 Thread André Draszik
From: André Draszik 

This should probably be there and now the main package is a real
meta-package only.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 000db880a1..47264028f2 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -44,19 +44,19 @@ python util_linux_binpackages () {
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${base_bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -92,11 +92,14 @@ PACKAGECONFIG[pylibmount] = "--with-python=3 
--enable-pylibmount,--without-pytho
 # Readline support
 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN} = ""
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
 FILES_${PN}-last = "${bindir}/lastb"
+FILES_${PN}-mount = "${sysconfdir}/default/mountall"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 11/15] util-linux: one package per binary (pt 4: bindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* ionice <- RRECOMMENDS
* lsblk <- RDEPENDS
* lscpu
* mcookie
* prlimit <- RRECOMMENDS
* unshare
* uuidgen

New packages:
* too many to list

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.

Nevertheless, all existing packages have been added to
RRECOMMENDS this time, even if they weren't in RDEPENDS /
RRECOMMENDS before.

Unfortunately, we need to add explicit ALTERNATIVE_LINK_NAME[]
for a few cases, as previously they were implied using
defaults by being specified in ALTERNATIVE_${PN}. We can't
easily automate that using do_split_packages(), so we
simply add them explicitly.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 45 ++---
 1 file changed, 21 insertions(+), 24 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index bab66f788e..7e3887dc92 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,12 +28,7 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-swaponoff \
- util-linux-uuidgen util-linux-lscpu \
- util-linux-mcookie \
- util-linux-lsblk \
- util-linux-prlimit \
- util-linux-ionice util-linux-unshare"
+PACKAGES =+ "util-linux-swaponoff"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 
 python util_linux_binpackages () {
@@ -60,6 +55,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+do_split_packages(d, root='${bindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -99,21 +98,14 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-uuidgen = "${bindir}/uuidgen"
-FILES_util-linux-prlimit = "${bindir}/prlimit"
-FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
+FILES_${PN}-last = "${bindir}/lastb"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \

${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
-FILES_util-linux-lsblk = "${bindir}/lsblk"
-FILES_util-linux-lscpu = "${bindir}/lscpu"
-
-FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
+FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 ${bindir}/uname26"
 
 # Util-linux' blkid replaces the e2fsprogs one
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
@@ -122,7 +114,6 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
-RRECOMMENDS_${PN} = "util-linux-prlimit util-linux-ionice"
 RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk 
${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
 RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount 
${PN}-mountpoint"
 
@@ -206,12 +197,6 @@ do_install_append_class-native () {
 
 ALTERNATIVE_PRIORITY = "80"
 
-ALTERNATIVE_${PN}  = " \
-hexdump last lastb logger mesg renice wall \
-setsid chrt flock utmpdump eject taskset fallocate \
-nsenter cal rev \
-"
-
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
 ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
@@ -219,9 

[OE-core] [PATCH v4 12/15] util-linux: simplify meta-package RDEPENDS / RRECOMMENDS

2019-01-16 Thread André Draszik
From: André Draszik 

The util-linux meta-package now simply RRECOMMENDS all
subpackages created. There is no distinction between what
it previously recommended or depended on for existing
packages.

This is to streamline the dependencies and to make things
less surprising.
It also stops the -dev package from depending on non-existing
packages like util-linux-losetup-dev etc.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: update commit message
---
 meta/recipes-core/util-linux/util-linux.inc | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 7e3887dc92..000db880a1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -33,16 +33,14 @@ PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 
'pylibmount', 'util-linux-pyl
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
+pn = d.getVar('PN')
+d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
+
 if d.getVar('ALTERNATIVE_' + pkg):
 return
 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
 d.setVar('ALTERNATIVE_' + pkg, modulename)
 
-def pkg_hook_with_recommends(f, pkg, file_regex, output_pattern, 
modulename):
-pn = d.getVar('PN')
-d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
-pkg_hook(f, pkg, file_regex, output_pattern, modulename)
-
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
@@ -54,11 +52,11 @@ python util_linux_binpackages () {
 do_split_packages(d, root='${sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+  hook=pkg_hook, extra_depends='', prepend=True)
 do_split_packages(d, root='${bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+  hook=pkg_hook, extra_depends='', prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -111,12 +109,6 @@ FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 
${bindir}/uname26"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
-RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
-
-RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk 
${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
-RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount 
${PN}-mountpoint"
-
 RRECOMMENDS_${PN}_class-native = ""
 RRECOMMENDS_${PN}_class-nativesdk = ""
 RDEPENDS_${PN}_class-native = ""
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 10/15] util-linux: one package per binary (pt 3: sbindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* blkdiscard <- RRECOMMENDS
* findfs
* fsck.cramfs
* mkfs <- RRECOMMENDS
* mkfs.cramfs
* partx
* readprofile <- RRECOMMENDS
* rfkill
* runuser <- RDEPENDS
* sfdisk <- RRECOMMENDS
* uuidd

New packages:
* too many to list

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.

Nevertheless, all existing packages have been added to
RRECOMMENDS this time, even if they weren't in RDEPENDS /
RRECOMMENDS before.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 42 -
 1 file changed, 16 insertions(+), 26 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 36a22cf6d7..bab66f788e 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,17 +28,13 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
- util-linux-swaponoff \
- util-linux-readprofile util-linux-uuidd \
- util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
- util-linux-mkfs util-linux-mcookie util-linux-rfkill \
- util-linux-lsblk util-linux-mkfs.cramfs \
- util-linux-partx \
- util-linux-findfs util-linux-prlimit \
+PACKAGES =+ "util-linux-swaponoff \
+ util-linux-uuidgen util-linux-lscpu \
+ util-linux-mcookie \
+ util-linux-lsblk \
+ util-linux-prlimit \
  util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
-PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -47,6 +43,11 @@ python util_linux_binpackages () {
 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
 d.setVar('ALTERNATIVE_' + pkg, modulename)
 
+def pkg_hook_with_recommends(f, pkg, file_regex, output_pattern, 
modulename):
+pn = d.getVar('PN')
+d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
+pkg_hook(f, pkg, file_regex, output_pattern, modulename)
+
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
@@ -55,6 +56,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook, extra_depends='', prepend=True)
+do_split_packages(d, root='${sbindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -94,16 +99,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
-FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
-FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
-FILES_util-linux-partx = "${sbindir}/partx"
-FILES_util-linux-findfs = "${sbindir}/findfs"
-FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
@@ -116,11 +113,6 @@ FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
 FILES_util-linux-lsblk = "${bindir}/lsblk"
 FILES_util-linux-lscpu = "${bindir}/lscpu"
 
-FILES_util-linux-mkfs = "${sbindir}/mkfs"
-
-FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
-FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
-
 FILES_util-linux-unshare = 

[OE-core] [PATCH v4 09/15] util-linux: one package per binary (pt 2: base_bindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* mount <- RRECOMMENDS
* umount <- RDEPENDS
* mountpoint <- RRECOMMENDS
* getopt
* su <- RDEPENDS

New packages:
* dmesg
* kill
* more

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.
Existing packages that aren't in RDEPENDS / RRECOMMENDS
haven't been added to RRECOMMENDS for that reason.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 32 -
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index a23fec69ea..36a22cf6d7 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -29,16 +29,16 @@ SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz
"
 
 PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
- util-linux-swaponoff util-linux-umount \
- util-linux-mount util-linux-readprofile util-linux-uuidd \
+ util-linux-swaponoff \
+ util-linux-readprofile util-linux-uuidd \
  util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
  util-linux-mkfs util-linux-mcookie util-linux-rfkill \
  util-linux-lsblk util-linux-mkfs.cramfs \
- util-linux-partx util-linux-mountpoint \
- util-linux-findfs util-linux-getopt util-linux-prlimit \
+ util-linux-partx \
+ util-linux-findfs util-linux-prlimit \
  util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
-PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -51,6 +51,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook, extra_depends='', prepend=True)
+do_split_packages(d, root='${base_bindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook, extra_depends='', prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -92,21 +96,18 @@ FILES_${PN}-dev += 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
 FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
 FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
-FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
 FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-findfs = "${sbindir}/findfs"
-FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
 FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
-FILES_util-linux-su = "${base_bindir}/su.${BPN} ${sysconfdir}/pam.d/su-l"
+FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
@@ -120,8 +121,6 @@ FILES_util-linux-mkfs = "${sbindir}/mkfs"
 FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
 FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 
-FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
-
 FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
 
 # Util-linux' blkid replaces the e2fsprogs one
@@ -131,8 +130,9 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 

[OE-core] [PATCH v4 08/15] util-linux: one package per binary (pt 1: base_sbindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Now that we have required infrastructure in place, we
can start creating one package per binary.

To make this process easier to follow, this is done
in steps, starting with binaries from base_sbindir.

Existing packages (and current dependency by main package):
* agetty
* blkid
* cfdisk <- RRECOMMENDS
* fdisk <- RRECOMMENDS
* fsck
* fstrim
* losetup <- RDEPENDS
* hwclock
* sulogin <- RDEPENDS
* swaponoff <- RDEPENDS
* switch-root <- RRECOMMENDS

New packages:
* blockdev
* ctrlaltdel
* mkswap
* nologin
* pivot-root
* swapon
* swapoff

swaponoff is empty now and simply depends on swapon swapoff

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.
Existing packages that aren't in RDEPENDS / RRECOMMENDS
haven't been added to RRECOMMENDS for that reason.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 64 ++---
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 4a72e3d40e..a23fec69ea 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,19 +28,35 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk 
util-linux-cfdisk util-linux-sfdisk \
- util-linux-swaponoff util-linux-losetup util-linux-umount \
+PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
+ util-linux-swaponoff util-linux-umount \
  util-linux-mount util-linux-readprofile util-linux-uuidd \
- util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs 
util-linux-fsck \
- util-linux-blkid util-linux-mkfs util-linux-mcookie 
util-linux-rfkill \
- util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
- util-linux-partx util-linux-hwclock util-linux-mountpoint \
- util-linux-findfs util-linux-getopt util-linux-sulogin 
util-linux-prlimit \
- util-linux-ionice util-linux-switch-root util-linux-unshare"
+ util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
+ util-linux-mkfs util-linux-mcookie util-linux-rfkill \
+ util-linux-lsblk util-linux-mkfs.cramfs \
+ util-linux-partx util-linux-mountpoint \
+ util-linux-findfs util-linux-getopt util-linux-prlimit \
+ util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
-PACKAGES_DYNAMIC = "^util-linux-lib.*"
+python util_linux_binpackages () {
+def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
+if d.getVar('ALTERNATIVE_' + pkg):
+return
+if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
+d.setVar('ALTERNATIVE_' + pkg, modulename)
+
+do_split_packages(d, root='${base_sbindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook, extra_depends='', prepend=True)
+}
+
+# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
+PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
+
+PACKAGES_DYNAMIC = "^util-linux-.*"
 
 SHARED_EXTRA_OECONF = "--disable-use-tty-group \
--disable-makeinstall-chown \
@@ -74,14 +90,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-agetty = "${base_sbindir}/agetty"
 FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
-FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
-FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}"
-FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
 FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
-FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} 
${base_sbindir}/swapoff.${BPN}"
-FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
 FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
 FILES_util-linux-umount = 

[OE-core] [PATCH v4 05/15] util-linux: fix the su and runuser packages

2019-01-16 Thread André Draszik
From: André Draszik 

The packages get an automatic RDEPENDS via shlibs, no
need to explicitly state it, so we can drop those
useless explicit assignments.

su is moved into ${base_bindir} in do_install(), so
because of a mismatched FILES specification su is
actually packaged into the main package at the moment,
not into the -su package as likely originally intended.

runuser needs the pam configuration files, so they should
be in the -runuser package, not in the main package.

While fixing this, we can simplify the update alternatives
processing for su.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index e479fc24e1..4a72e3d40e 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -96,7 +96,8 @@ FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
 FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
-FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l"
+FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
+FILES_util-linux-su = "${base_bindir}/su.${BPN} ${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
@@ -122,9 +123,6 @@ FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-RDEPENDS_util-linux-runuser += "libpam"
-RDEPENDS_util-linux-su += "libpam"
-
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
@@ -228,6 +226,7 @@ ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 
sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 
eject.1 logger.1"
+ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', 
'', d)}"
 
 ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
 ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
@@ -235,6 +234,7 @@ ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
 ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
 ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
 ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8"
+ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
 ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
 ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
 ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
@@ -263,6 +263,9 @@ ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
 ALTERNATIVE_util-linux-mount = "mount"
 ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
 
+ALTERNATIVE_${PN}-su = "su"
+ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+
 ALTERNATIVE_util-linux-umount = "umount"
 ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
 
@@ -305,15 +308,6 @@ ALTERNATIVE_LINK_NAME[switch_root] = 
"${base_sbindir}/switch_root"
 
 BBCLASSEXTEND = "native nativesdk"
 
-python do_package_prepend () {
-if '--enable-su' in d.getVar('EXTRA_OECONF').split():
-d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
-d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
-
-d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", 
d.expand('${base_bindir}/su'))
-d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", 
d.expand('${mandir}/man1/su.1'))
-}
-
 python populate_packages_prepend() {
 do_split_packages(d, '${base_libdir}', r'^lib(.*)\.so\..*$',
   output_pattern='util-linux-lib%s',
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 06/15] update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS

2019-01-16 Thread André Draszik
From: André Draszik 

At the moment, the update-alternatives file renaming is
happening right after copying into PKGD during packaging
time using an _append OVERRIDE to the copy function
perform_packagecopy().

This is not really readable and hard to maintain.

Additionally, this makes it impossible to e.g. populate
PACKAGES dynamically using do_split_packages() and still
do update-alternatives - update-alternatives file renaming
requires the PACKAGES variable to have been fully populated
to work correctly. On the other hand, do_split_packages()
can only execute after perform_packagecopy(), as it needs
PKGD populated; so it's impossible to insert
do_split_packages() early enough in a deterministic way in
this use-case.

As there doesn't seem to be a reason not to, convert
this to a proper function and use PACKAGE_PREPROCESS_FUNCS
instead - after all, that's what this is meant for.

No other classes or recipes in oe-core or meta-openembededd
seem to have a hard requirement on update-alterantives
executing before any other PACKAGE_PREPROCESS_FUNCS, so
this should be perfectly fine.

The only implication is that if compress_doc is inherited,
compressed man-page file names will end up being, e.g.
eject.1.util-linux.gz
  or
eject.1.gz.util-linux
based on the include of compress_doc.bbclass vs.
update-alternatives.bbclass order, but the symlink created
(alternative name) will always be correct.

This solves both problems:
* the code is easier to read / follow
* the above described use-case can be accomodated easily

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v4: * unconditionally assign PACKAGE_PREPROCESS_FUNCS
---
 meta/classes/update-alternatives.bbclass | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/meta/classes/update-alternatives.bbclass 
b/meta/classes/update-alternatives.bbclass
index f1250f877b..f3c014a5fc 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -131,14 +131,13 @@ def gen_updatealternativesvars(d):
 populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
 
 # We need to do the rename after the image creation step, but before
-# the split and strip steps..  packagecopy seems to be the earliest reasonable
-# place.
-python perform_packagecopy_append () {
-if update_alternatives_enabled(d):
-apply_update_alternative_renames(d)
-}
+# the split and strip steps..  PACKAGE_PREPROCESS_FUNCS is the right
+# place for that.
+PACKAGE_PREPROCESS_FUNCS += "apply_update_alternative_renames"
+python apply_update_alternative_renames () {
+if not update_alternatives_enabled(d):
+   return
 
-def apply_update_alternative_renames(d):
 # Check for deprecated usage...
 pn = d.getVar('BPN')
 if d.getVar('ALTERNATIVE_LINKS') != None:
@@ -204,6 +203,7 @@ def apply_update_alternative_renames(d):
 os.unlink(src)
 else:
 bb.warn('%s: Unable to resolve dangling symlink: %s' % 
(pn, alt_target))
+}
 
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
 
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 07/15] update-alternatives: try to update FILES_${PN} when renaming a file

2019-01-16 Thread André Draszik
From: André Draszik 

When using update-alternatives, FILES_${PN} must be
referencing the new name after update-alternatives has
renamed files.

This is more or less OK when having static lists of files to
be packaged into a package, but makes it quite hard to
dynamically generate FILES_${PN}, e.g. using do_split_packages(),
as in that case we can not easily modify what goes into
FILES_${PN}, because that list is based on filenames as seen
at the time do_split_packages() is executing.

Of couse one could explicitly specify the (renamed) file(s)
in the recipe, but that contradicts the intended usage of
do_split_packages().

Instead, if FILES_${PN} contains the file name as it was pre
renaming, we here modify this to reflect the new name.

This will allow usage of do_split_packages() to populate
FILES_${PN}.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v4: * introduce update_files() helper function
---
 meta/classes/update-alternatives.bbclass | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/update-alternatives.bbclass 
b/meta/classes/update-alternatives.bbclass
index f3c014a5fc..e252651128 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -138,6 +138,14 @@ python apply_update_alternative_renames () {
 if not update_alternatives_enabled(d):
return
 
+from re import sub
+
+def update_files(alt_target, alt_target_rename, pkg, d):
+f = d.getVar('FILES_' + pkg)
+if f:
+f = sub(r'(^|\s)%s(\s|$)' % alt_target, r'\1%s\2' % 
alt_target_rename, f)
+d.setVar('FILES_' + pkg, f)
+
 # Check for deprecated usage...
 pn = d.getVar('BPN')
 if d.getVar('ALTERNATIVE_LINKS') != None:
@@ -177,6 +185,7 @@ python apply_update_alternative_renames () {
 else:
 bb.note('%s: Rename %s -> %s' % (pn, alt_target, 
alt_target_rename))
 os.rename(src, dest)
+update_files(alt_target, alt_target_rename, pkg, d)
 else:
 bb.warn("%s: alternative target (%s or %s) does not exist, 
skipping..." % (pn, alt_target, alt_target_rename))
 continue
@@ -203,6 +212,8 @@ python apply_update_alternative_renames () {
 os.unlink(src)
 else:
 bb.warn('%s: Unable to resolve dangling symlink: %s' % 
(pn, alt_target))
+continue
+update_files(alt_target, alt_target_rename, pkg, d)
 }
 
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 03/15] util-linux: remove minix remnants

2019-01-16 Thread André Draszik
From: André Draszik 

While commit fc66762d7c11 ("util-linux: Disable minix support.")
(or e88cee8cc31d in poky) removed most of the bits, there are
still references to minix remaining.

Remove them.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 7bfec80508..406af58502 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -159,7 +159,7 @@ do_install () {
mkdir -p ${D}${base_bindir}
 
 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
-sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup 
swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
+sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk 
fsck blkid blockdev fstrim sulogin switch_root nologin"
 binprogs_a="dmesg getopt kill more umount mount login su mountpoint"
 
 if [ "${base_sbindir}" != "${sbindir}" ]; then
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 04/15] util-linux: be more explicit about what files go into packages

2019-01-16 Thread André Draszik
From: André Draszik 

Just using a wildcard leaves the reader wondering
what is meant here.

By being explicit we can describe exactly what is
intended, i.e. the file name as resulting from
the ALTERNATIVE and ALTERNATIVE_LINK_NAME mechanism.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 406af58502..e479fc24e1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -88,7 +88,7 @@ FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-rfkill = "${sbindir}/rfkill*"
+FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
@@ -105,20 +105,20 @@ FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
 FILES_util-linux-lsblk = "${bindir}/lsblk"
 FILES_util-linux-lscpu = "${bindir}/lscpu"
 
-FILES_util-linux-fsck = "${base_sbindir}/fsck*"
+FILES_util-linux-fsck = "${base_sbindir}/fsck.${BPN}"
 FILES_util-linux-mkfs = "${sbindir}/mkfs"
 
 FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
 FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 
-FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+FILES_util-linux-sulogin = "${base_sbindir}/sulogin.${BPN}"
 FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
 
 FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
 FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
 
 # Util-linux' blkid replaces the e2fsprogs one
-FILES_util-linux-blkid = "${base_sbindir}/blkid*"
+FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 02/15] util-linux: remove erroneous patch (qsort_r)

2019-01-16 Thread André Draszik
From: André Draszik 

The patch in question is patching the code to use
qsort() instead of qsort_r(), without adopting the
compare function. This is a major issue, because
the compare function as written is evaluating /
accessing a third argument, which is not passed
with this OE patch, causing access to random
memory.

Given this patch was added so as to support (old)
linux (host) distros which might not provide
qsort_r(), according to the git history, and given
these days util-linux detects availability of
qsort_r() during configure phase, and given musl
builds (which doesn't provide qsort_r() either)
work without problem, the right solution is to
simply drop this invalid patch.

Do so.

Signed-off-by: André Draszik 
---
 .../util-linux/util-linux-native-qsort.patch  | 33 ---
 .../util-linux/util-linux_2.32.1.bb   |  6 
 2 files changed, 39 deletions(-)
 delete mode 100644 
meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch

diff --git 
a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch 
b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
deleted file mode 100644
index 68bf22de8c..00
--- a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
-From: Robert Yang 
-Date: Wed, 26 Mar 2014 01:30:29 +
-Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
-
-qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
-the host like CentOS 5.x.
-
-Upstream-Status: Inappropriate [Other]
-
-Signed-off-by: Robert Yang 

- libfdisk/src/sun.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-Index: util-linux-2.24.2/libfdisk/src/sun.c
-===
 util-linux-2.24.2.orig/libfdisk/src/sun.c
-+++ util-linux-2.24.2/libfdisk/src/sun.c
-@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f
- }
- verify_sun_starts = starts;
- 
--qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
--(int (*)(const void *,const void *,void *)) verify_sun_cmp,
--verify_sun_starts);
--
-+qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
-+ (int (*)(const void *,const void *)) verify_sun_cmp);
-+ 
- if (array[0] == -1) {
-   fdisk_info(cxt, _("No partitions defined."));
-   return 0;
diff --git a/meta/recipes-core/util-linux/util-linux_2.32.1.bb 
b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
index b0492afff3..0f860c221b 100644
--- a/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -1,14 +1,8 @@
 require util-linux.inc
 
-# To support older hosts, we need to patch and/or revert
-# some upstream changes.  Only do this for native packages.
-OLDHOST = ""
-OLDHOST_class-native = "file://util-linux-native-qsort.patch"
-
 SRC_URI += "file://configure-sbindir.patch \
 file://runuser.pamd \
 file://runuser-l.pamd \
-${OLDHOST} \
 file://ptest.patch \
 file://run-ptest \
 file://display_testname_for_subtest.patch \
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 01/15] util-linux: simplify version upgrades (MAJOR_VERSION)

2019-01-16 Thread André Draszik
From: André Draszik 

There doesn't appear to be a need to manually and
explicitly specificy the major version (for the
download URL), it can be deduced easily from PV.

Do so.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc   | 3 ++-
 meta/recipes-core/util-linux/util-linux_2.32.1.bb | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index e514041a19..7bfec80508 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -24,7 +24,8 @@ DEPENDS = "zlib ncurses virtual/crypt"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
 
-SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz
 \
+MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
 PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk 
util-linux-cfdisk util-linux-sfdisk \
diff --git a/meta/recipes-core/util-linux/util-linux_2.32.1.bb 
b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
index c909836cbb..b0492afff3 100644
--- a/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -1,4 +1,3 @@
-MAJOR_VERSION = "2.32"
 require util-linux.inc
 
 # To support older hosts, we need to patch and/or revert
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 00/12] util-linux: one package per binary

2019-01-16 Thread André Draszik
v4:
* update patch 06/15
  * unconditionally assign PACKAGE_PREPROCESS_FUNCS
* update patch 07/15
  * introduce update_files() helper function

Cheers,
Andre'


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3 07/15] update-alternatives: try to update FILES_${PN} when renaming a file

2019-01-16 Thread Richard Purdie
On Wed, 2019-01-16 at 12:00 +, André Draszik wrote:
> From: André Draszik 
> 
> When using update-alternatives, FILES_${PN} must be
> referencing the new name after update-alternatives has
> renamed files.
> 
> This is more or less OK when having static lists of files to
> be packaged into a package, but makes it quite hard to
> dynamically generate FILES_${PN}, e.g. using do_split_packages(),
> as in that case we can not easily modify what goes into
> FILES_${PN}, because that list is based on filenames as seen
> at the time do_split_packages() is executing.
> 
> Of couse one could explicitly specify the (renamed) file(s)
> in the recipe, but that contradicts the intended usage of
> do_split_packages().
> 
> Instead, if FILES_${PN} contains the file name as it was pre
> renaming, we here modify this to reflect the new name.
> 
> This will allow usage of do_split_packages() to populate
> FILES_${PN}.
> 
> [YOCTO #13058]
> 
> Signed-off-by: André Draszik 
> ---
>  meta/classes/update-alternatives.bbclass | 11 +++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/meta/classes/update-alternatives.bbclass 
> b/meta/classes/update-alternatives.bbclass
> index 78291e7e45..363f1ae129 100644
> --- a/meta/classes/update-alternatives.bbclass
> +++ b/meta/classes/update-alternatives.bbclass
> @@ -135,6 +135,8 @@ populate_packages[vardeps] += "${UPDALTVARS} 
> ${@gen_updatealternativesvars(d)}"
>  # place for that.
>  PACKAGE_PREPROCESS_FUNCS += "${@'apply_update_alternative_renames' if 
> update_alternatives_enabled(d) else ''}"
>  python apply_update_alternative_renames () {
> +from re import sub
> +
>  # Check for deprecated usage...
>  pn = d.getVar('BPN')
>  if d.getVar('ALTERNATIVE_LINKS') != None:
> @@ -174,6 +176,10 @@ python apply_update_alternative_renames () {
>  else:
>  bb.note('%s: Rename %s -> %s' % (pn, alt_target, 
> alt_target_rename))
>  os.rename(src, dest)
> +f = d.getVar('FILES_' + pkg)
> +if f:
> +f = sub(r'(^|\s)%s(\s|$)' % alt_target, 
> r'\1%s\2' % alt_target_rename, f)
> +d.setVar('FILES_' + pkg, f)
>  else:
>  bb.warn("%s: alternative target (%s or %s) does not 
> exist, skipping..." % (pn, alt_target, alt_target_rename))
>  continue
> @@ -200,6 +206,11 @@ python apply_update_alternative_renames () {
>  os.unlink(src)
>  else:
>  bb.warn('%s: Unable to resolve dangling symlink: %s' % 
> (pn, alt_target))
> +continue
> +f = d.getVar('FILES_' + pkg)
> +if f:
> +f = sub(r'(^|\s)%s(\s|$)' % alt_target, r'\1%s\2' % 
> alt_target_rename, f)
> +d.setVar('FILES_' + pkg, f)
>  }
> 

Create an internal function and call it twice:

def update_files(alt_target, alt_target_rename, pkg, d):
f = d.getVar('FILES_' + pkg)
if f:
f = sub(r'(^|\s)%s(\s|$)' % alt_target, r'\1%s\2' % 
alt_target_rename, f)
d.setVar('FILES_' + pkg, f)

?

Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3 06/15] update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS

2019-01-16 Thread Richard Purdie
On Wed, 2019-01-16 at 12:00 +, André Draszik wrote:
> From: André Draszik 
> 
> At the moment, the update-alternatives file renaming is
> happening right after copying into PKGD during packaging
> time using an _append OVERRIDE to the copy function
> perform_packagecopy().
> 
> This is not really readable and hard to maintain.
> 
> Additionally, this makes it impossible to e.g. populate
> PACKAGES dynamically using do_split_packages() and still
> do update-alternatives - update-alternatives file renaming
> requires the PACKAGES variable to have been fully populated
> to work correctly. On the other hand, do_split_packages()
> can only execute after perform_packagecopy(), as it needs
> PKGD populated; so it's impossible to insert
> do_split_packages() early enough in a deterministic way in
> this use-case.
> 
> As there doesn't seem to be a reason not to, convert
> this to a proper function and use PACKAGE_PREPROCESS_FUNCS
> instead - after all, that's what this is meant for.
> 
> No other classes or recipes in oe-core or meta-openembededd
> seem to have a hard requirement on update-alterantives
> executing before any other PACKAGE_PREPROCESS_FUNCS, so
> this should be perfectly fine.
> 
> The only implication is that if compress_doc is inherited,
> compressed man-page file names will end up being, e.g.
> eject.1.util-linux.gz
>   or
> eject.1.gz.util-linux
> based on the include of compress_doc.bbclass vs.
> update-alternatives.bbclass order, but the symlink created
> (alternative name) will always be correct.
> 
> This solves both problems:
> * the code is easier to read / follow
> * the above described use-case can be accomodated easily
> 
> [YOCTO #13058]
> 
> Signed-off-by: André Draszik 
> ---
>  meta/classes/update-alternatives.bbclass | 13 +
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/meta/classes/update-alternatives.bbclass
> b/meta/classes/update-alternatives.bbclass
> index f1250f877b..78291e7e45 100644
> --- a/meta/classes/update-alternatives.bbclass
> +++ b/meta/classes/update-alternatives.bbclass
> @@ -131,14 +131,10 @@ def gen_updatealternativesvars(d):
>  populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativ
> esvars(d)}"
>  
>  # We need to do the rename after the image creation step, but before
> -# the split and strip steps..  packagecopy seems to be the earliest
> reasonable
> -# place.
> -python perform_packagecopy_append () {
> -if update_alternatives_enabled(d):
> -apply_update_alternative_renames(d)
> -}
> -
> -def apply_update_alternative_renames(d):
> +# the split and strip steps..  PACKAGE_PREPROCESS_FUNCS is the right
> +# place for that.
> +PACKAGE_PREPROCESS_FUNCS += "${@'apply_update_alternative_renames'
> if update_alternatives_enabled(d) else ''}"
> +python apply_update_alternative_renames () {

Looks good, how about adding:

if not update_alternatives_enabled(d):
   return

here to make it slightly more readable?

>  # Check for deprecated usage...
>  pn = d.getVar('BPN')
>  if d.getVar('ALTERNATIVE_LINKS') != None:
> @@ -204,6 +200,7 @@ def apply_update_alternative_renames(d):
>  os.unlink(src)
>  else:
>  bb.warn('%s: Unable to resolve dangling symlink:
> %s' % (pn, alt_target))
> +}


Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] glibc: glibc support powerpc e5500 and e6500

2019-01-16 Thread Burton, Ross
No Upstream-Status or your S-o-b in the patch.

Ross

On Wed, 16 Jan 2019 at 10:13, C.r. Guo  wrote:
>
> From: Chunrong Guo 
>
> Signed-off-by: Chunrong Guo 
> ---
>  .../glibc/0035-glibc-support-e5500-and-e6500.patch | 562 
> +
>  meta/recipes-core/glibc/glibc_2.28.bb  |   1 +
>  2 files changed, 563 insertions(+)
>  create mode 100644 
> meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
>
> diff --git 
> a/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch 
> b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
> new file mode 100644
> index 000..bc54de7
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
> @@ -0,0 +1,562 @@
> +From 70dc75d3da86dea8b6ebdaedfa76e625a076678e Mon Sep 17 00:00:00 2001
> +From: Chunrong Guo 
> +Date: Wed, 31 Oct 2018 17:56:24 +0800
> +Subject: [PATCH] glibc: support e5500 and e6500
> +
> +Signed-off-by: BJ DevOps Team 
> +---
> + sysdeps/powerpc/powerpc64/be/e5500/Implies |   2 +
> + sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c| 137 
> +
> + sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c   | 103 
> + .../powerpc/powerpc64/be/e5500/multiarch/Implies   |   1 +
> + sysdeps/powerpc/powerpc64/be/e6500/Implies |   2 +
> + sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c| 137 
> +
> + sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c   | 103 
> + .../powerpc/powerpc64/be/e6500/multiarch/Implies   |   1 +
> + 8 files changed, 486 insertions(+)
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/Implies
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/multiarch/Implies
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/Implies
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c
> + create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/multiarch/Implies
> +
> +diff --git a/sysdeps/powerpc/powerpc64/be/e5500/Implies 
> b/sysdeps/powerpc/powerpc64/be/e5500/Implies
> +new file mode 100644
> +index 000..a795586
> +--- /dev/null
>  b/sysdeps/powerpc/powerpc64/be/e5500/Implies
> +@@ -0,0 +1,2 @@
> ++powerpc/powerpc64/e5500
> ++
> +diff --git a/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c 
> b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
> +new file mode 100644
> +index 000..13a8197
> +--- /dev/null
>  b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
> +@@ -0,0 +1,137 @@
> ++/* Double-precision floating point square root.
> ++   Copyright (C) 2010 Free Software Foundation, Inc.
> ++   This file is part of the GNU C Library.
> ++
> ++   The GNU C Library is free software; you can redistribute it and/or
> ++   modify it under the terms of the GNU Lesser General Public
> ++   License as published by the Free Software Foundation; either
> ++   version 2.1 of the License, or (at your option) any later version.
> ++
> ++   The GNU C Library is distributed in the hope that it will be useful,
> ++   but WITHOUT ANY WARRANTY; without even the implied warranty of
> ++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> ++   Lesser General Public License for more details.
> ++
> ++   You should have received a copy of the GNU Lesser General Public
> ++   License along with the GNU C Library; if not, write to the Free
> ++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
> ++   02111-1307 USA.  */
> ++
> ++#include 
> ++#include 
> ++#include 
> ++#include 
> ++
> ++#include 
> ++#include 
> ++
> ++static const ieee_float_shape_type a_nan = {.word = 0x7fc0 };
> ++static const ieee_float_shape_type a_inf = {.word = 0x7f80 };
> ++static const float two108 = 3.245185536584267269e+32;
> ++static const float twom54 = 5.551115123125782702e-17;
> ++static const float half = 0.5;
> ++
> ++/* The method is based on the descriptions in:
> ++
> ++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 
> 5;
> ++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, 
> chapter 9
> ++
> ++   We find the actual square root and half of its reciprocal
> ++   simultaneously.  */
> ++
> ++double
> ++__slow_ieee754_sqrt (double b)
> ++{
> ++  if (__builtin_expect (b > 0, 1))
> ++{
> ++  double y, g, h, d, r;
> ++  ieee_double_shape_type u;
> ++
> ++  if (__builtin_expect (b != a_inf.value, 1))
> ++{
> ++  fenv_t fe;
> ++
> ++  fe = fegetenv_register ();
> ++
> ++  u.value = b;
> ++
> ++  relax_fenv_state ();
> ++
> ++  __asm__ ("frsqrte %[estimate], %[x]\n"
> ++   : [estimate] "=f" (y) : [x] "f" (b));
> ++
> ++  /* Following Muller et al, page 168, 

Re: [OE-core] [PATCH] populate_sdk_base: add option of add other type of sdk

2019-01-16 Thread Burton, Ross
On Wed, 16 Jan 2019 at 09:37,  wrote:
> +SDK_TAR_TYPE ?= "tar.xz"
> +SDK_TAR_DEPENDS ?= "xz-native"
> +SDK_TAR_CMD ?= "tar ${SDKTAROPTS} -cf - . | xz -T 0 > 
> ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE}"

Don't call these SDK_TAR because they might not be generating a
tarball.  How about SDK_ARCHIVE_*

Using overrides or flags would let you put the zip logic into oe-core
too, because it is feasible that more than meta-mingw will want to use
zip archives.

Also, add a comment about the expected behaviour of the CMD,
specifically what the input variables are and where the output should
go.  Bonus points fo refactoring slightly so the command is passed an
absolute input directory, and absolute output filename.

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3 00/12] util-linux: one package per binary

2019-01-16 Thread André Draszik
On Wed, 2019-01-16 at 12:00 +, André Draszik wrote:
> v3:
> * update 12/15 util-linux: simplify meta-package RDEPENDS / RRECOMMENDS
>   commit message
> * replace patch
> 06/15 update-alternatives: allow hooks before renaming files
>   with
> 06/15 update-alternatives: convert file renames to
> PACKAGE_PREPROCESS_FUNCS
> * update follow-up patches 7 8 9 10 accordingly
>   
> As per Richard's request / suggestion

This also was rebased on top of current master-next to avoid merge conflicts
due to 'meta: Fix Deprecated warnings from regexs'

Cheers,
Andre'


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 13/15] util-linux: move /etc/default/mountall into -mount subpackage

2019-01-16 Thread André Draszik
From: André Draszik 

This should probably be there and now the main package is a real
meta-package only.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 000db880a1..47264028f2 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -44,19 +44,19 @@ python util_linux_binpackages () {
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${base_bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 do_split_packages(d, root='${bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook, extra_depends='', prepend=True)
+  hook=pkg_hook, extra_depends='')
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -92,11 +92,14 @@ PACKAGECONFIG[pylibmount] = "--with-python=3 
--enable-pylibmount,--without-pytho
 # Readline support
 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN} = ""
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
 FILES_${PN}-last = "${bindir}/lastb"
+FILES_${PN}-mount = "${sysconfdir}/default/mountall"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 15/15] utils-linux: final cleanup

2019-01-16 Thread André Draszik
From: André Draszik 

* use ${PN} instead of util-linux
* use PACKAGESPLITFUNCS for creating util-linux-lib* packages
  rather than an _append OVERRIDE
* sort ALTERNATIVE_LINK_NAME alphabetically
* Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use systemd_system_unitdir instead of open-coding
* inherit manpages so as to benefit from man-db processing (note
  that manpages are not generated here, we just want the
  automatic update of the package index caches
* use EXTRA_OEMAKE instead of duplicating command line arguments

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * use PACKAGESPLITFUNCS =+ rather than PACKAGESPLITFUNCS_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use systemd_system_unitdir instead of open-coding
* inherit manpages
* use EXTRA_OEMAKE instead of duplicating command line arguments
* also sort ALTERNATIVE_LINK_NAME for man pages
---
 meta/recipes-core/util-linux/util-linux.inc | 156 
 1 file changed, 65 insertions(+), 91 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 458df5d047..c5a8c4f41f 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -19,7 +19,7 @@ LIC_FILES_CHKSUM = 
"file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c
 
file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
 
 #gtk-doc is not enabled as it requires xmlto which requires util-linux
-inherit autotools gettext pkgconfig systemd update-alternatives python3-dir 
bash-completion ptest
+inherit autotools gettext manpages pkgconfig systemd update-alternatives 
python3-dir bash-completion ptest
 DEPENDS = "zlib ncurses virtual/crypt"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
@@ -28,8 +28,8 @@ MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-swaponoff"
-PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
+PACKAGES =+ "${PN}-swaponoff"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'${PN}-pylibmount', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -62,7 +62,16 @@ python util_linux_binpackages () {
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
 PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
 
-PACKAGES_DYNAMIC = "^util-linux-.*"
+python util_linux_libpackages() {
+do_split_packages(d, root='${base_libdir}', 
file_regex=r'^lib(.*)\.so\..*$',
+  output_pattern='${PN}-lib%s',
+  description='${PN} lib%s',
+  extra_depends='', prepend=True, allow_links=True)
+}
+
+PACKAGESPLITFUNCS =+ "util_linux_libpackages"
+
+PACKAGES_DYNAMIC = "^${PN}-.*"
 
 SHARED_EXTRA_OECONF = "--disable-use-tty-group \
--disable-makeinstall-chown \
@@ -76,49 +85,46 @@ SHARED_EXTRA_OECONF = "--disable-use-tty-group \
 "
 
 EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'"
 
 PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', 
d)}"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su 
--disable-runuser, libpam,"
-
 # Respect the systemd feature for uuidd
-PACKAGECONFIG[systemd] = "--with-systemd 
--with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemd 
--without-systemdsystemunitdir,systemd"
-
+PACKAGECONFIG[systemd] = "--with-systemd 
--with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd 
--without-systemdsystemunitdir,systemd"
 # Build setpriv requires libcap-ng
 PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
-
 # Build python bindings for libmount
 PACKAGECONFIG[pylibmount] = "--with-python=3 
--enable-pylibmount,--without-python --disable-pylibmount,python3"
-
 # Readline support
 PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
 
 ALLOW_EMPTY_${PN} = "1"
 FILES_${PN} = ""
 FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
-
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
-
 FILES_${PN}-last = "${bindir}/lastb"
 FILES_${PN}-mount = "${sysconfdir}/default/mountall"
-FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
-FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
-   ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
-  

[OE-core] [PATCH v3 14/15] util-linux: let -ptest package depend on all of util-linux

2019-01-16 Thread André Draszik
From: André Draszik 

ptest executes all the binaries, so they really need to be available
in the file system.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 47264028f2..458df5d047 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -290,7 +290,7 @@ python populate_packages_prepend() {
 }
 
 RDEPENDS_${PN}-bash-completion += "util-linux-lsblk"
-RDEPENDS_${PN}-ptest = "bash grep coreutils which util-linux-blkid 
util-linux-fsck btrfs-tools"
+RDEPENDS_${PN}-ptest = "bash grep coreutils which btrfs-tools ${PN}"
 
 do_compile_ptest() {
 oe_runmake buildtest-TESTS
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 10/15] util-linux: one package per binary (pt 3: sbindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* blkdiscard <- RRECOMMENDS
* findfs
* fsck.cramfs
* mkfs <- RRECOMMENDS
* mkfs.cramfs
* partx
* readprofile <- RRECOMMENDS
* rfkill
* runuser <- RDEPENDS
* sfdisk <- RRECOMMENDS
* uuidd

New packages:
* too many to list

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.

Nevertheless, all existing packages have been added to
RRECOMMENDS this time, even if they weren't in RDEPENDS /
RRECOMMENDS before.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 42 -
 1 file changed, 16 insertions(+), 26 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 36a22cf6d7..bab66f788e 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,17 +28,13 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
- util-linux-swaponoff \
- util-linux-readprofile util-linux-uuidd \
- util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
- util-linux-mkfs util-linux-mcookie util-linux-rfkill \
- util-linux-lsblk util-linux-mkfs.cramfs \
- util-linux-partx \
- util-linux-findfs util-linux-prlimit \
+PACKAGES =+ "util-linux-swaponoff \
+ util-linux-uuidgen util-linux-lscpu \
+ util-linux-mcookie \
+ util-linux-lsblk \
+ util-linux-prlimit \
  util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
-PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -47,6 +43,11 @@ python util_linux_binpackages () {
 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
 d.setVar('ALTERNATIVE_' + pkg, modulename)
 
+def pkg_hook_with_recommends(f, pkg, file_regex, output_pattern, 
modulename):
+pn = d.getVar('PN')
+d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
+pkg_hook(f, pkg, file_regex, output_pattern, modulename)
+
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
@@ -55,6 +56,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook, extra_depends='', prepend=True)
+do_split_packages(d, root='${sbindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -94,16 +99,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
-FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
-FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
-FILES_util-linux-partx = "${sbindir}/partx"
-FILES_util-linux-findfs = "${sbindir}/findfs"
-FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
@@ -116,11 +113,6 @@ FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
 FILES_util-linux-lsblk = "${bindir}/lsblk"
 FILES_util-linux-lscpu = "${bindir}/lscpu"
 
-FILES_util-linux-mkfs = "${sbindir}/mkfs"
-
-FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
-FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
-
 FILES_util-linux-unshare = 

[OE-core] [PATCH v3 09/15] util-linux: one package per binary (pt 2: base_bindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* mount <- RRECOMMENDS
* umount <- RDEPENDS
* mountpoint <- RRECOMMENDS
* getopt
* su <- RDEPENDS

New packages:
* dmesg
* kill
* more

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.
Existing packages that aren't in RDEPENDS / RRECOMMENDS
haven't been added to RRECOMMENDS for that reason.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 32 -
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index a23fec69ea..36a22cf6d7 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -29,16 +29,16 @@ SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz
"
 
 PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
- util-linux-swaponoff util-linux-umount \
- util-linux-mount util-linux-readprofile util-linux-uuidd \
+ util-linux-swaponoff \
+ util-linux-readprofile util-linux-uuidd \
  util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
  util-linux-mkfs util-linux-mcookie util-linux-rfkill \
  util-linux-lsblk util-linux-mkfs.cramfs \
- util-linux-partx util-linux-mountpoint \
- util-linux-findfs util-linux-getopt util-linux-prlimit \
+ util-linux-partx \
+ util-linux-findfs util-linux-prlimit \
  util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
-PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser', '', d)}"
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
@@ -51,6 +51,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook, extra_depends='', prepend=True)
+do_split_packages(d, root='${base_bindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook, extra_depends='', prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -92,21 +96,18 @@ FILES_${PN}-dev += 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
 FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
 FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
-FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
 FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-findfs = "${sbindir}/findfs"
-FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
 FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
-FILES_util-linux-su = "${base_bindir}/su.${BPN} ${sysconfdir}/pam.d/su-l"
+FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
@@ -120,8 +121,6 @@ FILES_util-linux-mkfs = "${sbindir}/mkfs"
 FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
 FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 
-FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
-
 FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
 
 # Util-linux' blkid replaces the e2fsprogs one
@@ -131,8 +130,9 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 

[OE-core] [PATCH v3 12/15] util-linux: simplify meta-package RDEPENDS / RRECOMMENDS

2019-01-16 Thread André Draszik
From: André Draszik 

The util-linux meta-package now simply RRECOMMENDS all
subpackages created. There is no distinction between what
it previously recommended or depended on for existing
packages.

This is to streamline the dependencies and to make things
less surprising.
It also stops the -dev package from depending on non-existing
packages like util-linux-losetup-dev etc.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: update commit message
---
 meta/recipes-core/util-linux/util-linux.inc | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 7e3887dc92..000db880a1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -33,16 +33,14 @@ PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 
'pylibmount', 'util-linux-pyl
 
 python util_linux_binpackages () {
 def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
+pn = d.getVar('PN')
+d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
+
 if d.getVar('ALTERNATIVE_' + pkg):
 return
 if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
 d.setVar('ALTERNATIVE_' + pkg, modulename)
 
-def pkg_hook_with_recommends(f, pkg, file_regex, output_pattern, 
modulename):
-pn = d.getVar('PN')
-d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg)
-pkg_hook(f, pkg, file_regex, output_pattern, modulename)
-
 do_split_packages(d, root='${base_sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
@@ -54,11 +52,11 @@ python util_linux_binpackages () {
 do_split_packages(d, root='${sbindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+  hook=pkg_hook, extra_depends='', prepend=True)
 do_split_packages(d, root='${bindir}',
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
-  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+  hook=pkg_hook, extra_depends='', prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -111,12 +109,6 @@ FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 
${bindir}/uname26"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
-RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
-
-RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk 
${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
-RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount 
${PN}-mountpoint"
-
 RRECOMMENDS_${PN}_class-native = ""
 RRECOMMENDS_${PN}_class-nativesdk = ""
 RDEPENDS_${PN}_class-native = ""
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 11/15] util-linux: one package per binary (pt 4: bindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Similar to the previous patch.

Existing packages (and current dependency by main package):
* ionice <- RRECOMMENDS
* lsblk <- RDEPENDS
* lscpu
* mcookie
* prlimit <- RRECOMMENDS
* unshare
* uuidgen

New packages:
* too many to list

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.

Nevertheless, all existing packages have been added to
RRECOMMENDS this time, even if they weren't in RDEPENDS /
RRECOMMENDS before.

Unfortunately, we need to add explicit ALTERNATIVE_LINK_NAME[]
for a few cases, as previously they were implied using
defaults by being specified in ALTERNATIVE_${PN}. We can't
easily automate that using do_split_packages(), so we
simply add them explicitly.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 45 ++---
 1 file changed, 21 insertions(+), 24 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index bab66f788e..7e3887dc92 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,12 +28,7 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-swaponoff \
- util-linux-uuidgen util-linux-lscpu \
- util-linux-mcookie \
- util-linux-lsblk \
- util-linux-prlimit \
- util-linux-ionice util-linux-unshare"
+PACKAGES =+ "util-linux-swaponoff"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 
 python util_linux_binpackages () {
@@ -60,6 +55,10 @@ python util_linux_binpackages () {
   file_regex=r'(.*)', output_pattern='${PN}-%s',
   description='${PN} %s',
   hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
+do_split_packages(d, root='${bindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook_with_recommends, extra_depends='', 
prepend=True)
 }
 
 # we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
@@ -99,21 +98,14 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-mcookie = "${bindir}/mcookie"
-FILES_util-linux-uuidgen = "${bindir}/uuidgen"
-FILES_util-linux-prlimit = "${bindir}/prlimit"
-FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
+FILES_${PN}-last = "${bindir}/lastb"
 FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
 FILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
-
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \

${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*"
-FILES_util-linux-lsblk = "${bindir}/lsblk"
-FILES_util-linux-lscpu = "${bindir}/lscpu"
-
-FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
+FILES_${PN}-setarch = "${bindir}/linux32 ${bindir}/linux64 ${bindir}/uname26"
 
 # Util-linux' blkid replaces the e2fsprogs one
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
@@ -122,7 +114,6 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
-RRECOMMENDS_${PN} = "util-linux-prlimit util-linux-ionice"
 RRECOMMENDS_${PN} += "${PN}-blockdev ${PN}-cfdisk ${PN}-ctrlaltdel ${PN}-fdisk 
${PN}-mkswap ${PN}-nologin ${PN}-pivot-root ${PN}-switch-root"
 RRECOMMENDS_${PN} += "${PN}-dmesg ${PN}-kill ${PN}-more ${PN}-mount 
${PN}-mountpoint"
 
@@ -206,12 +197,6 @@ do_install_append_class-native () {
 
 ALTERNATIVE_PRIORITY = "80"
 
-ALTERNATIVE_${PN}  = " \
-hexdump last lastb logger mesg renice wall \
-setsid chrt flock utmpdump eject taskset fallocate \
-nsenter cal rev \
-"
-
 ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
 ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
 ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
@@ -219,9 

[OE-core] [PATCH v3 07/15] update-alternatives: try to update FILES_${PN} when renaming a file

2019-01-16 Thread André Draszik
From: André Draszik 

When using update-alternatives, FILES_${PN} must be
referencing the new name after update-alternatives has
renamed files.

This is more or less OK when having static lists of files to
be packaged into a package, but makes it quite hard to
dynamically generate FILES_${PN}, e.g. using do_split_packages(),
as in that case we can not easily modify what goes into
FILES_${PN}, because that list is based on filenames as seen
at the time do_split_packages() is executing.

Of couse one could explicitly specify the (renamed) file(s)
in the recipe, but that contradicts the intended usage of
do_split_packages().

Instead, if FILES_${PN} contains the file name as it was pre
renaming, we here modify this to reflect the new name.

This will allow usage of do_split_packages() to populate
FILES_${PN}.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/classes/update-alternatives.bbclass | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/update-alternatives.bbclass 
b/meta/classes/update-alternatives.bbclass
index 78291e7e45..363f1ae129 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -135,6 +135,8 @@ populate_packages[vardeps] += "${UPDALTVARS} 
${@gen_updatealternativesvars(d)}"
 # place for that.
 PACKAGE_PREPROCESS_FUNCS += "${@'apply_update_alternative_renames' if 
update_alternatives_enabled(d) else ''}"
 python apply_update_alternative_renames () {
+from re import sub
+
 # Check for deprecated usage...
 pn = d.getVar('BPN')
 if d.getVar('ALTERNATIVE_LINKS') != None:
@@ -174,6 +176,10 @@ python apply_update_alternative_renames () {
 else:
 bb.note('%s: Rename %s -> %s' % (pn, alt_target, 
alt_target_rename))
 os.rename(src, dest)
+f = d.getVar('FILES_' + pkg)
+if f:
+f = sub(r'(^|\s)%s(\s|$)' % alt_target, r'\1%s\2' 
% alt_target_rename, f)
+d.setVar('FILES_' + pkg, f)
 else:
 bb.warn("%s: alternative target (%s or %s) does not exist, 
skipping..." % (pn, alt_target, alt_target_rename))
 continue
@@ -200,6 +206,11 @@ python apply_update_alternative_renames () {
 os.unlink(src)
 else:
 bb.warn('%s: Unable to resolve dangling symlink: %s' % 
(pn, alt_target))
+continue
+f = d.getVar('FILES_' + pkg)
+if f:
+f = sub(r'(^|\s)%s(\s|$)' % alt_target, r'\1%s\2' % 
alt_target_rename, f)
+d.setVar('FILES_' + pkg, f)
 }
 
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 06/15] update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS

2019-01-16 Thread André Draszik
From: André Draszik 

At the moment, the update-alternatives file renaming is
happening right after copying into PKGD during packaging
time using an _append OVERRIDE to the copy function
perform_packagecopy().

This is not really readable and hard to maintain.

Additionally, this makes it impossible to e.g. populate
PACKAGES dynamically using do_split_packages() and still
do update-alternatives - update-alternatives file renaming
requires the PACKAGES variable to have been fully populated
to work correctly. On the other hand, do_split_packages()
can only execute after perform_packagecopy(), as it needs
PKGD populated; so it's impossible to insert
do_split_packages() early enough in a deterministic way in
this use-case.

As there doesn't seem to be a reason not to, convert
this to a proper function and use PACKAGE_PREPROCESS_FUNCS
instead - after all, that's what this is meant for.

No other classes or recipes in oe-core or meta-openembededd
seem to have a hard requirement on update-alterantives
executing before any other PACKAGE_PREPROCESS_FUNCS, so
this should be perfectly fine.

The only implication is that if compress_doc is inherited,
compressed man-page file names will end up being, e.g.
eject.1.util-linux.gz
  or
eject.1.gz.util-linux
based on the include of compress_doc.bbclass vs.
update-alternatives.bbclass order, but the symlink created
(alternative name) will always be correct.

This solves both problems:
* the code is easier to read / follow
* the above described use-case can be accomodated easily

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/classes/update-alternatives.bbclass | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/meta/classes/update-alternatives.bbclass 
b/meta/classes/update-alternatives.bbclass
index f1250f877b..78291e7e45 100644
--- a/meta/classes/update-alternatives.bbclass
+++ b/meta/classes/update-alternatives.bbclass
@@ -131,14 +131,10 @@ def gen_updatealternativesvars(d):
 populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
 
 # We need to do the rename after the image creation step, but before
-# the split and strip steps..  packagecopy seems to be the earliest reasonable
-# place.
-python perform_packagecopy_append () {
-if update_alternatives_enabled(d):
-apply_update_alternative_renames(d)
-}
-
-def apply_update_alternative_renames(d):
+# the split and strip steps..  PACKAGE_PREPROCESS_FUNCS is the right
+# place for that.
+PACKAGE_PREPROCESS_FUNCS += "${@'apply_update_alternative_renames' if 
update_alternatives_enabled(d) else ''}"
+python apply_update_alternative_renames () {
 # Check for deprecated usage...
 pn = d.getVar('BPN')
 if d.getVar('ALTERNATIVE_LINKS') != None:
@@ -204,6 +200,7 @@ def apply_update_alternative_renames(d):
 os.unlink(src)
 else:
 bb.warn('%s: Unable to resolve dangling symlink: %s' % 
(pn, alt_target))
+}
 
 PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
 
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 08/15] util-linux: one package per binary (pt 1: base_sbindir)

2019-01-16 Thread André Draszik
From: André Draszik 

Now that we have required infrastructure in place, we
can start creating one package per binary.

To make this process easier to follow, this is done
in steps, starting with binaries from base_sbindir.

Existing packages (and current dependency by main package):
* agetty
* blkid
* cfdisk <- RRECOMMENDS
* fdisk <- RRECOMMENDS
* fsck
* fstrim
* losetup <- RDEPENDS
* hwclock
* sulogin <- RDEPENDS
* swaponoff <- RDEPENDS
* switch-root <- RRECOMMENDS

New packages:
* blockdev
* ctrlaltdel
* mkswap
* nologin
* pivot-root
* swapon
* swapoff

swaponoff is empty now and simply depends on swapon swapoff

To avoid breaking existing users, all the new packages
are added to the main package as RRECOMMENDS_${PN}, so
they are pulled into existing images etc.

The existing RDEPENDS_${PN} will need some further
clean-up in the future, as it appears a bit random which
packages the main package depends on vs. recommends.
Existing packages that aren't in RDEPENDS / RRECOMMENDS
haven't been added to RRECOMMENDS for that reason.

[YOCTO #13058]

Signed-off-by: André Draszik 

---
v3: * convert to PACKAGE_PREPROCESS_FUNCS rather than using
  apply_update_alternative_renames_prepend
v2: * Fix handling of escape characters in regexs and hence fix python
  Deprecation warnings which will be problematic in python 3.8.
* use PN for package name prefix, not BPN
---
 meta/recipes-core/util-linux/util-linux.inc | 64 ++---
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 4a72e3d40e..a23fec69ea 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -28,19 +28,35 @@ MAJOR_VERSION = 
"${@'.'.join(d.getVar('PV').split('.')[0:2])}"
 SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
-PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk 
util-linux-cfdisk util-linux-sfdisk \
- util-linux-swaponoff util-linux-losetup util-linux-umount \
+PACKAGES =+ "util-linux-blkdiscard util-linux-sfdisk \
+ util-linux-swaponoff util-linux-umount \
  util-linux-mount util-linux-readprofile util-linux-uuidd \
- util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs 
util-linux-fsck \
- util-linux-blkid util-linux-mkfs util-linux-mcookie 
util-linux-rfkill \
- util-linux-lsblk util-linux-mkfs.cramfs util-linux-fstrim \
- util-linux-partx util-linux-hwclock util-linux-mountpoint \
- util-linux-findfs util-linux-getopt util-linux-sulogin 
util-linux-prlimit \
- util-linux-ionice util-linux-switch-root util-linux-unshare"
+ util-linux-uuidgen util-linux-lscpu util-linux-fsck.cramfs \
+ util-linux-mkfs util-linux-mcookie util-linux-rfkill \
+ util-linux-lsblk util-linux-mkfs.cramfs \
+ util-linux-partx util-linux-mountpoint \
+ util-linux-findfs util-linux-getopt util-linux-prlimit \
+ util-linux-ionice util-linux-unshare"
 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 
'util-linux-pylibmount', '', d)}"
 PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
-PACKAGES_DYNAMIC = "^util-linux-lib.*"
+python util_linux_binpackages () {
+def pkg_hook(f, pkg, file_regex, output_pattern, modulename):
+if d.getVar('ALTERNATIVE_' + pkg):
+return
+if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename):
+d.setVar('ALTERNATIVE_' + pkg, modulename)
+
+do_split_packages(d, root='${base_sbindir}',
+  file_regex=r'(.*)', output_pattern='${PN}-%s',
+  description='${PN} %s',
+  hook=pkg_hook, extra_depends='', prepend=True)
+}
+
+# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS
+PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages "
+
+PACKAGES_DYNAMIC = "^util-linux-.*"
 
 SHARED_EXTRA_OECONF = "--disable-use-tty-group \
--disable-makeinstall-chown \
@@ -74,14 +90,8 @@ FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
 
 FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la"
 
-FILES_util-linux-agetty = "${base_sbindir}/agetty"
 FILES_util-linux-blkdiscard = "${sbindir}/blkdiscard"
-FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
-FILES_util-linux-fstrim = "${base_sbindir}/fstrim.${BPN}"
-FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
 FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
-FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} 
${base_sbindir}/swapoff.${BPN}"
-FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
 FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
 FILES_util-linux-mcookie = "${bindir}/mcookie"
 FILES_util-linux-umount = 

[OE-core] [PATCH v3 05/15] util-linux: fix the su and runuser packages

2019-01-16 Thread André Draszik
From: André Draszik 

The packages get an automatic RDEPENDS via shlibs, no
need to explicitly state it, so we can drop those
useless explicit assignments.

su is moved into ${base_bindir} in do_install(), so
because of a mismatched FILES specification su is
actually packaged into the main package at the moment,
not into the -su package as likely originally intended.

runuser needs the pam configuration files, so they should
be in the -runuser package, not in the main package.

While fixing this, we can simplify the update alternatives
processing for su.

[YOCTO #13058]

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index e479fc24e1..4a72e3d40e 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -96,7 +96,8 @@ FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
 FILES_util-linux-runuser = "${sbindir}/runuser"
 FILES_util-linux-prlimit = "${bindir}/prlimit"
 FILES_util-linux-ionice = "${bindir}/ionice.${BPN}"
-FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l"
+FILES_util-linux-runuser = "${sysconfdir}/pam.d/runuser*"
+FILES_util-linux-su = "${base_bindir}/su.${BPN} ${sysconfdir}/pam.d/su-l"
 CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
 
 FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
@@ -122,9 +123,6 @@ FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-RDEPENDS_util-linux-runuser += "libpam"
-RDEPENDS_util-linux-su += "libpam"
-
 RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup 
util-linux-sulogin util-linux-lsblk"
 RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 
'util-linux-runuser util-linux-su', '', d)}"
 
@@ -228,6 +226,7 @@ ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze"
 ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin"
 
 ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 
sulogin.8 utmpdump.1 rfkill.8 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3 
eject.1 logger.1"
+ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', 
'', d)}"
 
 ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
 ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
@@ -235,6 +234,7 @@ ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
 ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
 ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
 ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8"
+ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
 ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
 ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
 ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
@@ -263,6 +263,9 @@ ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
 ALTERNATIVE_util-linux-mount = "mount"
 ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
 
+ALTERNATIVE_${PN}-su = "su"
+ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+
 ALTERNATIVE_util-linux-umount = "umount"
 ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
 
@@ -305,15 +308,6 @@ ALTERNATIVE_LINK_NAME[switch_root] = 
"${base_sbindir}/switch_root"
 
 BBCLASSEXTEND = "native nativesdk"
 
-python do_package_prepend () {
-if '--enable-su' in d.getVar('EXTRA_OECONF').split():
-d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
-d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
-
-d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", 
d.expand('${base_bindir}/su'))
-d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", 
d.expand('${mandir}/man1/su.1'))
-}
-
 python populate_packages_prepend() {
 do_split_packages(d, '${base_libdir}', r'^lib(.*)\.so\..*$',
   output_pattern='util-linux-lib%s',
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 04/15] util-linux: be more explicit about what files go into packages

2019-01-16 Thread André Draszik
From: André Draszik 

Just using a wildcard leaves the reader wondering
what is meant here.

By being explicit we can describe exactly what is
intended, i.e. the file name as resulting from
the ALTERNATIVE and ALTERNATIVE_LINK_NAME mechanism.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 406af58502..e479fc24e1 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -88,7 +88,7 @@ FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
 FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
 FILES_util-linux-uuidgen = "${bindir}/uuidgen"
 FILES_util-linux-uuidd = "${sbindir}/uuidd"
-FILES_util-linux-rfkill = "${sbindir}/rfkill*"
+FILES_util-linux-rfkill = "${sbindir}/rfkill.${BPN}"
 FILES_util-linux-partx = "${sbindir}/partx"
 FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
 FILES_util-linux-findfs = "${sbindir}/findfs"
@@ -105,20 +105,20 @@ FILES_util-linux-pylibmount = 
"${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so
 FILES_util-linux-lsblk = "${bindir}/lsblk"
 FILES_util-linux-lscpu = "${bindir}/lscpu"
 
-FILES_util-linux-fsck = "${base_sbindir}/fsck*"
+FILES_util-linux-fsck = "${base_sbindir}/fsck.${BPN}"
 FILES_util-linux-mkfs = "${sbindir}/mkfs"
 
 FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
 FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
 
-FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+FILES_util-linux-sulogin = "${base_sbindir}/sulogin.${BPN}"
 FILES_util-linux-mountpoint = "${base_bindir}/mountpoint.${BPN}"
 
 FILES_util-linux-switch-root = "${base_sbindir}/switch_root.${BPN}"
 FILES_util-linux-unshare = "${bindir}/unshare.${BPN}"
 
 # Util-linux' blkid replaces the e2fsprogs one
-FILES_util-linux-blkid = "${base_sbindir}/blkid*"
+FILES_util-linux-blkid = "${base_sbindir}/blkid.${BPN}"
 RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
 RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
 
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 01/15] util-linux: simplify version upgrades (MAJOR_VERSION)

2019-01-16 Thread André Draszik
From: André Draszik 

There doesn't appear to be a need to manually and
explicitly specificy the major version (for the
download URL), it can be deduced easily from PV.

Do so.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc   | 3 ++-
 meta/recipes-core/util-linux/util-linux_2.32.1.bb | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index e514041a19..7bfec80508 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -24,7 +24,8 @@ DEPENDS = "zlib ncurses virtual/crypt"
 DEPENDS_append_class-native = " lzo-native"
 DEPENDS_append_class-nativesdk = " lzo-native"
 
-SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz
 \
+MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
+SRC_URI = 
"${KERNELORG_MIRROR}/linux/utils/${BPN}/v${MAJOR_VERSION}/${BP}.tar.xz \
"
 
 PACKAGES =+ "util-linux-agetty util-linux-blkdiscard util-linux-fdisk 
util-linux-cfdisk util-linux-sfdisk \
diff --git a/meta/recipes-core/util-linux/util-linux_2.32.1.bb 
b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
index c909836cbb..b0492afff3 100644
--- a/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -1,4 +1,3 @@
-MAJOR_VERSION = "2.32"
 require util-linux.inc
 
 # To support older hosts, we need to patch and/or revert
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 03/15] util-linux: remove minix remnants

2019-01-16 Thread André Draszik
From: André Draszik 

While commit fc66762d7c11 ("util-linux: Disable minix support.")
(or e88cee8cc31d in poky) removed most of the bits, there are
still references to minix remaining.

Remove them.

Signed-off-by: André Draszik 
---
 meta/recipes-core/util-linux/util-linux.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/util-linux/util-linux.inc 
b/meta/recipes-core/util-linux/util-linux.inc
index 7bfec80508..406af58502 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -159,7 +159,7 @@ do_install () {
mkdir -p ${D}${base_bindir}
 
 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
-sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup 
swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin"
+sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk 
fsck blkid blockdev fstrim sulogin switch_root nologin"
 binprogs_a="dmesg getopt kill more umount mount login su mountpoint"
 
 if [ "${base_sbindir}" != "${sbindir}" ]; then
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 02/15] util-linux: remove erroneous patch (qsort_r)

2019-01-16 Thread André Draszik
From: André Draszik 

The patch in question is patching the code to use
qsort() instead of qsort_r(), without adopting the
compare function. This is a major issue, because
the compare function as written is evaluating /
accessing a third argument, which is not passed
with this OE patch, causing access to random
memory.

Given this patch was added so as to support (old)
linux (host) distros which might not provide
qsort_r(), according to the git history, and given
these days util-linux detects availability of
qsort_r() during configure phase, and given musl
builds (which doesn't provide qsort_r() either)
work without problem, the right solution is to
simply drop this invalid patch.

Do so.

Signed-off-by: André Draszik 
---
 .../util-linux/util-linux-native-qsort.patch  | 33 ---
 .../util-linux/util-linux_2.32.1.bb   |  6 
 2 files changed, 39 deletions(-)
 delete mode 100644 
meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch

diff --git 
a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch 
b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
deleted file mode 100644
index 68bf22de8c..00
--- a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
-From: Robert Yang 
-Date: Wed, 26 Mar 2014 01:30:29 +
-Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
-
-qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
-the host like CentOS 5.x.
-
-Upstream-Status: Inappropriate [Other]
-
-Signed-off-by: Robert Yang 

- libfdisk/src/sun.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-Index: util-linux-2.24.2/libfdisk/src/sun.c
-===
 util-linux-2.24.2.orig/libfdisk/src/sun.c
-+++ util-linux-2.24.2/libfdisk/src/sun.c
-@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f
- }
- verify_sun_starts = starts;
- 
--qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
--(int (*)(const void *,const void *,void *)) verify_sun_cmp,
--verify_sun_starts);
--
-+qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
-+ (int (*)(const void *,const void *)) verify_sun_cmp);
-+ 
- if (array[0] == -1) {
-   fdisk_info(cxt, _("No partitions defined."));
-   return 0;
diff --git a/meta/recipes-core/util-linux/util-linux_2.32.1.bb 
b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
index b0492afff3..0f860c221b 100644
--- a/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -1,14 +1,8 @@
 require util-linux.inc
 
-# To support older hosts, we need to patch and/or revert
-# some upstream changes.  Only do this for native packages.
-OLDHOST = ""
-OLDHOST_class-native = "file://util-linux-native-qsort.patch"
-
 SRC_URI += "file://configure-sbindir.patch \
 file://runuser.pamd \
 file://runuser-l.pamd \
-${OLDHOST} \
 file://ptest.patch \
 file://run-ptest \
 file://display_testname_for_subtest.patch \
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 00/12] util-linux: one package per binary

2019-01-16 Thread André Draszik
v3:
* update 12/15 util-linux: simplify meta-package RDEPENDS / RRECOMMENDS
  commit message
* replace patch
06/15 update-alternatives: allow hooks before renaming files
  with
06/15 update-alternatives: convert file renames to PACKAGE_PREPROCESS_FUNCS
* update follow-up patches 7 8 9 10 accordingly
  
As per Richard's request / suggestion

[YOCTO #13058]

Cheers,
Andre'


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 06/15] update-alternatives: allow hooks before renaming files

2019-01-16 Thread André Draszik
On Tue, 2019-01-15 at 16:45 +, Richard Purdie wrote:
> On Tue, 2019-01-15 at 14:45 +, André Draszik wrote:
> > From: André Draszik 
> > 
> > At the moment, the update alternatives handling is happening
> > right after copying into PKGD during packaging time using
> > an _append OVERRIDE to the copy function. This means that at
> > this point the PACKAGES variable must have been fully
> > populated, as that is a prerequisite for update-alternatives.
> > 
> > In other words, this makes it impossible to e.g. populate
> > PACKAGES dynamically using do_split_packages() and still do
> > update-alternatives, as do_split_packages() can never
> > execute early enough in a deterministic way.
> > 
> > By converting the existing python function from a 'def'
> > type function to a 'python' type function, we now make it
> > possible for somebody to hook themselves between copying
> > into PKGD and execution of update-alternatives, via
> > a _prepend OVERRIDE, which is not possible with 'def' type
> > functions.
> > 
> > [YOCTO #13058]
> 
> I don't think you need to do this. Can you add your function to the
> start of PACKAGEBUILDPKGD rather than using
> apply_update_alternative_renames_prepend
> ?

do_split_packages() can only execute after perform_packagecopy() which is
the first function in PACKAGEBUILDPKGD. So other than redefining
PACKAGEBUILDPKGD, or adding another variable just for u/a and modifying this
var in util-linux, I'd say impossible while keeping it all legible /
maintainable.

> or maybe use PACKAGE_PREPROCESS_FUNCS?
> 
> In fact we should probably fix the update-alternatives class to use
> PACKAGE_PREPROCESS_FUNCS rather than perform_packagecopy_append too.
> 
> Regardless, I'd like to see us try and make this more readable rather
> than less which means separate functions and less prepend/appending and
> more use of the variables...

This sounds good, thank you. While I did contemplate that originally, I was
mislead by a comment in the u/a class and didn't follow that approach. I now
think it will work fine, though. Patch upcoming.

Cheers,
Andre'

> 
> Cheers,
> 
> Richard
> 
> 
> > Signed-off-by: André Draszik 
> > ---
> >  meta/classes/update-alternatives.bbclass | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta/classes/update-alternatives.bbclass
> > b/meta/classes/update-alternatives.bbclass
> > index f1250f877b..ffedada2f6 100644
> > --- a/meta/classes/update-alternatives.bbclass
> > +++ b/meta/classes/update-alternatives.bbclass
> > @@ -135,10 +135,10 @@ populate_packages[vardeps] += "${UPDALTVARS} 
> > ${@gen_updatealternativesvars(d)}"
> >  # place.
> >  python perform_packagecopy_append () {
> >  if update_alternatives_enabled(d):
> > -apply_update_alternative_renames(d)
> > +bb.build.exec_func('apply_update_alternative_renames', d)
> >  }
> >  
> > -def apply_update_alternative_renames(d):
> > +python apply_update_alternative_renames () {
> >  # Check for deprecated usage...
> >  pn = d.getVar('BPN')
> >  if d.getVar('ALTERNATIVE_LINKS') != None:
> > @@ -204,6 +204,7 @@ def apply_update_alternative_renames(d):
> >  os.unlink(src)
> >  else:
> >  bb.warn('%s: Unable to resolve dangling symlink:
> > %s' % (pn, alt_target))
> > +}
> >  
> >  PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
> >  
> > -- 
> > 2.20.1
> > 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2 1/1] ltp: Update to 20190115

2019-01-16 Thread Richard Purdie
On Wed, 2019-01-16 at 00:06 +0100, Petr Vorel wrote:
> Updated patches
> * 0004-build-Add-option-to-select-libc-implementation.patch
> * 0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch
> * 0001-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch
> 
> Removed patches (accepted in upstream)
> * 0001-getcpu01-Rename-getcpu-to-avoid-conflict-with-glibc-.patch
> * 0001-netns_helper.sh-use-ping-6-when-ping6-is-not-avaliab.patch
> * 0001-setrlimit05-Use-another-method-to-get-bad-address.patch
> * 0001-sigwaitinfo01-recent-glibc-calls-syscall-directly.patch
> * 0001-statx-fix-compile-errors.patch
> * 0001-syscalls-fcntl-make-OFD-command-use-fcntl64-syscall-.patch
> (accepted v2 version, see 
> http://lists.linux.it/pipermail/ltp/2018-October/009691.html)
> 
> Signed-off-by: Petr Vorel 
> ---
> Changes v1->v2:
> * Update SRCREV (previous version used old version)
> * Refresh patches

Thanks for looking at this. Unfortunately it failed in testing on most
targets:

https://autobuilder.yoctoproject.org/typhoon/#/builders/46/builds/181/steps/7/logs/step1b

(one failure given as an example).

Warnings as errors are good during development but sometimes less
useful during release due to the variety of end user configurations.

Cheers,

Richard

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] glibc: glibc support powerpc e5500 and e6500

2019-01-16 Thread C.r. Guo
From: Chunrong Guo 

Signed-off-by: Chunrong Guo 
---
 .../glibc/0035-glibc-support-e5500-and-e6500.patch | 562 +
 meta/recipes-core/glibc/glibc_2.28.bb  |   1 +
 2 files changed, 563 insertions(+)
 create mode 100644 
meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch

diff --git 
a/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch 
b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
new file mode 100644
index 000..bc54de7
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
@@ -0,0 +1,562 @@
+From 70dc75d3da86dea8b6ebdaedfa76e625a076678e Mon Sep 17 00:00:00 2001
+From: Chunrong Guo 
+Date: Wed, 31 Oct 2018 17:56:24 +0800
+Subject: [PATCH] glibc: support e5500 and e6500
+
+Signed-off-by: BJ DevOps Team 
+---
+ sysdeps/powerpc/powerpc64/be/e5500/Implies |   2 +
+ sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c| 137 +
+ sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c   | 103 
+ .../powerpc/powerpc64/be/e5500/multiarch/Implies   |   1 +
+ sysdeps/powerpc/powerpc64/be/e6500/Implies |   2 +
+ sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c| 137 +
+ sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c   | 103 
+ .../powerpc/powerpc64/be/e6500/multiarch/Implies   |   1 +
+ 8 files changed, 486 insertions(+)
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/multiarch/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/multiarch/Implies
+
+diff --git a/sysdeps/powerpc/powerpc64/be/e5500/Implies 
b/sysdeps/powerpc/powerpc64/be/e5500/Implies
+new file mode 100644
+index 000..a795586
+--- /dev/null
 b/sysdeps/powerpc/powerpc64/be/e5500/Implies
+@@ -0,0 +1,2 @@
++powerpc/powerpc64/e5500
++
+diff --git a/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c 
b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 000..13a8197
+--- /dev/null
 b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,137 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include 
++#include 
++#include 
++#include 
++
++#include 
++#include 
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc0 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f80 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, 
chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++double
++__slow_ieee754_sqrt (double b)
++{
++  if (__builtin_expect (b > 0, 1))
++{
++  double y, g, h, d, r;
++  ieee_double_shape_type u;
++
++  if (__builtin_expect (b != a_inf.value, 1))
++{
++  fenv_t fe;
++
++  fe = fegetenv_register ();
++
++  u.value = b;
++
++  relax_fenv_state ();
++
++  __asm__ ("frsqrte %[estimate], %[x]\n"
++   : [estimate] "=f" (y) : [x] "f" (b));
++
++  /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp.  */
++
++  /* Indicate that these can be performed prior to the branch.  GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before 

[OE-core] [PATCH] classes/compress_doc: add missing import subprocess

2019-01-16 Thread André Draszik
From: André Draszik 

Enabling compress_doc gives the following stack trace:

File: 'exec_python_func() autogenerated', lineno: 2, function: 
 0001:
 *** 0002:package_do_compress_doc(d)
 0003:
File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 
50, function: package_do_compress_doc
 0046:mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir"))
 0047:if os.path.exists(mandir):
 0048:# Decompress doc files which format is not compress_mode
 0049:decompress_doc(mandir, compress_mode, decompress_cmds)
 *** 0050:compress_doc(mandir, compress_mode, compress_cmds)
 0051:
 0052:infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir"))
 0053:if os.path.exists(infodir):
 0054:# Decompress doc files which format is not compress_mode
File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 
180, function: compress_doc
 0176:_collect_hardlink(hardlink_dict, file)
 0177:# Normal file
 0178:elif os.path.isfile(file):
 0179:cmd = "%s %s" % (compress_cmds[compress_mode], 
file)
 *** 0180:(retval, output) = subprocess.getstatusoutput(cmd)
 0181:if retval:
 0182:bb.warn("compress failed %s (cmd was %s)%s" % 
(retval, cmd, ":\n%s" % output if output else ""))
 0183:continue
 0184:bb.note('compress file %s' % file)
Exception: NameError: name 'subprocess' is not defined

Fix by adding the missing import in two places.

Signed-off-by: André Draszik 
---
 meta/classes/compress_doc.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/compress_doc.bbclass 
b/meta/classes/compress_doc.bbclass
index 45bb8fff65..d6d11fad26 100644
--- a/meta/classes/compress_doc.bbclass
+++ b/meta/classes/compress_doc.bbclass
@@ -160,6 +160,7 @@ def _is_compress_doc(file, compress_format_list):
 return False, ''
 
 def compress_doc(topdir, compress_mode, compress_cmds):
+import subprocess
 hardlink_dict = {}
 for root, dirs, files in os.walk(topdir):
 for f in files:
@@ -187,6 +188,7 @@ def compress_doc(topdir, compress_mode, compress_cmds):
 
 # Decompress doc files which format is not compress_mode
 def decompress_doc(topdir, compress_mode, decompress_cmds):
+import subprocess
 hardlink_dict = {}
 decompress = True
 for root, dirs, files in os.walk(topdir):
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] populate_sdk_base: add option of add other type of sdk

2019-01-16 Thread changqing.li
From: Changqing Li 

Current sdk type is tar.xz, but for mingw sdk, since we
have symlink under the sdk folder, 7zip which used to
extract tar.xz cannot handle it, refer 7zip upstream bug:
https://sourceforge.net/p/sevenzip/discussion/45797/thread/c71d6b96/
so add option for usr can select the sdk type.

Also tried to use option --dereference of tar which use means:
"follow symlinks; archive and dump the files they point to"
with this option, when archive it will deal with symlink to hard link,
but windows not support hard link, so drop this solution,
and use .zip for windows.

Signed-off-by: Changqing Li 
---
 meta/classes/populate_sdk_base.bbclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass 
b/meta/classes/populate_sdk_base.bbclass
index 677ba3c..4fef2f6 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -44,8 +44,12 @@ TOOLCHAIN_TARGET_TASK ?= "${@multilib_pkg_extend(d, 
'packagegroup-core-standalon
 TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
 TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
 
+SDK_TAR_TYPE ?= "tar.xz"
+SDK_TAR_DEPENDS ?= "xz-native"
+SDK_TAR_CMD ?= "tar ${SDKTAROPTS} -cf - . | xz -T 0 > 
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE}"
+
 SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
-SDK_DEPENDS = "virtual/fakeroot-native xz-native cross-localedef-native 
nativesdk-qemuwrapper-cross ${@' '.join(["%s-qemuwrapper-cross" % m for m in 
d.getVar("MULTILIB_VARIANTS").split()])} qemuwrapper-cross"
+SDK_DEPENDS = "virtual/fakeroot-native ${SDK_TAR_DEPENDS} 
cross-localedef-native nativesdk-qemuwrapper-cross ${@' 
'.join(["%s-qemuwrapper-cross" % m for m in 
d.getVar("MULTILIB_VARIANTS").split()])} qemuwrapper-cross"
 PATH_prepend = 
"${STAGING_DIR_HOST}${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(all_multilib_tune_values(d,
 'STAGING_BINDIR_CROSS').split())}:"
 SDK_DEPENDS_append_libc-glibc = " nativesdk-glibc-locale"
 
@@ -225,7 +229,7 @@ fakeroot tar_sdk() {
# Package it up
mkdir -p ${SDKDEPLOYDIR}
cd ${SDK_OUTPUT}/${SDKPATH}
-   tar ${SDKTAROPTS} -cf - . | xz -T 0 > 
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
+   ${SDK_TAR_CMD}
 }
 
 TOOLCHAIN_SHAR_EXT_TMPL ?= "${COREBASE}/meta/files/toolchain-shar-extract.sh"
@@ -268,10 +272,10 @@ EOF
chmod +x ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
 
# append the SDK tarball
-   cat ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz >> 
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
+   cat ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE} >> 
${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.sh
 
# delete the old tarball, we don't need it anymore
-   rm ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.tar.xz
+   rm ${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.${SDK_TAR_TYPE}
 }
 
 populate_sdk_log_check() {
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/1] parselogs.py: whilelist one more amba error message

2019-01-16 Thread Chen Qi
*** BLURB HERE ***
The following changes since commit 1ee53881eea3a7ca4d4f6a5ca9c4c6e6488d2348:

  perl: fix yet another race failure (2019-01-14 17:38:24 +)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib ChenQi/qemuarm-parselogs
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/qemuarm-parselogs

Chen Qi (1):
  parselogs.py: whilelist one more amba error message

 meta/lib/oeqa/runtime/cases/parselogs.py | 1 +
 1 file changed, 1 insertion(+)

-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1] parselogs.py: whilelist one more amba error message

2019-01-16 Thread Chen Qi
When using linux-yocto-dev, we will have one more amba error message
for qemuarm, so ignore it too.

Signed-off-by: Chen Qi 
---
 meta/lib/oeqa/runtime/cases/parselogs.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/lib/oeqa/runtime/cases/parselogs.py 
b/meta/lib/oeqa/runtime/cases/parselogs.py
index f6e9820..3d72e20 100644
--- a/meta/lib/oeqa/runtime/cases/parselogs.py
+++ b/meta/lib/oeqa/runtime/cases/parselogs.py
@@ -113,6 +113,7 @@ ignore_errors = {
 'OF: amba_device_add() failed (-19) for /amba/sctl@101e',
 'OF: amba_device_add() failed (-19) for /amba/watchdog@101e1000',
 'OF: amba_device_add() failed (-19) for /amba/sci@101f',
+'OF: amba_device_add() failed (-19) for /amba/spi@101f4000',
 'OF: amba_device_add() failed (-19) for /amba/ssp@101f4000',
 'OF: amba_device_add() failed (-19) for /amba/fpga/sci@a000',
 'Failed to initialize \'/amba/timer@101e3000\': -22',
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [thud][PATCH] glibc: glibc support powerpc e5500 and e6500

2019-01-16 Thread C.r. Guo
From: Chunrong Guo 

Signed-off-by: Chunrong Guo 
---
 .../glibc/0035-glibc-support-e5500-and-e6500.patch | 562 +
 meta/recipes-core/glibc/glibc_2.28.bb  |   1 +
 2 files changed, 563 insertions(+)
 create mode 100644 
meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch

diff --git 
a/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch 
b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
new file mode 100644
index 000..bc54de7
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0035-glibc-support-e5500-and-e6500.patch
@@ -0,0 +1,562 @@
+From 70dc75d3da86dea8b6ebdaedfa76e625a076678e Mon Sep 17 00:00:00 2001
+From: Chunrong Guo 
+Date: Wed, 31 Oct 2018 17:56:24 +0800
+Subject: [PATCH] glibc: support e5500 and e6500
+
+Signed-off-by: BJ DevOps Team 
+---
+ sysdeps/powerpc/powerpc64/be/e5500/Implies |   2 +
+ sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c| 137 +
+ sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c   | 103 
+ .../powerpc/powerpc64/be/e5500/multiarch/Implies   |   1 +
+ sysdeps/powerpc/powerpc64/be/e6500/Implies |   2 +
+ sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c| 137 +
+ sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c   | 103 
+ .../powerpc/powerpc64/be/e6500/multiarch/Implies   |   1 +
+ 8 files changed, 486 insertions(+)
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e5500/multiarch/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/Implies
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/be/e6500/multiarch/Implies
+
+diff --git a/sysdeps/powerpc/powerpc64/be/e5500/Implies 
b/sysdeps/powerpc/powerpc64/be/e5500/Implies
+new file mode 100644
+index 000..a795586
+--- /dev/null
 b/sysdeps/powerpc/powerpc64/be/e5500/Implies
+@@ -0,0 +1,2 @@
++powerpc/powerpc64/e5500
++
+diff --git a/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c 
b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 000..13a8197
+--- /dev/null
 b/sysdeps/powerpc/powerpc64/be/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,137 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include 
++#include 
++#include 
++#include 
++
++#include 
++#include 
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc0 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f80 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, 
chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++double
++__slow_ieee754_sqrt (double b)
++{
++  if (__builtin_expect (b > 0, 1))
++{
++  double y, g, h, d, r;
++  ieee_double_shape_type u;
++
++  if (__builtin_expect (b != a_inf.value, 1))
++{
++  fenv_t fe;
++
++  fe = fegetenv_register ();
++
++  u.value = b;
++
++  relax_fenv_state ();
++
++  __asm__ ("frsqrte %[estimate], %[x]\n"
++   : [estimate] "=f" (y) : [x] "f" (b));
++
++  /* Following Muller et al, page 168, equation 5.20.
++
++ h goes to 1/(2*sqrt(b))
++ g goes to sqrt(b).
++
++ We need three iterations to get within 1ulp.  */
++
++  /* Indicate that these can be performed prior to the branch.  GCC
++ insists on sinking them below the branch, however; it seems like
++ they'd be better before 

[OE-core] [PATCH] ptest-runner: pass libdir to DEFAULT_DIRECTORY when compiling

2019-01-16 Thread Li Zhou
Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
When libdir isn't "/usr/lib", it will cause "No ptests found" error
when running "ptest-runner" command. Here pass libdir to
DEFAULT_DIRECTORY when compiling to avoid that error.

Signed-off-by: Li Zhou 
---
 ...r-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch | 36 ++
 .../ptest-runner/ptest-runner_2.3.bb   |  5 +--
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 
meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch

diff --git 
a/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
 
b/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
new file mode 100644
index 000..56e1f96
--- /dev/null
+++ 
b/meta/recipes-support/ptest-runner/ptest-runner/0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch
@@ -0,0 +1,36 @@
+From 6a663ac38c71108890e42f451f3a7b22afee0a40 Mon Sep 17 00:00:00 2001
+From: Li Zhou 
+Date: Wed, 16 Jan 2019 15:00:17 +0800
+Subject: [PATCH] ptest-runner: remove DEFAULT_DIRECTORY's hard coded
+ initialization
+
+Ptest data are installed to PTEST_PATH ?= "${libdir}/${BPN}/ptest".
+Here make DEFAULT_DIRECTORY be able to be defined outside of c code,
+in case libdir isn't "/usr/lib", which will cause "No ptests found"
+error when running "ptest-runner" command. We will pass libdir to
+DEFAULT_DIRECTORY when compiling to avoid that error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou 
+---
+ main.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/main.c b/main.c
+index 83600b7..e963efe 100644
+--- a/main.c
 b/main.c
+@@ -37,7 +37,9 @@
+ 
+ #include "utils.h"
+ 
++#ifndef DEFAULT_DIRECTORY
+ #define DEFAULT_DIRECTORY "/usr/lib"
++#endif
+ #define DEFAULT_TIMEOUT 300
+ 
+ static inline void
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb 
b/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
index 26add9b..9866d1a 100644
--- a/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
+++ b/meta/recipes-support/ptest-runner/ptest-runner_2.3.bb
@@ -10,12 +10,13 @@ LIC_FILES_CHKSUM = 
"file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
 SRCREV = "80712583732b4a809532f644fb09e7d2e812d7ba"
 PV = "2.3+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \
+   
file://0001-ptest-runner-remove-DEFAULT_DIRECTORY-s-hard-coded-i.patch"
 S = "${WORKDIR}/git"
 
 FILES_${PN} = "${bindir}/ptest-runner"
 
-EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OEMAKE = "-e MAKEFLAGS= CFLAGS="${CFLAGS} 
-DDEFAULT_DIRECTORY=\\\"${libdir}\\\"""
 
 do_compile () {
oe_runmake
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2 0/1] selftest/wic: update test case test_qemu

2019-01-16 Thread kai.kang
From: Kai Kang 

V2:
* check mounted partition with egrep rather than check output

Kai Kang (1):
  selftest/wic: update test case test_qemu

 meta/lib/oeqa/selftest/cases/wic.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] wic: sdimage-bootpart: Use mmcblk0 drive instead of bogus mmcblk

2019-01-16 Thread Alexey Brodkin
Apparently either nobody ever used sdimage-bootpart.wks
or fstab was kept untouched due to "--no-fstab-update" usage as
some boards like IMX may have, see [1].

Otherwise addition of the following line to the target's fstab:
-->8-
/dev/mmcblkp1   /boot   vfatdefaults0   0
-->8-

gets us unusable target:
-->8-
[* ] A start job is running for dev-mmcblkp1.device (23s / 1min 30s)
[ TIME ] Timed out waiting for device dev-mmcblkp1.device.
[DEPEND] Dependency failed for /boot.
[DEPEND] Dependency failed for Local File Systems.

You are in emergency mode. After logging in, type "journalctl -xb" to view
system logs, "systemctl reboot" to reboot, "systemctl default" or "exit"
to boot into default mode.
Press Enter for maintenance
-->8-

Fix it with use of "mmcblk0" device name.

[1] 
https://lists.yoctoproject.org/pipermail/meta-freescale/2018-February/022156.html

Signed-off-by: Alexey Brodkin 
Cc: Maciej Borzecki 
Cc: Maciek Borzecki 
Cc: Richard Purdie 

Signed-off-by: Alexey Brodkin 
---
 scripts/lib/wic/canned-wks/sdimage-bootpart.wks | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/wic/canned-wks/sdimage-bootpart.wks 
b/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
index 7ffd632f4a..63bc4dab6a 100644
--- a/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
+++ b/scripts/lib/wic/canned-wks/sdimage-bootpart.wks
@@ -2,5 +2,5 @@
 # long-description: Creates a partitioned SD card image. Boot files
 # are located in the first vfat partition.
 
-part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label 
boot --active --align 4 --size 16
-part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4
+part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label 
boot --active --align 4 --size 16
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4
-- 
2.16.2

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/1] selftest/wic: update test case test_qemu

2019-01-16 Thread kai.kang
From: Kai Kang 

This test case boots the image in qemu and checks for mounted partitions.
But the outputs of mount are different between sysvinit and systemd:

sysvinit:
/dev/root /\r\n/dev/sda1 /boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt
systemd:
/dev/sda1 /boot\r\n/dev/sda2 /\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt

So check mounted partitions by egrep rather than check output of runqemu.

Signed-off-by: Kai Kang 
---
 meta/lib/oeqa/selftest/cases/wic.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/wic.py 
b/meta/lib/oeqa/selftest/cases/wic.py
index 36ee5e5a14..79925f942f 100644
--- a/meta/lib/oeqa/selftest/cases/wic.py
+++ b/meta/lib/oeqa/selftest/cases/wic.py
@@ -625,9 +625,11 @@ class Wic2(WicTestCase):
 self.remove_config(config)
 
 with runqemu('wic-image-minimal', ssh=False) as qemu:
-cmd = "mount |grep '^/dev/' | cut -f1,3 -d ' ' | sort"
+cmd = "mount | grep '^/dev/' | cut -f1,3 -d ' ' | egrep -c -e 
'/dev/sda1 /boot' " \
+  "-e '/dev/root /|/dev/sda2 /' -e '/dev/sda3 /media' -e 
'/dev/sda4 /mnt'"
 status, output = qemu.run_serial(cmd)
-self.assertEqual(output, '/dev/root /\r\n/dev/sda1 
/boot\r\n/dev/sda3 /media\r\n/dev/sda4 /mnt')
+self.assertEqual(1, status, 'Failed to run command "%s": %s' % 
(cmd, output))
+self.assertEqual(output, '4')
 cmd = "grep UUID= /etc/fstab"
 status, output = qemu.run_serial(cmd)
 self.assertEqual(1, status, 'Failed to run command "%s": %s' % 
(cmd, output))
-- 
2.18.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core