[yocto] [meta-mingw][PATCH 0/19] Adding support for building QEMU for Windows

2017-01-30 Thread Nathan Rossi
This series enables a number of packages and dependencies to be built
for mingw32. The goal is to enable the building and packaging of QEMU
targeting mingw32 with support for SDL/VNC enabled as well as being able
to execute the qemu* machines of oe-core/meta.

The following series fixes a number of issues with compilation of
certain components that are required to build and distribute QEMU. This
series includes:

 * Enabling 'secure-api' for mingw-w64-headers
 * Fix/enable building of shared libraries for gettext
 * Work around to avoid dependency on bash for glib-2.0, clean up of
   some glib-2.0 appends which are resolved in oe-core meta
 * Better packaging of libgcc for easy use on Windows (deploy dll to
   bindir)
 * Updating FILES_* to support locations for mingw32 output (bindir
   contains .dll) for libgcc, expat, libpcre, gettext, glib-2.0, libsdl,
   libgpg-error and libgcrypt
 * Addition of PACKAGECONFIG options to libsdl, and configuring of
   PACKAGECONFIG for libsdl, glib-2.0 and libgcrypt to handle Windows
   only features and or ability to disable features that do not support
   mingw32/Windows
 * Enabling build of libfdt in the dtc recipe, but skipping dtc itself
 * Fixes for configuring libgpg-error and libgcrypt when targeting
   mingw32

The intended build execution is to allow for 'buildtools-tarball' (or
any populate_sdk target with 'nativesdk-qemu' in TOOLCHAIN_HOST_TASK) to
create an output that includes all dependent nativesdk binaries as well
as a nativesdk QEMU binaries. This series does not however address
fixing the environment setup script or self-extracting installer shell
script that is normally provided by buildtools-tarball.

This series with the multiple oe-core/meta series was tested on the
following target Windows platforms: Windows 10 (64-bit), Windows 8.1
(64-bit) and Windows 7 SP1 (64-bit).

The changes were also tested on the following Linux build hosts: Debian
8 (64-bit), Ubuntu 16.04 (64-bit), CentOS 7 (64-bit).

For convenience this series is also available in the git repository:

  https://github.com/nathanrossi/meta-mingw nrossi/mingw-qemu-v2

This series partly depends on a set of series for oe-core/meta. The
following series are required for building of QEMU (but not all parts of
this series specifically), including dll packaging detection and
libgcrypt support:

  https://patchwork.openembedded.org/series/5049/
  https://patchwork.openembedded.org/series/5050/
  https://patchwork.openembedded.org/series/5051/
  https://patchwork.openembedded.org/series/5052/
  https://patchwork.openembedded.org/series/5053/

A branch which has the series above merged has been published to allow
for easy testing, it is available at:

  https://github.com/nathanrossi/openembedded-core 
testing/mingw-support-2017-01-30

---

Changes v2:
 * Moved a number of patches from oe-core series to this series
 * Updated cover letter to reflect series additional inclusion
 * Bring cover letter info from oe-core/meta series
 * Updated commit messages

Nathan Rossi (19):
  mingw-w64-headers: Add 'secure-api' PACKAGECONFIG
  libgcc: Relocate and package dll's in bindir
  expat: Fix ${PN}-bin handling for .exe files
  libpcre: Handle shipping .exe and .dll files for mingw32
  gettext_0.19.%.bbappend: Fix/enable shared building of gettext
  gettext_0.19.%.bbappend: Handle packaging .dll's for mingw32
  gettext_0.19.%.bbappend: Handle gettext-libintl .dll packaging
  glib-2.0: Prevent a bash dependency via bash-completion
  glib-2.0: Disable libmount support for mingw32 targets
  glib-2.0: Handle packaging .dll and .exe files for mingw32
  glib-2.0: Clean up unnecessary appends that are resolved in oe-core
  dtc: Only build libfdt for mingw32
  libsdl: Windows specific PACKAGECONFIG
  libsdl: Fix ${PN}-bin handling for .exe files
  libgpg-error: Handle packaging .exe files
  libgpg-error_1.25.bbappend: Add patch to fix configure bug for mingw32
  libgcrypt: Handle packaging of .exe and .def files
  libgcrypt: Disable 'capabilities' for mingw32
  libgcrypt_1.7.3.bbappend: Add patch to fix configure bug for mingw32

 recipes-core/dtc/dtc_%.bbappend| 16 ++
 recipes-core/expat/expat_%.bbappend|  3 +
 .../fix-gl_cv_prog_as_underscore-test.patch| 67 ++
 recipes-core/gettext/gettext_0.19.%.bbappend   | 11 +++-
 recipes-core/glib-2.0/glib-2.0_%.bbappend  | 17 +-
 recipes-devtools/gcc/libgcc_%.bbappend |  8 ++-
 .../mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb |  4 ++
 recipes-graphics/libsdl/libsdl_%.bbappend  |  9 +++
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 +++
 recipes-support/libgcrypt/libgcrypt_%.bbappend | 11 
 recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend |  6 ++
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 +++
 .../libgpg-error/libgpg-error_%.bbappend   |  3 +
 .../libgpg-error/libgpg-error_1.25.bbappend|  6 ++

[yocto] [meta-mingw][PATCH 1/19] mingw-w64-headers: Add 'secure-api' PACKAGECONFIG

2017-01-30 Thread Nathan Rossi
Add the 'secure-api' PACKAGECONFIG and enable it by default. The
'secure-api' feature enables the secure string functions that are
provided in the MS C Runtime e.g. "strerror_s".

These functions are needed for glib-2.0 compilation.

Signed-off-by: Nathan Rossi 
---
 recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb | 4 
 1 file changed, 4 insertions(+)

diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb 
b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
index 06312d604e..5cd4e34e09 100644
--- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
+++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
@@ -18,6 +18,10 @@ inherit autotools nativesdk
 INHIBIT_DEFAULT_DEPS = "1"
 DEPENDS = ""
 
+PACKAGECONFIG ??= "secure-api"
+
+PACKAGECONFIG[secure-api] = "--enable-secure-api,--disable-secure-api"
+
 do_configure() {
oe_runconf
 }
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 1/19] mingw-w64-headers: Add 'secure-api' PACKAGECONFIG

2017-01-30 Thread Nathan Rossi
Add the 'secure-api' PACKAGECONFIG and enable it by default. The
'secure-api' feature enables the secure string functions that are
provided in the MS C Runtime e.g. "strerror_s".

These functions are needed for glib-2.0 compilation.

Signed-off-by: Nathan Rossi 
---
 recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb | 4 
 1 file changed, 4 insertions(+)

diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb 
b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
index 06312d604e..5cd4e34e09 100644
--- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
+++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb
@@ -18,6 +18,10 @@ inherit autotools nativesdk
 INHIBIT_DEFAULT_DEPS = "1"
 DEPENDS = ""
 
+PACKAGECONFIG ??= "secure-api"
+
+PACKAGECONFIG[secure-api] = "--enable-secure-api,--disable-secure-api"
+
 do_configure() {
oe_runconf
 }
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 0/19] Adding support for building QEMU for Windows

2017-01-30 Thread Nathan Rossi
This series enables a number of packages and dependencies to be built
for mingw32. The goal is to enable the building and packaging of QEMU
targeting mingw32 with support for SDL/VNC enabled as well as being able
to execute the qemu* machines of oe-core/meta.

The following series fixes a number of issues with compilation of
certain components that are required to build and distribute QEMU. This
series includes:

 * Enabling 'secure-api' for mingw-w64-headers
 * Fix/enable building of shared libraries for gettext
 * Work around to avoid dependency on bash for glib-2.0, clean up of
   some glib-2.0 appends which are resolved in oe-core meta
 * Better packaging of libgcc for easy use on Windows (deploy dll to
   bindir)
 * Updating FILES_* to support locations for mingw32 output (bindir
   contains .dll) for libgcc, expat, libpcre, gettext, glib-2.0, libsdl,
   libgpg-error and libgcrypt
 * Addition of PACKAGECONFIG options to libsdl, and configuring of
   PACKAGECONFIG for libsdl, glib-2.0 and libgcrypt to handle Windows
   only features and or ability to disable features that do not support
   mingw32/Windows
 * Enabling build of libfdt in the dtc recipe, but skipping dtc itself
 * Fixes for configuring libgpg-error and libgcrypt when targeting
   mingw32

The intended build execution is to allow for 'buildtools-tarball' (or
any populate_sdk target with 'nativesdk-qemu' in TOOLCHAIN_HOST_TASK) to
create an output that includes all dependent nativesdk binaries as well
as a nativesdk QEMU binaries. This series does not however address
fixing the environment setup script or self-extracting installer shell
script that is normally provided by buildtools-tarball.

This series with the multiple oe-core/meta series was tested on the
following target Windows platforms: Windows 10 (64-bit), Windows 8.1
(64-bit) and Windows 7 SP1 (64-bit).

The changes were also tested on the following Linux build hosts: Debian
8 (64-bit), Ubuntu 16.04 (64-bit), CentOS 7 (64-bit).

For convenience this series is also available in the git repository:

  https://github.com/nathanrossi/meta-mingw nrossi/mingw-qemu-v2

This series partly depends on a set of series for oe-core/meta. The
following series are required for building of QEMU (but not all parts of
this series specifically), including dll packaging detection and
libgcrypt support:

  https://patchwork.openembedded.org/series/5049/
  https://patchwork.openembedded.org/series/5050/
  https://patchwork.openembedded.org/series/5051/
  https://patchwork.openembedded.org/series/5052/
  https://patchwork.openembedded.org/series/5053/

A branch which has the series above merged has been published to allow
for easy testing, it is available at:

  https://github.com/nathanrossi/openembedded-core 
testing/mingw-support-2017-01-30

---

Changes v2:
 * Moved a number of patches from oe-core series to this series
 * Updated cover letter to reflect series additional inclusion
 * Bring cover letter info from oe-core/meta series
 * Updated commit messages

