Re: [ptxdist] [RFC] Colons in filenames

2016-02-10 Thread Michael Olbrich
On Wed, Feb 03, 2016 at 11:05:02PM +0100, Ladislav Michl wrote:
> On Fri, Jan 22, 2016 at 09:06:36AM +0100, Michael Olbrich wrote:
> > On Fri, Jan 22, 2016 at 01:31:37AM +0100, Ladislav Michl wrote:
> > > Now I'm going to be honest. Previous patch 'Add usb-modeswitch-data 
> > > package'
> > > break things - 'ptxdist images' fails as ':' is used as delimiter in 
> > > perms file.
> > > Patch bellow escapes semicolon on producer side, anyone cares about 
> > > consumer?
> > 
> > This does not work well with IFS in bash and FS in awk. but I think we can
> > switch different character. Maybe a vertical tab?
> 
> Well, I did not give up 'escaping idea' yet. What about something like this?
> (awk part could be done better)

I think the most readable would be replace the escaping:

'\:' -> 0x1
':'  -> 0x2
0x1  -> ':'

and then use 0x2 as separator.

Well there is also DOPERMISSIONS in rules/post/ptxd_make_image_common.make
which ist mostly but not exactly the same. But I suppose we could merge
that. It will require some testing and careful review. This stuff is rather
tricky.
And then there is scripts/lib/ptxd_make_image_fix_permissions.sh...

Michael

> diff --git a/scripts/lib/ptxd_lib_dopermissions.awk 
> b/scripts/lib/ptxd_lib_dopermissions.awk
> index 336948c..17ee1b6 100755
> --- a/scripts/lib/ptxd_lib_dopermissions.awk
> +++ b/scripts/lib/ptxd_lib_dopermissions.awk
> @@ -5,13 +5,29 @@ BEGIN {
>  }
>  
>  $1 ~ "f" {
> - printf("chmod %s'.%s' &&\n" \
> -"chown %s.%s '.%s' &&\n", \
> -$5, $2, $3, $4, $2);
> + path = $2;
> + for (i = 3; i <= NF; i++) {
> + if (substr(path, length(path), 1) == "\\")
> + path = substr(path, 1, length(path) - 1) ":" $i;
> + else {
> + printf("chmod %s'.%s' &&\n" \
> +"chown %s.%s '.%s' &&\n", \
> +$(i+2), path, $i, $(i+1), path);
> + break;
> + }
> + }
>  }
>  
>  $1 ~ "n" {
> - printf("mknod -m %s '.%s'   %s %s %s &&\n" \
> -"chown %s.%s '.%s' &&\n", \
> -$5, $2, $6, $7, $8, $3, $4, $2);
> + path = $2;
> + for (i = 3; i <= NF; i++) {
> + if (substr(path, length(path), 1) == "\\")
> + path = substr(path, 1, length(path) - 1) ":" $i;
> + else {
> + printf("mknod -m %s '.%s'   %s %s %s &&\n" \
> +"chown %s.%s '.%s' &&\n", \
> +$(i+2), path, $(i+3), $(i+4), $(i+5), $i, 
> $(i+1), path);
> + break;
> + }
> + }
>  }
> diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh 
> b/scripts/lib/ptxd_make_xpkg_pkg.sh
> index 5ba404e..01ce361 100644
> --- a/scripts/lib/ptxd_make_xpkg_pkg.sh
> +++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
> @@ -210,7 +210,7 @@ install directory:
>  install -m "${mod_nfs}" -d "${ndirs[@]/%/${dir}}" &&
>  install -m "${mod}" -o "${usr}" -g "${grp}" -d "${pdirs[@]/%/${dir}}" &&
>  
> -echo "f:${dir}:${usr}:${grp}:${mod}" >> "${pkg_xpkg_perms}" ||
> +echo "f:${dir//:/\\:}:${usr}:${grp}:${mod}" >> "${pkg_xpkg_perms}" ||
>  ptxd_install_error "install_dir failed!"
>  }
>  export -f ptxd_install_dir
> @@ -343,7 +343,7 @@ Usually, just remove the 6th parameter and everything 
> works fine.
>  # now change to requested user and group
>  chown "${usr}:${grp}" "${pdirs[@]/%/${dst}}" &&
>  
> -echo "f:${dst}:${usr}:${grp}:${mod}" >> "${pkg_xpkg_perms}"
> +echo "f:${dst//:/\\:}:${usr}:${grp}:${mod}" >> "${pkg_xpkg_perms}"
>  }
>  export -f ptxd_install_file_impl
>  
> @@ -414,7 +414,7 @@ install device node:
>  done &&
>  chown "${usr}:${grp}" "${pdirs[@]/%/${dst}}" &&
>  
> -echo "n:${dst}:${usr}:${grp}:${mod}:${type}:${major}:${minor}" >> 
> "${pkg_xpkg_perms}"
> +echo "n:${dst//:/\\:}:${usr}:${grp}:${mod}:${type}:${major}:${minor}" >> 
> "${pkg_xpkg_perms}"
>  }
>  export -f ptxd_install_mknod
>  
> 
> ___
> 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

