[OE-core] $PWD in terminal.bbclass

2019-04-30 Thread Enrico Scholz via Openembedded-core
Hi,

terminal.bbclass exports the original environment before running the
terminal command.  This environment includes the original $PWD too so
that the generated script (run.do_terminal) looks like

| #!/usr/bin/env /bin/bash
| ...
| export PWD="/srv/projects/.../build"   << the directory with conf/local.conf 
e.g.
| ...
| do_terminal() {
| exec /bin/bash -c ...
| }


Assigning PWD works like 'cd' and changes the actual path so that
do_terminal() will be executed from the directory where bitbake has
been started from.  But usually, the [dirs] directory (e.g. '${B}') is
expected.

Is this really intented?  Here, this breaks kernel's '-c menuconfig' (at
least).

A trivial fix would be something like

|envdata.delVar("PS1")
|+   envdata.delVar("PWD")

in terminal.bbclass.  But is there any reason to have PWD in ${BB_ORIGENV}
at all?  imo, there is no reason to keep this variable and it should be
removed in bitbake already.


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


Re: [OE-core] [PATCH 1/2] systemd: change default locale from C.UTF-8 to C

2019-04-16 Thread Enrico Scholz via Openembedded-core
Richard Purdie

writes:

>> current default locale is set to C.UTF-8, but glibc not support
>> locale C.UTF-8. so set to the default locale C.
>
> Doesn't your second patch mean we don't need this one?

C.UTF-8 instead of plain C has runtime costs because additional files
need to be read by services.

imo, plain C should be a PACKAGE_CONFIG option which is enabled by
default.


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


[OE-core] [PATCH] dhcp: fix isc_boolean_t patch

2019-04-14 Thread Enrico Scholz via Openembedded-core
There is a copy & paste error in 5775e9ef2fce1d0b9860602f1065bb1e09bc1b61
which breaks dhcpd.

Cc: Armin Kuster 
Signed-off-by: Enrico Scholz 
---
 ...1-dhcpd-fix-Replace-custom-isc_boolean_t-with-C-standa.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/meta/recipes-connectivity/dhcp/dhcp/0001-dhcpd-fix-Replace-custom-isc_boolean_t-with-C-standa.patch
 
b/meta/recipes-connectivity/dhcp/dhcp/0001-dhcpd-fix-Replace-custom-isc_boolean_t-with-C-standa.patch
index d2e57714cd..fa3d9c4e1f 100644
--- 
a/meta/recipes-connectivity/dhcp/dhcp/0001-dhcpd-fix-Replace-custom-isc_boolean_t-with-C-standa.patch
+++ 
b/meta/recipes-connectivity/dhcp/dhcp/0001-dhcpd-fix-Replace-custom-isc_boolean_t-with-C-standa.patch
@@ -1816,7 +1816,7 @@ Index: dhcp-4.4.1/common/options.c
  {
if (universe->save_func)
 -  (*universe->save_func)(universe, options, oc, ISC_FALSE);
-+  (*universe->save_func)(universe, options, oc, true);
++  (*universe->save_func)(universe, options, oc, false);
else
log_error("can't store options in %s space.", universe->name);
  }
-- 
2.20.1

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


[OE-core] [PATCH] utils.py: added sh_quote() function

2019-04-03 Thread Enrico Scholz via Openembedded-core
This function is a wrapper around "shlex.quote()" and can be used in
"${@...}" context where shlex (or pipes, which provides similar
functionality) is unavailable.

Signed-off-by: Enrico Scholz 
---
 meta/lib/oe/utils.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 3a496090f3..cedd053d36 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -490,3 +490,6 @@ class ImageQAFailed(bb.build.FuncFailed):
 
 return msg
 
+def sh_quote(string):
+import shlex
+return shlex.quote(string)
-- 
2.20.1

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


Re: [OE-core] [PATCH] pseudo: build with recent attr

2018-12-17 Thread Enrico Scholz via Openembedded-core
"Burton, Ross"  writes:

> | In file included from port_wrappers.c:8:0,
> |  from pseudo_wrappers.c:307:
> | ports/linux/xattr/pseudo_wrappers.c: In function ‘shared_getxattr’:
> | ports/linux/xattr/pseudo_wrappers.c:134:11: error: ‘ENOATTR’ undeclared 
> (first use in this function)
> |errno = ENOATTR;
>
> Breaks when building with old xattr.