Nathan Rossi (19):
  mingw-w64-headers: Add 'secure-api' PACKAGECONFIG
  libgcc: Relocate and package dll's in bindir
  expat: Fix ${PN}-bin handling for .exe files
  libpcre: Handle shipping .exe and .dll files for mingw32
  gettext_0.19.%.bbappend: Fix/enable shared building of gettext
  gettext_0.19.%.bbappend: Handle packaging .dll's for mingw32
  gettext_0.19.%.bbappend: Handle gettext-libintl .dll packaging
  glib-2.0: Prevent a bash dependency via bash-completion
  glib-2.0: Disable libmount support for mingw32 targets
  glib-2.0: Handle packaging .dll and .exe files for mingw32
  glib-2.0: Clean up unnecessary appends that are resolved in oe-core
  dtc: Only build libfdt for mingw32
  libsdl: Windows specific PACKAGECONFIG
  libsdl: Fix ${PN}-bin handling for .exe files
  libgpg-error: Handle packaging .exe files
  libgpg-error_1.25.bbappend: Add patch to fix configure bug for mingw32
  libgcrypt: Handle packaging of .exe and .def files
  libgcrypt: Disable 'capabilities' for mingw32
  libgcrypt_1.7.3.bbappend: Add patch to fix configure bug for mingw32

 recipes-core/dtc/dtc_%.bbappend| 16 ++
 recipes-core/expat/expat_%.bbappend|  3 +
 .../fix-gl_cv_prog_as_underscore-test.patch| 67 ++
 recipes-core/gettext/gettext_0.19.%.bbappend   | 11 +++-
 recipes-core/glib-2.0/glib-2.0_%.bbappend  | 17 +-
 recipes-devtools/gcc/libgcc_%.bbappend |  8 ++-
 .../mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb |  4 ++
 recipes-graphics/libsdl/libsdl_%.bbappend  |  9 +++
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 +++
 recipes-support/libgcrypt/libgcrypt_%.bbappend | 11 
 recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend |  6 ++
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 +++
 .../libgpg-error/libgpg-error_%.bbappend   |  3 +
 .../libgpg-error/libgpg-error_1.25.bbappend|  6 ++

[yocto] [meta-mingw][PATCH v2 2/19] libgcc: Relocate and package dll's in bindir

2017-01-30 Thread Nathan Rossi
Relocate and package the dll's provided by libgcc in bindir. It is
convention that on mingw/windows dll files are installed into the
bindir, this is done to avoid issues with search paths and allows for
execution of binaries without the need to point at a libdir.

Signed-off-by: Nathan Rossi 
---
 recipes-devtools/gcc/libgcc_%.bbappend | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/recipes-devtools/gcc/libgcc_%.bbappend 
b/recipes-devtools/gcc/libgcc_%.bbappend
index dd95317618..2a95d02cad 100644
--- a/recipes-devtools/gcc/libgcc_%.bbappend
+++ b/recipes-devtools/gcc/libgcc_%.bbappend
@@ -1,2 +1,8 @@
-FILES_${PN}_append_mingw32 = " ${base_libdir}/libgcc*.dll"
+FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll"
 FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a"
+
+do_install_append_mingw32 () {
+   # move the .dll files into bindir
+   install -d ${D}${bindir}
+   mv ${D}${base_libdir}/libgcc*.dll ${D}${bindir}/
+}
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta-mingw][PATCH 0/19] Adding support for building QEMU for Windows

2017-01-30 Thread Nathan Rossi
Sorry this should have v2 in the subject. I realized just as the
second patch was sent. I've resent with v2 for clarity.

Regards,
Nathan

On 30 January 2017 at 18:41, Nathan Rossi  wrote:
> This series enables a number of packages and dependencies to be built
> for mingw32. The goal is to enable the building and packaging of QEMU
> targeting mingw32 with support for SDL/VNC enabled as well as being able
> to execute the qemu* machines of oe-core/meta.
>
> The following series fixes a number of issues with compilation of
> certain components that are required to build and distribute QEMU. This
> series includes:
>
>  * Enabling 'secure-api' for mingw-w64-headers
>  * Fix/enable building of shared libraries for gettext
>  * Work around to avoid dependency on bash for glib-2.0, clean up of
>some glib-2.0 appends which are resolved in oe-core meta
>  * Better packaging of libgcc for easy use on Windows (deploy dll to
>bindir)
>  * Updating FILES_* to support locations for mingw32 output (bindir
>contains .dll) for libgcc, expat, libpcre, gettext, glib-2.0, libsdl,
>libgpg-error and libgcrypt
>  * Addition of PACKAGECONFIG options to libsdl, and configuring of
>PACKAGECONFIG for libsdl, glib-2.0 and libgcrypt to handle Windows
>only features and or ability to disable features that do not support
>mingw32/Windows
>  * Enabling build of libfdt in the dtc recipe, but skipping dtc itself
>  * Fixes for configuring libgpg-error and libgcrypt when targeting
>mingw32
>
> The intended build execution is to allow for 'buildtools-tarball' (or
> any populate_sdk target with 'nativesdk-qemu' in TOOLCHAIN_HOST_TASK) to
> create an output that includes all dependent nativesdk binaries as well
> as a nativesdk QEMU binaries. This series does not however address
> fixing the environment setup script or self-extracting installer shell
> script that is normally provided by buildtools-tarball.
>
> This series with the multiple oe-core/meta series was tested on the
> following target Windows platforms: Windows 10 (64-bit), Windows 8.1
> (64-bit) and Windows 7 SP1 (64-bit).
>
> The changes were also tested on the following Linux build hosts: Debian
> 8 (64-bit), Ubuntu 16.04 (64-bit), CentOS 7 (64-bit).
>
> For convenience this series is also available in the git repository:
>
>   https://github.com/nathanrossi/meta-mingw nrossi/mingw-qemu-v2
>
> This series partly depends on a set of series for oe-core/meta. The
> following series are required for building of QEMU (but not all parts of
> this series specifically), including dll packaging detection and
> libgcrypt support:
>
>   https://patchwork.openembedded.org/series/5049/
>   https://patchwork.openembedded.org/series/5050/
>   https://patchwork.openembedded.org/series/5051/
>   https://patchwork.openembedded.org/series/5052/
>   https://patchwork.openembedded.org/series/5053/
>
> A branch which has the series above merged has been published to allow
> for easy testing, it is available at:
>
>   https://github.com/nathanrossi/openembedded-core 
> testing/mingw-support-2017-01-30
>
> ---
>
> Changes v2:
>  * Moved a number of patches from oe-core series to this series
>  * Updated cover letter to reflect series additional inclusion
>  * Bring cover letter info from oe-core/meta series
>  * Updated commit messages
>
> Nathan Rossi (19):
>   mingw-w64-headers: Add 'secure-api' PACKAGECONFIG
>   libgcc: Relocate and package dll's in bindir
>   expat: Fix ${PN}-bin handling for .exe files
>   libpcre: Handle shipping .exe and .dll files for mingw32
>   gettext_0.19.%.bbappend: Fix/enable shared building of gettext
>   gettext_0.19.%.bbappend: Handle packaging .dll's for mingw32
>   gettext_0.19.%.bbappend: Handle gettext-libintl .dll packaging
>   glib-2.0: Prevent a bash dependency via bash-completion
>   glib-2.0: Disable libmount support for mingw32 targets
>   glib-2.0: Handle packaging .dll and .exe files for mingw32
>   glib-2.0: Clean up unnecessary appends that are resolved in oe-core
>   dtc: Only build libfdt for mingw32
>   libsdl: Windows specific PACKAGECONFIG
>   libsdl: Fix ${PN}-bin handling for .exe files
>   libgpg-error: Handle packaging .exe files
>   libgpg-error_1.25.bbappend: Add patch to fix configure bug for mingw32
>   libgcrypt: Handle packaging of .exe and .def files
>   libgcrypt: Disable 'capabilities' for mingw32
>   libgcrypt_1.7.3.bbappend: Add patch to fix configure bug for mingw32
>
>  recipes-core/dtc/dtc_%.bbappend| 16 ++
>  recipes-core/expat/expat_%.bbappend|  3 +
>  .../fix-gl_cv_prog_as_underscore-test.patch| 67 
> ++
>  recipes-core/gettext/gettext_0.19.%.bbappend   | 11 +++-
>  recipes-core/glib-2.0/glib-2.0_%.bbappend  | 17 +-
>  recipes-devtools/gcc/libgcc_%.bbappend |  8 ++-
>  .../mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb |  4 ++
>  recipes-graphics/libsdl/libsdl_%.bbappend  |  9 +++
>  ...c-Set-my

[yocto] [meta-mingw][PATCH v2 3/19] expat: Fix ${PN}-bin handling for .exe files

2017-01-30 Thread Nathan Rossi
For mingw it is convention to have DLLs in bindir. To avoid grouping
anything other that .exe files into the ${PN}-bin package, override it
so that only '*.exe' files are shipped.

Signed-off-by: Nathan Rossi 
---
 recipes-core/expat/expat_%.bbappend | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 recipes-core/expat/expat_%.bbappend

diff --git a/recipes-core/expat/expat_%.bbappend 
b/recipes-core/expat/expat_%.bbappend
new file mode 100644
index 00..626ea5b938
--- /dev/null
+++ b/recipes-core/expat/expat_%.bbappend
@@ -0,0 +1,3 @@
+
+FILES_${PN}-bin_mingw32 = "${bindir}/*.exe ${sbindir}/*.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 4/19] libpcre: Handle shipping .exe and .dll files for mingw32

2017-01-30 Thread Nathan Rossi
Package the .dll and .exe files into their expected packages.

Signed-off-by: Nathan Rossi 
---
 recipes-support/libpcre/libpcre_%.bbappend | 6 ++
 1 file changed, 6 insertions(+)
 create mode 100644 recipes-support/libpcre/libpcre_%.bbappend

diff --git a/recipes-support/libpcre/libpcre_%.bbappend 
b/recipes-support/libpcre/libpcre_%.bbappend
new file mode 100644
index 00..b154f8d3b6
--- /dev/null
+++ b/recipes-support/libpcre/libpcre_%.bbappend
@@ -0,0 +1,6 @@
+
+FILES_libpcrecpp_mingw32 = "${bindir}/libpcrecpp*.dll"
+FILES_libpcreposix_mingw32 = "${bindir}/libpcreposix*.dll"
+FILES_pcregrep_mingw32 = "${bindir}/pcregrep.exe"
+FILES_pcretest_mingw32 = "${bindir}/pcretest.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 5/19] gettext_0.19.%.bbappend: Fix/enable shared building of gettext

2017-01-30 Thread Nathan Rossi
Fix building of shared gettext for i686/32-bit mingw32. This adds a
patch which fixes an issue with gnulib that is included in gettext.

This patch does not need to be submitted upstream as it is fixing an
issue with the included version of gnulib. Upstream gnulib has already
fixed this issue and upstream gettext has already updated the included
gnulib, however gettext has not yet made a release that includes this
fix.

Signed-off-by: Nathan Rossi 
---
 .../fix-gl_cv_prog_as_underscore-test.patch| 67 ++
 recipes-core/gettext/gettext_0.19.%.bbappend   |  7 ++-
 2 files changed, 73 insertions(+), 1 deletion(-)
 create mode 100644 
recipes-core/gettext/gettext/fix-gl_cv_prog_as_underscore-test.patch

