Re: [ptxdist] [PATCH v3] Detect changes in package patch series

2018-08-27 Thread Michael Olbrich
On Mon, Aug 27, 2018 at 05:59:25PM +0200, Michael Olbrich wrote:
> On Fri, Aug 03, 2018 at 04:41:56AM -0400, j...@ringle.org wrote:
> > From: Jon Ringle 
> > 
> > For a long time it has bothered me that if a package's patches were changed
> > ptxdist would not detect this change and I would often have old versions of
> > *-dev.tar.gz packages that got used because the packages patches were
> > updated.
> > 
> > This commit solves this problem.
> > 
> > Here's how it works:
> > 1) In the package rule makefile add `${PKG}_SERIES_SHA256 :=`
> > 2) extract the package and from the packages src dir do `git ptx-patches`
> >This will populate the rule makefile _SERIES_SHA256 value
> > 3) Anytime you make a patch change to a package and do `git ptx-patches`
> >the series file gets updated with the `git rev-parse HEAD` value which
> >causes the series file to have a new sha256 value and therefore a new
> >value gets populated in the rule makefile, which then causes the package
> >to be rebuilt and the *-dev.tar.gz package will have a different cfghash
> >in the filename
> 
> This is rather limited. I've been thinking about a more general solution:
> 
> I'd like to hash all patches + series during extract and create a stamp
> file (like the one for the rules and options) during 'extract'. And save
> some data to recreate the hash:
> - list of all possible patch dirs (in case of new patches in the BSP)
> - relative paths to patches and series.
> 
> I think we can recreate the hashes for all enabled packages with this with
> reasonable startup overhead.
> 
> Then depend on the new stamp with the extract stage. This will need some
> extra checks, so we don't loose local changes:
> - make it optional
> - abort before deleting the source tree if there is a .git
> Stuff like this.
> 
> And of course add the hash to the config/rules hash for *-dev.tar.gz.

... and this last step won't work, because we cannot calculate the correct
hash without running 'extract' first :-/. I need to think about this some
more.

Michael

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] PTXdist usescases

2018-08-27 Thread Michael Olbrich
On Mon, Aug 13, 2018 at 02:40:14PM +0200, Robert Schwebel wrote:
> On Mon, Aug 13, 2018 at 02:16:20PM +0200, Erwin Rol wrote:
> > > Michael Olbrich prototyped a layering system for ptxdist¹ just before
> > > leaving for vacation; 
> > 
> > So who allowed him to go on vacation ? ;-P 
> 
> I don't know :-)

:-)

> > > we are currently testing the prototype and mol
> > > will post it here on the mailing list afterwards.
> > > 
> > > My impression is that it will be able to solve your usecases.
> > 
> > OK sounds interesting, I'll keep an eye out for the mail.

The dev packages[1] might be interresting for you too. They should be
relocatable.

Michael

[1] 
https://www.ptxdist.org/doc/daily_work_section.html?highlight=dev#using-pre-built-archives

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v4 1/2] Add libfaketime as a core component of ptxdist for patchin support

2018-08-27 Thread Michael Olbrich
On Fri, Aug 03, 2018 at 11:44:55AM -0400, j...@ringle.org wrote:
> From: Jon Ringle 
> 
> libfaketime will be used during patchin so that committer timestamps always
> have a fixed value and therefore making the ${PKG}_SERIES_SHA256 value
> repeatable
> 
> The minimal set of source files was picked out of libfaketime-0.9.7

I think it should be possible to provide the correct timestamps with
GIT_AUTHOR_DATE and/or GIT_COMMITTER_DATE or something like that.

Michael