Yes; defining ENOATTR in  was a mistake, violated POSIX
and causes such problems now...  I am tending to rewrite the patch with
something like

-#include 
+#include 
+#include 
+#ifndef ENOATTR
+# define ENOATTR ENODATA
+#endif

and I am disussing this with Seebs atm...


Enrico
-- 
SIGMA Chemnitz GmbH   Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13   Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] attr: updated acl + attr

2018-12-14 Thread Enrico Scholz via Openembedded-core
"Burton, Ross"  writes:

>> Recent acl and attr package versions changed their buildsystem to
>> standard automake so that previous buildsystem related patches are not
>> needed anymore and recipes become very simple.
>
> pseudo-native doesn't build anymore:

strange... Requires an explicit '-c cleansstate pseudo-native' to show
the error but it built fine with a removed TMPDIR


> | In file included from pseudo_ports.h:15:0,
> |  from pseudo.h:171,
> |  from pseudo.c:37:
> | ports/linux/xattr/portdefs.h:1:24: fatal error: attr/xattr.h: No such file 
> or directory
> |  #include 

I thnk, fixing it in pseudo is the correct way because 
has been removed by intention by upstream.  Most software seems to use
this "new" header already, but there can be a problem with ENOATTR which
requires either an #include of , a manual #define or
replacement by ENODATA.


Alternatively, we can ship -- like Fedora -- a compatibility wrapper
like

-- 
/* legacy wrapper; see
 * 
http://git.savannah.nongnu.org/cgit/attr.git/commit/include?id=7921157890d07858d092f4003ca4c6bae9fd2c38
 */

#warning Using legacy ; please update program to include 


#include 
#include "attributes.h"
-- 



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


[OE-core] [PATCH] pseudo: build with recent attr

2018-12-14 Thread Enrico Scholz via Openembedded-core
Recent attr package removed  which is shipped by libc
for a very long time already.

Signed-off-by: Enrico Scholz 
---
 ...001-use-sys-xattr.h-not-attr-xattr.h.patch | 54 +++
 meta/recipes-devtools/pseudo/pseudo_git.bb|  1 +
 2 files changed, 55 insertions(+)
 create mode 100644 
meta/recipes-devtools/pseudo/files/0001-use-sys-xattr.h-not-attr-xattr.h.patch

diff --git 
a/meta/recipes-devtools/pseudo/files/0001-use-sys-xattr.h-not-attr-xattr.h.patch
 
b/meta/recipes-devtools/pseudo/files/0001-use-sys-xattr.h-not-attr-xattr.h.patch
new file mode 100644
index 00..5eddea5ba1
--- /dev/null
+++ 
b/meta/recipes-devtools/pseudo/files/0001-use-sys-xattr.h-not-attr-xattr.h.patch
@@ -0,0 +1,54 @@
+From 7132668ce2409e0919a79d6f236827665f068427 Mon Sep 17 00:00:00 2001
+From: Enrico Scholz 
+Date: Fri, 14 Dec 2018 18:41:04 +0100
+Subject: [PATCH, pseudo] use , not 
+
+ has been removed from recent attr package:
+
+   The xattr syscalls are provided by glibc since ages, so there is
+   no need to use the indirect system call "syscall" anymore. This
+   removes the need for the  header; use 
+   instead.
+
+   
http://git.savannah.nongnu.org/cgit/attr.git/commit/include?id=7921157890d07858d092f4003ca4c6bae9fd2c38
+
+For Linux, we have to include  to define ENODATA.
+
+Signed-off-by: Enrico Scholz 
+---
+Upstream-Status: pending
+
+ ports/linux/subports | 4 ++--
+ ports/linux/xattr/portdefs.h | 3 ++-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/ports/linux/subports b/ports/linux/subports
+index a29044a..44e0e9e 100755
+--- a/ports/linux/subports
 b/ports/linux/subports