diff --git 
a/recipes-core/gettext/gettext/fix-gl_cv_prog_as_underscore-test.patch 
b/recipes-core/gettext/gettext/fix-gl_cv_prog_as_underscore-test.patch
new file mode 100644
index 00..636789f31d
--- /dev/null
+++ b/recipes-core/gettext/gettext/fix-gl_cv_prog_as_underscore-test.patch
@@ -0,0 +1,67 @@
+Backport gnulib fix for mingw into gettext's included version of gnulib
+
+http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=68b6adebef05670a312fb92b05e7bd089d2ed43a
+
+Upstream-Status: Backport
+Signed-off-by: Nathan Rossi 
+
+--- a/gettext-runtime/gnulib-m4/asm-underscore.m4
 b/gettext-runtime/gnulib-m4/asm-underscore.m4
+@@ -27,11 +27,11 @@
+ #endif
+ int foo(void) { return 0; }
+ EOF
+  # Look for the assembly language name in the .s file.
+  AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) 
>/dev/null 2>&1
+- if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' 
conftest.$gl_asmext >/dev/null; then
++ if LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' 
conftest.$gl_asmext >/dev/null; then
+gl_cv_prog_as_underscore=yes
+  else
+gl_cv_prog_as_underscore=no
+  fi
+  rm -f conftest*
+--- a/gettext-runtime/configure
 b/gettext-runtime/configure
+@@ -24601,11 +24601,11 @@
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; } >/dev/null 2>&1
+- if LC_ALL=C grep -E '(^|^a-zA-Z0-9_)_foo(^a-zA-Z0-9_|$)' 
conftest.$gl_asmext >/dev/null; then
++ if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' 
conftest.$gl_asmext >/dev/null; then
+gl_cv_prog_as_underscore=yes
+  else
+gl_cv_prog_as_underscore=no
+  fi
+  rm -f conftest*
+--- a/gettext-tools/gnulib-m4/asm-underscore.m4
 b/gettext-tools/gnulib-m4/asm-underscore.m4
+@@ -27,11 +27,11 @@
+ #endif
+ int foo(void) { return 0; }
+ EOF
+  # Look for the assembly language name in the .s file.
+  AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) 
>/dev/null 2>&1
+- if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' 
conftest.$gl_asmext >/dev/null; then
++ if LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' 
conftest.$gl_asmext >/dev/null; then
+gl_cv_prog_as_underscore=yes
+  else
+gl_cv_prog_as_underscore=no
+  fi
+  rm -f conftest*
+--- a/gettext-tools/configure
 b/gettext-tools/configure
+@@ -32284,11 +32284,11 @@
+   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; } >/dev/null 2>&1
+- if LC_ALL=C grep -E '(^|^a-zA-Z0-9_)_foo(^a-zA-Z0-9_|$)' 
conftest.$gl_asmext >/dev/null; then
++ if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' 
conftest.$gl_asmext >/dev/null; then
+gl_cv_prog_as_underscore=yes
+  else
+gl_cv_prog_as_underscore=no
+  fi
+  rm -f conftest*
diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend 
b/recipes-core/gettext/gettext_0.19.%.bbappend
index efd10d6bb6..1cf0188ea5 100644
--- a/recipes-core/gettext/gettext_0.19.%.bbappend
+++ b/recipes-core/gettext/gettext_0.19.%.bbappend
@@ -2,5 +2,10 @@ DEPENDS_append_mingw32 = " pthreads-win32"
 LDFLAGS_prepend_mingw32 = " -lpthread "
 
 CFLAGS_append_mingw32 = " -DLIBXML_STATIC"
-EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static 
--disable-shared "
+EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
+SRC_URI_append = " \
+   file://fix-gl_cv_prog_as_underscore-test.patch \
+   "
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 6/19] gettext_0.19.%.bbappend: Handle packaging .dll's for mingw32

2017-01-30 Thread Nathan Rossi
Package the libgettext*.dll files in their respective packages.

Signed-off-by: Nathan Rossi 
---
 recipes-core/gettext/gettext_0.19.%.bbappend | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend 
b/recipes-core/gettext/gettext_0.19.%.bbappend
index 1cf0188ea5..d485cdc70e 100644
--- a/recipes-core/gettext/gettext_0.19.%.bbappend
+++ b/recipes-core/gettext/gettext_0.19.%.bbappend
@@ -9,3 +9,6 @@ SRC_URI_append = " \
file://fix-gl_cv_prog_as_underscore-test.patch \
"
 
+FILES_libgettextlib_mingw32 = "${bindir}/libgettextlib-*.dll"
+FILES_libgettextsrc_mingw32 = "${bindir}/libgettextsrc-*.dll"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 7/19] gettext_0.19.%.bbappend: Handle gettext-libintl .dll packaging

2017-01-30 Thread Nathan Rossi
For mingw32 handle packaging of gettext-libintl in bindir.

Signed-off-by: Nathan Rossi 
---
Note this patch is separated from the preceding due to being dependent
on a change in oe-core/meta being applied to add the 'gettext-libintl'
package.
---
 recipes-core/gettext/gettext_0.19.%.bbappend | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-core/gettext/gettext_0.19.%.bbappend 
b/recipes-core/gettext/gettext_0.19.%.bbappend
index d485cdc70e..6238b3871a 100644
--- a/recipes-core/gettext/gettext_0.19.%.bbappend
+++ b/recipes-core/gettext/gettext_0.19.%.bbappend
@@ -11,4 +11,5 @@ SRC_URI_append = " \
 
 FILES_libgettextlib_mingw32 = "${bindir}/libgettextlib-*.dll"
 FILES_libgettextsrc_mingw32 = "${bindir}/libgettextsrc-*.dll"
+FILES_gettext-libintl_mingw32 = "${bindir}/libintl*.dll"
 
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 9/19] glib-2.0: Disable libmount support for mingw32 targets

2017-01-30 Thread Nathan Rossi
MinGW/Windows does not have support for libmount, so disable it when
targeting mingw32.

Signed-off-by: Nathan Rossi 
---
 recipes-core/glib-2.0/glib-2.0_%.bbappend | 4 
 1 file changed, 4 insertions(+)

diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend 
b/recipes-core/glib-2.0/glib-2.0_%.bbappend
index 2b9ec53182..5683364c37 100644
--- a/recipes-core/glib-2.0/glib-2.0_%.bbappend
+++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend
@@ -4,3 +4,7 @@ FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias 
${libdir}/gthread-2.0.def
 # glib always provides bash-completion output, package the output but prevent
 # the dependency chain on bash (via bash-completion) for mingw32 targets only.
 RDEPENDS_${PN}-bash-completion_remove_mingw32 = "bash-completion"
+
+# libmount is not buildable for mingw/windows
+PACKAGECONFIG_remove_mingw32 = "libmount"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 8/19] glib-2.0: Prevent a bash dependency via bash-completion

2017-01-30 Thread Nathan Rossi
Prevent glib-2.0 depending on bash indirectly due to the RDEPEND on
bash-completion. The bash dependency is undesirable due to bash
depending on POSIX compatibility (fork, etc) which is not provided by
MinGW but instead MSYS or CYGWIN.

The glib-2.0 configure does not allow for disabling of bash-completion
output, so instead of disabling the bash-completion bbclass entirely
allow the output to be packaged but remove the
RDEPENDS_${PN}-bash-completion on bash-completion.

Signed-off-by: Nathan Rossi 
---
 recipes-core/glib-2.0/glib-2.0_%.bbappend | 4 
 1 file changed, 4 insertions(+)

diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend 
b/recipes-core/glib-2.0/glib-2.0_%.bbappend
index d0531d6f4c..2b9ec53182 100644
--- a/recipes-core/glib-2.0/glib-2.0_%.bbappend
+++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend
@@ -1,2 +1,6 @@
 EXTRA_OECONF_mingw32 = "--enable-included-printf=yes ${CORECONF}"
 FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias 
${libdir}/gthread-2.0.def"
+
+# glib always provides bash-completion output, package the output but prevent
+# the dependency chain on bash (via bash-completion) for mingw32 targets only.
+RDEPENDS_${PN}-bash-completion_remove_mingw32 = "bash-completion"
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 10/19] glib-2.0: Handle packaging .dll and .exe files for mingw32

2017-01-30 Thread Nathan Rossi
Handle the packaging of .dll files into the ${PN} package, also package
only certain .exe files into the ${PN} and others into the ${PN}-utils
packages. This is required due to the mingw/windows convention where
.dll's are shipped in the bindir.

Move the packaging of *.def into the ${PN}-dev package, it is only used
during development/compilation.

Signed-off-by: Nathan Rossi 
---
 recipes-core/glib-2.0/glib-2.0_%.bbappend | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend 
b/recipes-core/glib-2.0/glib-2.0_%.bbappend
index 5683364c37..2accd7aa83 100644
--- a/recipes-core/glib-2.0/glib-2.0_%.bbappend
+++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend
@@ -1,5 +1,5 @@
 EXTRA_OECONF_mingw32 = "--enable-included-printf=yes ${CORECONF}"
-FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias 
${libdir}/gthread-2.0.def"
+FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias"
 
 # glib always provides bash-completion output, package the output but prevent
 # the dependency chain on bash (via bash-completion) for mingw32 targets only.
@@ -8,3 +8,10 @@ RDEPENDS_${PN}-bash-completion_remove_mingw32 = 
"bash-completion"
 # libmount is not buildable for mingw/windows
 PACKAGECONFIG_remove_mingw32 = "libmount"
 
+FILES_${PN}_append_mingw32 = " \
+   ${bindir}/lib*.dll \
+   ${libexecdir}/*gio-querymodules.exe \
+   "
+FILES_${PN}-dev_append_mingw32 = " ${libdir}/*.def"
+FILES_${PN}-utils_mingw32 = "${bindir}/*.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 11/19] glib-2.0: Clean up unnecessary appends that are resolved in oe-core

2017-01-30 Thread Nathan Rossi
The changes that are appended for '--enable-include=printf=yes' and
removal of charset.alias are handled in oe-core.

Signed-off-by: Nathan Rossi 
---
 recipes-core/glib-2.0/glib-2.0_%.bbappend | 2 --
 1 file changed, 2 deletions(-)

diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend 
b/recipes-core/glib-2.0/glib-2.0_%.bbappend
index 2accd7aa83..08f726192f 100644
--- a/recipes-core/glib-2.0/glib-2.0_%.bbappend
+++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend
@@ -1,5 +1,3 @@
-EXTRA_OECONF_mingw32 = "--enable-included-printf=yes ${CORECONF}"
-FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias"
 
 # glib always provides bash-completion output, package the output but prevent
 # the dependency chain on bash (via bash-completion) for mingw32 targets only.
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 12/19] dtc: Only build libfdt for mingw32

2017-01-30 Thread Nathan Rossi
Whilst building libfdt on mingw32 is functional, building dtc for mingw32
is not. This is due to dtc relying on certain POSIX functions as well as
not handling the MSVCRT printf formatting.

This change enables building and installing libfdt only for mingw32,
disabling the build of device-tree-compiler itself.