> 
> Signed-off-by: Jon Ringle 
> ---
>  Makefile.in   |   14 +-
>  scripts/libfaketime/Makefile  |  118 ++
>  scripts/libfaketime/faketime.c|  385 ++
>  scripts/libfaketime/faketime_common.h |   61 +
>  scripts/libfaketime/libfaketime.c | 2410 
> +
>  scripts/libfaketime/libfaketime.map   |   10 +
>  scripts/libfaketime/time_ops.h|  104 ++
>  7 files changed, 3101 insertions(+), 1 deletion(-)
>  create mode 100644 scripts/libfaketime/Makefile
>  create mode 100644 scripts/libfaketime/faketime.c
>  create mode 100644 scripts/libfaketime/faketime_common.h
>  create mode 100644 scripts/libfaketime/libfaketime.c
>  create mode 100644 scripts/libfaketime/libfaketime.map
>  create mode 100644 scripts/libfaketime/time_ops.h
> 
> diff --git a/Makefile.in b/Makefile.in
> index 40c676c..6e08377 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -22,7 +22,7 @@ export SHELL
>  
>  @BUILD_NCONF_TRUE@NCONF = nconf
>  
> -all: kconfig environment
> +all: kconfig libfaketime environment
>   @touch .done
>  
>  kconfig:
> @@ -41,6 +41,17 @@ kconfig:
>   conf mconf $(NCONF)
>   @echo "done."
>  
> +libfaketime:
> + @echo "building libfaketime ..."
> + @CC="$(CC)" \
> + CXX="$(CXX)" \
> + CFLAGS="$(CFLAGS)" \
> + CXXFLAGS="$(CXXFLAGS)" \
> + CPPFLAGS="$(CPPFLAGS)" \
> + LDFLAGS="$(LDFLAGS)" \
> + $(MAKE) -C "$(abs_srcdir)/scripts/libfaketime" all
> + @echo "done."
> +
>  environment:
>   @echo -n "preparing PTXdist environment ..."
>   @ln -sf @AWK@ "$(abs_srcdir)/bin/awk"
> @@ -89,6 +100,7 @@ clean:
>   @rm -f .done
>   @find "$(abs_srcdir)/bin" -type l -print0 | xargs -0 rm -f
>   @$(MAKE) -C "$(abs_srcdir)/scripts/kconfig" clean
> + @$(MAKE) -C "$(abs_srcdir)/scripts/libfaketime" clean
>  
>  dirty-check:
>   @case "$(version)" in \
> diff --git a/scripts/libfaketime/Makefile b/scripts/libfaketime/Makefile
> new file mode 100644
> index 000..a557c38
> --- /dev/null
> +++ b/scripts/libfaketime/Makefile
> @@ -0,0 +1,118 @@
> +#
> +# Notes:
> +#
> +#   * Compilation Defines:
> +#
> +# FAKE_STAT
> +# - Enables time faking also for files' timestamps.
> +#
> +# NO_ATFILE
> +# - Disables support for the fstatat() group of functions
> +#
> +# PTHREAD
> +# - Define this to enable multithreading support.
> +#
> +# PTHREAD_SINGLETHREADED_TIME
> +# - Define this if you want to single-thread time() ... there ARE
> +#   possibile caching side-effects in a multithreaded environment
> +#   without this, but the performance impact may require you to
> +#   try it unsynchronized.
> +#
> +# FAKE_INTERNAL_CALLS
> +# - Also intercept libc internal __functions, e.g. not just time(),
> +#   but also __time(). Enhances compatibility with applications
> +#   that make use of low-level system calls, such as Java Virtual
> +#   Machines.
> +#
> +#  FAKE_SLEEP
> +#  - Also intercept sleep(), nanosleep(), usleep(), alarm(), 
> [p]poll()
> +#
> +#  FAKE_TIMERS
> +#  - Also intercept timer_settime() and timer_gettime()
> +#
> +#  MULTI_ARCH
> +#  - If MULTI_ARCH is set, the faketime wrapper program will put 
> a literal
> +#$LIB into the LD_PRELOAD environment variable it creates, 
> which makes
> +#ld automatically choose the correct library version to use 
> for the
> +#target binary. Use for Linux platforms with Multi-Arch 
> support only!
> +#
> +#   * Compilation addition: second libMT target added for building the 
> pthread-
> +# enabled library as a separate library
> +#
> +#   * Compilation switch change: previous versions compiled using 
> '-nostartfiles'
> +# This is no longer the case since there is a 'startup' constructor for 
> the library
> +# which is used to activate the start-at times when specified. This also 
> initializes
> +# the dynamic disabling of the FAKE_STAT calls.
> +#
> +# By default, libfaketime will be compiled for your system's default 
> architecture.
> +# To build 32-bit libraries and binaries, add -m32 to CFLAGS and LDFLAGS.
> +#
> +# Change PREFIX to where you want libfaketime (libraries and wrapper binary) 
> installed.
> +# LIBDIRNAME is relative to PREFIX. The default is to install into 
> $PREFIX/lib/faketime,
> +# but you can set LIBDIRNAME to, e.g., /lib64 if you 