+@@ -29,11 +29,11 @@ fi
+ if$port_xattr; then
+   cat > dummy.c <
+-#include 
++#include 
+ int i;
+ EOF
+   if ! ${CC} -c -o dummy.o dummy.c >/dev/null 2>&1; then
+-  echo >&2 "Warning: Can't compile trivial program using 
".
++  echo >&2 "Warning: Can't compile trivial program using 
".
+   echo >&2 " xattr support will require that header."
+   fi
+   echo "linux/xattr"
+diff --git a/ports/linux/xattr/portdefs.h b/ports/linux/xattr/portdefs.h
+index 367ca60..bb577f1 100644
+--- a/ports/linux/xattr/portdefs.h
 b/ports/linux/xattr/portdefs.h
+@@ -1,2 +1,3 @@
+-#include 
++#include 
++#include 
+ #include 
+-- 
+2.19.2
+
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb 
b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 79e0b6bd21..a0147d2d19 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -6,6 +6,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo \
file://fallback-group \
file://moreretries.patch \
file://toomanyfiles.patch \
+   file://0001-use-sys-xattr.h-not-attr-xattr.h.patch \
"
 
 SRCREV = "6294b344e5140f5467e6860f45a174440015304e"
-- 
2.19.2

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


[OE-core] [PATCH] attr: updated acl + attr

2018-12-14 Thread Enrico Scholz via Openembedded-core
Recent acl and attr package versions changed their buildsystem to
standard automake so that previous buildsystem related patches are not
needed anymore and recipes become very simple.

Other, functionality related patches are integrated in upstream and
were removed too.

Because of the buildsystem changes, the 'ptest' parts of the recipes do
not work anymore and would not a complete rewrite.  For now, 'ptest'
has been removed.

Signed-off-by: Enrico Scholz 
---
 ...file-libacl-should-depend-on-include.patch |  51 --
 ...-order-of-expected-output-of-getfacl.patch | 198 --
 meta/recipes-support/attr/acl/configure.ac|  49 --
 meta/recipes-support/attr/acl/run-ptest   |  64 --
 .../acl/test-fix-directory-permissions.patch  |  37 -
 .../test-fix-insufficient-quoting-of.patch| 100 ---
 ...-SELinux-machines-for-root-testcases.patch |  84 ---
 meta/recipes-support/attr/acl_2.2.52.bb   |  52 --
 meta/recipes-support/attr/acl_2.2.53.bb   |  23 +
 meta/recipes-support/attr/attr.inc|  46 --
 .../0001-Use-stdint-types-consistently.patch  |  69 --
 .../attr/attr/attr-Missing-configure.ac.patch |  63 --
 .../attr/attr/dont-use-decl-macros.patch  |  56 --
 meta/recipes-support/attr/attr_2.4.47.bb  |  15 -
 meta/recipes-support/attr/attr_2.4.48.bb  |  27 +
 meta/recipes-support/attr/ea-acl.inc  |  52 --
 ...option-to-enable-disable-static-libr.patch |  70 --
 ...e-attr.5-man-page-moved-to-man-pages.patch | 240 ---
 .../Remove-the-section-2-man-pages.patch  | 666 --
 .../attr/files/relative-libdir.patch  |  25 -
 meta/recipes-support/attr/files/run-ptest |   5 -
 21 files changed, 50 insertions(+), 1942 deletions(-)
 delete mode 100644 
meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
 delete mode 100644 
meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch
 delete mode 100644 meta/recipes-support/attr/acl/configure.ac
 delete mode 100644 meta/recipes-support/attr/acl/run-ptest
 delete mode 100644 
meta/recipes-support/attr/acl/test-fix-directory-permissions.patch
 delete mode 100644 
meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch
 delete mode 100644 
meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch
 delete mode 100644 meta/recipes-support/attr/acl_2.2.52.bb
 create mode 100644 meta/recipes-support/attr/acl_2.2.53.bb
 delete mode 100644 meta/recipes-support/attr/attr.inc
 delete mode 100644 
meta/recipes-support/attr/attr/0001-Use-stdint-types-consistently.patch
 delete mode 100644 
meta/recipes-support/attr/attr/attr-Missing-configure.ac.patch
 delete mode 100644 meta/recipes-support/attr/attr/dont-use-decl-macros.patch
 delete mode 100644 meta/recipes-support/attr/attr_2.4.47.bb
 create mode 100644 meta/recipes-support/attr/attr_2.4.48.bb
 delete mode 100644 meta/recipes-support/attr/ea-acl.inc
 delete mode 100644 
meta/recipes-support/attr/files/0001-Added-configure-option-to-enable-disable-static-libr.patch
 delete mode 100644 