Signed-off-by: Nathan Rossi 
---
 recipes-core/dtc/dtc_%.bbappend | 16 
 1 file changed, 16 insertions(+)
 create mode 100644 recipes-core/dtc/dtc_%.bbappend

diff --git a/recipes-core/dtc/dtc_%.bbappend b/recipes-core/dtc/dtc_%.bbappend
new file mode 100644
index 00..140693778a
--- /dev/null
+++ b/recipes-core/dtc/dtc_%.bbappend
@@ -0,0 +1,16 @@
+
+do_configure_append_mingw32 () {
+   # don't try to build the other dtc components when installing 
libs
+   sed -i 's/install-lib: all/install-lib: libfdt/g' ${S}/Makefile
+}
+
+do_compile_mingw32 () {
+   oe_runmake libfdt
+}
+
+do_install_mingw32 () {
+   oe_runmake install-lib install-includes
+}
+
+RDEPENDS_${PN}-misc_remove_mingw32 = "bash"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 13/19] libsdl: Windows specific PACKAGECONFIG

2017-01-30 Thread Nathan Rossi
Add a PACKAGECONFIG for 'stdio-redirect'. This configure option
enables/disables the Windows only option for redirecting the
stdout/stderr to files instead of to the console.

Add the 'directx' PACKAGECONFIG to configure whether to build with
DirectX support. By default this is enabled (when targeting
mingw32/windows) however this requires the DirectX libraries in order to
include and link against.

Disable X11 support when building for the nativesdk mingw32.

Signed-off-by: Nathan Rossi 
---
 recipes-graphics/libsdl/libsdl_%.bbappend | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 recipes-graphics/libsdl/libsdl_%.bbappend

diff --git a/recipes-graphics/libsdl/libsdl_%.bbappend 
b/recipes-graphics/libsdl/libsdl_%.bbappend
new file mode 100644
index 00..5f5787d318
--- /dev/null
+++ b/recipes-graphics/libsdl/libsdl_%.bbappend
@@ -0,0 +1,7 @@
+# Disable default x11 support
+PACKAGECONFIG_class-nativesdk_mingw32 = ""
+
+# Configs that only apply to Windows/MinGW
+PACKAGECONFIG[stdio-redirect] = 
"--enable-stdio-redirect,--disable-stdio-redirect"
+PACKAGECONFIG[directx] = "--enable-directx,--disable-directx"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 14/19] libsdl: Fix ${PN}-bin handling for .exe files

2017-01-30 Thread Nathan Rossi
For mingw it is convention to have DLLs in bindir. To avoid grouping
anything other that .exe files into the ${PN}-bin package, override it
so that only '*.exe' files are shipped.

Signed-off-by: Nathan Rossi 
---
 recipes-graphics/libsdl/libsdl_%.bbappend | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/recipes-graphics/libsdl/libsdl_%.bbappend 
b/recipes-graphics/libsdl/libsdl_%.bbappend
index 5f5787d318..bb65f03d89 100644
--- a/recipes-graphics/libsdl/libsdl_%.bbappend
+++ b/recipes-graphics/libsdl/libsdl_%.bbappend
@@ -5,3 +5,5 @@ PACKAGECONFIG_class-nativesdk_mingw32 = ""
 PACKAGECONFIG[stdio-redirect] = 
"--enable-stdio-redirect,--disable-stdio-redirect"
 PACKAGECONFIG[directx] = "--enable-directx,--disable-directx"
 
+FILES_${PN}-bin_mingw32 = "${bindir}/*.exe ${sbindir}/*.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 15/19] libgpg-error: Handle packaging .exe files

2017-01-30 Thread Nathan Rossi
Handle packaging gpg-error.exe in the -dev package.

Signed-off-by: Nathan Rossi 
---
 recipes-support/libgpg-error/libgpg-error_%.bbappend | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 recipes-support/libgpg-error/libgpg-error_%.bbappend

diff --git a/recipes-support/libgpg-error/libgpg-error_%.bbappend 
b/recipes-support/libgpg-error/libgpg-error_%.bbappend
new file mode 100644
index 00..8fcfa78225
--- /dev/null
+++ b/recipes-support/libgpg-error/libgpg-error_%.bbappend
@@ -0,0 +1,3 @@
+
+FILES_${PN}-dev_append_mingw32 = " ${bindir}/gpg-error.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 16/19] libgpg-error_1.25.bbappend: Add patch to fix configure bug for mingw32

2017-01-30 Thread Nathan Rossi
Resolve bug with the generation of the versioninfo.rc file which depends
on the BUILD_REVISION being set during configure. The BUILD_REVISION is
unset when building against tarball source due to no git repository
information. This patch sets the BUILD_REVISION to 0 when no information
is available.

Signed-off-by: Nathan Rossi 
---
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++
 .../libgpg-error/libgpg-error_1.25.bbappend|  6 +++
 2 files changed, 52 insertions(+)
 create mode 100644 
recipes-support/libgpg-error/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
 create mode 100644 recipes-support/libgpg-error/libgpg-error_1.25.bbappend

diff --git 
a/recipes-support/libgpg-error/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
 
b/recipes-support/libgpg-error/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
new file mode 100644
index 00..ea5a10261c
--- /dev/null
+++ 
b/recipes-support/libgpg-error/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
@@ -0,0 +1,46 @@
+From 274bb6fc22f8e0bfe521305d5e67eee268cabf7f Mon Sep 17 00:00:00 2001
+From: Nathan Rossi 
+Date: Fri, 30 Dec 2016 18:02:26 +1000
+Subject: [PATCH] configure.ac: Set 'mym4_revision' to 0 if not a git repo
+
+---
+It is possible for the source to not be located in a git repository
+(e.g. source is from a tarball). In which case the git repository
+information is not available. This results in the mym4_revision being an
+empty string however this value is used in BUILD_FILEVERSION where it is
+assumed to be 4 decimal values. Additionally BUILD_REVISION uses this
+value and is also assumed to be non-empty.
+
+In the case of BUILD_FILEVERSION it is used in versioninfo.rc.in, where
+it must be populated as 4 decimal values due to the expected syntax. In
+cases where it is not (e.g. when BUILD_FILEVERSION = '1,26,0,' a syntax
+error is raised.
+
+windres: versioninfo.rc.in:21: syntax error
+
+This patch changes mym4_revision so that if the 'git rev-parse' returns
+non-zero (e.g. not in a git repository) the value falls back to '0'.
+This propagates as '0' to both BUILD_FILEVERSION and BUILD_REVISION.
+
+Signed-off-by: Nathan Rossi 
+Upstream-Status: Submitted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6d4f173d1b..149ac02b5f 100644
+--- a/configure.ac
 b/configure.ac
+@@ -35,7 +35,7 @@ m4_define([mym4_version_minor], [27])
+ # processing is done by autoconf and not during the configure run.
+ m4_define([mym4_version], [mym4_version_major.mym4_version_minor])
+ m4_define([mym4_revision],
+-  m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
++  m4_esyscmd([(git rev-parse --short HEAD || printf '0') | tr -d 
'\n\r']))
+ m4_define([mym4_revision_dec],
+   m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+ m4_define([mym4_betastring],
+-- 
+2.11.0
+
diff --git a/recipes-support/libgpg-error/libgpg-error_1.25.bbappend 
b/recipes-support/libgpg-error/libgpg-error_1.25.bbappend
new file mode 100644
index 00..e30e37688e
--- /dev/null
+++ b/recipes-support/libgpg-error/libgpg-error_1.25.bbappend
@@ -0,0 +1,6 @@
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append = " \
+   
file://configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch \
+   "
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 17/19] libgcrypt: Handle packaging of .exe and .def files

2017-01-30 Thread Nathan Rossi
Handle packaging of .exe for the hmac/dumpexp packages. Also add the
packaging of mpicalc.exe to the -dev package.

Also handle the packaging of the .def files into the -dev package.

Signed-off-by: Nathan Rossi 
---
 recipes-support/libgcrypt/libgcrypt_%.bbappend | 8 
 1 file changed, 8 insertions(+)
 create mode 100644 recipes-support/libgcrypt/libgcrypt_%.bbappend

diff --git a/recipes-support/libgcrypt/libgcrypt_%.bbappend 
b/recipes-support/libgcrypt/libgcrypt_%.bbappend
new file mode 100644
index 00..631cbabb3e
--- /dev/null
+++ b/recipes-support/libgcrypt/libgcrypt_%.bbappend
@@ -0,0 +1,8 @@
+
+FILES_${PN}-dev_append_mingw32 = " \
+   ${libdir}/*.def \
+   ${bindir}/hmac256.exe \
+   ${bindir}/mpicalc.exe \
+   "
+FILES_dumpsexp-dev_append_mingw32 = " ${bindir}/dumpsexp.exe"
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 18/19] libgcrypt: Disable 'capabilities' for mingw32

2017-01-30 Thread Nathan Rossi
libcap does not support mingw32, so disable 'capabilities' support for
the mingw32 targets.

Signed-off-by: Nathan Rossi 
---
 recipes-support/libgcrypt/libgcrypt_%.bbappend | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/recipes-support/libgcrypt/libgcrypt_%.bbappend 
b/recipes-support/libgcrypt/libgcrypt_%.bbappend
index 631cbabb3e..50dca097fb 100644
--- a/recipes-support/libgcrypt/libgcrypt_%.bbappend
+++ b/recipes-support/libgcrypt/libgcrypt_%.bbappend
@@ -1,4 +1,7 @@
 
+# libcap does not support mingw32
+PACKAGECONFIG_remove_mingw32 = "capabilities"
+
 FILES_${PN}-dev_append_mingw32 = " \
${libdir}/*.def \
${bindir}/hmac256.exe \
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-mingw][PATCH v2 19/19] libgcrypt_1.7.3.bbappend: Add patch to fix configure bug for mingw32

2017-01-30 Thread Nathan Rossi
Resolve bug with the generation of the versioninfo.rc file which depends
on the BUILD_REVISION being set during configure. The BUILD_REVISION is
unset when building against tarball source due to no git repository
information. This patch sets the BUILD_REVISION to 0 when no information
is available.

Signed-off-by: Nathan Rossi 
---
 ...c-Set-mym4_revision-to-0-if-not-a-git-rep.patch | 46 ++
 recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend |  6 +++
 2 files changed, 52 insertions(+)
 create mode 100644 
recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
 create mode 100644 recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend

diff --git 
a/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
 
b/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
new file mode 100644
index 00..b7b407ab4b
--- /dev/null
+++ 
b/recipes-support/libgcrypt/files/configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch
@@ -0,0 +1,46 @@
+From bb6f9e18b5ccef26978f3f3ed2fe7bf3d4d498e7 Mon Sep 17 00:00:00 2001
+From: Nathan Rossi 
+Date: Fri, 30 Dec 2016 18:02:26 +1000
+Subject: [PATCH] configure.ac: Set 'mym4_revision' to 0 if not a git repo
+
+---
+It is possible for the source to not be located in a git repository
+(e.g. source is from a tarball). In which case the git repository
+information is not available. This results in the mym4_revision being an
+empty string however this value is used in BUILD_FILEVERSION where it is
+assumed to be 4 decimal values. Additionally BUILD_REVISION uses this
+value and is also assumed to be non-empty.
+
+In the case of BUILD_FILEVERSION it is used in versioninfo.rc.in, where
+it must be populated as 4 decimal values due to the expected syntax. In
+cases where it is not (e.g. when BUILD_FILEVERSION = '1,7,5,' a syntax
+error is raised.
+
+windres: versioninfo.rc.in:21: syntax error
+
+This patch changes mym4_revision so that if the 'git rev-parse' returns
+non-zero (e.g. not in a git repository) the value falls back to '0'.
+This propagates as '0' to both BUILD_FILEVERSION and BUILD_REVISION.
+
+Signed-off-by: Nathan Rossi 
+Upstream-Status: Submitted
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 31c0d553fa..a3deffa6e9 100644
+--- a/configure.ac
 b/configure.ac
+@@ -39,7 +39,7 @@ m4_define(mym4_version_micro, [0])
+ m4_define(mym4_version,
+   [mym4_version_major.mym4_version_minor.mym4_version_micro])
+ m4_define([mym4_revision],
+-  m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
++  m4_esyscmd([(git rev-parse --short HEAD || printf '0') | tr -d 
'\n\r']))
+ m4_define([mym4_revision_dec],
+   m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+ m4_define([mym4_betastring],
+-- 
+2.11.0
+
diff --git a/recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend 
b/recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend
new file mode 100644
index 00..e30e37688e
--- /dev/null
+++ b/recipes-support/libgcrypt/libgcrypt_1.7.3.bbappend
@@ -0,0 +1,6 @@
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+SRC_URI_append = " \
+   
file://configure.ac-Set-mym4_revision-to-0-if-not-a-git-rep.patch \
+   "
+
-- 
2.11.0

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta-security][PATCH 5/6] libtpm: update to tip.

2017-01-30 Thread Patrick Ohly
On Sun, 2017-01-29 at 09:12 -0800, Armin Kuster wrote:
> diff --git a/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
> b/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
> new file mode 100644
> index 000..25760bb
> --- /dev/null
> +++ b/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
> @@ -0,0 +1,18 @@
> +Upstream-Status: Pending
> +Signed-off-by: Armin Kuster 

Just wondering: what's your approach regarding "pending" patches? Accept
them into the layer, then submit upstream later as time permits?

Besides that, the six patches are all fine, so please consider them

Signed-off-by: Patrick Ohly 

However, when I started using these recipes already before the latest
changes, I had to fix quite a few things before the recipes were usable
(will send patches shortly):
- tcsd from trousers doesn't start because of incorrect ownership of 
  /etc/tcsd.conf
- swtpm was more useful for me as a native tool in combination with
  Stefan's qemu-tpm patches, but couldn't be compiled natively
- libtspi.so.1 was not getting installed, causing tpm tools to fail

I had the impression that the recipes were mostly in a "they build" kind
of state, but not really used much in practice. Is that correct?

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] [meta-security][PATCH 6/6] swtpm: update to tip

2017-01-30 Thread Patrick Ohly
On Sun, 2017-01-29 at 09:12 -0800, Armin Kuster wrote:
> fix signed build issues
> 
> Signed-off-by: Armin Kuster 
> ---
>  recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 ---
>  recipes-tpm/swtpm/files/fix_signed_issue.patch| 48 
> +++
>  recipes-tpm/swtpm/swtpm_1.0.bb| 18 +++--
>  3 files changed, 63 insertions(+), 44 deletions(-)
>  delete mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch
>  create mode 100644 recipes-tpm/swtpm/files/fix_signed_issue.patch
> 
> diff --git a/recipes-tpm/swtpm/files/fix_lib_search_path.patch 
> b/recipes-tpm/swtpm/files/fix_lib_search_path.patch
> deleted file mode 100644
> index 015f418..000
> --- a/recipes-tpm/swtpm/files/fix_lib_search_path.patch
> +++ /dev/null

This patch is still needed when building swtpm-native. I'll add back a
version that applies to latest tip.

> diff --git a/recipes-tpm/swtpm/files/fix_signed_issue.patch 
> b/recipes-tpm/swtpm/files/fix_signed_issue.patch
> new file mode 100644
> index 000..427df62
> --- /dev/null
> +++ b/recipes-tpm/swtpm/files/fix_signed_issue.patch
> @@ -0,0 +1,48 @@
> +Upstream-Status: Pending
> +Signed-off-by Armin Kuster 

[...]

> +Index: git/src/swtpm_ioctl/tpm_ioctl.c
> +===
> +--- git.orig/src/swtpm_ioctl/tpm_ioctl.c
>  git/src/swtpm_ioctl/tpm_ioctl.c
> +@@ -303,7 +303,7 @@ static int do_save_state_blob(int fd, bo
[...]
> + /* no tpm_result here */
> +-printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, 
> cap));
> ++printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, 
> cap));