Re: [ptxdist] [PATCH v4 3/3] Allow local rules/*.in to source $(PTXDIST_TOPDIR)/rules/*.in

2018-08-27 Thread Michael Olbrich
On Fri, Aug 03, 2018 at 02:44:03PM -0400, j...@ringle.org wrote:
> From: Jon Ringle 
> 
> In scripts/kconfig/zconf.l the function zconf_fopen() is used to open files
> being opened via the `source` kconfig keyword. If it fails to open the
> given file, it will try to open the file under $(PTXDIST_TOPDIR)
> 
> This allows a local rules/*.in to extend options to a that are project
> specific without having to maintain the entire rules/*.in file locally

I think just creating a extra file 'socat-extras.in' with the additional
options should work too.

Michael

> For example:
> ~/git/rootfs$ cat rules/socat.in
> ## SECTION=networking
> 
> source "rules/socat.in"
> 
> if SOCAT
> 
> config SOCAT_SYSTEMD_SOCKET
> bool
> prompt "systemd socket activation"
> select SYSTEMD
> help
>   Include systemd socket activation support.
> 
> endif
> 
> Signed-off-by: Jon Ringle 
> ---
>  scripts/kconfig/lkc.h   | 2 +-
>  scripts/kconfig/zconf.l | 4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
> index 91ca126..f370af1 100644
> --- a/scripts/kconfig/lkc.h
> +++ b/scripts/kconfig/lkc.h
> @@ -23,7 +23,7 @@ extern "C" {
>  
>  #include "lkc_proto.h"
>  
> -#define SRCTREE "srctree"
> +#define SRCTREE "PTXDIST_TOPDIR"
>  
>  #ifndef PACKAGE
>  #define PACKAGE "linux"
> diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
> index c410d25..959c86c 100644
> --- a/scripts/kconfig/zconf.l
> +++ b/scripts/kconfig/zconf.l
> @@ -269,9 +269,7 @@ static void zconf_endhelp(void)
>  /*
>   * Try to open specified file with following names:
>   * ./name
> - * $(srctree)/name
> - * The latter is used when srctree is separate from objtree
> - * when compiling the kernel.
> + * $(PTXDIST_TOPDIR)/name
>   * Return NULL if file is not found.
>   */
>  FILE *zconf_fopen(const char *name)
> -- 
> 1.9.1
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v3] Detect changes in package patch series

2018-08-27 Thread Michael Olbrich
On Fri, Aug 03, 2018 at 04:41:56AM -0400, j...@ringle.org wrote:
> From: Jon Ringle 
> 
> For a long time it has bothered me that if a package's patches were changed
> ptxdist would not detect this change and I would often have old versions of
> *-dev.tar.gz packages that got used because the packages patches were
> updated.
> 
> This commit solves this problem.
> 
> Here's how it works:
> 1) In the package rule makefile add `${PKG}_SERIES_SHA256 :=`
> 2) extract the package and from the packages src dir do `git ptx-patches`
>This will populate the rule makefile _SERIES_SHA256 value
> 3) Anytime you make a patch change to a package and do `git ptx-patches`
>the series file gets updated with the `git rev-parse HEAD` value which
>causes the series file to have a new sha256 value and therefore a new
>value gets populated in the rule makefile, which then causes the package
>to be rebuilt and the *-dev.tar.gz package will have a different cfghash
>in the filename

This is rather limited. I've been thinking about a more general solution:

I'd like to hash all patches + series during extract and create a stamp
file (like the one for the rules and options) during 'extract'. And save
some data to recreate the hash:
- list of all possible patch dirs (in case of new patches in the BSP)
- relative paths to patches and series.

I think we can recreate the hashes for all enabled packages with this with
reasonable startup overhead.

Then depend on the new stamp with the extract stage. This will need some
extra checks, so we don't loose local changes:
- make it optional
- abort before deleting the source tree if there is a .git
Stuff like this.

And of course add the hash to the config/rules hash for *-dev.tar.gz.

Unfortunately, I don't know when I'll find some time to implement this.

Michael