[ptxdist] executables in /usr/bin vs /bin

2016-02-10 Thread Clemens Gruber
Hi,

in the proposed version bump for procps, the default path changed to
/bin instead of /usr/bin. In my patch I just renamed the paths. But
maybe that's the wrong approach and we should keep all binaries in
/usr/bin ?

Debian on the other hand puts most of them in /usr/bin and a few into
/bin.

Should I send a v2 with all rules changed like this?
@$(call install_copy, procps, 0, 0, 0755, /bin/free, /usr/bin/free)

Or should we put some binaries in /bin to be consistent with Debian?
(/bin/ps, /bin/pidof, /usr/bin/top, /usr/bin/vmstat, ... ?)

Btw: This is the commit from procps-ng where they changed it to /bin:
https://gitlab.com/procps-ng/procps/commit/430b559ba2826f80dffa840622ae0fc744000b13

Thanks,
Clemens

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] ptxdist locale problems

2016-02-10 Thread Michael Olbrich
On Tue, Feb 02, 2016 at 08:27:14PM +0100, Clemens Gruber wrote:
> On Tue, Feb 02, 2016 at 08:24:12PM +0100, Clemens Gruber wrote:
> > On Mon, Feb 01, 2016 at 04:36:39PM +0100, Michael Olbrich wrote:
> > > With a corresponding /etc/locale.conf I see
> > > System Locale: LANG=en_US.utf8
> > 
> > Hm, now localectl does show the following:
> > System Locale: LANG=en_US.utf8
> > 
> > But, the "locale" program still shows:
> > LANG=
> > LC_CTYPE="POSIX"
> > LC_NUMERIC="POSIX"
> > LC_TIME="POSIX"
> > LC_COLLATE="POSIX"
> > LC_MONETARY="POSIX"
> > LC_MESSAGES="POSIX"
> > LC_PAPER="POSIX"
> > LC_NAME="POSIX"
> > LC_ADDRESS="POSIX"
> > LC_TELEPHONE="POSIX"
> > LC_MEASUREMENT="POSIX"
> > LC_IDENTIFICATION="POSIX"
> > LC_ALL=
> > 
> > > What does "localectl list-locales" tell you?
> > 
> > It shows: en_US.utf8
> > 
> > So ptxdist did generate the locale files correctly, but the
> > /etc/locale.conf entry does not seem to have any effect on the output of
> > "locale". Is this expected and what can I do about it?
> > Shouldn't systemd-localed also set the environment variables?
> > 
> > Michael, does your machine show LANG=en_US.utf8 in the output of the
> > "locale" command?
> > 
> > Thanks for your help.
> > Clemens
> 
> If I try to connect to the machine with mosh, I get:
> "The locale requested by LC_CTYPE=en_US.utf8 isn't available here.
> Running `locale-gen en_US.utf8' may be necessary.
> 
> mosh-server needs a UTF-8 native locale to run."

"systemctl show-environment" contains the correct 'LANG'. However, LANG is
not set in the shell. Maybe we should add something like this to
/etc/profile.d/systemdd.sh:

if [ -s /etc/locale.conf ]; then
. /etc/locale.conf
export LANG
fi

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] search path order for patch series

2016-02-10 Thread Juergen Borleis
Hi Alexander,

On Tuesday 09 February 2016 16:29:06 Alexander Stein wrote:
> in a project I have to add a platform which requirs a slightly different
> (kernel) patch set than current one. Up to now my patches are located in
> PTXDIST_WORKSPACE/patches/linux-x.y.z which works great. I tried to use a
> series.PLATFORMSUFFIX which didn't work. After reading
> 
http://www.pengutronix.de/software/ptxdist/appnotes/OSELAS.BSP-Pengutronix-Generic-arm-Quickstart.pdf
> I noticed that section 4.1.2 and 4.2.4 names different search orders. While I
> prefere the one from 4.1.2 (PTXDIST_PLATFORMCONFIGDIR/patches/linux-x.y.z
> before PTXDIST_WORKSPACE/patches/linux-x.y.z) it seems that ptxdist actually
> uses the one from 4.2.4 PTXDIST_WORKSPACE/patches/linux-x.y.z before
> PTXDIST_PLATFORMCONFIGDIR/patches/linux-x.y.z. Which one was intended?

A single platform can be used in different BSPs, and a BSP describes a specific 
application which might need special adaptions to the platform to make it 
work.

So, the BSP itself (e.g. "PTXDIST_WORKSPACE") has always the highest priority.

Regards,
Juergen

-- 
Pengutronix e.K.                              | Juergen Borleis             |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] Added support for boost.python

2016-02-10 Thread Tobias Schmidl
This works both against python2 and python3.

Signed-off-by: Tobias Schmidl 
---
 rules/boost.in   | 30 +++---
 rules/boost.make | 10 ++
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/rules/boost.in b/rules/boost.in
index f1ceeb0..3ed0253 100644
--- a/rules/boost.in
+++ b/rules/boost.in
@@ -245,8 +245,32 @@ config BOOST_WAVE
 
 config BOOST_PYTHON
bool
+
+choice
prompt "python"
-   depends on BROKEN
-   help
- boost python support (still broken)
+   default BOOST_NOPYTHON
+
+   config BOOST_NOPYTHON
+   bool
+   prompt "no python support"
+   help
+ Select this option if you don't want to build boost.python.
+
+   config BOOST_PYTHON2
+   bool
+   prompt "python2"
+   select PYTHON
+   select BOOST_PYTHON
+   help
+ Select this option if you want to use boost.python in 
combination with python2.
+
+   config BOOST_PYTHON3
+   bool
+   prompt "python3"
+   select PYTHON3
+   select BOOST_PYTHON
+   help
+ Select this option if you want to use boost.python in 
combination with python3.
+endchoice
+
 endif
diff --git a/rules/boost.make b/rules/boost.make
index e9a1e33..46858d0 100644
--- a/rules/boost.make
+++ b/rules/boost.make
@@ -132,6 +132,16 @@ $(STATEDIR)/boost.prepare:
cd $(BOOST_DIR) && ./bootstrap.sh $(BOOST_CONF_OPT)
@cd $(BOOST_DIR) && \
echo "using gcc : $(PTXCONF_ARCH_STRING) : $(CROSS_CXX) ;" > 
$(BOOST_DIR)/user-config.jam
+
+ifdef PTXCONF_BOOST_PYTHON3
+   @cd $(BOOST_DIR) && \
+   echo "using python : $(PYTHON3_MAJORMINOR) : 
$(SYSROOT)/usr/bin/python : $(SYSROOT)/usr/include/python$(PYTHON3_MAJORMINOR)m 
: $(SYSROOT)/usr/lib/python$(PYTHON3_MAJORMINOR) ;" >> 
$(BOOST_DIR)/user-config.jam
+endif
+ifdef PTXCONF_BOOST_PYTHON2
+   @cd $(BOOST_DIR) && \
+   echo "using python : $(PYTHON_MAJORMINOR) : 
$(SYSROOT)/usr/bin/python : $(SYSROOT)/usr/include/python$(PYTHON_MAJORMINOR)m 
: $(SYSROOT)/usr/lib/python$(PYTHON_MAJORMINOR) ;" >> 
$(BOOST_DIR)/user-config.jam
+endif
+
@echo "all:">  $(BOOST_DIR)/Makefile
@echo ' @$(BOOST_JAM) $(JAM_MAKE_OPT)'  >> $(BOOST_DIR)/Makefile
@echo "install:">> $(BOOST_DIR)/Makefile
-- 
2.1.4


___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] search path order for patch series

2016-02-10 Thread Alexander Stein
Hello Jürgen,

On Wednesday 10 February 2016 09:32:37, Juergen Borleis wrote:
> On Tuesday 09 February 2016 16:29:06 Alexander Stein wrote:
> > in a project I have to add a platform which requirs a slightly different
> > (kernel) patch set than current one. Up to now my patches are located in
> > PTXDIST_WORKSPACE/patches/linux-x.y.z which works great. I tried to use a
> > series.PLATFORMSUFFIX which didn't work. After reading
> > 
> http://www.pengutronix.de/software/ptxdist/appnotes/OSELAS.BSP-Pengutronix-Generic-arm-Quickstart.pdf
> > I noticed that section 4.1.2 and 4.2.4 names different search orders. While 
> > I
> > prefere the one from 4.1.2 (PTXDIST_PLATFORMCONFIGDIR/patches/linux-x.y.z
> > before PTXDIST_WORKSPACE/patches/linux-x.y.z) it seems that ptxdist actually
> > uses the one from 4.2.4 PTXDIST_WORKSPACE/patches/linux-x.y.z before
> > PTXDIST_PLATFORMCONFIGDIR/patches/linux-x.y.z. Which one was intended?
> 
> A single platform can be used in different BSPs, and a BSP describes a 
> specific 
> application which might need special adaptions to the platform to make it 
> work.
> 
> So, the BSP itself (e.g. "PTXDIST_WORKSPACE") has always the highest priority.

How to handle the case where a specific BSP requires different adaptions for 
different platforms which aren't required in another BSP?

Nevertheless the documentation is misleading/wrong (4.1.2):
> One location is the project’s currently used platform directory. If the
> currently used platform is located in configs/arm-qemu, PTXdist searches in
> ./configs/arm-qemu/patches/.
>
> If no patch series was found in
> the platform directory, the next location PTXdist it searches for a patch
> series is the main project directory in ./patches/.

This clearly states that the platform has priority over BSP/project.

Best regards,
Alexander
-- 
Dipl.-Inf. Alexander Stein
SYS TEC electronic GmbH
alexander.st...@systec-electronic.com

Legal and Commercial Address:
Am Windrad 2
08468 Heinsdorfergrund
Germany

Office: +49 (0) 3765 38600-0
Fax:+49 (0) 3765 38600-4100
 
Managing Directors:
Director Technology/CEO: Dipl.-Phys. Siegmar Schmidt;
Director Commercial Affairs/COO: Dipl. Ing. (FH) Armin von Collrepp
Commercial Registry:
Amtsgericht Chemnitz, HRB 28082; USt.-Id Nr. DE150534010


___
ptxdist mailing list
ptxdist@pengutronix.de

[ptxdist] Antwort: Re: [PATCH 2/2] Improved support for boost.python

2016-02-10 Thread Tobias Schmidl
Hello all,


-"ptxdist"  schrieb: -
>> On Tue, Jan 26, 2016 at 02:22:19PM +0100, Tobias Schmidl wrote:
>> This works both against python2 and python3.
>> 
> This wont work. You need a choice here with BOOST_NOPYTHON / BOOST_PYTHON /
> BOOST_PYTHON3 and then 'select' the correct python version in the toplevel
> option. If there is no build-time dependency then use
> 
>   select PTYHON3  if RUNTIME
> 

thanks, will resubmit.

Best regards,

Tobias


___
ptxdist mailing list
ptxdist@pengutronix.de