This is causing an error when building for x86-64:

tpm_ioctl.c:866:9: error: format ‘%llx’ expects argument of type ‘long long 
unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=]
|  printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, 
cap));
|  ^
| cc1: all warnings being treated as errors

If you want, I can fix it as part of my upcoming patches with:

printf("ptm capability is 0x%llx\n", (long long unsigned)devtoh64(is_chardev, 
cap));

-- 
Best Regards, Patrick Ohly

The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.



-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Making header of out-of-tree module available

2017-01-30 Thread colin.helliwell
I have a recipe which builds my own (out-of-tree) driver module - this
packages/installs the module fine. (It's recipe has "inherit module"). 

Now I'm writing a recipe to build a library which uses the driver. What's
needed to get the driver's header file 'exported' so that it can be included
by the library's recipe?

Thanks

 

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Yocto Project Status WW05’17

2017-01-30 Thread Jolley, Stephen K
Current Dev Position: YP 2.3 M3

Next Deadline: YP 2.3 M3 by Feb. 27, 2017


SWAT team rotation: Paul -> Ross on Jan. 27, 2017.

SWAT team rotation: Ross -> Leo on Feb. 3, 2017.

https://wiki.yoctoproject.org/wiki/Yocto_Build_Failure_Swat_Team


Key Status/Updates:

·The recipe specific sysroots changes has caused fallout in various 
areas although given the invasiveness of the change, the fallout so far hasn’t 
been too bad and should be fixable. Master has a number of bug fixes and 
improvements added to help address some of the issues.

·Unfortunately the recipe specific sysroots change does have some 
significant performance implications. Some measures to mitigate these have been 
committed, others are worked on but it seems unlikely we’ll be able to achieve 
the pre-rss performance as the individual sysroots do have some overhead. We’re 
considering disabling/removing .la files as one measure which may gain back 
some performance (since .la files commonly need sed fixups each time a new 
sysroot is generated).

·The 2.2.1 release will now happen after M2.

·Patch merging continues to be slow due to continued failure and 
instability of the ubuntu1404 autobuilder worker (seems to be OS related).

·QA on M2-rc1 is ongoing, nothing blocking has been found as yet but 
the rss fixes in master may be a reason to consider an rc2.


Proposed upcoming dot releases:

YP 2.2.1 Release by Jan. 20, 2017 (Will be after YP 2.3 M2 is out of QA)

YP 2.1.3 Cut off May 8, 2017

YP 2.1.3 Release by May 19, 2017

YP 2.2.2 Cut off May 22, 2017

YP 2.2.2 Release by June 2, 2017


Key YP 2.3 Dates:

YP 2.3 M2 Release is targeted for Feb. 3, 2017

YP 2.3 M3 Cutoff is Feb 27, 2017

YP 2.3 M3 Release is Mar. 10, 2017

YP 2.3 M4 Cutoff is April 3, 2017

YP 2.3 M4 Release is April 28, 2017


Tracking Metrics:

WDD 2630 (last week 2614)

(https://wiki.yoctoproject.org/charts/combo.html)


Key Status Links for YP:

https://wiki.yoctoproject.org/wiki/Yocto_Project_v2.3_Status

https://wiki.yoctoproject.org/wiki/Yocto_2.3_Schedule

https://wiki.yoctoproject.org/wiki/Yocto_2.3_Features

[If anyone has suggestions for other information you’d like to see on this 
weekly status update, let us know!]

Thanks,

Stephen K. Jolley
Yocto Project Program Manager
INTEL, MS JF1-255, 2111 N.E. 25th Avenue, Hillsboro, OR 97124
•   Work Telephone:(503) 712-0534
•Cell:   (208) 244-4460
• Email:stephen.k.jol...@intel.com

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Making header of out-of-tree module available

2017-01-30 Thread Daniel.
You don't, you make your library depends on your driver, and not on kernel
exported headers. In my case I add the header to the -dev package and make
the library compilation depend on kernel module.

# kernel-module-foo.bb
FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"

# libfoo.bb
DEPENDS = "kernel-module-foo"

Cheers

2017-01-30 13:37 GMT-02:00 :

> I have a recipe which builds my own (out-of-tree) driver module – this
> packages/installs the module fine. (It’s recipe has “inherit module”).
>
> Now I’m writing a recipe to build a library which uses the driver. What’s
> needed to get the driver’s header file ‘exported’ so that it can be
> included by the library’s recipe?
>
> Thanks
>
>
>
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>


-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Making header of out-of-tree module available

2017-01-30 Thread colin.helliwell
Thanks Daniel,

I’ve given that a try, but the header isn’t appearing (with ‘bitbake rfctrl’) 
anywhere but the module’s own workdir.

It’s recipe is

 

SUMMARY = " RF driver"

LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

 

inherit module

 

SRC_URI = "file://Makefile \

   file://rfctrl.c \

   file://rfctrl.h \

   file://COPYING \

  "

 

FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"

 

S = "${WORKDIR}"

 

 

With a makefile:

 

obj-m := rfctrl.o

 

SRC := $(shell pwd)

 

all:

$(MAKE) -C $(KERNEL_SRC) M=$(SRC)

 

modules_install:

$(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install

 

clean:

rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c

rm -f Module.markers Module.symvers modules.order

rm -rf .tmp_versions Modules.symvers

 

 

 

From: Daniel. [mailto:danielhi...@gmail.com] 
Sent: 30 January 2017 16:46
To: colin.helliw...@ln-systems.com
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] Making header of out-of-tree module available

 

You don't, you make your library depends on your driver, and not on kernel 
exported headers. In my case I add the header to the -dev package and make the 
library compilation depend on kernel module.

# kernel-module-foo.bb  

FILES_${PN}-dev = "/usr/include/foo/linux/foo.h" 

# libfoo.bb  

DEPENDS = "kernel-module-foo"

Cheers

 

2017-01-30 13:37 GMT-02:00 mailto:colin.helliw...@ln-systems.com> >:

I have a recipe which builds my own (out-of-tree) driver module – this 
packages/installs the module fine. (It’s recipe has “inherit module”). 

Now I’m writing a recipe to build a library which uses the driver. What’s 
needed to get the driver’s header file ‘exported’ so that it can be included by 
the library’s recipe?

Thanks

 


--
___
yocto mailing list
yocto@yoctoproject.org  
https://lists.yoctoproject.org/listinfo/yocto




-- 

"Do or do not. There is no try"
  Yoda Master

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Making header of out-of-tree module available

2017-01-30 Thread Daniel.
do_install_append() {
install -d ${D}/usr/include/nrf24/linux/
install -m 0755 ${S}/include/linux/nrf24.h
${D}/usr/include/nrf24/linux/
}


Try something like this ^

Regards,

2017-01-30 15:05 GMT-02:00 :

> Thanks Daniel,
>
> I’ve given that a try, but the header isn’t appearing (with ‘bitbake
> rfctrl’) anywhere but the module’s own workdir.
>
> It’s recipe is
>
>
>
> SUMMARY = " RF driver"
>
> LICENSE = "GPLv2"
>
> LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
>
>
>
> inherit module
>
>
>
> SRC_URI = "file://Makefile \
>
>file://rfctrl.c \
>
>file://rfctrl.h \
>
>file://COPYING \
>
>   "
>
>
>
> FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"
>
>
>
> S = "${WORKDIR}"
>
>
>
>
>
> With a makefile:
>
>
>
> obj-m := rfctrl.o
>
>
>
> SRC := $(shell pwd)
>
>
>
> all:
>
> $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
>
>
>
> modules_install:
>
> $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
>
>
>
> clean:
>
> rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
>
> rm -f Module.markers Module.symvers modules.order
>
> rm -rf .tmp_versions Modules.symvers
>
>
>
>
>
>
>
> *From:* Daniel. [mailto:danielhi...@gmail.com]
> *Sent:* 30 January 2017 16:46
> *To:* colin.helliw...@ln-systems.com
> *Cc:* yocto@yoctoproject.org
> *Subject:* Re: [yocto] Making header of out-of-tree module available
>
>
>
> You don't, you make your library depends on your driver, and not on kernel
> exported headers. In my case I add the header to the -dev package and make
> the library compilation depend on kernel module.
>
> # kernel-module-foo.bb
>
> FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"
>
> # libfoo.bb
>
> DEPENDS = "kernel-module-foo"
>
> Cheers
>
>
>
> 2017-01-30 13:37 GMT-02:00 :
>
> I have a recipe which builds my own (out-of-tree) driver module – this
> packages/installs the module fine. (It’s recipe has “inherit module”).
>
> Now I’m writing a recipe to build a library which uses the driver. What’s
> needed to get the driver’s header file ‘exported’ so that it can be
> included by the library’s recipe?
>
> Thanks
>
>
>
>
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>
>
>
> --
>
> *"Do or do not. There is no try"*
> *  Yoda Master*
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Making header of out-of-tree module available

2017-01-30 Thread Daniel.
At your kernel-module-.bb

:)

2017-01-30 15:13 GMT-02:00 Daniel. :

> do_install_append() {
> install -d ${D}/usr/include/nrf24/linux/
> install -m 0755 ${S}/include/linux/nrf24.h
> ${D}/usr/include/nrf24/linux/
> }
>
>
> Try something like this ^
>
> Regards,
>
> 2017-01-30 15:05 GMT-02:00 :
>
>> Thanks Daniel,
>>
>> I’ve given that a try, but the header isn’t appearing (with ‘bitbake
>> rfctrl’) anywhere but the module’s own workdir.
>>
>> It’s recipe is
>>
>>
>>
>> SUMMARY = " RF driver"
>>
>> LICENSE = "GPLv2"
>>
>> LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
>>
>>
>>
>> inherit module
>>
>>
>>
>> SRC_URI = "file://Makefile \
>>
>>file://rfctrl.c \
>>
>>file://rfctrl.h \
>>
>>file://COPYING \
>>
>>   "
>>
>>
>>
>> FILES_${PN}-dev = "/usr/include/rfctrl/linux/rfctrl.h"
>>
>>
>>
>> S = "${WORKDIR}"
>>
>>
>>
>>
>>
>> With a makefile:
>>
>>
>>
>> obj-m := rfctrl.o
>>
>>
>>
>> SRC := $(shell pwd)
>>
>>
>>
>> all:
>>
>> $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
>>
>>
>>
>> modules_install:
>>
>> $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install
>>
>>
>>
>> clean:
>>
>> rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
>>
>> rm -f Module.markers Module.symvers modules.order
>>
>> rm -rf .tmp_versions Modules.symvers
>>
>>
>>
>>
>>
>>
>>
>> *From:* Daniel. [mailto:danielhi...@gmail.com]
>> *Sent:* 30 January 2017 16:46
>> *To:* colin.helliw...@ln-systems.com
>> *Cc:* yocto@yoctoproject.org
>> *Subject:* Re: [yocto] Making header of out-of-tree module available
>>
>>
>>
>> You don't, you make your library depends on your driver, and not on
>> kernel exported headers. In my case I add the header to the -dev package
>> and make the library compilation depend on kernel module.
>>
>> # kernel-module-foo.bb
>>
>> FILES_${PN}-dev = "/usr/include/foo/linux/foo.h"
>>
>> # libfoo.bb
>>
>> DEPENDS = "kernel-module-foo"
>>
>> Cheers
>>
>>
>>
>> 2017-01-30 13:37 GMT-02:00 :
>>
>> I have a recipe which builds my own (out-of-tree) driver module – this
>> packages/installs the module fine. (It’s recipe has “inherit module”).
>>
>> Now I’m writing a recipe to build a library which uses the driver. What’s
>> needed to get the driver’s header file ‘exported’ so that it can be
>> included by the library’s recipe?
>>
>> Thanks
>>
>>
>>
>>
>> --
>> ___
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>>
>>
>> --
>>
>> *"Do or do not. There is no try"*
>> *  Yoda Master*
>>
>
>
>
> --
> *"Do or do not. There is no try"*
>   *Yoda Master*
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] Test packages and staging area conflicts