> Signed-off-by: Jon Ringle 
> ---
> 
> I only updated the commit comment in v3
> 
>  scripts/git-ptx-patches| 38 
> +++---
>  scripts/lib/ptxd_make_world_patchin.sh | 22 
>  2 files changed, 52 insertions(+), 8 deletions(-)
> 
> diff --git a/scripts/git-ptx-patches b/scripts/git-ptx-patches
> index f2568f9..d37c936 100755
> --- a/scripts/git-ptx-patches
> +++ b/scripts/git-ptx-patches
> @@ -2,9 +2,31 @@
>  
>  PTX_PATCHES_HEADER="# generated by git-ptx-patches"
>  
> -function _md5sum() {
> - local sum=$(md5sum)
> - echo "# $sum git-ptx-patches magic"
> +function _gitsha1sum() {
> + local sha1=$(git rev-parse HEAD)
> + echo "# $sha1 git-ptx-patches magic"
> +}
> +
> +update_series_sha256() {
> + local makefile="$(readlink -f .ptxdist/rule.make)"
> + source .ptxdist/rule.env
> + set -- $(sha256sum .ptxdist/series)
> + local sha256="${1}"
> +
> + local count=$(grep "^${PKG}_SERIES_SHA256[   ]*:=" "${makefile}" 2> 
> /dev/null | wc -l)
> + if [ "${count}" -gt 1 ]; then
> + echo "Error: Could not update patch series sha256sum for 
> '${pkg_label}': ${PKG}_SERIES_SHA256 found ${count} times in '${makefile}'."
> + exit 1
> + fi
> + local current_sha256=$(grep "^${PKG}_SERIES_SHA256[  ]*:= " 
> "${makefile}" |cut -f2 -d=|xargs)
> + if [ "${current_sha256}" != "${sha256}" ]; then
> + sed -i "s/^\(\<${PKG}_SERIES_SHA256[]*:=\) *[a-f0-9]*\$/\1 
> ${sha256}/" "${makefile}"
> + if ! grep -q "${sha256}\$" "${makefile}"; then
> + echo "Warning: ${PKG}_SERIES_SHA256 is missing from 
> '${makefile}'."
> + else
> + echo "New patch series checksum for '${pkg_label}': 
> ${sha256} in '${makefile}'."
> + fi
> + fi
>  }
>  
>  if [ ! -L .ptxdist/patches ]; then
> @@ -22,10 +44,8 @@ tag=base
>  
>  if grep -q "$PTX_PATCHES_HEADER" .ptxdist/series; then
>   echo "Found series file generated by git-ptx-patches."
> - lines=$(wc -l < .ptxdist/series)
> - lines=$[lines-1]
> - magic=$(head -n$lines .ptxdist/series | _md5sum)
> - if grep -q "^$magic" .ptxdist/series; then
> + magic=$(git rev-parse HEAD)
> + if grep -q "^# $magic" .ptxdist/series; then
>   remove_old=yes
>   else
>   echo "Warning: .ptxdist/series was modified."
> @@ -132,7 +152,9 @@ cat .ptxdist/series.0 > .ptxdist/series
>  git format-patch -M -N $GIT_EXTRA_ARGS ${tagopt} -o .ptxdist/patches/ 
> ${range} | sed -e 's,^.ptxdist/patches/,,' > .ptxdist/series.auto
>  cat .ptxdist/series.auto >> .ptxdist/series
>  cat .ptxdist/series.1 >> .ptxdist/series
> -cat .ptxdist/series | _md5sum >> .ptxdist/series
> +cat .ptxdist/series | _gitsha1sum >> .ptxdist/series
> +
> +update_series_sha256
>  
>  # The first line of the patch is 'From  ...'
>  # remove it to avoid unnecessary changes in the patch files.
> diff --git a/scripts/lib/ptxd_make_world_patchin.sh 
> b/scripts/lib/ptxd_make_world_patchin.sh
> index e57da64..25decf0 100644
> --- a/scripts/lib/ptxd_make_world_patchin.sh
> 

[ptxdist] [PATCH 3/3] weston: version bump 4.0.0 -> 5.0.0

2018-08-27 Thread Philipp Zabel
Signed-off-by: Philipp Zabel 
---
 rules/weston.make | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules/weston.make b/rules/weston.make
index dd942b0bb800..f5d7488974d8 100644
--- a/rules/weston.make
+++ b/rules/weston.make
@@ -17,9 +17,9 @@ PACKAGES-$(PTXCONF_WESTON) += weston
 #
 # Paths and names
 #
-WESTON_VERSION := 4.0.0
-LIBWESTON_MAJOR := 4
-WESTON_MD5 := 33709aa4d5916f89643fca0fc0064b39
+WESTON_VERSION := 5.0.0
+LIBWESTON_MAJOR := 5
+WESTON_MD5 := 752a04ce3c65af4884cfac4e57231bdb
 WESTON := weston-$(WESTON_VERSION)
 WESTON_SUFFIX  := tar.xz
 WESTON_URL := 
http://wayland.freedesktop.org/releases/$(WESTON).$(WESTON_SUFFIX)
-- 
2.18.0


___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH 2/3] wayland-protocols: version bump 1.13 -> 1.16

2018-08-27 Thread Philipp Zabel
Signed-off-by: Philipp Zabel 
---
 rules/wayland-protocols.make | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules/wayland-protocols.make b/rules/wayland-protocols.make
index ec069fe7ebf7..c5442d521958 100644
--- a/rules/wayland-protocols.make
+++ b/rules/wayland-protocols.make
@@ -16,8 +16,8 @@ PACKAGES-$(PTXCONF_WAYLAND_PROTOCOLS) += wayland-protocols
 #
 # Paths and names
 #
-WAYLAND_PROTOCOLS_VERSION  := 1.13
-WAYLAND_PROTOCOLS_MD5  := 29312149dafcd4a0e739ba94995a574d
+WAYLAND_PROTOCOLS_VERSION  := 1.16
+WAYLAND_PROTOCOLS_MD5  := e0b523ff162e30bab46be1d65d527683
 WAYLAND_PROTOCOLS  := 
wayland-protocols-$(WAYLAND_PROTOCOLS_VERSION)
 WAYLAND_PROTOCOLS_SUFFIX   := tar.xz
 WAYLAND_PROTOCOLS_URL  := 
https://wayland.freedesktop.org/releases/$(WAYLAND_PROTOCOLS).$(WAYLAND_PROTOCOLS_SUFFIX)
-- 
2.18.0


___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH] rauc: Make rauc bundle version configurable

2018-08-27 Thread Gavin Schenk
In my usecase I need PTXCONF_PROJECT_VERSION in the rauc bundle instead
of PTXDIST_BSP_AUTOVERSION that is hard coded in rules/image-rauc.make.

Introduce a new switch RAUC_BUNDLE_VERSION to menuconfig that defaults
to "${PTXDIST_BSP_AUTOVERSION}".

Signed-off-by: Gavin Schenk 
---
Hi,