meta/recipes-support/attr/files/Remove-the-attr.5-man-page-moved-to-man-pages.patch
 delete mode 100644 
meta/recipes-support/attr/files/Remove-the-section-2-man-pages.patch
 delete mode 100644 meta/recipes-support/attr/files/relative-libdir.patch
 delete mode 100644 meta/recipes-support/attr/files/run-ptest

diff --git 
a/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch 
b/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
deleted file mode 100644
index 4c7cba3b88..00
--- 
a/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From d82457ce5ca7455e336da5e244d95f90e52aaef8 Mon Sep 17 00:00:00 2001
-From: Robert Yang 
-Date: Tue, 18 Apr 2017 01:17:26 -0700
-Subject: [PATCH] Makefile: libacl should depend on include
-
-Fixed race issue:
- In file included from acl_copy_entry.c:22:0:
- libacl.h:19:21: fatal error: sys/acl.h: No such file or directory
-  #include 
-
-[snip]
-
- compilation terminated.
- acl_get_file.c:27:24: fatal error: acl/libacl.h: No such file or directory
-  #include 
- ^
-
-The acl.h is in "include" directory, and include/Makefile creates
-symlink "sys" and "acl" poinst to current dirctory:
-$ ls include/ -l
-acl -> .
-sys -> .
-
-So if "libacl" target runs before "include", the error would happen
-since no "acl" or "sys" directory.
-
-Let libacl depend on include can fix the problem.
-
-Upstream-Status: Pending
-
-Signed-off-by: Robert Yang 

- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index dce32d3..8a79379 100644
 a/Makefile
-+++ b/Makefile
-@@ -48,7 +48,7 @@ else
- endif
- 
- # tool/lib dependencies
--libacl: libmisc
-+libacl: include libmisc
- getfacl setfacl chacl: libacl
- 
- ifeq ($(HAVE_BUILDDEFS), yes)
--- 
-2.10.2
-
diff --git 

Re: [OE-core] Submission of 'emit-buildvars' class?

2018-08-20 Thread Enrico Scholz via Openembedded-core
Alexander Kanavin  writes:

>> I do not know, how this can be done with plain OE.  As said, SDKs are too
>> heavy weighted, 'devshell' too slow and can not be scripted, 'externalsrc'
>> is broken, slow and can not be scripted.
>
> For better or worse, Yocto Project has standardized on devtool (not
> devshell!)

'devtool' is for writing recipes, not for writing software.


> and externalsrc for these kind of local development workflows. You are
> very welcome to improve and add to them, so they are not broken

I tried 'externalsrc' after the per-package sysroot changes but just run
into bugs (class tried to write into read-only mounted source dir, every
2nd 'do_fetch' failed because sysroot was already populated).


Doing a 'make -f ../Makefile.common install' which writes data directly
into the NFS root is much faster than doing all the steps of the dev*
tools.


> or slow,

They *are* slow.

| $ cd workspace/kernel
| 
| $ git commit -m 'empty' --allow-empty
| 
| $ time bitbake linux-mainline
| real4m7.417s
| user0m0.763s
| sys 0m0.110s

vs.

| time make -f ../Makefile.kernel  -j12
| real0m13.204s
| user0m54.888s
| sys 0m17.970s



Even a plain 'bitbake'  is takes 0.5 sec:

| $ time bitbake
| Nothing to do.  Use 'bitbake world' to build everything, or run 'bitbake 
--help' for usage information.
| 
| real0m0.588s
| user0m0.255s
| sys 0m0.023s

vs.

| $ time make
| real0m0.007s
| user0m0.002s
| sys 0m0.005s



And some things are impossible because they are not supported by the
design.  E.g. how would would you implement the flymake 'check-syntax'
target[1]

| check-syntax:
| gcc -o /dev/null -S ${CHK_SOURCES} || true

with devtool/devshell/externalsrc?


Deciding which task to execute (compile, do_compile_kernelmodules) and
installation into NFS root is not supported by dev* either.



Enrico


Footnotes: 
[1]  
https://www.gnu.org/software/emacs/manual/html_mono/flymake.html#Example_002d_002d_002dConfiguring-a-tool-called-via-make

-- 
SIGMA Chemnitz GmbH   Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13   Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] Submission of 'emit-buildvars' class?