2017-01-30 Thread Daniel.
I've been using testing packages so that they can be built from SCM testing
branches and quickdly deployed to package repository. This makes new
testing releases avaible to software developers and they can installs it by
using package manager. The testing packages are the same as production
packages except that they don't go to the image, they conflict with
production packages (so asking for installing removes the production
package as expected) and they have a -text suffix.

The problem with this aproach is that the testing and production packages
conflict so I face this warnings at each compilation of any of both:

WARNING: The recipe foo-test is trying to install files into a shared area
when those files already exist.

And buil

How to aproach that? Am I doing something stupid?

Regards,

-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Test packages and staging area conflicts

2017-01-30 Thread Daniel.
I'm using this little hack:

do_install[depends] = "${RCONFLICTS_${PN}}:do_cleansstate"

But this seems not right...

Regards,

2017-01-30 17:56 GMT-02:00 Daniel. :

> I've been using testing packages so that they can be built from SCM
> testing branches and quickdly deployed to package repository. This makes
> new testing releases avaible to software developers and they can installs
> it by using package manager. The testing packages are the same as
> production packages except that they don't go to the image, they conflict
> with production packages (so asking for installing removes the production
> package as expected) and they have a -text suffix.
>
> The problem with this aproach is that the testing and production packages
> conflict so I face this warnings at each compilation of any of both:
>
> WARNING: The recipe foo-test is trying to install files into a shared area
> when those files already exist.
>
> And buil
>
> How to aproach that? Am I doing something stupid?
>
> Regards,
>
> --
> *"Do or do not. There is no try"*
>   *Yoda Master*
>



-- 
*"Do or do not. There is no try"*
  *Yoda Master*
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [patchwork][PATCH 0/2] Series-view: Enable status/bundle edition

2017-01-30 Thread Jose Lamego
This changes enable patch status updating, adding a patch to an existing
bundle and creating a new bundle from the series view.