Some time ago we discussed to hardcode PTXCONF_PROJECT_VERSION instead of
PTXDIST_BSP_AUTOVERSION in the makefile. There was a reason not to change
this, but I do not remember exactly ( Something with a "-" that is mandatory ).
Now this patch is my new approach. It is full compatible and solves my usecase.

Would you agree to put it into rules/rauc.in, or is 
platforms/image-rauc.in the better place? 

Please suggest!

Regards
Gavin

 rules/image-rauc.make | 2 +-
 rules/rauc.in | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/rules/image-rauc.make b/rules/image-rauc.make
index bf7408db8..0ee31b0ab 100644
--- a/rules/image-rauc.make
+++ b/rules/image-rauc.make
@@ -31,7 +31,7 @@ IMAGE_RAUC_CERT = 
$(PTXDIST_PLATFORMCONFIGDIR)/config/rauc/rauc.cert.pem
 
 IMAGE_RAUC_ENV := \
RAUC_BUNDLE_COMPATIBLE="$(call 
remove_quotes,$(PTXCONF_RAUC_COMPATIBLE))" \
-   RAUC_BUNDLE_VERSION=$(PTXDIST_BSP_AUTOVERSION) \
+   RAUC_BUNDLE_VERSION="$(call remove_quotes, 
$(PTXCONF_RAUC_BUNDLE_VERSION))" \
RAUC_BUNDLE_BUILD=$(shell date +%FT%T%z) \
RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
RAUC_KEY=$(IMAGE_RAUC_KEY) \
diff --git a/rules/rauc.in b/rules/rauc.in
index ec8e76f00..b2fea4bf6 100644
--- a/rules/rauc.in
+++ b/rules/rauc.in
@@ -33,4 +33,11 @@ config RAUC_COMPATIBLE
  Only if the compatible in the targets RAUC system.conf file and those
  in the Bundle's manifest match exactly, an update will be performed
 
+config RAUC_BUNDLE_VERSION
+   prompt "RAUC Bundle Version"
+   string
+   default "${PTXDIST_BSP_AUTOVERSION}"
+   help
+ Overwrite the bundle version if needed.
+
 endif
-- 
2.18.0


-- 
Eckelmann AG
Vorstand: Dipl.-Ing. Peter Frankenbach (Sprecher) Dipl.-Wi.-Ing. Philipp 
Eckelmann
Dr.-Ing. Marco Münchhof Dr.-Ing. Frank Uhlemann
Vorsitzender des Aufsichtsrats: Hubertus G. Krossa
Stv. Vorsitzender des Aufsichtsrats: Dr.-Ing. Gerd Eckelmann
Sitz der Gesellschaft: Berliner Str. 161, 65205 Wiesbaden, Amtsgericht 
Wiesbaden HRB 12636
http://www.eckelmann.de

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] [PATCH v2] libgpiod: add support for python3 bindings

2018-08-27 Thread Boerje Sewing
Signed-off-by: Boerje Sewing 
---

Changes in v2:
- Shorten the Makefile (thanks Denis)
- Fix indentation in Kconfig file (thanks Ladislav)

 rules/libgpiod.in   |  8 
 rules/libgpiod.make | 14 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/rules/libgpiod.in b/rules/libgpiod.in
index d3d0c6002..c62d24f12 100644
--- a/rules/libgpiod.in
+++ b/rules/libgpiod.in
@@ -55,4 +55,12 @@ config LIBGPIOD_GPIOMON
help
  Waits for events on a GPIO line
 
+config LIBGPIOD_PYTHON3
+   bool
+   prompt "Install python3 bindings"
+   select PYTHON3
+   select HOST_SYSTEM_PYTHON3
+   help
+ Provides bindings for Python 3
+
 endif
diff --git a/rules/libgpiod.make b/rules/libgpiod.make
index ed677c2d5..e35e20c8f 100644
--- a/rules/libgpiod.make
+++ b/rules/libgpiod.make
@@ -36,7 +36,11 @@ LIBGPIOD_CONF_OPT:= \
--$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
--disable-tests \
--disable-bindings-cxx \
-   --disable-bindings-python
+   --$(call ptx/endis, PTXCONF_LIBGPIOD_PYTHON3)-bindings-python
+
+LIBGPIOD_CONF_ENV := \
+   $(CROSS_ENV) \
+   $(if $(PTXCONF_PYTHON3), ac_cv_path_PYTHON=$(CROSS_PYTHON3))
 
 # libgpiod requires kernel headers >= 4.8
 ifdef PTXCONF_KERNEL_HEADER
@@ -71,6 +75,14 @@ $(STATEDIR)/libgpiod.targetinstall:
/usr/bin/$$tool); \
done
 