2018-08-20 Thread Enrico Scholz via Openembedded-core
Alexander Kanavin  writes:

>> we are using for some time an 'emit-buildvars' class which exports
>> bitbake variables into makefile fragments.  This class is used for for
>> developing of kernel, u-boot and other low level software and for
>> generic packaging.
>
> I don't quite understand how this is useful? Can you provide specific
> usage scenarios please?

I ma doing perhaps 70% of my development for kernel, u-boot and barebox.
Building them with the actual toolchain requires only a

| make -f ../Makefile.kernel tftp

Result is available after a few seconds on the TFTP server; when using a
specialized variant ('kbuild-file=...'), even faster so that it can be
used in Emacs flymake mode.


Ditto for other programs (testsuites or so); you write your recipe with
all the 'DEPENDS', execute the 'emit_buildvars' task and build your
application with

| make -f ../Makefile.common R=my-app

When you see that something is missing in DEPENDS, add it, reexecute
'emit_buildvars' and it will be in the per-package sysroot.  Excluding
the build time of the dependency, this won't take more than 30 seconds.


Or, it is trivial to run unfsd in the enviornment of the image recipe
and to build kernel modules with

| make -f ../Makefile.kernel modules modules-install

These modules will be installed there and can be used immediately on the
target system:

| # rmmod foo-module
| # modprobe foo-module


I do not know, how this can be done with plain OE.  As said, SDKs are too
heavy weighted, 'devshell' too slow and can not be scripted, 'externalsrc'
is broken, slow and can not be scripted.


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


[OE-core] Submission of 'emit-buildvars' class?

2018-08-20 Thread Enrico Scholz via Openembedded-core
Hello,

we are using for some time an 'emit-buildvars' class which exports
bitbake variables into makefile fragments.  This class is used for for
developing of kernel, u-boot and other low level software and for
generic packaging.

The class supports exporting images over userspace NFS and is available
at

  
https://github.com/sigma-embedded/meta-de.sigma-chemnitz/blob/sumo/classes/elito-emit-buildvars.bbclass
  
https://github.com/sigma-embedded/meta-de.sigma-chemnitz/tree/sumo/scripts/buildvars
  
https://github.com/sigma-embedded/meta-de.sigma-chemnitz/blob/sumo/classes/elito-nfs-export.bbclass

It is much faster than 'devshell' and can be used in a scripted
environment.  A complete SDK is far too heavy weight for our tasks
and not flexible enough.

Is there common interest in such a functionality? If so, I would split
it out from our layer and submit it for core.



A more detailed description:

The generated makefile fragment contains information about the per-package
sysroot and can be used to set e.g. $PATH.  The system requires a small
Makefile to instantiate these variables; e.g. for common cases something
like

  workspace/Makefile.common ---
|  # --*- makefile -*--
| WORKSPACE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST
| DEPLOY_DIR ?= ${WORKSPACE_DIR}/../build/tmp/deploy
| MACHINE ?= imx8m-var-dart
| 
| _BUILDVAR_STYLE ?= _generic_
| include ${DEPLOY_DIR}/buildvars/${MACHINE}/$R.mk
| 
| %:
|   ${MAKE} $@

is enough.  For kernel development, the makefile contains some more
information about the image which is going to be exported over NFS.

  workspace/Makefile.kernel ---
| # --*- makefile -*--
| WORKSPACE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST
| DEPLOY_DIR ?= ${WORKSPACE_DIR}/../build/tmp/deploy
| MACHINE ?= imx8m-var-dart
| 
| _BUILDVAR_STYLE := kernel
| IMAGE_RECIPE = camtest-image
| 
| HAVE_NFSROOT=1
| include ${WORKSPACE_DIR}/../sources/de.sigma-chemnitz.core/mk/nfs-opt.mk
| include ${DEPLOY_DIR}/buildvars/${MACHINE}/linux-mainline.mk


Now, generate the '.mk' fragments either manually:

| $ bitbake busybox -c emit_buildvars

or enable it within the recipe (recommended when working on it)

| BUILDVARS_EMIT = "true"

and build the package.


When you try to fix something in 'busybox', extract the sources
somewhere (e.g. in workspace/) and call

| make -f ../Makefile.common R=busybox all

to build it.


Else, see the class for more details.



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