[YOCTO #10973]

Jose Lamego (2):
  series.js: Get patch id and pass it to POST request
  series.py: Add POST call

 htdocs/js/series.js   | 24 --
 patchwork/views/series.py | 84 +--
 2 files changed, 104 insertions(+), 4 deletions(-)

-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [patchwork][PATCH 1/2] series.js: Get patch id and pass it to POST request

2017-01-30 Thread Jose Lamego
Patch forms in series view do not pass selected patch id
as context element during a POST call, so no status/bundle
updates can be performed from such view.

This change includes the selected patch id as a context
element and pass it to POST call through a hidden input field.

[YOCTO #10973]

Signed-off-by: Jose Lamego 
---
 htdocs/js/series.js | 24 ++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/htdocs/js/series.js b/htdocs/js/series.js
index 4f4f477..1795bc3 100644
--- a/htdocs/js/series.js
+++ b/htdocs/js/series.js
@@ -1,5 +1,5 @@
 $(document).ready(function(){
-$('[data-toggle="tooltip"]').tooltip();
+$('[data-toggle="tooltip"]').tooltip()
 revTab=document.getElementById('revs-list')
 coverView=document.getElementById('cover-letter-view'),
 patchView=document.getElementById('patch-view'),
@@ -34,10 +34,30 @@ $(document).ready(function(){
 })
 
 $('.patch-link').on('click', function(){
+var pa=this.getAttribute("data-url")
+var curr_rev=document.getElementById('revs-list').value
+pa=pa.match(/\d+/)[0]
 coverView.style.display='none'
 patchView.style.display='block'
 patchView.innerHTML=
 'Loading patch...'
-$("#patch-view").load(this.getAttribute("data-url") + " #patch-body")
+$("#patch-view").load(
+this.getAttribute("data-url") + " #patch-body", function() {
+forms=document.forms
+for (i=0 i < document.forms.length i++){
+var n=(i + 1)
+var patch_field=document.createElement("input")
+patch_field.type="hidden"
+patch_field.name="patch"
+patch_field.value=pa
+var div=document.createElement("div")
+var this_form=document.forms.item(i)
+if (typeof this_form !== "undefined"){
+this_form.appendChild(div)
+div.appendChild(patch_field)
+}
+}
+}
+)
 })
 })
-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [patchwork][PATCH 2/2] series.py: Add POST call

2017-01-30 Thread Jose Lamego
Current view is missing a POST call, avoiding users to update
or edit patch status or bundles.

This change adds POST call to series view, including the target
patch id, which is taken from request context.

[YOCTO #10973]

Signed-off-by: Jose Lamego 
---
 patchwork/views/series.py | 84 +--
 1 file changed, 82 insertions(+), 2 deletions(-)

diff --git a/patchwork/views/series.py b/patchwork/views/series.py
index 1c14074..0a70232 100644
--- a/patchwork/views/series.py
+++ b/patchwork/views/series.py
@@ -18,9 +18,14 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 from django.conf import settings
-from django.shortcuts import render, get_object_or_404, get_list_or_404
+from django.shortcuts import render, render_to_response
+from django.shortcuts import get_object_or_404, get_list_or_404
+from django.http import HttpResponseForbidden
 from django.views.generic import View
-from patchwork.models import Project, Series, SeriesRevision, TestResult
+from patchwork.models import Patch, Project, Bundle
+from patchwork.models import Series, SeriesRevision, TestResult
+from patchwork.requestcontext import PatchworkRequestContext
+from patchwork.forms import PatchForm, CreateBundleForm
 
 
 class SeriesListView(View):
@@ -53,3 +58,78 @@ class SeriesView(View):
 'cover_letter': revision.cover_letter,
 'revisions': revisions,
 })
+
+def post(self, request, *args, **kwargs):
+init_data = request.POST
+pa_id = init_data.get('patch', None)
+curr_rev = init_data.get('rev', None)
+patch = get_object_or_404(Patch, id=pa_id)
+series = get_object_or_404(Series, pk=kwargs['series'])
+context = PatchworkRequestContext(request)
+context.project = patch.project
+editable = patch.is_editable(request.user)
+
+revisions = get_list_or_404(SeriesRevision, series=series)
+for revision in revisions:
+revision.patch_list = revision.ordered_patches().\
+select_related('state', 'submitter')
+revision.test_results = TestResult.objects \
+.filter(revision=revision, patch=None) \
+.order_by('test__name').select_related('test')
+
+form = None
+createbundleform = None
+
+if editable:
+form = PatchForm(instance=patch)
+if request.user.is_authenticated():
+createbundleform = CreateBundleForm()
+
+if request.method == 'POST':
+action = request.POST.get('action', None)
+if action:
+action = action.lower()
+
+if action == 'createbundle':
+bundle = Bundle(owner=request.user, project=patch.project)
+createbundleform = CreateBundleForm(instance=bundle,
+data=request.POST)
+if createbundleform.is_valid():
+createbundleform.save()
+bundle.append_patch(patch)
+bundle.save()
+createbundleform = CreateBundleForm()
+context.add_message('Bundle %s created' % bundle.name)
+
+elif action == 'addtobundle':
+bundle = get_object_or_404(
+Bundle, id=request.POST.get('bundle_id'))
+try:
+bundle.append_patch(patch)
+bundle.save()
+context.add_message('Patch added to bundle "%s"' %
+bundle.name)
+except Exception as ex:
+context.add_message("Couldn't add patch '%s' to bundle %s:\
+ %s" % (patch.name, bundle.name, ex.message))
+
+# all other actions require edit privs
+elif not editable:
+return HttpResponseForbidden()
+
+elif action is None:
+form = PatchForm(data=request.POST, instance=patch)
+if form.is_valid():
+form.save()
+context.add_message('Patch ID: %s updated' % patch.pk)
+
+context['series'] = series
+context['patchform'] = form
+context['createbundleform'] = createbundleform
+context['project'] = patch.project
+context['revisions'] = revisions
+context['test_results'] = TestResult.objects \
+.filter(revision=None, patch=patch) \
+.order_by('test__name').select_related('test')
+
+return render_to_response('patchwork/series.html', context)
-- 
1.9.1

-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] esdk without using Poky?

2017-01-30 Thread Gary Thomas

On 2017-01-04 14:25, Gary Thomas wrote:

On 2017-01-04 13:54, Patrick Ohly wrote:

On Wed, 2017-01-04 at 12:05 +0100, Gary Thomas wrote:

On 2016-11-04 04:41, Paul Eggleton wrote:

On Wed, 02 Nov 2016 07:25:13 Gary Thomas wrote:

I've tested your patches for this (from the OE-core mailing list)
and I can now build and use the eSDK for my board :-)


Great!


I do have a couple observations/questions:

* I added my missing tool with this line in my local.conf
  TOOLCHAIN_HOST_TASK_append = " nativesdk-ti-cgt-pru"
   Why did this cause many of the nativesdk tools to have to be rebuilt?


So just FYI this will only work for the standard SDK, it's not the right way
to add these tools for the eSDK - in fact it may break the eSDK due to
bringing things into the native sysroot that shouldn't be there.

At the moment I think the only way to properly add this to the eSDK is to do
this:

SDK_TARGETS += "ti-cgt-pru-native:do_populate_sysroot"

We don't document this, and it's a little awkward in any case. I'll work on
it.


This was working great for me until I just upgraded to the latest [poky]
master (rev dbb247cac5fbf7b037e4955f9793828451723924).  With the SDK_TARGETS
line in my local.conf, I get this error:

ERROR: Error for 
/local/poky-cutting-edge/meta-rainier-am335x-p8701/packages/images/magicard-demo-image_1.0.bb,
dependency ti-cgt-pru-native:do_populate_sysroot:do_populate_sysroot

   ^^^


 does not contain exactly one ':' character.
  Task 'rdepends' should be specified in the form 'packagename:task'

Any ideas what changed and how I get it working again?


I enhanced the error checking, and the rdepends varflag in your example
indeed isn't valid. ":do_populate_sysroot" got appended twice to the
recipe name. That error got ignored silently earlier.

populate_sdk_ext.bbclass appends ":do_populate_sysroot" when setting
do_sdk_depends[rdepends], so you should use just:

   SDK_TARGETS += "ti-cgt-pru-native"



Thanks that worked - at least I can build, I haven't checked the esdk yet.



Sadly, this is broken once again.  I just upgraded my Poky/Yocto
to rev d45d4a5a21ab4209b87331dddf515ecdb62367fa and if I have the
  SDK_TARGETS += "ti-cgt-pru-native"
in my local.conf, I get this hard error:

ERROR: Task do_sdk_depends in 
/home/gary/tmp/p8701_2017-01-31/opt/amltd/poky/meta-rainier-am335x-p8701/packages/images/installer-image.bb rdepends 
upon non-existent task do_package_write_ipk in 
virtual:native:/home/gary/tmp/p8701_2017-01-31/opt/amltd/poky/meta-ti/recipes-ti/devtools/ti-cgt-pru_2.1.1.bb

ERROR: Command execution failed: 1

Any ideas how to proceed?

Thanks

--

Gary Thomas |  Consulting for the
MLB Associates  |Embedded world

--
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 0/8] tpm: virtual TPM for qemu

2017-01-30 Thread Patrick Ohly
I recently started using swtpm-native in combination with the qemu-tpm
patches to simulate a virtual TPM chip in qemu. The qemu-tpm patches
should go into OE-core, but currently usage is a bit cumbersome
(requires root privileges and manually starting swtpm before each
runqemu invocation), so at this time I only consider the meta-security
changes ready and useful enough for merging.

Inside the virtual machine I used tpm-tools + trousers to set up
sealed keys for EVM, which required fixing a few things.

These patches were based on Armin's swtpm+trousers version update
series which needs to be merged first to avoid merge conflicts.

Patrick Ohly (8):
  trousers: missing libtspi.so.1 in libtspi package
  trousers: recommend tcsd
  trousers: tcsd.conf must be owned tss:tss
  swtpm: enable native and nativesdk flavors
  swtpm: depends on tpm-tools
  swtpm: fix compiler format warning
  swtpm: cuse packageconfig
  swtpm-wrappers: simplify using swtpm-native

 recipes-tpm/swtpm/files/fix_lib_search_path.patch | 64 -
 recipes-tpm/swtpm/files/fix_signed_issue.patch|  2 +-
 recipes-tpm/swtpm/swtpm-wrappers.bb   | 41 ++-
 recipes-tpm/swtpm/swtpm_1.0.bb| 12 ++-
 recipes-tpm/trousers/trousers_git.bb  |  7 +-
 5 files changed, 121 insertions(+), 5 deletions(-)
 create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch
 create mode 100644 recipes-tpm/swtpm/swtpm-wrappers.bb

base-commit: 6787dd986122cd6420b1f348c4550a42ed596f57
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 1/8] trousers: missing libtspi.so.1 in libtspi package

2017-01-30 Thread Patrick Ohly
The soname of libtspi.so is "libtspi.so.1" and therefore apps
linked against that library depend on the libtspi.so.1 symlink
to find the library.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/trousers/trousers_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-tpm/trousers/trousers_git.bb 
b/recipes-tpm/trousers/trousers_git.bb
index 1dedd7c..0a7e5b6 100644
--- a/recipes-tpm/trousers/trousers_git.bb
+++ b/recipes-tpm/trousers/trousers_git.bb
@@ -57,6 +57,7 @@ PACKAGES = " \
"
 
 FILES_libtspi = " \
+   ${libdir}/*.so.1 \
${libdir}/*.so.1.2.0 \
"
 FILES_libtspi-dbg = " \
@@ -69,7 +70,6 @@ FILES_libtspi-dbg = " \
 FILES_libtspi-dev = " \
${includedir} \
${libdir}/*.so \
-   ${libdir}/*.so.1 \
"
 FILES_libtspi-doc = " \
${mandir}/man3 \
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 2/8] trousers: recommend tcsd

2017-01-30 Thread Patrick Ohly
Installing tpm-tools for tools like tpm_takeown pull in the libtspi
package, but the resulting system is not functional unless the tcsd
(from the main "trousers" package) also gets installed. A RRECOMMENDS
entry for that takes care of that automatically.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/trousers/trousers_git.bb | 4 
 1 file changed, 4 insertions(+)

diff --git a/recipes-tpm/trousers/trousers_git.bb 
b/recipes-tpm/trousers/trousers_git.bb
index 0a7e5b6..5737de3 100644
--- a/recipes-tpm/trousers/trousers_git.bb
+++ b/recipes-tpm/trousers/trousers_git.bb
@@ -56,6 +56,10 @@ PACKAGES = " \
trousers-doc \
"
 
+# libtspi needs tcsd for most (all?) operations, so suggest to
+# install that.
+RRECOMMENDS_libtspi = "${PN}"
+
 FILES_libtspi = " \
${libdir}/*.so.1 \
${libdir}/*.so.1.2.0 \
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 3/8] trousers: tcsd.conf must be owned tss:tss