+ifdef PTXCONF_LIBGPIOD_PYTHON3
+   @$(call install_copy, libgpiod, 0, 0, 0755, $(PYTHON3_SITEPACKAGES))
+   @for file in $(shell cd $(LIBGPIOD_PKGDIR) && find . -name "gpiod.*"); \
+   do \
+   $(call install_copy, libgpiod, 0, 0, 0644, -, /$$file); \
+   done
+endif
+
@$(call install_finish, libgpiod)
 
@$(call touch)
-- 
2.18.0


___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH v2 2/3] lxc: add new package

2018-08-27 Thread Michael Grzeschik
On Wed, Aug 22, 2018 at 10:27:50AM +0200, Michael Grzeschik wrote:
> This patch adds support for the lxc container system. We install the
> userspace lib and application. We also add some small configuration to
> be able to create a busybox based lxc container.
> 
> $ lxc-create -t busybox -n busybox01
> $ lxc-start busybox01
> $ cp /etc/shadow /var/lib/lxc/busybox01/rootfs/etc/shadow
> $ lxc-console -n busybox01
> 
> Inside the container we can prepare the network:

I found a conflict when enabling mount/umount in busybox
when having a target using systemd, as systemd depends
on the util-linux-ng mount/umount.

The whole lxc container creation using templates is not ment for
embedded systems. We better find a way to create these in the
host. So I will drop the template feautre in v3.

mgr

> 
> $ ip addr add 192.168.0.23/24 dev eth0
> $ ip link set eth0 up
> 
> This way the container has network support in an veth setup.
> 
> To make sure all necessary kernel options are enabled use:
> $ CONFIG=$(BSP)/config/platform-$(platform)/kernelconfig lxc-checkconfig
> 
> Signed-off-by: Michael Grzeschik 
> ---
> v1 -> v2: - prefixed used variables with PTXCONF_ :
> LXC_TEMPLATES, LXC_HOOKS, LXC_SELINUX
>   - fixed used variable LXC_SYSTEMD_UNIT
>   - added missing dir /usr/lib/lxc/rootfs
>   - added dependency to busybox tools when using templates
>   - added dependency to iptables when starting systemd.service
>   - removed some extra commented unused options
>   - removed hooks
>   - only installing busybox template
>   - added dependency to busybox_umount
> 
>  ...te-new-lxcbr0-subnet-at-startup-time.patch | 138 
>  patches/lxc-3.0.1/series  |   1 +
>  projectroot/etc/default/lxc-net   |   7 +
>  projectroot/etc/lxc/default.conf  |   4 +
>  rules/dnsmasq.in  |   1 +
>  rules/lxc.in  |  76 +++
>  rules/lxc.make| 211 ++
>  7 files changed, 438 insertions(+)
>  create mode 100644 
> patches/lxc-3.0.1/0001-Allocate-new-lxcbr0-subnet-at-startup-time.patch
>  create mode 100644 patches/lxc-3.0.1/series
>  create mode 100644 projectroot/etc/default/lxc-net
>  create mode 100644 projectroot/etc/lxc/default.conf
>  create mode 100644 rules/lxc.in
>  create mode 100644 rules/lxc.make
> 
> diff --git 
> a/patches/lxc-3.0.1/0001-Allocate-new-lxcbr0-subnet-at-startup-time.patch 
> b/patches/lxc-3.0.1/0001-Allocate-new-lxcbr0-subnet-at-startup-time.patch
> new file mode 100644
> index 0..411ed049a
> --- /dev/null
> +++ b/patches/lxc-3.0.1/0001-Allocate-new-lxcbr0-subnet-at-startup-time.patch
> @@ -0,0 +1,138 @@
> +From 4ac6a6c863c5b27fbe37d24ee52ec0ee75a07286 Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?St=C3=A9phane=20Graber?= 
> +Date: Tue, 3 Nov 2015 11:42:58 -0500
> +Subject: [PATCH] Allocate new lxcbr0 subnet at startup time
> +
> +---
> + config/init/common/lxc-net.in | 100 +++---
> + 1 file changed, 91 insertions(+), 9 deletions(-)
> +
> +diff --git a/config/init/common/lxc-net.in b/config/init/common/lxc-net.in
> +index df9f1181..6837be19 100644
> +--- a/config/init/common/lxc-net.in
>  b/config/init/common/lxc-net.in
> +@@ -24,6 +24,85 @@ LXC_IPV6_MASK=""
> + LXC_IPV6_NETWORK=""
> + LXC_IPV6_NAT="false"
> + 
> ++write_lxc_net()
> ++{
> ++local i=$1
> ++cat >>  $distrosysconfdir/lxc-net << EOF
> ++# Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
> ++# containers.  Set to "false" if you'll use virbr0 or another existing
> ++# bridge, or mavlan to your host's NIC.
> ++USE_LXC_BRIDGE="true"
> ++
> ++# If you change the LXC_BRIDGE to something other than lxcbr0, then
> ++# you will also need to update your /etc/lxc/default.conf as well as the
> ++# configuration (/var/lib/lxc//config) for any containers
> ++# already created using the default config to reflect the new bridge
> ++# name.
> ++# If you have the dnsmasq daemon installed, you'll also have to update
> ++# /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon.
> ++LXC_BRIDGE="lxcbr0"
> ++LXC_ADDR="10.0.$i.1"
> ++LXC_NETMASK="255.255.255.0"
> ++LXC_NETWORK="10.0.$i.0/24"
> ++LXC_DHCP_RANGE="10.0.$i.2,10.0.$i.254"
> ++LXC_DHCP_MAX="253"
> ++# Uncomment the next line if you'd like to use a conf-file for the lxcbr0
> ++# dnsmasq.  For instance, you can use 'dhcp-host=mail1,10.0.3.100' to have
> ++# container 'mail1' always get ip address 10.0.3.100.
> ++#LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf
> ++
> ++# Uncomment the next line if you want lxcbr0's dnsmasq to resolve the .lxc
> ++# domain.  You can then add "server=/lxc/10.0.$i.1' (or your actual 
> \$LXC_ADDR)
> ++# to your system dnsmasq configuration file (normally /etc/dnsmasq.conf,
> ++# or /etc/NetworkManager/dnsmasq.d/lxc.conf on systems that use 
> NetworkManager).
> ++# Once these changes are 

Re: [ptxdist] [PATCH] libgpiod: add support for python3 bindings.

2018-08-27 Thread Börje Sewing


On 08/24/2018 04:20 PM, Denis OSTERLAND wrote:
> Am Freitag, den 24.08.2018, 15:58 +0200 schrieb Boerje Sewing:
>> Signed-off-by: Boerje Sewing 
>> ---
>>  rules/libgpiod.in   |  8 
>>  rules/libgpiod.make | 20 ++--
>>  2 files changed, 26 insertions(+), 2 deletions(-)
>>
>> diff --git a/rules/libgpiod.in b/rules/libgpiod.in
>> index d3d0c6002..ad52d6f10 100644
>> --- a/rules/libgpiod.in
>> +++ b/rules/libgpiod.in
>> @@ -55,4 +55,12 @@ config LIBGPIOD_GPIOMON
>>  help
>>    Waits for events on a GPIO line
>>  
>> +config LIBGPIOD_PYTHON3
>> +bool
>> +prompt "Install python3 bindings"
>> +select PYTHON3
>> +select HOST_SYSTEM_PYTHON3
>> +help
>> +  Provides bindings for Python 3
>> +
>>  endif
>> diff --git a/rules/libgpiod.make b/rules/libgpiod.make
>> index ed677c2d5..888597ce3 100644
>> --- a/rules/libgpiod.make
>> +++ b/rules/libgpiod.make
>> @@ -35,8 +35,16 @@ LIBGPIOD_CONF_OPT := \
>>  $(CROSS_AUTOCONF_USR) \
>>  --$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
>>  --disable-tests \
>> ---disable-bindings-cxx \
>> ---disable-bindings-python
>> +--disable-bindings-cxx
>> +
>> +ifdef PTXCONF_LIBGPIOD_PYTHON3
>> +LIBGPIOD_CONF_OPT   += --enable-bindings-python
>> +LIBGPIOD_CONF_ENV := \
>> +$(CROSS_ENV) \
>> +ac_cv_path_PYTHON=$(CROSS_PYTHON3)
>> +else
>> +LIBGPIOD_CONF_OPT   += --disable-bindings-python
>> +endif
> I would suggest:
>   --$(call ptx/endis, PTXCONF_LIBGPIOD_PYTHON3)-bindings-python
> and
> LIBGPIOD_CONF_ENV := \
>   $(CROSS_ENV) \
>   $(if $(PTXCONF_PYTHON3), ac_cv_path_PYTHON=$(CROSS_PYTHON3))

Tanks for your review :) Works and will be in patch v2. 

>>  
>>  # libgpiod requires kernel headers >= 4.8
>>  ifdef PTXCONF_KERNEL_HEADER
>> @@ -71,6 +79,14 @@ $(STATEDIR)/libgpiod.targetinstall:
>>  /usr/bin/$$tool); \
>>  done
>>  
>> +ifdef PTXCONF_LIBGPIOD_PYTHON3
>> +@$(call install_copy, libgpiod, 0, 0, 0755, $(PYTHON3_SITEPACKAGES))
>> +@for file in $(shell cd $(LIBGPIOD_PKGDIR) && find . -name "gpiod.*"); \
>> +do \
>> +$(call install_copy, libgpiod, 0, 0, 0644, -, /$$file); \
>> +done
>> +endif
>> +
>>  @$(call install_finish, libgpiod)
>>  
>>  @$(call touch)
> Regards Denis
> 
> Diehl Connectivity Solutions GmbH
> Geschäftsführung: Horst Leonberger
> Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
> Nürnberg: HRB 32315
> ___
> 
> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
> enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
> haben. Bitte loeschen Sie in diesem Fall die Nachricht.
> Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung 
> und/oder Publikation dieser E-Mail ist strengstens untersagt.
> The contents of the above mentioned e-mail is not legally binding. This 
> e-mail contains confidential and/or legally protected information. Please 
> inform us if you have received this e-mail by
> mistake and delete it in such a case. Each unauthorized reproduction, 
> disclosure, alteration, distribution and/or publication of this e-mail is 
> strictly prohibited. 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH] libgpiod: add support for python3 bindings.