2017-01-30 Thread Patrick Ohly
The upstream dist/Makefile.am ensures that /etc/tcsd.conf
is owned by tss:tss, and that must not be changed because
otherwise tcsd refuses to start.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/trousers/trousers_git.bb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/recipes-tpm/trousers/trousers_git.bb 
b/recipes-tpm/trousers/trousers_git.bb
index 5737de3..a256bfa 100644
--- a/recipes-tpm/trousers/trousers_git.bb
+++ b/recipes-tpm/trousers/trousers_git.bb
@@ -39,7 +39,6 @@ do_install_append() {
 install -m 0644 ${WORKDIR}/tcsd.service ${D}${systemd_unitdir}/system/
 sed -i -e 's#@SBINDIR@#${sbindir}#g' 
${D}${systemd_unitdir}/system/tcsd.service
 fi
-chown -R root:root ${D}${sysconfdir}/tcsd.conf
 }
 
 CONFFILES_${PN} += "${sysconfig}/tcsd.conf"
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 4/8] swtpm: enable native and nativesdk flavors

2017-01-30 Thread Patrick Ohly
For use with qemu-tpm as described in the swtpm main README, swtpm
must be compiled natively. nativesdk is added just in case that
someone wants to add this to an SDK.

The fix_lib_search_path.patch was recently removed during the version
update, but it is still needed when building natively. Here's a
version that applies cleanly again.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/swtpm/files/fix_lib_search_path.patch | 64 -
 recipes-tpm/swtpm/swtpm_1.0.bb|  3 +-
 2 files changed, 67 insertions(+)
 create mode 100644 recipes-tpm/swtpm/files/fix_lib_search_path.patch

diff --git a/recipes-tpm/swtpm/files/fix_lib_search_path.patch 
b/recipes-tpm/swtpm/files/fix_lib_search_path.patch
new file mode 100644
index 000..28aca4a
--- /dev/null
+++ b/recipes-tpm/swtpm/files/fix_lib_search_path.patch
@@ -0,0 +1,64 @@
+From 85706ceb6877ade3b589d3c390abf5b3492bb718 Mon Sep 17 00:00:00 2001
+From: Armin Kuster 
+Date: Thu, 13 Oct 2016 02:03:56 -0700
+Subject: [PATCH] swtpm: add new package
+
+Upstream-Status: Inappropriate [OE config]
+
+Signed-off-by: Armin Kuster 
+
+Rebased to current tip.
+
+Signed-off-by: Patrick Ohly 
+
+---
+ configure.ac | 32 ++--
+ 1 file changed, 10 insertions(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c4a9c6d..6267f64 100644
+--- a/configure.ac
 b/configure.ac
+@@ -395,29 +395,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-security"
+ dnl We have to make sure libtpms is using the same crypto library
+ dnl to avoid problems
+ AC_MSG_CHECKING([the crypto library libtpms is using])
+-dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \
+-   sed -n '/SEARCH_DIR/p' | \
+-   sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g')
+-for dir in $dirs $LIBRARY_PATH; do
+-  if test -r $dir/libtpms.so; then
+-if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
+-  libtpms_cryptolib="openssl"
+-  break
+-fi
+-if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
+-  libtpms_cryptolib="freebl"
+-  break
+-fi
++dir="$SEARCH_DIR"
++if test -r $dir/libtpms.so; then
++  if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then
++libtpms_cryptolib="openssl"
++break
+   fi
+-  case $host_os in
+-  cygwin)
+-if test -r $dir/libtpms.a; then
+-  if test -n "$(nm $dir/libtpms.a | grep "U AES_encrypt")"; then
+-libtpms_cryptolib="openssl"
+-  fi
+-fi
+-  esac
+-done
++  if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then
++libtpms_cryptolib="freebl"
++break
++  fi
++fi
+ 
+ if test -z "$libtpms_cryptolib"; then
+   AC_MSG_ERROR([Could not determine libtpms crypto library.])
+-- 
+2.1.4
+
diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb
index 27b4b8c..d5a2a58 100644
--- a/recipes-tpm/swtpm/swtpm_1.0.bb
+++ b/recipes-tpm/swtpm/swtpm_1.0.bb
@@ -9,6 +9,7 @@ SRCREV = "ca906a02124d0ed8b6194e845d272d23ee394a34"
 SRC_URI = " \
git://github.com/stefanberger/swtpm.git \
file://fix_signed_issue.patch \
+   file://fix_lib_search_path.patch \
"
 
 S = "${WORKDIR}/git"
@@ -45,3 +46,5 @@ USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir  \
 --no-create-home  --shell /bin/false ${BPN}"
 
 RDEPENDS_${PN} = "libtpm expect socat bash"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 5/8] swtpm: depends on tpm-tools

2017-01-30 Thread Patrick Ohly
The configure script checks for tpm_nvdefine from tpm-tools and fails
when it is not present.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/swtpm/swtpm_1.0.bb | 5 +
 1 file changed, 5 insertions(+)

diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb
index d5a2a58..5283f5d 100644
--- a/recipes-tpm/swtpm/swtpm_1.0.bb
+++ b/recipes-tpm/swtpm/swtpm_1.0.bb
@@ -5,6 +5,11 @@ SECTION = "apps"
 
 DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm libtpm-native"
 
+# configure checks for the tools already during compilation and
+# then swtpm_setup needs them at runtime
+DEPENDS += "tpm-tools-native"
+RDEPENDS_${PN} += "tpm-tools"
+
 SRCREV = "ca906a02124d0ed8b6194e845d272d23ee394a34"
 SRC_URI = " \
git://github.com/stefanberger/swtpm.git \
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 7/8] swtpm: cuse packageconfig

2017-01-30 Thread Patrick Ohly
The CUSE support in swtpm does not depend on selinux. It is needed
for simulating a virtual TPM, one of the use cases for swtpm-native, so
enable it by default.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/swtpm/swtpm_1.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb
index 5283f5d..0733adc 100644
--- a/recipes-tpm/swtpm/swtpm_1.0.bb
+++ b/recipes-tpm/swtpm/swtpm_1.0.bb
@@ -25,12 +25,12 @@ PARALLEL_MAKE = ""
 TSS_USER="tss"
 TSS_GROUP="tss"
 
-PACKAGECONFIG ?= "openssl"
+PACKAGECONFIG ?= "openssl cuse"
 PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 
'selinux', '', d)}"
 PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
 PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
 PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux"
-PACKAGECONFIG[cuse] = "--with-cuse, --without-cuse, libselinux"
+PACKAGECONFIG[cuse] = "--with-cuse, --without-cuse"
 
 EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}"
 
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 6/8] swtpm: fix compiler format warning

2017-01-30 Thread Patrick Ohly
When building for x86-64, gcc complains:

tpm_ioctl.c:866:9: error: format ‘%llx’ expects argument of type ‘long long 
unsigned int’, but argument 2 has type ‘long unsigned int’ [-Werror=format=]
|  printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, 
cap));
|  ^
| cc1: all warnings being treated as errors

Casting to "long long unsigned" matches the format specifier in all
cases, including those where "long long" is larger than 64 bits.

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/swtpm/files/fix_signed_issue.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/recipes-tpm/swtpm/files/fix_signed_issue.patch 
b/recipes-tpm/swtpm/files/fix_signed_issue.patch
index 427df62..140585b 100644
--- a/recipes-tpm/swtpm/files/fix_signed_issue.patch
+++ b/recipes-tpm/swtpm/files/fix_signed_issue.patch
@@ -42,7 +42,7 @@ Index: git/src/swtpm_ioctl/tpm_ioctl.c
  }
  /* no tpm_result here */
 -printf("ptm capability is 0x%lx\n", (uint64_t)devtoh64(is_chardev, 
cap));
-+printf("ptm capability is 0x%llx\n", (uint64_t)devtoh64(is_chardev, 
cap));
++printf("ptm capability is 0x%llx\n", (long long 
unsigned)devtoh64(is_chardev, cap));
  
  } else if (!strcmp(command, "-i")) {
  init.u.req.init_flags = htodev32(is_chardev, 
PTM_INIT_FLAG_DELETE_VOLATILE);
-- 
git-series 0.9.1
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] [meta-security][PATCH 8/8] swtpm-wrappers: simplify using swtpm-native

2017-01-30 Thread Patrick Ohly
Native tools exist in recipe specific sysroots and are normally
not meant to be called from outside a build. But that's what we
need to do when using swtpm-native together with qemu, so these
wrappers make that possible by setting up the necessary environment
and hiding the internal paths.

Invoking swtpm_setup.sh gets some special support: swtpm_setup.sh runs
two daemons, tcsd and swtpm, of which tcsd insists on running as root
or tss. In practice, running as the normal user is perfectly
fine. Instead of patching the upstream source code, the approach take
here is to run under pseudo.

Usage examples:

$ bitbake swtpm-wrappers
$ mkdir -p my-machine/myvtpm0
$ tmp-glibc/work/x86_64-linux/swtpm-wrappers/1.0-r0/swtpm_setup_oe.sh 
--tpm-state my-machine/myvtpm0
Starting vTPM manufacturing as root:root @ Mon 16 Jan 2017 04:09:21 PM CET
TPM is listening on TCP port 55675.
-rw--- 1 root root 65 Jan 16 16:09 /tmp/tmp.2yJBKTTwRk
Ending vTPM manufacturing @ Mon 16 Jan 2017 04:09:21 PM CET

The resulting "my-machine/myvtpm0" can then be used with swtpm (this time,
it really has to be running as root because it uses CUSES to create /dev/vtpm0)
and qemu-tpm (patches not currently in OE-core, have to be applied manually):

$ sudo env TPM_DIR=my-machine/myvtpm0 
tmp-glibc/work/x86_64-linux/swtpm-wrappers/1.0-r0/swtpm_cuse_oe.sh -n vtpm0
$ sudo chmod a+rw /dev/vtpm0
$ runqemu ... 'qemuparams=-tpmdev cuse-tpm,id=tpm0,path=/dev/vtpm0 -device 
tpm-tis,tpmdev=tpm0'

Signed-off-by: Patrick Ohly 
---
 recipes-tpm/swtpm/swtpm-wrappers.bb | 41 ++-
 1 file changed, 41 insertions(+)
 create mode 100644 recipes-tpm/swtpm/swtpm-wrappers.bb

diff --git a/recipes-tpm/swtpm/swtpm-wrappers.bb 
b/recipes-tpm/swtpm/swtpm-wrappers.bb
new file mode 100644
index 000..676c35e
--- /dev/null
+++ b/recipes-tpm/swtpm/swtpm-wrappers.bb
@@ -0,0 +1,41 @@
+SUMMARY = "SWTPM - OpenEmbedded wrapper scripts for native swtpm tools"
+LICENSE = "MIT"
+DEPENDS = "swtpm-native tpm-tools-native"
+
+inherit native
+
+# The whole point of the recipe is to make files available
+# for use after the build is done, so don't clean up...
+RM_WORK_EXCLUDE += "${PN}"
+
+do_create_wrapper () {
+cat >${WORKDIR}/swtpm_setup_oe.sh <${WORKDIR}/swtpm_cuse_oe.sh