2018-08-27 Thread Börje Sewing
On 08/25/2018 01:33 PM, Ladislav Michl wrote:
> +1 for suggestion bellow and...
> 
> On Fri, Aug 24, 2018 at 02:20:36PM +, Denis OSTERLAND wrote:
>> Am Freitag, den 24.08.2018, 15:58 +0200 schrieb Boerje Sewing:
>>> Signed-off-by: Boerje Sewing 
>>> ---
>>>  rules/libgpiod.in   |  8 
>>>  rules/libgpiod.make | 20 ++--
>>>  2 files changed, 26 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/rules/libgpiod.in b/rules/libgpiod.in
>>> index d3d0c6002..ad52d6f10 100644
>>> --- a/rules/libgpiod.in
>>> +++ b/rules/libgpiod.in
>>> @@ -55,4 +55,12 @@ config LIBGPIOD_GPIOMON
>>>     help
>>>       Waits for events on a GPIO line
>>>  
>>> +config LIBGPIOD_PYTHON3
>>> +bool
> 
> ... please also fix above indentation. Thank you.
> 

Thanks for your review :) Consider it as done (patch v2 will be mailed today).

>>> +   prompt "Install python3 bindings"
>>> +   select PYTHON3
>>> +   select HOST_SYSTEM_PYTHON3
>>> +   help
>>> +     Provides bindings for Python 3
>>> +
>>>  endif
>>> diff --git a/rules/libgpiod.make b/rules/libgpiod.make
>>> index ed677c2d5..888597ce3 100644
>>> --- a/rules/libgpiod.make
>>> +++ b/rules/libgpiod.make
>>> @@ -35,8 +35,16 @@ LIBGPIOD_CONF_OPT:= \
>>>     $(CROSS_AUTOCONF_USR) \
>>>     --$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
>>>     --disable-tests \
>>> -   --disable-bindings-cxx \
>>> -   --disable-bindings-python
>>> +   --disable-bindings-cxx
>>> +
>>> +ifdef PTXCONF_LIBGPIOD_PYTHON3
>>> +LIBGPIOD_CONF_OPT  += --enable-bindings-python
>>> +LIBGPIOD_CONF_ENV := \
>>> +   $(CROSS_ENV) \
>>> +   ac_cv_path_PYTHON=$(CROSS_PYTHON3)
>>> +else
>>> +LIBGPIOD_CONF_OPT  += --disable-bindings-python
>>> +endif
>> I would suggest:
>>  --$(call ptx/endis, PTXCONF_LIBGPIOD_PYTHON3)-bindings-python
>> and
>> LIBGPIOD_CONF_ENV := \
>>  $(CROSS_ENV) \
>>  $(if $(PTXCONF_PYTHON3), ac_cv_path_PYTHON=$(CROSS_PYTHON3))
>>>  
>>>  # libgpiod requires kernel headers >= 4.8
>>>  ifdef PTXCONF_KERNEL_HEADER
>>> @@ -71,6 +79,14 @@ $(STATEDIR)/libgpiod.targetinstall:
>>>     /usr/bin/$$tool); \
>>>     done
>>>  
>>> +ifdef PTXCONF_LIBGPIOD_PYTHON3
>>> +   @$(call install_copy, libgpiod, 0, 0, 0755, $(PYTHON3_SITEPACKAGES))
>>> +   @for file in $(shell cd $(LIBGPIOD_PKGDIR) && find . -name "gpiod.*"); \
>>> +   do \
>>> +   $(call install_copy, libgpiod, 0, 0, 0644, -, /$$file); \
>>> +   done
>>> +endif
>>> +
>>>     @$(call install_finish, libgpiod)
>>>  
>>>     @$(call touch)
>> Regards Denis
>>
>> Diehl Connectivity Solutions GmbH
>> Geschäftsführung: Horst Leonberger
>> Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
>> Nürnberg: HRB 32315
>> ___
>>
>> Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
>> enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
>> Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
>> haben. Bitte loeschen Sie in diesem Fall die Nachricht.
>> Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung 
>> und/oder Publikation dieser E-Mail ist strengstens untersagt.
>> The contents of the above mentioned e-mail is not legally binding. This 
>> e-mail contains confidential and/or legally protected information. Please 
>> inform us if you have received this e-mail by
>> mistake and delete it in such a case. Each unauthorized reproduction, 
>> disclosure, alteration, distribution and/or publication of this e-mail is 
>> strictly prohibited. 
>> ___
>> ptxdist mailing list
>> ptxdist@pengutronix.de
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

___
ptxdist mailing list
ptxdist@pengutronix.de