Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: version of gdb in morty
From: Alexander Kanavin @ 2016-11-03 13:32 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <CAMKF1sp2Bft-bhJqT_C0siXFiHJyT8ouqoNQ2vmt-XGnJqw9Wg@mail.gmail.com>

On 11/03/2016 02:27 AM, Khem Raj wrote:
> I think doing an upgrade to 7.11.1 and Backporting that to morty is a
> reasonable option here

Update to 7.12 for master branch please.

Alex



^ permalink raw reply

* Re: [PATCH] gdb: update 7.11+git1a982b689c -> 7.11.1
From: Alexander Kanavin @ 2016-11-03 13:31 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1478127423-4954-1-git-send-email-armccurdy@gmail.com>

On 11/03/2016 12:57 AM, Andre McCurdy wrote:
>   41d8236 Set GDB version number to 7.11.1.

Master branch of oe-core should be updated to the latest release of gdb, 
which is 7.12 at the moment. This patch is fine for morty though.

Alex



^ permalink raw reply

* [krogoth][PATCH 2/2] qemu: Security fix CVE-2016-4952
From: Adrian Dudau @ 2016-11-03 13:18 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <1478179081-34596-1-git-send-email-adrian.dudau@enea.com>

affects qemu < 2.7.0

Quick Emulator(Qemu) built with the VMWARE PVSCSI paravirtual SCSI bus
emulation support is vulnerable to an OOB r/w access issue. It could
occur while processing SCSI commands 'PVSCSI_CMD_SETUP_RINGS' or
'PVSCSI_CMD_SETUP_MSG_RING'.

A privileged user inside guest could use this flaw to crash the Qemu
process resulting in DoS.

References:
----------
http://www.openwall.com/lists/oss-security/2016/05/23/1

Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
---
 .../recipes-devtools/qemu/qemu/CVE-2016-4952.patch | 105 +++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_2.5.0.bb           |   1 +
 2 files changed, 106 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/qemu/CVE-2016-4952.patch

diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2016-4952.patch b/meta/recipes-devtools/qemu/qemu/CVE-2016-4952.patch
new file mode 100644
index 0000000..52d2a1e
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/CVE-2016-4952.patch
@@ -0,0 +1,105 @@
+From 3e831b40e015ba34dfb55ff11f767001839425ff Mon Sep 17 00:00:00 2001
+From: Prasad J Pandit <pjp@fedoraproject.org>
+Date: Mon, 23 May 2016 16:18:05 +0530
+Subject: [PATCH] scsi: pvscsi: check command descriptor ring buffer size (CVE-2016-4952)
+
+Vmware Paravirtual SCSI emulation uses command descriptors to
+process SCSI commands. These descriptors come with their ring
+buffers. A guest could set the ring buffer size to an arbitrary
+value leading to OOB access issue. Add check to avoid it.
+
+Upstream-Status: Backported
+
+Reported-by: Li Qiang <liqiang6-s@360.cn>
+Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
+Cc: qemu-stable@nongnu.org
+Message-Id: <1464000485-27041-1-git-send-email-ppandit@redhat.com>
+Reviewed-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
+Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
+---
+ hw/scsi/vmw_pvscsi.c |   24 ++++++++++++++++++++----
+ 1 files changed, 20 insertions(+), 4 deletions(-)
+
+diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
+index f67b5bf..2d7528d 100644
+--- a/hw/scsi/vmw_pvscsi.c
++++ b/hw/scsi/vmw_pvscsi.c
+@@ -153,7 +153,7 @@ pvscsi_log2(uint32_t input)
+     return log;
+ }
+ 
+-static void
++static int
+ pvscsi_ring_init_data(PVSCSIRingInfo *m, PVSCSICmdDescSetupRings *ri)
+ {
+     int i;
+@@ -161,6 +161,10 @@ pvscsi_ring_init_data(PVSCSIRingInfo *m, PVSCSICmdDescSetupRings *ri)
+     uint32_t req_ring_size, cmp_ring_size;
+     m->rs_pa = ri->ringsStatePPN << VMW_PAGE_SHIFT;
+ 
++    if ((ri->reqRingNumPages > PVSCSI_SETUP_RINGS_MAX_NUM_PAGES)
++        || (ri->cmpRingNumPages > PVSCSI_SETUP_RINGS_MAX_NUM_PAGES)) {
++        return -1;
++    }
+     req_ring_size = ri->reqRingNumPages * PVSCSI_MAX_NUM_REQ_ENTRIES_PER_PAGE;
+     cmp_ring_size = ri->cmpRingNumPages * PVSCSI_MAX_NUM_CMP_ENTRIES_PER_PAGE;
+     txr_len_log2 = pvscsi_log2(req_ring_size - 1);
+@@ -192,15 +196,20 @@ pvscsi_ring_init_data(PVSCSIRingInfo *m, PVSCSICmdDescSetupRings *ri)
+ 
+     /* Flush ring state page changes */
+     smp_wmb();
++
++    return 0;
+ }
+ 
+-static void
++static int
+ pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSetupMsgRing *ri)
+ {
+     int i;
+     uint32_t len_log2;
+     uint32_t ring_size;
+ 
++    if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) {
++        return -1;
++    }
+     ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE;
+     len_log2 = pvscsi_log2(ring_size - 1);
+ 
+@@ -220,6 +229,8 @@ pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSetupMsgRing *ri)
+ 
+     /* Flush ring state page changes */
+     smp_wmb();
++
++    return 0;
+ }
+ 
+ static void
+@@ -770,7 +781,10 @@ pvscsi_on_cmd_setup_rings(PVSCSIState *s)
+     trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_RINGS");
+ 
+     pvscsi_dbg_dump_tx_rings_config(rc);
+-    pvscsi_ring_init_data(&s->rings, rc);
++    if (pvscsi_ring_init_data(&s->rings, rc) < 0) {
++        return PVSCSI_COMMAND_PROCESSING_FAILED;
++    }
++
+     s->rings_info_valid = TRUE;
+     return PVSCSI_COMMAND_PROCESSING_SUCCEEDED;
+ }
+@@ -850,7 +864,9 @@ pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s)
+     }
+ 
+     if (s->rings_info_valid) {
+-        pvscsi_ring_init_msg(&s->rings, rc);
++        if (pvscsi_ring_init_msg(&s->rings, rc) < 0) {
++            return PVSCSI_COMMAND_PROCESSING_FAILED;
++        }
+         s->msg_ring_info_valid = TRUE;
+     }
+     return sizeof(PVSCSICmdDescSetupMsgRing) / sizeof(uint32_t);
+-- 
+1.7.0.4
+
diff --git a/meta/recipes-devtools/qemu/qemu_2.5.0.bb b/meta/recipes-devtools/qemu/qemu_2.5.0.bb
index 58902b1..b965f69 100644
--- a/meta/recipes-devtools/qemu/qemu_2.5.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_2.5.0.bb
@@ -27,6 +27,7 @@ SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
             file://CVE-2016-4002.patch \
             file://CVE-2016-5403.patch \
             file://CVE-2016-4441.patch \
+            file://CVE-2016-4952.patch \
            "
 SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
 SRC_URI[md5sum] = "f469f2330bbe76e3e39db10e9ac4f8db"
-- 
1.9.1



^ permalink raw reply related

* [PATCH 3/3] linux-yocto/4.1: update to v4.1.35
From: Bruce Ashfield @ 2016-11-03 13:25 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core
In-Reply-To: <cover.1478179369.git.bruce.ashfield@windriver.com>

Updating to the korg -stable release.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto_4.1.bb      | 20 ++++++++++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
index b95fb5857725..d15a4dcb195d 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
@@ -11,13 +11,13 @@ python () {
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
-SRCREV_machine ?= "966ddde490030166010c5770f8f86cdd0e961c76"
-SRCREV_meta ?= "3c3197e65b6f2f5514853c1fe78ae8ffc131b02c"
+SRCREV_machine ?= "5395c3b5960ec1b769c0716f2889ef1101b66588"
+SRCREV_meta ?= "89785d2b18fa49233046125fddee8e161c8bec4d"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.1.33"
+LINUX_VERSION ?= "4.1.35"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
index ba01702cb63e..5d5e1fa945b9 100644
--- a/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
@@ -4,13 +4,13 @@ KCONFIG_MODE = "--allnoconfig"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-LINUX_VERSION ?= "4.1.33"
+LINUX_VERSION ?= "4.1.35"
 
 KMETA = "kernel-meta"
 KCONF_BSP_AUDIT_LEVEL = "2"
 
-SRCREV_machine ?= "f4d0900b2851e829e990e0f64b09ed3b8e355fae"
-SRCREV_meta ?= "3c3197e65b6f2f5514853c1fe78ae8ffc131b02c"
+SRCREV_machine ?= "f358ce2569953d18cf6bd91d0269076938e5b091"
+SRCREV_meta ?= "89785d2b18fa49233046125fddee8e161c8bec4d"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.1.bb b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
index 788a8eaaa8be..529c20737238 100644
--- a/meta/recipes-kernel/linux/linux-yocto_4.1.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
@@ -11,20 +11,20 @@ KBRANCH_qemux86  ?= "standard/base"
 KBRANCH_qemux86-64 ?= "standard/base"
 KBRANCH_qemumips64 ?= "standard/mti-malta64"
 
-SRCREV_machine_qemuarm ?= "d67ef485ce1420df11bda2d9f6fb78ef50c1adff"
-SRCREV_machine_qemuarm64 ?= "f4d0900b2851e829e990e0f64b09ed3b8e355fae"
-SRCREV_machine_qemumips ?= "65116339cfd210990c9c4710cdfec3ebd59abb0e"
-SRCREV_machine_qemuppc ?= "30816907653b57f1f3d5f9a7a2f6339bab14a680"
-SRCREV_machine_qemux86 ?= "f4d0900b2851e829e990e0f64b09ed3b8e355fae"
-SRCREV_machine_qemux86-64 ?= "f4d0900b2851e829e990e0f64b09ed3b8e355fae"
-SRCREV_machine_qemumips64 ?= "f7a0b532b6ac81757d85b0c9a928f45a87c9e364"
-SRCREV_machine ?= "f4d0900b2851e829e990e0f64b09ed3b8e355fae"
-SRCREV_meta ?= "3c3197e65b6f2f5514853c1fe78ae8ffc131b02c"
+SRCREV_machine_qemuarm ?= "bb6c714397ab4c48f4fcc76c0a609afbb42dfa2a"
+SRCREV_machine_qemuarm64 ?= "f358ce2569953d18cf6bd91d0269076938e5b091"
+SRCREV_machine_qemumips ?= "4a42cbc6464c592a8ce81cf9aefb780df02e10ac"
+SRCREV_machine_qemuppc ?= "f0ecbfc7c5c24f0ecdd05e3304f0bea302ed116c"
+SRCREV_machine_qemux86 ?= "f358ce2569953d18cf6bd91d0269076938e5b091"
+SRCREV_machine_qemux86-64 ?= "f358ce2569953d18cf6bd91d0269076938e5b091"
+SRCREV_machine_qemumips64 ?= "9162b0e9523407b638a3f7e2ed26450334e24969"
+SRCREV_machine ?= "f358ce2569953d18cf6bd91d0269076938e5b091"
+SRCREV_meta ?= "89785d2b18fa49233046125fddee8e161c8bec4d"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.1.33"
+LINUX_VERSION ?= "4.1.35"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
-- 
2.5.0



^ permalink raw reply related

* [PATCH 2/3] linux-yocto/4.4: update to v4.4.30
From: Bruce Ashfield @ 2016-11-03 13:25 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core
In-Reply-To: <cover.1478179369.git.bruce.ashfield@windriver.com>

Updating to the korg -stable release.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto_4.4.bb      | 20 ++++++++++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
index 6c1138277e54..27a4fa36bcd3 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb
@@ -11,13 +11,13 @@ python () {
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
-SRCREV_machine ?= "652b564985db555b549ef73405aea6c38919eefc"
-SRCREV_meta ?= "3030330b066a33ce21164a8b30d0503cf9f68e5b"
+SRCREV_machine ?= "634050bef6cb967f654a62557bc18dd620bf2e95"
+SRCREV_meta ?= "d2d1decbd11e8f78b1aee36605d3653015d710e5"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.4.26"
+LINUX_VERSION ?= "4.4.30"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
index 76c41639c0d2..7e4fca43f3e8 100644
--- a/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb
@@ -4,13 +4,13 @@ KCONFIG_MODE = "--allnoconfig"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-LINUX_VERSION ?= "4.4.26"
+LINUX_VERSION ?= "4.4.30"
 
 KMETA = "kernel-meta"
 KCONF_BSP_AUDIT_LEVEL = "2"
 
-SRCREV_machine ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_meta ?= "3030330b066a33ce21164a8b30d0503cf9f68e5b"
+SRCREV_machine ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_meta ?= "d2d1decbd11e8f78b1aee36605d3653015d710e5"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.4.bb b/meta/recipes-kernel/linux/linux-yocto_4.4.bb
index e3a3d901d1b2..0678448f054c 100644
--- a/meta/recipes-kernel/linux/linux-yocto_4.4.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_4.4.bb
@@ -11,20 +11,20 @@ KBRANCH_qemux86  ?= "standard/base"
 KBRANCH_qemux86-64 ?= "standard/base"
 KBRANCH_qemumips64 ?= "standard/mti-malta64"
 
-SRCREV_machine_qemuarm ?= "187bcc13f3023c3ae0a3ba5c69ae85c4e5e693ac"
-SRCREV_machine_qemuarm64 ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_machine_qemumips ?= "2f273556495dd2871f08c73fc3f40d1ad546c638"
-SRCREV_machine_qemuppc ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_machine_qemux86 ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_machine_qemux86-64 ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_machine_qemumips64 ?= "0a19cacf5738876666a4b530a9fa14f05b355299"
-SRCREV_machine ?= "ca6a08bd7f86ebef11f763d26f787f7d65270473"
-SRCREV_meta ?= "3030330b066a33ce21164a8b30d0503cf9f68e5b"
+SRCREV_machine_qemuarm ?= "d752c82364bf890681c161d80717d174419e7512"
+SRCREV_machine_qemuarm64 ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_machine_qemumips ?= "ebf27c56cf862b2d5fd08e229e027b5e4dff3609"
+SRCREV_machine_qemuppc ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_machine_qemux86 ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_machine_qemux86-64 ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_machine_qemumips64 ?= "de5b483095712c0c347689ef98e2a9b95bed4c7a"
+SRCREV_machine ?= "3c15255fd62c2202d76b5c110265f16d33010b9d"
+SRCREV_meta ?= "d2d1decbd11e8f78b1aee36605d3653015d710e5"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.4.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.4;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.4.26"
+LINUX_VERSION ?= "4.4.30"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
-- 
2.5.0



^ permalink raw reply related

* [PATCH 1/3] linux-yocto/4.8: update to 4.8.6
From: Bruce Ashfield @ 2016-11-03 13:25 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core
In-Reply-To: <cover.1478179369.git.bruce.ashfield@windriver.com>

Integrating the korg -stable release.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto_4.8.bb      | 20 ++++++++++----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb b/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb
index e51c9cdcca0e..26b309d8b8f4 100644
--- a/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb
@@ -11,13 +11,13 @@ python () {
         raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-rt to enable it")
 }
 
-SRCREV_machine ?= "4057556c041f6aac0d29aa3425587d414c9a0090"
-SRCREV_meta ?= "83110d94edeb856a3667b62903ed4ae91c24117d"
+SRCREV_machine ?= "b99b6fac437104e206d30540a5cb12103049af1e"
+SRCREV_meta ?= "87e5fc8b7cb387f197cdd098cdde4e96e9e8ed0d"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.8.git;branch=${KBRANCH};name=machine \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.8;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.8.3"
+LINUX_VERSION ?= "4.8.6"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb
index c8ddbd93dc7f..63dd11baa19e 100644
--- a/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb
@@ -4,13 +4,13 @@ KCONFIG_MODE = "--allnoconfig"
 
 require recipes-kernel/linux/linux-yocto.inc
 
-LINUX_VERSION ?= "4.8.3"
+LINUX_VERSION ?= "4.8.6"
 
 KMETA = "kernel-meta"
 KCONF_BSP_AUDIT_LEVEL = "2"
 
-SRCREV_machine ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_meta ?= "83110d94edeb856a3667b62903ed4ae91c24117d"
+SRCREV_machine ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_meta ?= "87e5fc8b7cb387f197cdd098cdde4e96e9e8ed0d"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.8.bb b/meta/recipes-kernel/linux/linux-yocto_4.8.bb
index 13778b9c4db6..03691982b1f0 100644
--- a/meta/recipes-kernel/linux/linux-yocto_4.8.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_4.8.bb
@@ -11,20 +11,20 @@ KBRANCH_qemux86  ?= "standard/base"
 KBRANCH_qemux86-64 ?= "standard/base"
 KBRANCH_qemumips64 ?= "standard/mti-malta64"
 
-SRCREV_machine_qemuarm ?= "4cc544ad09ad704322cb66fe4ba197a6a05dc71f"
-SRCREV_machine_qemuarm64 ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_machine_qemumips ?= "c285969d4f9376a671167ecf397578c8ad3e6a75"
-SRCREV_machine_qemuppc ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_machine_qemux86 ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_machine_qemux86-64 ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_machine_qemumips64 ?= "64f96ba530e58456070f26b0f3fcce3f64988b72"
-SRCREV_machine ?= "1adf9d36338dc3c63cdbf6f98bcbdc7bba42a794"
-SRCREV_meta ?= "83110d94edeb856a3667b62903ed4ae91c24117d"
+SRCREV_machine_qemuarm ?= "94d3e8675e2fcb09f29814a33ccf79df06149104"
+SRCREV_machine_qemuarm64 ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_machine_qemumips ?= "046ff6344eee25dcc0eea1214e0ad8771ddfabfb"
+SRCREV_machine_qemuppc ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_machine_qemux86 ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_machine_qemux86-64 ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_machine_qemumips64 ?= "edcb167f91abc071cc98cbd762418ff7ab9d839b"
+SRCREV_machine ?= "9d5f74f941c3ca234f58ff8e539f5ca64458c0a7"
+SRCREV_meta ?= "87e5fc8b7cb387f197cdd098cdde4e96e9e8ed0d"
 
 SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.8.git;name=machine;branch=${KBRANCH}; \
            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.8;destsuffix=${KMETA}"
 
-LINUX_VERSION ?= "4.8.3"
+LINUX_VERSION ?= "4.8.6"
 
 PV = "${LINUX_VERSION}+git${SRCPV}"
 
-- 
2.5.0



^ permalink raw reply related

* [PATCH 0/3] linux-yocto: -stable updates
From: Bruce Ashfield @ 2016-11-03 13:25 UTC (permalink / raw)
  To: richard.purdie; +Cc: openembedded-core

Hi all,

Here are some -stable updates to the 4.1, 4.4 and 4.8 kernel tree. I did build
and boot tests for the arches for the different version and also selected -rt
boot tests.

It is a lot of combinations to cover, but I don't expect any major issues.

Any of these SRCREV updates are good for backporting to the various release
branches, since they are bugfix only.

Cheers,

Bruce

The following changes since commit c3d2df883a9d6d5036277114339673656d89a728:

  oeqa/selftest/kernel.py: Add new file destined for kernel related tests (2016-11-01 10:05:46 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib zedd/kernel
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=zedd/kernel

Bruce Ashfield (3):
  linux-yocto/4.8: update to 4.8.6
  linux-yocto/4.4: update to v4.4.30
  linux-yocto/4.1: update to v4.1.35

 meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-rt_4.4.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-rt_4.8.bb   |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.4.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto-tiny_4.8.bb |  6 +++---
 meta/recipes-kernel/linux/linux-yocto_4.1.bb      | 20 ++++++++++----------
 meta/recipes-kernel/linux/linux-yocto_4.4.bb      | 20 ++++++++++----------
 meta/recipes-kernel/linux/linux-yocto_4.8.bb      | 20 ++++++++++----------
 9 files changed, 48 insertions(+), 48 deletions(-)

-- 
2.5.0



^ permalink raw reply

* qemu woes on recent Fedora 24 kernels
From: Krisztian Litkey @ 2016-11-03 13:06 UTC (permalink / raw)
  To: openembedded-core

  Hi,

I thought I share this with others in case I'm not the only one who
have been struggling with this recently. I've been running lately into
really bad (and non-deterministic) clock skew issues, often triggering
oopses, when testing images with qemu on fedora 24. I'm not sure what
has changed in the fedora kernels that triggered this behavior, but
switching the clock source from TSC to HPET (by appending
clocksource=hpet to the kernel command line in the generated qemu
config file) did the trick for me and got rid of the problems.

  Cheers,
    kli



^ permalink raw reply

* Re: [PATCH v2 1/1] Make yocto-spdx support spdx2.0 SPEC
From: Jan-Simon Möller @ 2016-11-03  9:05 UTC (permalink / raw)
  To: Lei, Maohui; +Cc: openembedded-core@lists.openembedded.org
In-Reply-To: <1B56A49860EB2D45ADE3731B15C959FDFE580F6A@G08CNEXMBPEKD01.g08.fujitsu.local>

Hi Lei, Maxin!

Where do we stand: 
- v1 of patch submitted
- comment to create/use dosocs-native tp avoid the separate install (well, +1)
- comment that "the following direct dependencies that not belong to oe-core"

Did I summarize that correctly ?

@Maxin: what would you propose, work on the dependencies or let the user 
        install ?
@Lei: can you find where those dependencies are ?
      (https://layers.openembedded.org/layerindex/branch/morty/recipes/)

Best,
Jan-Simon

Am Donnerstag, 3. November 2016, 04:02:42 schrieb Lei, Maohui:
> Ping.
> 
> 
> 
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > [mailto:openembedded-
 core-bounces@lists.openembedded.org] On Behalf Of
> > Lei, Maohui
> > Sent: Monday, October 17, 2016 9:04 AM
> > To: Maxin B. John; Jan-Simon Möller
> > Cc: jsmoeller@linuxfoundation.org;
> > openembedded-core@lists.openembedded.org
 Subject: Re: [OE-core] [PATCH
> > v2 1/1] Make yocto-spdx support spdx2.0 SPEC 
> > Hi Maxin, Simon
> > 
> > 
> > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > or other repos, can we make the spdx.bbclass depend on
> > > > "dosocs-native"
> > > 
> > > or
> > > 
> > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > >
> > >
> > >
> > > That's a good idea. I will try.
> > 
> > 
> > I tried to make DoSOCSv2 recipe to oe-core, and find that there are at
> > least
 the following direct dependencies that not belong to oe-core.
> > 
> > PostgreSQL
> > python-psycopg2
> > jinja2
> > python-magic
> > docopt
> > SQLAlchemy
> > psycopg2
> > 
> > I think it difficult to add them all into oe-core and it's the reason that
> > why
 the original spdx module didn't add fossology into oe-core.
> > 
> > 
> > 
> > Best regards
> > Lei
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: openembedded-core-bounces@lists.openembedded.org
> > > [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> > > Lei, Maohui
> > > Sent: Thursday, September 22, 2016 10:19 AM
> > > To: Maxin B. John; Jan-Simon Möller
> > > Cc: jsmoeller@linuxfoundation.org; openembedded-
> > > core@lists.openembedded.org
> > > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support spdx2.0
> > > SPEC
> > >
> > >
> > >
> > > Hi Maxin, Simon
> > >
> > >
> > >
> > > > It would be nice to include the reason for change from fossology to
> > > > dosocs2 in the commit message too (from cover letter)
> > >
> > >
> > >
> > > OK, I will add the reasons into the commit message in v3.
> > >
> > >
> > >
> > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > or other repos, can we make the spdx.bbclass depend on
> > > > "dosocs-native"
> > > 
> > > or
> > > 
> > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > >
> > >
> > >
> > > That's a good idea. I will try.
> > >
> > >
> > >
> > >
> > > Best Regards
> > > Lei
> > >
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Maxin B. John [mailto:maxin.john@intel.com]
> > > > Sent: Monday, September 19, 2016 6:58 PM
> > > > To: Lei, Maohui
> > > > Cc: openembedded-core@lists.openembedded.org;
> > > > jsmoeller@linuxfoundation.org
> > > > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support
> > > > spdx2.0 SPEC
> > > >
> > > >
> > > >
> > > > Hi,
> > > >
> > > >
> > > >
> > > > Please find my comments below:
> > > >
> > > >
> > > >
> > > > On Mon, Sep 19, 2016 at 04:39:50PM +0800, Lei Maohui wrote:
> > > > 
> > > > > More:
> > > > > - change spdx tool from fossology to dosocs2
> > > >
> > > >
> > > >
> > > > It would be nice to include the reason for change from fossology to
> > > > dosocs2 in the commit message too (from cover letter)
> > > >
> > > >
> > > >
> > > > > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > > > > ---
> > > > > 
> > > > >  meta/classes/spdx.bbclass | 505
> > > > > 
> > > > > ++++++++++++++++++------------------
> > > > 
> > > > ----------
> > > > 
> > > > >  meta/conf/licenses.conf   |  67 +-----
> > > > >  2 files changed, 198 insertions(+), 374 deletions(-)
> > > > >
> > > > >
> > > > >
> > > > > diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass
> > > > > index 0c92765..27c0fa0 100644
> > > > > --- a/meta/classes/spdx.bbclass
> > > > > +++ b/meta/classes/spdx.bbclass
> > > > > @@ -1,365 +1,252 @@
> > > > > 
> > > > >  # This class integrates real-time license scanning, generation of
> > > > > 
> > > > > SPDX standard  # output and verifiying license info during the
> > > > 
> > > > building process.
> > > > 
> > > > > -# It is a combination of efforts from the OE-Core, SPDX and
> > > > 
> > > > Fossology projects.
> > > > 
> > > > > +# It is a combination of efforts from the OE-Core, SPDX and
> > > > > +DoSOCSv2
> > > > 
> > > > projects.
> > > > 
> > > > >  #
> > > > > 
> > > > > -# For more information on FOSSology:
> > > > > -#   http://www.fossology.org
> > > > > -#
> > > > > -# For more information on FOSSologySPDX commandline:
> > > > > -#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-> > > > 
> > > > SPDX-Web-API
> > > > 
> > > > > +# For more information on DoSOCSv2:
> > > > > +#   https://github.com/DoSOCSv2
> > > >
> > > >
> > > >
> > > > Instead of requesting the user to install the DoSOCSv2 from github
> > > > or other repos, can we make the spdx.bbclass depend on
> > > > "dosocs-native"
> > > 
> > > or
> > > 
> > > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > > >
> > > >
> > > >
> > > > That might make it easy to use this class.
> > > >
> > > >
> > > >
> > > > >  # For more information on SPDX:
> > > > >  #   http://www.spdx.org
> > > > >  #
> > > > > 
> > > > > +# Note:
> > > > > +# 1) Make sure DoSOCSv2 has beed installed in your host # 2) By
> > > > > +default,spdx files will be output to the path which is defined
> > > > 
> > > > as[SPDX_MANIFEST_DIR]
> > > > 
> > > > > +#    in ./meta/conf/licenses.conf.
> > > > >
> > > > >
> > > > >
> > > > > -# SPDX file will be output to the path which is defined
> > > > > as[SPDX_MANIFEST_DIR] -# in ./meta/conf/licenses.conf.
> > > > > +SPDXOUTPUTDIR = "${WORKDIR}/spdx_output_dir"
> > > > > 
> > > > >  SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
> > > > >
> > > > >
> > > > >
> > > > >  # If ${S} isn't actually the top-level source directory, set
> > > 
> > > SPDX_S
> > > 
> > > > > to point at  # the real top-level directory.
> > > > > +
> > > > > 
> > > > >  SPDX_S ?= "${S}"
> > > > >
> > > > >
> > > > >
> > > > >  python do_spdx () {
> > > > >  
> > > > >      import os, sys
> > > > > 
> > > > > -    import json, shutil
> > > > > -
> > > > > -    info = {}
> > > > > -    info['workdir'] = d.getVar('WORKDIR', True)
> > > > > -    info['sourcedir'] = d.getVar('SPDX_S', True)
> > > > > -    info['pn'] = d.getVar('PN', True)
> > > > > -    info['pv'] = d.getVar('PV', True)
> > > > > -    info['spdx_version'] = d.getVar('SPDX_VERSION', True)
> > > > > -    info['data_license'] = d.getVar('DATA_LICENSE', True)
> > > > > -
> > > > > -    sstatedir = d.getVar('SPDXSSTATEDIR', True)
> > > > > -    sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] +
> > > > 
> > > > ".spdx")
> > > > 
> > > > > +    import json
> > > > >
> > > > >
> > > > >
> > > > > -    manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
> > > > > -    info['outfile'] = os.path.join(manifest_dir, info['pn'] +
> > > > 
> > > > ".spdx" )
> > > > 
> > > > > +    ## It's no necessary  to get spdx files for *-native
> > > > > +    if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > > +        return None
> > > > >
> > > > >
> > > > >
> > > > > -    info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
> > > > > -    info['tar_file'] = os.path.join(info['workdir'], info['pn'] +
> > > > 
> > > > ".tar.gz" )
> > > > 
> > > > > +    ## gcc is too big to get spdx file.
> > > > > +    if 'gcc' in d.getVar('PN', True):
> > > > > +        return None
> > > > >
> > > > >
> > > > >
> > > > > -    # Make sure important dirs exist
> > > > > -    try:
> > > > > -        bb.utils.mkdirhier(manifest_dir)
> > > > > -        bb.utils.mkdirhier(sstatedir)
> > > > > -        bb.utils.mkdirhier(info['spdx_temp_dir'])
> > > > > -    except OSError as e:
> > > > > -        bb.error("SPDX: Could not set up required directories: " +
> > > > 
> > > > str(e))
> > > > 
> > > > > -        return
> > > > > +    info = {}
> > > > > +    info['workdir'] = (d.getVar('WORKDIR', True) or "")
> > > > > +    info['pn'] = (d.getVar( 'PN', True ) or "")
> > > > > +    info['pv'] = (d.getVar( 'PV', True ) or "")
> > > > > +    info['package_download_location'] = (d.getVar( 'SRC_URI',
> > > > > + True
> > > > > + )
> > > > 
> > > > or "")
> > > > 
> > > > > +    if info['package_download_location'] != "":
> > > > > +        info['package_download_location'] =
> > > > 
> > > > info['package_download_location'].split()[0]
> > > > 
> > > > > +    info['spdx_version'] = (d.getVar('SPDX_VERSION', True) or '')
> > > > > +    info['data_license'] = (d.getVar('DATA_LICENSE', True) or '')
> > > > > +    info['creator'] = {}
> > > > > +    info['creator']['Tool'] = (d.getVar('CREATOR_TOOL', True) or
> > > 
> > > '')
> > > 
> > > > > +    info['license_list_version'] =
> > > > > + (d.getVar('LICENSELISTVERSION',
> > > > 
> > > > True) or '')
> > > > 
> > > > > +    info['package_homepage'] = (d.getVar('HOMEPAGE', True) or "")
> > > > > +    info['package_summary'] = (d.getVar('SUMMARY', True) or "")
> > > > > +    info['package_summary'] =
> > > > 
> > > > info['package_summary'].replace("\n","")
> > > > 
> > > > > +    info['package_summary'] =
> > > 
> > > info['package_summary'].replace("'","
> > > 
> > > > > + ")
> > > > > +
> > > > > +    spdx_sstate_dir = (d.getVar('SPDXSSTATEDIR', True) or "")
> > > > > +    manifest_dir = (d.getVar('SPDX_MANIFEST_DIR', True) or "")
> > > > > +    info['outfile'] = os.path.join(manifest_dir, info['pn'] + "-"
> > > 
> > > +
> > > 
> > > > info['pv'] + ".spdx" )
> > > > 
> > > > > +    sstatefile = os.path.join(spdx_sstate_dir,
> > > > > +        info['pn'] + "-" + info['pv'] + ".spdx" )
> > > > >
> > > > >
> > > > >
> > > > >      ## get everything from cache.  use it to decide if
> > > > > 
> > > > > -    ## something needs to be rerun
> > > > > -    cur_ver_code = get_ver_code(info['sourcedir'])
> > > > > +    ## something needs to be rerun
> > > > > +    if not os.path.exists( spdx_sstate_dir ):
> > > > > +        bb.utils.mkdirhier( spdx_sstate_dir )
> > > > > +
> > > > > +    d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > > +    info['sourcedir'] = (d.getVar('SPDX_S', True) or "")
> > > > > +    cur_ver_code = get_ver_code( info['sourcedir'] ).split()[0]
> > > > > 
> > > > >      cache_cur = False
> > > > > 
> > > > > -    if os.path.exists(sstatefile):
> > > > > +    if os.path.exists( sstatefile ):
> > > > > 
> > > > >          ## cache for this package exists. read it in
> > > > > 
> > > > > -        cached_spdx = get_cached_spdx(sstatefile)
> > > > > -
> > > > > -        if cached_spdx['PackageVerificationCode'] == cur_ver_code:
> > > > > -            bb.warn("SPDX: Verification code for " + info['pn']
> > > > > -                  + "is same as cache's. do nothing")
> > > > > +        cached_spdx = get_cached_spdx( sstatefile )
> > > > > +        if cached_spdx:
> > > > > +            cached_spdx = cached_spdx.split()[0]
> > > > > +        if (cached_spdx == cur_ver_code):
> > > > > +            bb.warn(info['pn'] + "'s ver code same as cache's. do
> > > > > + nothing")
> > > > > 
> > > > >              cache_cur = True
> > > > > 
> > > > > +            create_manifest(info,sstatefile)
> > > > > +    if not cache_cur:
> > > > > +        ## setup dosocs2 command
> > > > > +        dosocs2_command = "dosocs2 oneshot %s" % info['sourcedir']
> > > > > +        ## no necessary to scan the git directory.
> > > > > +        git_path = "%s/.git" % info['sourcedir']
> > > > > +        if os.path.exists(git_path):
> > > > > +            remove_dir_tree(git_path)
> > > > > +
> > > > > +        ## Get spdx file
> > > > > +        run_dosocs2(dosocs2_command,sstatefile)
> > > > > +        if get_cached_spdx( sstatefile ) != None:
> > > > > +            write_cached_spdx( info,sstatefile,cur_ver_code )
> > > > > +            ## CREATE MANIFEST(write to outfile )
> > > > > +            create_manifest(info,sstatefile)
> > > > > 
> > > > >          else:
> > > > > 
> > > > > -            local_file_info = setup_foss_scan(info, True,
> > > > 
> > > > cached_spdx['Files'])
> > > > 
> > > > > -    else:
> > > > > -        local_file_info = setup_foss_scan(info, False, None)
> > > > > -
> > > > > -    if cache_cur:
> > > > > -        spdx_file_info = cached_spdx['Files']
> > > > > -        foss_package_info = cached_spdx['Package']
> > > > > -        foss_license_info = cached_spdx['Licenses']
> > > > > -    else:
> > > > > -        ## setup fossology command
> > > > > -        foss_server = d.getVar('FOSS_SERVER', True)
> > > > > -        foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
> > > > > -        foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) ==
> > > 
> > > "true"
> > > 
> > > > or False
> > > > 
> > > > > -        foss_command = "wget %s --post-file=%s %s"\
> > > > > -            % (foss_flags, info['tar_file'], foss_server)
> > > > > -
> > > > > -        foss_result = run_fossology(foss_command, foss_full_spdx)
> > > > > -        if foss_result is not None:
> > > > > -            (foss_package_info, foss_file_info, foss_license_info)
> > > 
> > > =
> > > 
> > > > foss_result
> > > > 
> > > > > -            spdx_file_info = create_spdx_doc(local_file_info,
> > > > 
> > > > foss_file_info)
> > > > 
> > > > > -            ## write to cache
> > > > > -            write_cached_spdx(sstatefile, cur_ver_code,
> > > > 
> > > > foss_package_info,
> > > > 
> > > > > -                              spdx_file_info, foss_license_info)
> > > > > -        else:
> > > > > -            bb.error("SPDX: Could not communicate with FOSSology
> > > > 
> > > > server. Command was: " + foss_command)
> > > > 
> > > > > -            return
> > > > > -
> > > > > -    ## Get document and package level information
> > > > > -    spdx_header_info = get_header_info(info, cur_ver_code,
> > > > 
> > > > foss_package_info)
> > > > 
> > > > > +            bb.warn('Can\'t get the spdx file ' + info['pn'] + '.
> > > > 
> > > > Please check your dosocs2.')
> > > > 
> > > > > +    d.setVar('WORKDIR', info['workdir']) } ## Get the src after
> > > > > +do_patch.
> > > > > +python do_get_spdx_s() {
> > > > >
> > > > >
> > > > >
> > > > > -    ## CREATE MANIFEST
> > > > > -    create_manifest(info, spdx_header_info, spdx_file_info,
> > > > 
> > > > foss_license_info)
> > > > 
> > > > > +    ## It's no necessary  to get spdx files for *-native
> > > > > +    if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > > +        return None
> > > > >
> > > > >
> > > > >
> > > > > -    ## clean up the temp stuff
> > > > > -    shutil.rmtree(info['spdx_temp_dir'], ignore_errors=True)
> > > > > -    if os.path.exists(info['tar_file']):
> > > > > -        remove_file(info['tar_file'])
> > > > > +    ## gcc is too big to get spdx file.
> > > > > +    if 'gcc' in d.getVar('PN', True):
> > > > > +        return None
> > > > > +
> > > > > +    ## Change the WORKDIR to make do_unpack do_patch run in
> > > 
> > > another
> > > 
> > > > dir.
> > > > 
> > > > > +    d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > > +    ## The changed 'WORKDIR' also casued 'B' changed, create dir
> > > 
> > > 'B'
> > > 
> > > > for the
> > > > 
> > > > > +    ## possibly requiring of the following tasks (such as some
> > > > 
> > > > recipes's
> > > > 
> > > > > +    ## do_patch required 'B' existed).
> > > > > +    bb.utils.mkdirhier(d.getVar('B', True))
> > > > > +
> > > > > +    ## The kernel source is ready after do_validate_branches
> > > > > +    if bb.data.inherits_class('kernel-yocto', d):
> > > > > +        bb.build.exec_func('do_unpack', d)
> > > > > +        bb.build.exec_func('do_kernel_checkout', d)
> > > > > +        bb.build.exec_func('do_validate_branches', d)
> > > > > +    else:
> > > > > +        bb.build.exec_func('do_unpack', d)
> > > > > +    ## The S of the gcc source is work-share
> > > > > +    flag = d.getVarFlag('do_unpack', 'stamp-base', True)
> > > > > +    if flag:
> > > > > +        d.setVar('S', d.getVar('WORKDIR', True) + "/gcc-" +
> > > > 
> > > > d.getVar('PV', True))
> > > > 
> > > > > +    bb.build.exec_func('do_patch', d)
> > > > > 
> > > > >  }
> > > > > 
> > > > > -addtask spdx after do_patch before do_configure
> > > > > -
> > > > > -def create_manifest(info, header, files, licenses):
> > > > > -    import codecs
> > > > > -    with codecs.open(info['outfile'], mode='w', encoding='utf-8')
> > > 
> > > as
> > > 
> > > > f:
> > > > 
> > > > > -        # Write header
> > > > > -        f.write(header + '\n')
> > > > > -
> > > > > -        # Write file data
> > > > > -        for chksum, block in files.iteritems():
> > > > > -            f.write("FileName: " + block['FileName'] + '\n')
> > > > > -            for key, value in block.iteritems():
> > > > > -                if not key == 'FileName':
> > > > > -                    f.write(key + ": " + value + '\n')
> > > > > -            f.write('\n')
> > > > > -
> > > > > -        # Write license data
> > > > > -        for id, block in licenses.iteritems():
> > > > > -            f.write("LicenseID: " + id + '\n')
> > > > > -            for key, value in block.iteritems():
> > > > > -                f.write(key + ": " + value + '\n')
> > > > > -            f.write('\n')
> > > > > -
> > > > > -def get_cached_spdx(sstatefile):
> > > > > -    import json
> > > > > -    import codecs
> > > > > -    cached_spdx_info = {}
> > > > > -    with codecs.open(sstatefile, mode='r', encoding='utf-8') as f:
> > > > > -        try:
> > > > > -            cached_spdx_info = json.load(f)
> > > > > -        except ValueError as e:
> > > > > -            cached_spdx_info = None
> > > > > -    return cached_spdx_info
> > > > >
> > > > >
> > > > >
> > > > > -def write_cached_spdx(sstatefile, ver_code, package_info, files,
> > > > 
> > > > license_info):
> > > > 
> > > > > -    import json
> > > > > -    import codecs
> > > > > -    spdx_doc = {}
> > > > > -    spdx_doc['PackageVerificationCode'] = ver_code
> > > > > -    spdx_doc['Files'] = {}
> > > > > -    spdx_doc['Files'] = files
> > > > > -    spdx_doc['Package'] = {}
> > > > > -    spdx_doc['Package'] = package_info
> > > > > -    spdx_doc['Licenses'] = {}
> > > > > -    spdx_doc['Licenses'] = license_info
> > > > > -    with codecs.open(sstatefile, mode='w', encoding='utf-8') as f:
> > > > > -        f.write(json.dumps(spdx_doc))
> > > > > -
> > > > > -def setup_foss_scan(info, cache, cached_files):
> > > > > -    import errno, shutil
> > > > > -    import tarfile
> > > > > -    file_info = {}
> > > > > -    cache_dict = {}
> > > > > -
> > > > > -    for f_dir, f in list_files(info['sourcedir']):
> > > > > -        full_path = os.path.join(f_dir, f)
> > > > > -        abs_path = os.path.join(info['sourcedir'], full_path)
> > > > > -        dest_dir = os.path.join(info['spdx_temp_dir'], f_dir)
> > > > > -        dest_path = os.path.join(info['spdx_temp_dir'], full_path)
> > > > > -
> > > > > -        checksum = hash_file(abs_path)
> > > > > -        if not checksum is None:
> > > > > -            file_info[checksum] = {}
> > > > > -            ## retain cache information if it exists
> > > > > -            if cache and checksum in cached_files:
> > > > > -                file_info[checksum] = cached_files[checksum]
> > > > > -            ## have the file included in what's sent to the
> > > > 
> > > > FOSSology server
> > > > 
> > > > > -            else:
> > > > > -                file_info[checksum]['FileName'] = full_path
> > > > > -                try:
> > > > > -                    bb.utils.mkdirhier(dest_dir)
> > > > > -                    shutil.copyfile(abs_path, dest_path)
> > > > > -                except OSError as e:
> > > > > -                    bb.warn("SPDX: mkdirhier failed: " + str(e))
> > > > > -                except shutil.Error as e:
> > > > > -                    bb.warn("SPDX: copyfile failed: " + str(e))
> > > > > -                except IOError as e:
> > > > > -                    bb.warn("SPDX: copyfile failed: " + str(e))
> > > > > -        else:
> > > > > -            bb.warn("SPDX: Could not get checksum for file: " + f)
> > > > > +addtask get_spdx_s after do_patch before do_configure addtask
> > > > > +spdx after do_get_spdx_s before do_configure
> > > > > +
> > > > > +def create_manifest(info,sstatefile):
> > > > > +    import shutil
> > > > > +    shutil.copyfile(sstatefile,info['outfile'])
> > > > > +
> > > > > +def get_cached_spdx( sstatefile ):
> > > > > +    import subprocess
> > > > > +
> > > > > +    if not os.path.exists( sstatefile ):
> > > > > +        return None
> > > > >
> > > > >
> > > > >
> > > > > -    with tarfile.open(info['tar_file'], "w:gz") as tar:
> > > > > -        tar.add(info['spdx_temp_dir'],
> > > > 
> > > > arcname=os.path.basename(info['spdx_temp_dir']))
> > > > 
> > > > > +    try:
> > > > > +        output = subprocess.check_output(['grep',
> > > > 
> > > > "PackageVerificationCode", sstatefile])
> > > > 
> > > > > +    except subprocess.CalledProcessError as e:
> > > > > +        bb.error("Index creation command '%s' failed with return
> > > > 
> > > > code %d:\n%s" % (e.cmd, e.returncode, e.output))
> > > > 
> > > > > +        return None
> > > > > +    cached_spdx_info=output.decode('utf-8').split(': ')
> > > > > +    return cached_spdx_info[1]
> > > > > +
> > > > > +## Add necessary information into spdx file def
> > > > > +write_cached_spdx( info,sstatefile, ver_code ):
> > > > > +    import subprocess
> > > > > +
> > > > > +    def sed_replace(dest_sed_cmd,key_word,replace_info):
> > > > > +        dest_sed_cmd = dest_sed_cmd + "-e 's#^" + key_word + ".*#"
> > > > > + +
> > > > 
> > > > \
> > > > 
> > > > > +            key_word + replace_info + "#' "
> > > > > +        return dest_sed_cmd
> > > > > +
> > > > > +    def sed_insert(dest_sed_cmd,key_word,new_line):
> > > > > +        dest_sed_cmd = dest_sed_cmd + "-e '/^" + key_word \
> > > > > +            + r"/a\\" + new_line + "' "
> > > > > +        return dest_sed_cmd
> > > > > +
> > > > > +    ## Document level information
> > > > > +    sed_cmd = r"sed -i -e 's#\r$##g' "
> > > > > +    spdx_DocumentComment = "<text>SPDX for " + info['pn'] + "
> > > > 
> > > > version " \
> > > > 
> > > > > +        + info['pv'] + "</text>"
> > > > > +    sed_cmd =
> > > > > + sed_replace(sed_cmd,"DocumentComment",spdx_DocumentComment)
> > > > >
> > > > >
> > > > >
> > > > > -    return file_info
> > > > > +    ## Creator information
> > > > > +    sed_cmd = sed_insert(sed_cmd,"CreatorComment:
> > > > > + ","LicenseListVersion: " + info['license_list_version'])
> > > > > +
> > > > > +    ## Package level information
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageName: ",info['pn'])
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageVersion: ",info['pv'])
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageDownloadLocation:
> > > > 
> > > > ",info['package_download_location'])
> > > > 
> > > > > +    sed_cmd = sed_insert(sed_cmd,"PackageChecksum:
> > > > 
> > > > ","PackageHomePage: " + info['package_homepage'])
> > > > 
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageSummary: ","<text>" +
> > > > 
> > > > info['package_summary'] + "</text>")
> > > > 
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageVerificationCode:
> > > > 
> > > > ",ver_code)
> > > > 
> > > > > +    sed_cmd = sed_replace(sed_cmd,"PackageDescription: ",
> > > > > +        "<text>" + info['pn'] + " version " + info['pv'] +
> > > 
> > > "</text>")
> > > 
> > > > > +    sed_cmd = sed_cmd + sstatefile
> > > > > +
> > > > > +    subprocess.call("%s" % sed_cmd, shell=True)
> > > > > +
> > > > > +def remove_dir_tree( dir_name ):
> > > > > +    import shutil
> > > > > +    try:
> > > > > +        shutil.rmtree( dir_name )
> > > > > +    except:
> > > > > +        pass
> > > > >
> > > > >
> > > > >
> > > > > -def remove_file(file_name):
> > > > > +def remove_file( file_name ):
> > > > > 
> > > > >      try:
> > > > > 
> > > > > -        os.remove(file_name)
> > > > > +        os.remove( file_name )
> > > > > 
> > > > >      except OSError as e:
> > > > >      
> > > > >          pass
> > > > >
> > > > >
> > > > >
> > > > > -def list_files(dir):
> > > > > -    for root, subFolders, files in os.walk(dir):
> > > > > +def list_files( dir ):
> > > > > +    for root, subFolders, files in os.walk( dir ):
> > > > > 
> > > > >          for f in files:
> > > > > 
> > > > > -            rel_root = os.path.relpath(root, dir)
> > > > > +            rel_root = os.path.relpath( root, dir )
> > > > > 
> > > > >              yield rel_root, f
> > > > >      
> > > > >      return
> > > > >
> > > > >
> > > > >
> > > > > -def hash_file(file_name):
> > > > > +def hash_file( file_name ):
> > > > > +    """
> > > > > +    Return the hex string representation of the SHA1 checksum of
> > > > > +the
> > > > 
> > > > filename
> > > > 
> > > > > +    """
> > > > > 
> > > > >      try:
> > > > > 
> > > > > -        with open(file_name, 'rb') as f:
> > > > > -            data_string = f.read()
> > > > > -            sha1 = hash_string(data_string)
> > > > > -            return sha1
> > > > > -    except:
> > > > > +        import hashlib
> > > > > +    except ImportError:
> > > > > 
> > > > >          return None
> > > > > 
> > > > > +
> > > > > +    sha1 = hashlib.sha1()
> > > > > +    with open( file_name, "rb" ) as f:
> > > > > +        for line in f:
> > > > > +            sha1.update(line)
> > > > > +    return sha1.hexdigest()
> > > > >
> > > > >
> > > > >
> > > > > -def hash_string(data):
> > > > > +def hash_string( data ):
> > > > > 
> > > > >      import hashlib
> > > > >      sha1 = hashlib.sha1()
> > > > > 
> > > > > -    sha1.update(data)
> > > > > +    sha1.update( data.encode('utf-8') )
> > > > > 
> > > > >      return sha1.hexdigest()
> > > > >
> > > > >
> > > > >
> > > > > -def run_fossology(foss_command, full_spdx):
> > > > > +def run_dosocs2( dosocs2_command,  spdx_file ):
> > > > > +    import subprocess, codecs
> > > > > 
> > > > >      import string, re
> > > > > 
> > > > > -    import subprocess
> > > > > -
> > > > > -    p = subprocess.Popen(foss_command.split(),
> > > > > +
> > > > > +    p = subprocess.Popen(dosocs2_command.split(),
> > > > > 
> > > > >          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > > > > 
> > > > > -    foss_output, foss_error = p.communicate()
> > > > > +    dosocs2_output, dosocs2_error = p.communicate()
> > > > > 
> > > > >      if p.returncode != 0:
> > > > >      
> > > > >          return None
> > > > >
> > > > >
> > > > >
> > > > > -    foss_output = unicode(foss_output, "utf-8")
> > > > > -    foss_output = string.replace(foss_output, '\r', '')
> > > > > -
> > > > > -    # Package info
> > > > > -    package_info = {}
> > > > > -    if full_spdx:
> > > > > -        # All mandatory, only one occurrence
> > > > > -        package_info['PackageCopyrightText'] =
> > > > 
> > > > re.findall('PackageCopyrightText: (.*?</text>)', foss_output,
> > > > re.S)[0]
> > > > 
> > > > > -        package_info['PackageLicenseDeclared'] =
> > > > 
> > > > re.findall('PackageLicenseDeclared: (.*)', foss_output)[0]
> > > > 
> > > > > -        package_info['PackageLicenseConcluded'] =
> > > > 
> > > > re.findall('PackageLicenseConcluded: (.*)', foss_output)[0]
> > > > 
> > > > > -        # These may be more than one
> > > > > -        package_info['PackageLicenseInfoFromFiles'] =
> > > > 
> > > > re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output)
> > > > 
> > > > > -    else:
> > > > > -        DEFAULT = "NOASSERTION"
> > > > > -        package_info['PackageCopyrightText'] = "<text>" + DEFAULT
> > > 
> > > +
> > > 
> > > > "</text>"
> > > > 
> > > > > -        package_info['PackageLicenseDeclared'] = DEFAULT
> > > > > -        package_info['PackageLicenseConcluded'] = DEFAULT
> > > > > -        package_info['PackageLicenseInfoFromFiles'] = []
> > > > > -
> > > > > -    # File info
> > > > > -    file_info = {}
> > > > > -    records = []
> > > > > -    # FileName is also in PackageFileName, so we match on FileType
> > > > 
> > > > as well.
> > > > 
> > > > > -    records = re.findall('FileName:.*?FileType:.*?</text>',
> > > > 
> > > > foss_output, re.S)
> > > > 
> > > > > -    for rec in records:
> > > > > -        chksum = re.findall('FileChecksum: SHA1: (.*)\n', rec)[0]
> > > > > -        file_info[chksum] = {}
> > > > > -        file_info[chksum]['FileCopyrightText'] =
> > > > 
> > > > re.findall('FileCopyrightText: '
> > > > 
> > > > > -            + '(.*?</text>)', rec, re.S )[0]
> > > > > -        fields = ['FileName', 'FileType', 'LicenseConcluded',
> > > > 
> > > > 'LicenseInfoInFile']
> > > > 
> > > > > -        for field in fields:
> > > > > -            file_info[chksum][field] = re.findall(field + ':
> > > > > (.*)',
> > > > 
> > > > rec)[0]
> > > > 
> > > > > -
> > > > > -    # Licenses
> > > > > -    license_info = {}
> > > > > -    licenses = []
> > > > > -    licenses = re.findall('LicenseID:.*?LicenseName:.*?\n',
> > > > 
> > > > foss_output, re.S)
> > > > 
> > > > > -    for lic in licenses:
> > > > > -        license_id = re.findall('LicenseID: (.*)\n', lic)[0]
> > > > > -        license_info[license_id] = {}
> > > > > -        license_info[license_id]['ExtractedText'] =
> > > > 
> > > > re.findall('ExtractedText: (.*?</text>)', lic, re.S)[0]
> > > > 
> > > > > -        license_info[license_id]['LicenseName'] =
> > > > 
> > > > re.findall('LicenseName: (.*)', lic)[0]
> > > > 
> > > > > -
> > > > > -    return (package_info, file_info, license_info)
> > > > > -
> > > > > -def create_spdx_doc(file_info, scanned_files):
> > > > > -    import json
> > > > > -    ## push foss changes back into cache
> > > > > -    for chksum, lic_info in scanned_files.iteritems():
> > > > > -        if chksum in file_info:
> > > > > -            file_info[chksum]['FileType'] = lic_info['FileType']
> > > > > -            file_info[chksum]['FileChecksum: SHA1'] = chksum
> > > > > -            file_info[chksum]['LicenseInfoInFile'] =
> > > > 
> > > > lic_info['LicenseInfoInFile']
> > > > 
> > > > > -            file_info[chksum]['LicenseConcluded'] =
> > > > 
> > > > lic_info['LicenseConcluded']
> > > > 
> > > > > -            file_info[chksum]['FileCopyrightText'] =
> > > > 
> > > > lic_info['FileCopyrightText']
> > > > 
> > > > > -        else:
> > > > > -            bb.warn("SPDX: " + lic_info['FileName'] + " : " +
> > > 
> > > chksum
> > > 
> > > > > -                + " : is not in the local file info: "
> > > > > -                + json.dumps(lic_info, indent=1))
> > > > > -    return file_info
> > > > > +    dosocs2_output = dosocs2_output.decode('utf-8')
> > > > > +
> > > > > +    f = codecs.open(spdx_file,'w','utf-8')
> > > > > +    f.write(dosocs2_output)
> > > > >
> > > > >
> > > > >
> > > > > -def get_ver_code(dirname):
> > > > > +def get_ver_code( dirname ):
> > > > > 
> > > > >      chksums = []
> > > > > 
> > > > > -    for f_dir, f in list_files(dirname):
> > > > > -        hash = hash_file(os.path.join(dirname, f_dir, f))
> > > > > -        if not hash is None:
> > > > > -            chksums.append(hash)
> > > > > -        else:
> > > > > -            bb.warn("SPDX: Could not hash file: " + path)
> > > > > -    ver_code_string = ''.join(chksums).lower()
> > > > > -    ver_code = hash_string(ver_code_string)
> > > > > +    for f_dir, f in list_files( dirname ):
> > > > > +        try:
> > > > > +            stats = os.stat(os.path.join(dirname,f_dir,f))
> > > > > +        except OSError as e:
> > > > > +            bb.warn( "Stat failed" + str(e) + "\n")
> > > > > +            continue
> > > > > +        chksums.append(hash_file(os.path.join(dirname,f_dir,f)))
> > > > > +    ver_code_string = ''.join( chksums ).lower()
> > > > > +    ver_code = hash_string( ver_code_string )
> > > > > 
> > > > >      return ver_code
> > > > >
> > > > >
> > > > >
> > > > > -def get_header_info(info, spdx_verification_code, package_info):
> > > > > -    """
> > > > > -        Put together the header SPDX information.
> > > > > -        Eventually this needs to become a lot less
> > > > > -        of a hardcoded thing.
> > > > > -    """
> > > > > -    from datetime import datetime
> > > > > -    import os
> > > > > -    head = []
> > > > > -    DEFAULT = "NOASSERTION"
> > > > > -
> > > > > -    package_checksum = hash_file(info['tar_file'])
> > > > > -    if package_checksum is None:
> > > > > -        package_checksum = DEFAULT
> > > > > -
> > > > > -    ## document level information
> > > > > -    head.append("## SPDX Document Information")
> > > > > -    head.append("SPDXVersion: " + info['spdx_version'])
> > > > > -    head.append("DataLicense: " + info['data_license'])
> > > > > -    head.append("DocumentComment: <text>SPDX for "
> > > > > -        + info['pn'] + " version " + info['pv'] + "</text>")
> > > > > -    head.append("")
> > > > > -
> > > > > -    ## Creator information
> > > > > -    ## Note that this does not give time in UTC.
> > > > > -    now = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
> > > > > -    head.append("## Creation Information")
> > > > > -    ## Tools are supposed to have a version, but FOSSology+SPDX
> > > > 
> > > > provides none.
> > > > 
> > > > > -    head.append("Creator: Tool: FOSSology+SPDX")
> > > > > -    head.append("Created: " + now)
> > > > > -    head.append("CreatorComment: <text>UNO</text>")
> > > > > -    head.append("")
> > > > > -
> > > > > -    ## package level information
> > > > > -    head.append("## Package Information")
> > > > > -    head.append("PackageName: " + info['pn'])
> > > > > -    head.append("PackageVersion: " + info['pv'])
> > > > > -    head.append("PackageFileName: " +
> > > > 
> > > > os.path.basename(info['tar_file']))
> > > > 
> > > > > -    head.append("PackageSupplier: Person:" + DEFAULT)
> > > > > -    head.append("PackageDownloadLocation: " + DEFAULT)
> > > > > -    head.append("PackageSummary: <text></text>")
> > > > > -    head.append("PackageOriginator: Person:" + DEFAULT)
> > > > > -    head.append("PackageChecksum: SHA1: " + package_checksum)
> > > > > -    head.append("PackageVerificationCode: " +
> > > 
> > > spdx_verification_code)
> > > 
> > > > > -    head.append("PackageDescription: <text>" + info['pn']
> > > > > -        + " version " + info['pv'] + "</text>")
> > > > > -    head.append("")
> > > > > -    head.append("PackageCopyrightText: "
> > > > > -        + package_info['PackageCopyrightText'])
> > > > > -    head.append("")
> > > > > -    head.append("PackageLicenseDeclared: "
> > > > > -        + package_info['PackageLicenseDeclared'])
> > > > > -    head.append("PackageLicenseConcluded: "
> > > > > -        + package_info['PackageLicenseConcluded'])
> > > > > -
> > > > > -    for licref in package_info['PackageLicenseInfoFromFiles']:
> > > > > -        head.append("PackageLicenseInfoFromFiles: " + licref)
> > > > > -    head.append("")
> > > > > -
> > > > > -    ## header for file level
> > > > > -    head.append("## File Information")
> > > > > -    head.append("")
> > > > > -
> > > > > -    return '\n'.join(head)
> > > > > diff --git a/meta/conf/licenses.conf b/meta/conf/licenses.conf
> > > 
> > > index
> > > 
> > > > > 9917c40..5963e2f 100644
> > > > > --- a/meta/conf/licenses.conf
> > > > > +++ b/meta/conf/licenses.conf
> > > > > @@ -122,68 +122,5 @@ SPDXLICENSEMAP[SGIv1] = "SGI-1"
> > > > > 
> > > > >  #COPY_LIC_DIRS = "1"
> > > > >
> > > > >
> > > > >
> > > > >  ## SPDX temporary directory
> > > > > 
> > > > > -SPDX_TEMP_DIR = "${WORKDIR}/spdx_temp"
> > > > > -SPDX_MANIFEST_DIR = "/home/yocto/fossology_scans"
> > > > > -
> > > > > -## SPDX Format info
> > > > > -SPDX_VERSION = "SPDX-1.1"
> > > > > -DATA_LICENSE = "CC0-1.0"
> > > > > -
> > > > > -## Fossology scan information
> > > > > -# You can set option to control if the copyright information will
> > > > > be skipped -# during the identification process.
> > > > > -#
> > > > > -# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
> > > > > -# FOSS_COPYRIGHT = "true"
> > > > > -#   NO copyright will be processed. That means only license
> > > > 
> > > > information will be
> > > > 
> > > > > -#   identified and output to SPDX file
> > > > > -# FOSS_COPYRIGHT = "false"
> > > > > -#   Copyright will be identified and output to SPDX file along
> > > 
> > > with
> > > 
> > > > license
> > > > 
> > > > > -#   information. The process will take more time than not
> > > 
> > > processing
> > > 
> > > > copyright
> > > > 
> > > > > -#   information.
> > > > > -#
> > > > > -
> > > > > -FOSS_NO_COPYRIGHT = "true"
> > > > > -
> > > > > -# A option defined as[FOSS_RECURSIVE_UNPACK] in
> > > > > ./meta/conf/licenses.conf. is -# used to control if FOSSology
> > > 
> > > server
> > > 
> > > > > need recursively unpack tar.gz file which -# is sent from do_spdx
> > > > 
> > > > task.
> > > > 
> > > > > -#
> > > > > -# FOSS_RECURSIVE_UNPACK = "false":
> > > > > -#    FOSSology server does NOT recursively unpack. In the current
> > > > 
> > > > release, this
> > > > 
> > > > > -#    is the default choice because recursively unpack will not
> > > > 
> > > > necessarily break
> > > > 
> > > > > -#    down original compressed files.
> > > > > -# FOSS_RECURSIVE_UNPACK = "true":
> > > > > -#    FOSSology server recursively unpack components.
> > > > > -#
> > > > > -
> > > > > -FOSS_RECURSIVE_UNPACK = "false"
> > > > > -
> > > > > -# An option defined as [FOSS_FULL_SPDX] in
> > > > > ./meta/conf/licenses.conf is used to -# control what kind of SPDX
> > > > > output to get from the
> > > > 
> > > > FOSSology server.
> > > > 
> > > > > -#
> > > > > -# FOSS_FULL_SPDX = "true":
> > > > > -#   Tell FOSSology server to return full SPDX output, like if the
> > > > 
> > > > program was
> > > > 
> > > > > -#   run from the command line. This is needed in order to get
> > > > 
> > > > license refs for
> > > > 
> > > > > -#   the full package rather than individual files only.
> > > > > -#
> > > > > -# FOSS_FULL_SPDX = "false":
> > > > > -#   Tell FOSSology to only process license information for files.
> > > > 
> > > > All package
> > > > 
> > > > > -#   license tags in the report will be "NOASSERTION"
> > > > > -#
> > > > > -
> > > > > -FOSS_FULL_SPDX = "true"
> > > > > -
> > > > > -# FOSSologySPDX instance server. http://localhost/repo is the
> > > > 
> > > > default
> > > > 
> > > > > -# installation location for FOSSology.
> > > > > -#
> > > > > -# For more information on FOSSologySPDX commandline:
> > > > > -#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-> > > > 
> > > > SPDX-Web-API
> > > > 
> > > > > -#
> > > > > -
> > > > > -FOSS_BASE_URL = "http://localhost/repo/?mod=spdx_license_once"
> > > > > -FOSS_SERVER =
> > > >
> > > >
> > > 
> > > "${FOSS_BASE_URL}&fullSPDXFlag=${FOSS_FULL_SPDX}&noCopyright=${FOSS_NO
> > > 
> > > > _ COPYRIGHT}&recursiveUnpack=${FOSS_RECURSIVE_UNPACK}"
> > > > 
> > > > > -
> > > > > -FOSS_WGET_FLAGS = "-qO - --no-check-certificate --timeout=0"
> > > > > -
> > > > > -
> > > > > +SPDX_TEMP_DIR ?= "${WORKDIR}/spdx_temp"
> > > > > +SPDX_MANIFEST_DIR ?= "/home/yocto/spdx_scans"
> > > >
> > > >
> > > >
> > > > Best Regards,
> > > > Maxin
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > 
> > 
> > 
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
--
Jan-Simon Möller
dl9pf@gmx.de


^ permalink raw reply

* Re: [PATCH 1/2] devtool: update-recipe: decode output before treating it as a string
From: Paul Eggleton @ 2016-11-03  8:18 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <db66dad07cfa38a56436a7df05ce4ff0e3c91e90.1478141595.git.paul.eggleton@linux.intel.com>

On Thu, 03 Nov 2016 15:53:53 Paul Eggleton wrote:
> When you receive output from subprocess, with Python 3 it's a stream of
> bytes so you need to decode it before you can start treating it as a
> string.
> 
> Fixes [YOCTO #10447].

Oops, that should have been 10563. I've corrected the branch.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply

* Re: [PATCH v2 1/1] Make yocto-spdx support spdx2.0 SPEC
From: Lei, Maohui @ 2016-11-03  4:02 UTC (permalink / raw)
  To: Maxin B. John, Jan-Simon Möller
  Cc: jsmoeller@linuxfoundation.org,
	openembedded-core@lists.openembedded.org
In-Reply-To: <1B56A49860EB2D45ADE3731B15C959FDFE57A749@G08CNEXMBPEKD01.g08.fujitsu.local>

Ping.


> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-
> core-bounces@lists.openembedded.org] On Behalf Of Lei, Maohui
> Sent: Monday, October 17, 2016 9:04 AM
> To: Maxin B. John; Jan-Simon Möller
> Cc: jsmoeller@linuxfoundation.org; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support spdx2.0 SPEC
> 
> Hi Maxin, Simon
> 
> > > Instead of requesting the user to install the DoSOCSv2 from github
> > > or other repos, can we make the spdx.bbclass depend on "dosocs-native"
> > or
> > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> >
> > That's a good idea. I will try.
> 
> I tried to make DoSOCSv2 recipe to oe-core, and find that there are at least
> the following direct dependencies that not belong to oe-core.
> 
> PostgreSQL
> python-psycopg2
> jinja2
> python-magic
> docopt
> SQLAlchemy
> psycopg2
> 
> I think it difficult to add them all into oe-core and it's the reason that why
> the original spdx module didn't add fossology into oe-core.
> 
> 
> 
> Best regards
> Lei
> 
> 
> > -----Original Message-----
> > From: openembedded-core-bounces@lists.openembedded.org
> > [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> > Lei, Maohui
> > Sent: Thursday, September 22, 2016 10:19 AM
> > To: Maxin B. John; Jan-Simon Möller
> > Cc: jsmoeller@linuxfoundation.org; openembedded-
> > core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support spdx2.0
> > SPEC
> >
> > Hi Maxin, Simon
> >
> > > It would be nice to include the reason for change from fossology to
> > > dosocs2 in the commit message too (from cover letter)
> >
> > OK, I will add the reasons into the commit message in v3.
> >
> > > Instead of requesting the user to install the DoSOCSv2 from github
> > > or other repos, can we make the spdx.bbclass depend on "dosocs-native"
> > or
> > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> >
> > That's a good idea. I will try.
> >
> >
> > Best Regards
> > Lei
> >
> >
> > > -----Original Message-----
> > > From: Maxin B. John [mailto:maxin.john@intel.com]
> > > Sent: Monday, September 19, 2016 6:58 PM
> > > To: Lei, Maohui
> > > Cc: openembedded-core@lists.openembedded.org;
> > > jsmoeller@linuxfoundation.org
> > > Subject: Re: [OE-core] [PATCH v2 1/1] Make yocto-spdx support
> > > spdx2.0 SPEC
> > >
> > > Hi,
> > >
> > > Please find my comments below:
> > >
> > > On Mon, Sep 19, 2016 at 04:39:50PM +0800, Lei Maohui wrote:
> > > > More:
> > > > - change spdx tool from fossology to dosocs2
> > >
> > > It would be nice to include the reason for change from fossology to
> > > dosocs2 in the commit message too (from cover letter)
> > >
> > > > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > > > ---
> > > >  meta/classes/spdx.bbclass | 505
> > > > ++++++++++++++++++------------------
> > > ----------
> > > >  meta/conf/licenses.conf   |  67 +-----
> > > >  2 files changed, 198 insertions(+), 374 deletions(-)
> > > >
> > > > diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass
> > > > index 0c92765..27c0fa0 100644
> > > > --- a/meta/classes/spdx.bbclass
> > > > +++ b/meta/classes/spdx.bbclass
> > > > @@ -1,365 +1,252 @@
> > > >  # This class integrates real-time license scanning, generation of
> > > > SPDX standard  # output and verifiying license info during the
> > > building process.
> > > > -# It is a combination of efforts from the OE-Core, SPDX and
> > > Fossology projects.
> > > > +# It is a combination of efforts from the OE-Core, SPDX and
> > > > +DoSOCSv2
> > > projects.
> > > >  #
> > > > -# For more information on FOSSology:
> > > > -#   http://www.fossology.org
> > > > -#
> > > > -# For more information on FOSSologySPDX commandline:
> > > > -#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-
> > > SPDX-Web-API
> > > > +# For more information on DoSOCSv2:
> > > > +#   https://github.com/DoSOCSv2
> > >
> > > Instead of requesting the user to install the DoSOCSv2 from github
> > > or other repos, can we make the spdx.bbclass depend on "dosocs-native"
> > or
> > > similar and make that "DoSOCSv2" recipe available in oe-core ?
> > >
> > > That might make it easy to use this class.
> > >
> > > >  # For more information on SPDX:
> > > >  #   http://www.spdx.org
> > > >  #
> > > > +# Note:
> > > > +# 1) Make sure DoSOCSv2 has beed installed in your host # 2) By
> > > > +default,spdx files will be output to the path which is defined
> > > as[SPDX_MANIFEST_DIR]
> > > > +#    in ./meta/conf/licenses.conf.
> > > >
> > > > -# SPDX file will be output to the path which is defined
> > > > as[SPDX_MANIFEST_DIR] -# in ./meta/conf/licenses.conf.
> > > > +SPDXOUTPUTDIR = "${WORKDIR}/spdx_output_dir"
> > > >  SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
> > > >
> > > >  # If ${S} isn't actually the top-level source directory, set
> > SPDX_S
> > > > to point at  # the real top-level directory.
> > > > +
> > > >  SPDX_S ?= "${S}"
> > > >
> > > >  python do_spdx () {
> > > >      import os, sys
> > > > -    import json, shutil
> > > > -
> > > > -    info = {}
> > > > -    info['workdir'] = d.getVar('WORKDIR', True)
> > > > -    info['sourcedir'] = d.getVar('SPDX_S', True)
> > > > -    info['pn'] = d.getVar('PN', True)
> > > > -    info['pv'] = d.getVar('PV', True)
> > > > -    info['spdx_version'] = d.getVar('SPDX_VERSION', True)
> > > > -    info['data_license'] = d.getVar('DATA_LICENSE', True)
> > > > -
> > > > -    sstatedir = d.getVar('SPDXSSTATEDIR', True)
> > > > -    sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] +
> > > ".spdx")
> > > > +    import json
> > > >
> > > > -    manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
> > > > -    info['outfile'] = os.path.join(manifest_dir, info['pn'] +
> > > ".spdx" )
> > > > +    ## It's no necessary  to get spdx files for *-native
> > > > +    if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > +        return None
> > > >
> > > > -    info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
> > > > -    info['tar_file'] = os.path.join(info['workdir'], info['pn'] +
> > > ".tar.gz" )
> > > > +    ## gcc is too big to get spdx file.
> > > > +    if 'gcc' in d.getVar('PN', True):
> > > > +        return None
> > > >
> > > > -    # Make sure important dirs exist
> > > > -    try:
> > > > -        bb.utils.mkdirhier(manifest_dir)
> > > > -        bb.utils.mkdirhier(sstatedir)
> > > > -        bb.utils.mkdirhier(info['spdx_temp_dir'])
> > > > -    except OSError as e:
> > > > -        bb.error("SPDX: Could not set up required directories: " +
> > > str(e))
> > > > -        return
> > > > +    info = {}
> > > > +    info['workdir'] = (d.getVar('WORKDIR', True) or "")
> > > > +    info['pn'] = (d.getVar( 'PN', True ) or "")
> > > > +    info['pv'] = (d.getVar( 'PV', True ) or "")
> > > > +    info['package_download_location'] = (d.getVar( 'SRC_URI',
> > > > + True
> > > > + )
> > > or "")
> > > > +    if info['package_download_location'] != "":
> > > > +        info['package_download_location'] =
> > > info['package_download_location'].split()[0]
> > > > +    info['spdx_version'] = (d.getVar('SPDX_VERSION', True) or '')
> > > > +    info['data_license'] = (d.getVar('DATA_LICENSE', True) or '')
> > > > +    info['creator'] = {}
> > > > +    info['creator']['Tool'] = (d.getVar('CREATOR_TOOL', True) or
> > '')
> > > > +    info['license_list_version'] =
> > > > + (d.getVar('LICENSELISTVERSION',
> > > True) or '')
> > > > +    info['package_homepage'] = (d.getVar('HOMEPAGE', True) or "")
> > > > +    info['package_summary'] = (d.getVar('SUMMARY', True) or "")
> > > > +    info['package_summary'] =
> > > info['package_summary'].replace("\n","")
> > > > +    info['package_summary'] =
> > info['package_summary'].replace("'","
> > > > + ")
> > > > +
> > > > +    spdx_sstate_dir = (d.getVar('SPDXSSTATEDIR', True) or "")
> > > > +    manifest_dir = (d.getVar('SPDX_MANIFEST_DIR', True) or "")
> > > > +    info['outfile'] = os.path.join(manifest_dir, info['pn'] + "-"
> > +
> > > info['pv'] + ".spdx" )
> > > > +    sstatefile = os.path.join(spdx_sstate_dir,
> > > > +        info['pn'] + "-" + info['pv'] + ".spdx" )
> > > >
> > > >      ## get everything from cache.  use it to decide if
> > > > -    ## something needs to be rerun
> > > > -    cur_ver_code = get_ver_code(info['sourcedir'])
> > > > +    ## something needs to be rerun
> > > > +    if not os.path.exists( spdx_sstate_dir ):
> > > > +        bb.utils.mkdirhier( spdx_sstate_dir )
> > > > +
> > > > +    d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > +    info['sourcedir'] = (d.getVar('SPDX_S', True) or "")
> > > > +    cur_ver_code = get_ver_code( info['sourcedir'] ).split()[0]
> > > >      cache_cur = False
> > > > -    if os.path.exists(sstatefile):
> > > > +    if os.path.exists( sstatefile ):
> > > >          ## cache for this package exists. read it in
> > > > -        cached_spdx = get_cached_spdx(sstatefile)
> > > > -
> > > > -        if cached_spdx['PackageVerificationCode'] == cur_ver_code:
> > > > -            bb.warn("SPDX: Verification code for " + info['pn']
> > > > -                  + "is same as cache's. do nothing")
> > > > +        cached_spdx = get_cached_spdx( sstatefile )
> > > > +        if cached_spdx:
> > > > +            cached_spdx = cached_spdx.split()[0]
> > > > +        if (cached_spdx == cur_ver_code):
> > > > +            bb.warn(info['pn'] + "'s ver code same as cache's. do
> > > > + nothing")
> > > >              cache_cur = True
> > > > +            create_manifest(info,sstatefile)
> > > > +    if not cache_cur:
> > > > +        ## setup dosocs2 command
> > > > +        dosocs2_command = "dosocs2 oneshot %s" % info['sourcedir']
> > > > +        ## no necessary to scan the git directory.
> > > > +        git_path = "%s/.git" % info['sourcedir']
> > > > +        if os.path.exists(git_path):
> > > > +            remove_dir_tree(git_path)
> > > > +
> > > > +        ## Get spdx file
> > > > +        run_dosocs2(dosocs2_command,sstatefile)
> > > > +        if get_cached_spdx( sstatefile ) != None:
> > > > +            write_cached_spdx( info,sstatefile,cur_ver_code )
> > > > +            ## CREATE MANIFEST(write to outfile )
> > > > +            create_manifest(info,sstatefile)
> > > >          else:
> > > > -            local_file_info = setup_foss_scan(info, True,
> > > cached_spdx['Files'])
> > > > -    else:
> > > > -        local_file_info = setup_foss_scan(info, False, None)
> > > > -
> > > > -    if cache_cur:
> > > > -        spdx_file_info = cached_spdx['Files']
> > > > -        foss_package_info = cached_spdx['Package']
> > > > -        foss_license_info = cached_spdx['Licenses']
> > > > -    else:
> > > > -        ## setup fossology command
> > > > -        foss_server = d.getVar('FOSS_SERVER', True)
> > > > -        foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
> > > > -        foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) ==
> > "true"
> > > or False
> > > > -        foss_command = "wget %s --post-file=%s %s"\
> > > > -            % (foss_flags, info['tar_file'], foss_server)
> > > > -
> > > > -        foss_result = run_fossology(foss_command, foss_full_spdx)
> > > > -        if foss_result is not None:
> > > > -            (foss_package_info, foss_file_info, foss_license_info)
> > =
> > > foss_result
> > > > -            spdx_file_info = create_spdx_doc(local_file_info,
> > > foss_file_info)
> > > > -            ## write to cache
> > > > -            write_cached_spdx(sstatefile, cur_ver_code,
> > > foss_package_info,
> > > > -                              spdx_file_info, foss_license_info)
> > > > -        else:
> > > > -            bb.error("SPDX: Could not communicate with FOSSology
> > > server. Command was: " + foss_command)
> > > > -            return
> > > > -
> > > > -    ## Get document and package level information
> > > > -    spdx_header_info = get_header_info(info, cur_ver_code,
> > > foss_package_info)
> > > > +            bb.warn('Can\'t get the spdx file ' + info['pn'] + '.
> > > Please check your dosocs2.')
> > > > +    d.setVar('WORKDIR', info['workdir']) } ## Get the src after
> > > > +do_patch.
> > > > +python do_get_spdx_s() {
> > > >
> > > > -    ## CREATE MANIFEST
> > > > -    create_manifest(info, spdx_header_info, spdx_file_info,
> > > foss_license_info)
> > > > +    ## It's no necessary  to get spdx files for *-native
> > > > +    if d.getVar('PN', True) == d.getVar('BPN', True) + "-native":
> > > > +        return None
> > > >
> > > > -    ## clean up the temp stuff
> > > > -    shutil.rmtree(info['spdx_temp_dir'], ignore_errors=True)
> > > > -    if os.path.exists(info['tar_file']):
> > > > -        remove_file(info['tar_file'])
> > > > +    ## gcc is too big to get spdx file.
> > > > +    if 'gcc' in d.getVar('PN', True):
> > > > +        return None
> > > > +
> > > > +    ## Change the WORKDIR to make do_unpack do_patch run in
> > another
> > > dir.
> > > > +    d.setVar('WORKDIR', d.getVar('SPDX_TEMP_DIR', True))
> > > > +    ## The changed 'WORKDIR' also casued 'B' changed, create dir
> > 'B'
> > > for the
> > > > +    ## possibly requiring of the following tasks (such as some
> > > recipes's
> > > > +    ## do_patch required 'B' existed).
> > > > +    bb.utils.mkdirhier(d.getVar('B', True))
> > > > +
> > > > +    ## The kernel source is ready after do_validate_branches
> > > > +    if bb.data.inherits_class('kernel-yocto', d):
> > > > +        bb.build.exec_func('do_unpack', d)
> > > > +        bb.build.exec_func('do_kernel_checkout', d)
> > > > +        bb.build.exec_func('do_validate_branches', d)
> > > > +    else:
> > > > +        bb.build.exec_func('do_unpack', d)
> > > > +    ## The S of the gcc source is work-share
> > > > +    flag = d.getVarFlag('do_unpack', 'stamp-base', True)
> > > > +    if flag:
> > > > +        d.setVar('S', d.getVar('WORKDIR', True) + "/gcc-" +
> > > d.getVar('PV', True))
> > > > +    bb.build.exec_func('do_patch', d)
> > > >  }
> > > > -addtask spdx after do_patch before do_configure
> > > > -
> > > > -def create_manifest(info, header, files, licenses):
> > > > -    import codecs
> > > > -    with codecs.open(info['outfile'], mode='w', encoding='utf-8')
> > as
> > > f:
> > > > -        # Write header
> > > > -        f.write(header + '\n')
> > > > -
> > > > -        # Write file data
> > > > -        for chksum, block in files.iteritems():
> > > > -            f.write("FileName: " + block['FileName'] + '\n')
> > > > -            for key, value in block.iteritems():
> > > > -                if not key == 'FileName':
> > > > -                    f.write(key + ": " + value + '\n')
> > > > -            f.write('\n')
> > > > -
> > > > -        # Write license data
> > > > -        for id, block in licenses.iteritems():
> > > > -            f.write("LicenseID: " + id + '\n')
> > > > -            for key, value in block.iteritems():
> > > > -                f.write(key + ": " + value + '\n')
> > > > -            f.write('\n')
> > > > -
> > > > -def get_cached_spdx(sstatefile):
> > > > -    import json
> > > > -    import codecs
> > > > -    cached_spdx_info = {}
> > > > -    with codecs.open(sstatefile, mode='r', encoding='utf-8') as f:
> > > > -        try:
> > > > -            cached_spdx_info = json.load(f)
> > > > -        except ValueError as e:
> > > > -            cached_spdx_info = None
> > > > -    return cached_spdx_info
> > > >
> > > > -def write_cached_spdx(sstatefile, ver_code, package_info, files,
> > > license_info):
> > > > -    import json
> > > > -    import codecs
> > > > -    spdx_doc = {}
> > > > -    spdx_doc['PackageVerificationCode'] = ver_code
> > > > -    spdx_doc['Files'] = {}
> > > > -    spdx_doc['Files'] = files
> > > > -    spdx_doc['Package'] = {}
> > > > -    spdx_doc['Package'] = package_info
> > > > -    spdx_doc['Licenses'] = {}
> > > > -    spdx_doc['Licenses'] = license_info
> > > > -    with codecs.open(sstatefile, mode='w', encoding='utf-8') as f:
> > > > -        f.write(json.dumps(spdx_doc))
> > > > -
> > > > -def setup_foss_scan(info, cache, cached_files):
> > > > -    import errno, shutil
> > > > -    import tarfile
> > > > -    file_info = {}
> > > > -    cache_dict = {}
> > > > -
> > > > -    for f_dir, f in list_files(info['sourcedir']):
> > > > -        full_path = os.path.join(f_dir, f)
> > > > -        abs_path = os.path.join(info['sourcedir'], full_path)
> > > > -        dest_dir = os.path.join(info['spdx_temp_dir'], f_dir)
> > > > -        dest_path = os.path.join(info['spdx_temp_dir'], full_path)
> > > > -
> > > > -        checksum = hash_file(abs_path)
> > > > -        if not checksum is None:
> > > > -            file_info[checksum] = {}
> > > > -            ## retain cache information if it exists
> > > > -            if cache and checksum in cached_files:
> > > > -                file_info[checksum] = cached_files[checksum]
> > > > -            ## have the file included in what's sent to the
> > > FOSSology server
> > > > -            else:
> > > > -                file_info[checksum]['FileName'] = full_path
> > > > -                try:
> > > > -                    bb.utils.mkdirhier(dest_dir)
> > > > -                    shutil.copyfile(abs_path, dest_path)
> > > > -                except OSError as e:
> > > > -                    bb.warn("SPDX: mkdirhier failed: " + str(e))
> > > > -                except shutil.Error as e:
> > > > -                    bb.warn("SPDX: copyfile failed: " + str(e))
> > > > -                except IOError as e:
> > > > -                    bb.warn("SPDX: copyfile failed: " + str(e))
> > > > -        else:
> > > > -            bb.warn("SPDX: Could not get checksum for file: " + f)
> > > > +addtask get_spdx_s after do_patch before do_configure addtask
> > > > +spdx after do_get_spdx_s before do_configure
> > > > +
> > > > +def create_manifest(info,sstatefile):
> > > > +    import shutil
> > > > +    shutil.copyfile(sstatefile,info['outfile'])
> > > > +
> > > > +def get_cached_spdx( sstatefile ):
> > > > +    import subprocess
> > > > +
> > > > +    if not os.path.exists( sstatefile ):
> > > > +        return None
> > > >
> > > > -    with tarfile.open(info['tar_file'], "w:gz") as tar:
> > > > -        tar.add(info['spdx_temp_dir'],
> > > arcname=os.path.basename(info['spdx_temp_dir']))
> > > > +    try:
> > > > +        output = subprocess.check_output(['grep',
> > > "PackageVerificationCode", sstatefile])
> > > > +    except subprocess.CalledProcessError as e:
> > > > +        bb.error("Index creation command '%s' failed with return
> > > code %d:\n%s" % (e.cmd, e.returncode, e.output))
> > > > +        return None
> > > > +    cached_spdx_info=output.decode('utf-8').split(': ')
> > > > +    return cached_spdx_info[1]
> > > > +
> > > > +## Add necessary information into spdx file def
> > > > +write_cached_spdx( info,sstatefile, ver_code ):
> > > > +    import subprocess
> > > > +
> > > > +    def sed_replace(dest_sed_cmd,key_word,replace_info):
> > > > +        dest_sed_cmd = dest_sed_cmd + "-e 's#^" + key_word + ".*#"
> > > > + +
> > > \
> > > > +            key_word + replace_info + "#' "
> > > > +        return dest_sed_cmd
> > > > +
> > > > +    def sed_insert(dest_sed_cmd,key_word,new_line):
> > > > +        dest_sed_cmd = dest_sed_cmd + "-e '/^" + key_word \
> > > > +            + r"/a\\" + new_line + "' "
> > > > +        return dest_sed_cmd
> > > > +
> > > > +    ## Document level information
> > > > +    sed_cmd = r"sed -i -e 's#\r$##g' "
> > > > +    spdx_DocumentComment = "<text>SPDX for " + info['pn'] + "
> > > version " \
> > > > +        + info['pv'] + "</text>"
> > > > +    sed_cmd =
> > > > + sed_replace(sed_cmd,"DocumentComment",spdx_DocumentComment)
> > > >
> > > > -    return file_info
> > > > +    ## Creator information
> > > > +    sed_cmd = sed_insert(sed_cmd,"CreatorComment:
> > > > + ","LicenseListVersion: " + info['license_list_version'])
> > > > +
> > > > +    ## Package level information
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageName: ",info['pn'])
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageVersion: ",info['pv'])
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageDownloadLocation:
> > > ",info['package_download_location'])
> > > > +    sed_cmd = sed_insert(sed_cmd,"PackageChecksum:
> > > ","PackageHomePage: " + info['package_homepage'])
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageSummary: ","<text>" +
> > > info['package_summary'] + "</text>")
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageVerificationCode:
> > > ",ver_code)
> > > > +    sed_cmd = sed_replace(sed_cmd,"PackageDescription: ",
> > > > +        "<text>" + info['pn'] + " version " + info['pv'] +
> > "</text>")
> > > > +    sed_cmd = sed_cmd + sstatefile
> > > > +
> > > > +    subprocess.call("%s" % sed_cmd, shell=True)
> > > > +
> > > > +def remove_dir_tree( dir_name ):
> > > > +    import shutil
> > > > +    try:
> > > > +        shutil.rmtree( dir_name )
> > > > +    except:
> > > > +        pass
> > > >
> > > > -def remove_file(file_name):
> > > > +def remove_file( file_name ):
> > > >      try:
> > > > -        os.remove(file_name)
> > > > +        os.remove( file_name )
> > > >      except OSError as e:
> > > >          pass
> > > >
> > > > -def list_files(dir):
> > > > -    for root, subFolders, files in os.walk(dir):
> > > > +def list_files( dir ):
> > > > +    for root, subFolders, files in os.walk( dir ):
> > > >          for f in files:
> > > > -            rel_root = os.path.relpath(root, dir)
> > > > +            rel_root = os.path.relpath( root, dir )
> > > >              yield rel_root, f
> > > >      return
> > > >
> > > > -def hash_file(file_name):
> > > > +def hash_file( file_name ):
> > > > +    """
> > > > +    Return the hex string representation of the SHA1 checksum of
> > > > +the
> > > filename
> > > > +    """
> > > >      try:
> > > > -        with open(file_name, 'rb') as f:
> > > > -            data_string = f.read()
> > > > -            sha1 = hash_string(data_string)
> > > > -            return sha1
> > > > -    except:
> > > > +        import hashlib
> > > > +    except ImportError:
> > > >          return None
> > > > +
> > > > +    sha1 = hashlib.sha1()
> > > > +    with open( file_name, "rb" ) as f:
> > > > +        for line in f:
> > > > +            sha1.update(line)
> > > > +    return sha1.hexdigest()
> > > >
> > > > -def hash_string(data):
> > > > +def hash_string( data ):
> > > >      import hashlib
> > > >      sha1 = hashlib.sha1()
> > > > -    sha1.update(data)
> > > > +    sha1.update( data.encode('utf-8') )
> > > >      return sha1.hexdigest()
> > > >
> > > > -def run_fossology(foss_command, full_spdx):
> > > > +def run_dosocs2( dosocs2_command,  spdx_file ):
> > > > +    import subprocess, codecs
> > > >      import string, re
> > > > -    import subprocess
> > > > -
> > > > -    p = subprocess.Popen(foss_command.split(),
> > > > +
> > > > +    p = subprocess.Popen(dosocs2_command.split(),
> > > >          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
> > > > -    foss_output, foss_error = p.communicate()
> > > > +    dosocs2_output, dosocs2_error = p.communicate()
> > > >      if p.returncode != 0:
> > > >          return None
> > > >
> > > > -    foss_output = unicode(foss_output, "utf-8")
> > > > -    foss_output = string.replace(foss_output, '\r', '')
> > > > -
> > > > -    # Package info
> > > > -    package_info = {}
> > > > -    if full_spdx:
> > > > -        # All mandatory, only one occurrence
> > > > -        package_info['PackageCopyrightText'] =
> > > re.findall('PackageCopyrightText: (.*?</text>)', foss_output,
> > > re.S)[0]
> > > > -        package_info['PackageLicenseDeclared'] =
> > > re.findall('PackageLicenseDeclared: (.*)', foss_output)[0]
> > > > -        package_info['PackageLicenseConcluded'] =
> > > re.findall('PackageLicenseConcluded: (.*)', foss_output)[0]
> > > > -        # These may be more than one
> > > > -        package_info['PackageLicenseInfoFromFiles'] =
> > > re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output)
> > > > -    else:
> > > > -        DEFAULT = "NOASSERTION"
> > > > -        package_info['PackageCopyrightText'] = "<text>" + DEFAULT
> > +
> > > "</text>"
> > > > -        package_info['PackageLicenseDeclared'] = DEFAULT
> > > > -        package_info['PackageLicenseConcluded'] = DEFAULT
> > > > -        package_info['PackageLicenseInfoFromFiles'] = []
> > > > -
> > > > -    # File info
> > > > -    file_info = {}
> > > > -    records = []
> > > > -    # FileName is also in PackageFileName, so we match on FileType
> > > as well.
> > > > -    records = re.findall('FileName:.*?FileType:.*?</text>',
> > > foss_output, re.S)
> > > > -    for rec in records:
> > > > -        chksum = re.findall('FileChecksum: SHA1: (.*)\n', rec)[0]
> > > > -        file_info[chksum] = {}
> > > > -        file_info[chksum]['FileCopyrightText'] =
> > > re.findall('FileCopyrightText: '
> > > > -            + '(.*?</text>)', rec, re.S )[0]
> > > > -        fields = ['FileName', 'FileType', 'LicenseConcluded',
> > > 'LicenseInfoInFile']
> > > > -        for field in fields:
> > > > -            file_info[chksum][field] = re.findall(field + ': (.*)',
> > > rec)[0]
> > > > -
> > > > -    # Licenses
> > > > -    license_info = {}
> > > > -    licenses = []
> > > > -    licenses = re.findall('LicenseID:.*?LicenseName:.*?\n',
> > > foss_output, re.S)
> > > > -    for lic in licenses:
> > > > -        license_id = re.findall('LicenseID: (.*)\n', lic)[0]
> > > > -        license_info[license_id] = {}
> > > > -        license_info[license_id]['ExtractedText'] =
> > > re.findall('ExtractedText: (.*?</text>)', lic, re.S)[0]
> > > > -        license_info[license_id]['LicenseName'] =
> > > re.findall('LicenseName: (.*)', lic)[0]
> > > > -
> > > > -    return (package_info, file_info, license_info)
> > > > -
> > > > -def create_spdx_doc(file_info, scanned_files):
> > > > -    import json
> > > > -    ## push foss changes back into cache
> > > > -    for chksum, lic_info in scanned_files.iteritems():
> > > > -        if chksum in file_info:
> > > > -            file_info[chksum]['FileType'] = lic_info['FileType']
> > > > -            file_info[chksum]['FileChecksum: SHA1'] = chksum
> > > > -            file_info[chksum]['LicenseInfoInFile'] =
> > > lic_info['LicenseInfoInFile']
> > > > -            file_info[chksum]['LicenseConcluded'] =
> > > lic_info['LicenseConcluded']
> > > > -            file_info[chksum]['FileCopyrightText'] =
> > > lic_info['FileCopyrightText']
> > > > -        else:
> > > > -            bb.warn("SPDX: " + lic_info['FileName'] + " : " +
> > chksum
> > > > -                + " : is not in the local file info: "
> > > > -                + json.dumps(lic_info, indent=1))
> > > > -    return file_info
> > > > +    dosocs2_output = dosocs2_output.decode('utf-8')
> > > > +
> > > > +    f = codecs.open(spdx_file,'w','utf-8')
> > > > +    f.write(dosocs2_output)
> > > >
> > > > -def get_ver_code(dirname):
> > > > +def get_ver_code( dirname ):
> > > >      chksums = []
> > > > -    for f_dir, f in list_files(dirname):
> > > > -        hash = hash_file(os.path.join(dirname, f_dir, f))
> > > > -        if not hash is None:
> > > > -            chksums.append(hash)
> > > > -        else:
> > > > -            bb.warn("SPDX: Could not hash file: " + path)
> > > > -    ver_code_string = ''.join(chksums).lower()
> > > > -    ver_code = hash_string(ver_code_string)
> > > > +    for f_dir, f in list_files( dirname ):
> > > > +        try:
> > > > +            stats = os.stat(os.path.join(dirname,f_dir,f))
> > > > +        except OSError as e:
> > > > +            bb.warn( "Stat failed" + str(e) + "\n")
> > > > +            continue
> > > > +        chksums.append(hash_file(os.path.join(dirname,f_dir,f)))
> > > > +    ver_code_string = ''.join( chksums ).lower()
> > > > +    ver_code = hash_string( ver_code_string )
> > > >      return ver_code
> > > >
> > > > -def get_header_info(info, spdx_verification_code, package_info):
> > > > -    """
> > > > -        Put together the header SPDX information.
> > > > -        Eventually this needs to become a lot less
> > > > -        of a hardcoded thing.
> > > > -    """
> > > > -    from datetime import datetime
> > > > -    import os
> > > > -    head = []
> > > > -    DEFAULT = "NOASSERTION"
> > > > -
> > > > -    package_checksum = hash_file(info['tar_file'])
> > > > -    if package_checksum is None:
> > > > -        package_checksum = DEFAULT
> > > > -
> > > > -    ## document level information
> > > > -    head.append("## SPDX Document Information")
> > > > -    head.append("SPDXVersion: " + info['spdx_version'])
> > > > -    head.append("DataLicense: " + info['data_license'])
> > > > -    head.append("DocumentComment: <text>SPDX for "
> > > > -        + info['pn'] + " version " + info['pv'] + "</text>")
> > > > -    head.append("")
> > > > -
> > > > -    ## Creator information
> > > > -    ## Note that this does not give time in UTC.
> > > > -    now = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
> > > > -    head.append("## Creation Information")
> > > > -    ## Tools are supposed to have a version, but FOSSology+SPDX
> > > provides none.
> > > > -    head.append("Creator: Tool: FOSSology+SPDX")
> > > > -    head.append("Created: " + now)
> > > > -    head.append("CreatorComment: <text>UNO</text>")
> > > > -    head.append("")
> > > > -
> > > > -    ## package level information
> > > > -    head.append("## Package Information")
> > > > -    head.append("PackageName: " + info['pn'])
> > > > -    head.append("PackageVersion: " + info['pv'])
> > > > -    head.append("PackageFileName: " +
> > > os.path.basename(info['tar_file']))
> > > > -    head.append("PackageSupplier: Person:" + DEFAULT)
> > > > -    head.append("PackageDownloadLocation: " + DEFAULT)
> > > > -    head.append("PackageSummary: <text></text>")
> > > > -    head.append("PackageOriginator: Person:" + DEFAULT)
> > > > -    head.append("PackageChecksum: SHA1: " + package_checksum)
> > > > -    head.append("PackageVerificationCode: " +
> > spdx_verification_code)
> > > > -    head.append("PackageDescription: <text>" + info['pn']
> > > > -        + " version " + info['pv'] + "</text>")
> > > > -    head.append("")
> > > > -    head.append("PackageCopyrightText: "
> > > > -        + package_info['PackageCopyrightText'])
> > > > -    head.append("")
> > > > -    head.append("PackageLicenseDeclared: "
> > > > -        + package_info['PackageLicenseDeclared'])
> > > > -    head.append("PackageLicenseConcluded: "
> > > > -        + package_info['PackageLicenseConcluded'])
> > > > -
> > > > -    for licref in package_info['PackageLicenseInfoFromFiles']:
> > > > -        head.append("PackageLicenseInfoFromFiles: " + licref)
> > > > -    head.append("")
> > > > -
> > > > -    ## header for file level
> > > > -    head.append("## File Information")
> > > > -    head.append("")
> > > > -
> > > > -    return '\n'.join(head)
> > > > diff --git a/meta/conf/licenses.conf b/meta/conf/licenses.conf
> > index
> > > > 9917c40..5963e2f 100644
> > > > --- a/meta/conf/licenses.conf
> > > > +++ b/meta/conf/licenses.conf
> > > > @@ -122,68 +122,5 @@ SPDXLICENSEMAP[SGIv1] = "SGI-1"
> > > >  #COPY_LIC_DIRS = "1"
> > > >
> > > >  ## SPDX temporary directory
> > > > -SPDX_TEMP_DIR = "${WORKDIR}/spdx_temp"
> > > > -SPDX_MANIFEST_DIR = "/home/yocto/fossology_scans"
> > > > -
> > > > -## SPDX Format info
> > > > -SPDX_VERSION = "SPDX-1.1"
> > > > -DATA_LICENSE = "CC0-1.0"
> > > > -
> > > > -## Fossology scan information
> > > > -# You can set option to control if the copyright information will
> > > > be skipped -# during the identification process.
> > > > -#
> > > > -# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
> > > > -# FOSS_COPYRIGHT = "true"
> > > > -#   NO copyright will be processed. That means only license
> > > information will be
> > > > -#   identified and output to SPDX file
> > > > -# FOSS_COPYRIGHT = "false"
> > > > -#   Copyright will be identified and output to SPDX file along
> > with
> > > license
> > > > -#   information. The process will take more time than not
> > processing
> > > copyright
> > > > -#   information.
> > > > -#
> > > > -
> > > > -FOSS_NO_COPYRIGHT = "true"
> > > > -
> > > > -# A option defined as[FOSS_RECURSIVE_UNPACK] in
> > > > ./meta/conf/licenses.conf. is -# used to control if FOSSology
> > server
> > > > need recursively unpack tar.gz file which -# is sent from do_spdx
> > > task.
> > > > -#
> > > > -# FOSS_RECURSIVE_UNPACK = "false":
> > > > -#    FOSSology server does NOT recursively unpack. In the current
> > > release, this
> > > > -#    is the default choice because recursively unpack will not
> > > necessarily break
> > > > -#    down original compressed files.
> > > > -# FOSS_RECURSIVE_UNPACK = "true":
> > > > -#    FOSSology server recursively unpack components.
> > > > -#
> > > > -
> > > > -FOSS_RECURSIVE_UNPACK = "false"
> > > > -
> > > > -# An option defined as [FOSS_FULL_SPDX] in
> > > > ./meta/conf/licenses.conf is used to -# control what kind of SPDX
> > > > output to get from the
> > > FOSSology server.
> > > > -#
> > > > -# FOSS_FULL_SPDX = "true":
> > > > -#   Tell FOSSology server to return full SPDX output, like if the
> > > program was
> > > > -#   run from the command line. This is needed in order to get
> > > license refs for
> > > > -#   the full package rather than individual files only.
> > > > -#
> > > > -# FOSS_FULL_SPDX = "false":
> > > > -#   Tell FOSSology to only process license information for files.
> > > All package
> > > > -#   license tags in the report will be "NOASSERTION"
> > > > -#
> > > > -
> > > > -FOSS_FULL_SPDX = "true"
> > > > -
> > > > -# FOSSologySPDX instance server. http://localhost/repo is the
> > > default
> > > > -# installation location for FOSSology.
> > > > -#
> > > > -# For more information on FOSSologySPDX commandline:
> > > > -#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-
> > > SPDX-Web-API
> > > > -#
> > > > -
> > > > -FOSS_BASE_URL = "http://localhost/repo/?mod=spdx_license_once"
> > > > -FOSS_SERVER =
> > >
> > "${FOSS_BASE_URL}&fullSPDXFlag=${FOSS_FULL_SPDX}&noCopyright=${FOSS_NO
> > > _ COPYRIGHT}&recursiveUnpack=${FOSS_RECURSIVE_UNPACK}"
> > > > -
> > > > -FOSS_WGET_FLAGS = "-qO - --no-check-certificate --timeout=0"
> > > > -
> > > > -
> > > > +SPDX_TEMP_DIR ?= "${WORKDIR}/spdx_temp"
> > > > +SPDX_MANIFEST_DIR ?= "/home/yocto/spdx_scans"
> > >
> > > Best Regards,
> > > Maxin
> > >
> >
> >
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core



^ permalink raw reply

* [PATCH 2/2] lib/oe/recipeutils: print just filename in bbappend_recipe() if in temp dir
From: Paul Eggleton @ 2016-11-03  2:53 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478141595.git.paul.eggleton@linux.intel.com>

If you use devtool update-recipe with the --append option, and a "local"
(in oe-local-files) has been modified we copy it into the specified
destination layer. With the way the devtool update-recipe code works now
the source is always a temp directory, and printing paths from within
that is just confusing, so if the path starts with the temp directory
then just print the file name alone.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/recipeutils.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 58e4028..6caae5f 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -786,7 +786,11 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
         for newfile, srcfile in copyfiles.items():
             filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
             if os.path.abspath(newfile) != os.path.abspath(filedest):
-                bb.note('Copying %s to %s' % (newfile, filedest))
+                if newfile.startswith(tempfile.gettempdir()):
+                    newfiledisp = os.path.basename(newfile)
+                else:
+                    newfiledisp = newfile
+                bb.note('Copying %s to %s' % (newfiledisp, filedest))
                 bb.utils.mkdirhier(os.path.dirname(filedest))
                 shutil.copyfile(newfile, filedest)
 
-- 
2.5.5



^ permalink raw reply related

* [PATCH 1/2] devtool: update-recipe: decode output before treating it as a string
From: Paul Eggleton @ 2016-11-03  2:53 UTC (permalink / raw)
  To: openembedded-core
In-Reply-To: <cover.1478141595.git.paul.eggleton@linux.intel.com>

When you receive output from subprocess, with Python 3 it's a stream of
bytes so you need to decode it before you can start treating it as a
string.

Fixes [YOCTO #10447].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/standard.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4eff6f8..32eac23 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -331,6 +331,7 @@ def _git_ls_tree(repodir, treeish='HEAD', recursive=False):
         cmd.append('-r')
     out, _ = bb.process.run(cmd, cwd=repodir)
     ret = {}
+    out = out.decode('utf-8')
     for line in out.split('\0'):
         if line:
             split = line.split(None, 4)
-- 
2.5.5



^ permalink raw reply related

* [PATCH 0/2] Fixes for devtool update-recipe
From: Paul Eggleton @ 2016-11-03  2:53 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 98c6ebf1e05158c689e01b785d32757847cdb10c:

  oeqa/selftest/kernel.py: Add new file destined for kernel related tests (2016-11-01 10:05:40 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool-update-recipe
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool-update-recipe

Paul Eggleton (2):
  devtool: update-recipe: decode output before treating it as a string
  lib/oe/recipeutils: print just filename in bbappend_recipe() if in temp dir

 meta/lib/oe/recipeutils.py      | 6 +++++-
 scripts/lib/devtool/standard.py | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

-- 
2.5.5



^ permalink raw reply

* [PATCH 1/2] runqemu: Split out the base name of QB_DEFAULT_KERNEL
From: Alistair Francis @ 2016-11-02 23:18 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core
In-Reply-To: <1478128703-12144-1-git-send-email-alistair.francis@xilinx.com>

The function write_qemuboot_conf() in qemuboot.bbclass always inserts
the full path into QB_DEFAULT_KERNEL. Remove this path before using the
variable.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index dbe17ab..922ebaf 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -478,9 +478,12 @@ class BaseConfig(object):
         if self.fstype in self.vmtypes:
             return
 
+        # QB_DEFAULT_KERNEL is always a full file path
+        kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
+
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
         if not self.kernel:
-            kernel_match_name = "%s/%s" % (deploy_dir_image, self.get('QB_DEFAULT_KERNEL'))
+            kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
             kernel_match_link = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             kernel_startswith = "%s/%s*" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             cmds = (kernel_match_name, kernel_match_link, kernel_startswith)
-- 
2.7.4



^ permalink raw reply related

* [PATCH v2 1/2] runqemu: Split out the base name of QB_DEFAULT_KERNEL
From: Alistair Francis @ 2016-11-03  0:17 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core
In-Reply-To: <1478132237-28350-1-git-send-email-alistair.francis@xilinx.com>

The function write_qemuboot_conf() in qemuboot.bbclass always inserts
the full path into QB_DEFAULT_KERNEL. Remove this path before using the
variable.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index dbe17ab..922ebaf 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -478,9 +478,12 @@ class BaseConfig(object):
         if self.fstype in self.vmtypes:
             return
 
+        # QB_DEFAULT_KERNEL is always a full file path
+        kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
+
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
         if not self.kernel:
-            kernel_match_name = "%s/%s" % (deploy_dir_image, self.get('QB_DEFAULT_KERNEL'))
+            kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
             kernel_match_link = "%s/%s" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             kernel_startswith = "%s/%s*" % (deploy_dir_image, self.get('KERNEL_IMAGETYPE'))
             cmds = (kernel_match_name, kernel_match_link, kernel_startswith)
-- 
2.7.4



^ permalink raw reply related

* [PATCH v2 2/2] runqemu: Allow the user to specity no kernel or rootFS
From: Alistair Francis @ 2016-11-03  0:17 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core
In-Reply-To: <1478132237-28350-1-git-send-email-alistair.francis@xilinx.com>

In some cirsumstances the user doesn't want to supply a kernel, rootFS
or DTB to QEMU. This will occur more now that QEMU supports loading
images using a '-device loader' method.

Allow users to specify 'none' for QB_DEFAULT_FSTYPE or QB_DEFAULT_KERNEL
to avoid supplying these options to QEMU.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 922ebaf..5f60312 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -453,7 +453,7 @@ class BaseConfig(object):
     def check_rootfs(self):
         """Check and set rootfs"""
 
-        if self.fstype == 'nfs':
+        if self.fstype == 'nfs' or self.fstype == "none":
             return
 
         if self.rootfs and not os.path.exists(self.rootfs):
@@ -481,6 +481,10 @@ class BaseConfig(object):
         # QB_DEFAULT_KERNEL is always a full file path
         kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
 
+        # The user didn't want a kernel to be loaded
+        if kernel_name == "none":
+            return
+
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
         if not self.kernel:
             kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
@@ -857,6 +861,9 @@ class BaseConfig(object):
             k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server, self.nfs_dir, self.unfs_opts)
             self.kernel_cmdline = 'root=%s rw highres=off' % k_root
 
+        if self.fstype == 'none':
+            self.rootfs_options = ''
+
         self.set('ROOTFS_OPTIONS', self.rootfs_options)
 
     def guess_qb_system(self):
-- 
2.7.4



^ permalink raw reply related

* Re: [PATCH] gdb: update 7.11+git1a982b689c -> 7.11.1
From: Khem Raj @ 2016-11-03  0:30 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <1478127423-4954-1-git-send-email-armccurdy@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 7029 bytes --]

This is ok. Please backport it to morty as well

On Nov 2, 2016 4:00 PM, "Andre McCurdy" <armccurdy@gmail.com> wrote:

>   41d8236 Set GDB version number to 7.11.1.
>   136613e Fix PR gdb/19828: gdb -p <process from a container>: internal
> error
>   a0de87e Make gdb/linux-nat.c consider a waitstatus pending on the infrun
> side
>   cf2cd51 Add mi-threads-interrupt.exp test (PR 20039)
>   f0a8d0d Fix double prompt output after run control MI commands with
> mi-async on (PR 20045)
>   b5f0db4 Fix -exec-run not running asynchronously with mi-async on (PR
> gdb/18077)
>   7f8e34d Use target_terminal_ours_for_output in MI
>
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
>  meta/recipes-devtools/gdb/gdb-7.11.1.inc           | 22
> ++++++++++++++++++++
>  meta/recipes-devtools/gdb/gdb-7.11.inc             |  9 --------
>  meta/recipes-devtools/gdb/gdb-common.inc           | 24
> ----------------------
>  ...nadian_7.11.bb => gdb-cross-canadian_7.11.1.bb} |  0
>  .../gdb/{gdb-cross_7.11.bb => gdb-cross_7.11.1.bb} |  0
>  .../gdb/{gdb_7.11.bb => gdb_7.11.1.bb}             |  0
>  6 files changed, 22 insertions(+), 33 deletions(-)
>  create mode 100644 meta/recipes-devtools/gdb/gdb-7.11.1.inc
>  delete mode 100644 meta/recipes-devtools/gdb/gdb-7.11.inc
>  rename meta/recipes-devtools/gdb/{gdb-cross-canadian_7.11.bb =>
> gdb-cross-canadian_7.11.1.bb} (100%)
>  rename meta/recipes-devtools/gdb/{gdb-cross_7.11.bb =>
> gdb-cross_7.11.1.bb} (100%)
>  rename meta/recipes-devtools/gdb/{gdb_7.11.bb => gdb_7.11.1.bb} (100%)
>
> diff --git a/meta/recipes-devtools/gdb/gdb-7.11.1.inc
> b/meta/recipes-devtools/gdb/gdb-7.11.1.inc
> new file mode 100644
> index 0000000..d9dfe6f
> --- /dev/null
> +++ b/meta/recipes-devtools/gdb/gdb-7.11.1.inc
> @@ -0,0 +1,22 @@
> +LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
> +                   file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
> +                   file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6
> \
> +                   file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b66
> 74"
> +
> +SRC_URI = "http://ftp.gnu.org/gnu/gdb/gdb-${PV}.tar.xz \
> +           file://0001-include-sys-types.h-for-mode_t.patch \
> +           file://0002-make-man-install-relative-to-DESTDIR.patch \
> +           file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
> \
> +           file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
> \
> +           file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch
> \
> +           file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch
> \
> +           file://0007-use-asm-sgidefs.h.patch \
> +           file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
> +           file://0009-Change-order-of-CFLAGS.patch \
> +           file://0010-resolve-restrict-keyword-conflict.patch \
> +           file://0011-avx_mpx.patch \
> +"
> +
> +SRC_URI[md5sum] = "5aa71522e488e358243917967db87476"
> +SRC_URI[sha256sum] = "e9216da4e3755e9f414c1aa0026b62
> 6251dfc57ffe572a266e98da4f6988fc70"
> diff --git a/meta/recipes-devtools/gdb/gdb-7.11.inc
> b/meta/recipes-devtools/gdb/gdb-7.11.inc
> deleted file mode 100644
> index a9267d5..0000000
> --- a/meta/recipes-devtools/gdb/gdb-7.11.inc
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
> -                   file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
> -                   file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6
> \
> -                   file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b66
> 74"
> -
> -SRC_URI[md5sum] = "b93a2721393e5fa226375b42d567d90b"
> -SRC_URI[sha256sum] = "ff14f8050e6484508c73cbfa63731e
> 57901478490ca1672dc0b5e2b03f6af622"
> -
> diff --git a/meta/recipes-devtools/gdb/gdb-common.inc
> b/meta/recipes-devtools/gdb/gdb-common.inc
> index 0923143..33a5ce9 100644
> --- a/meta/recipes-devtools/gdb/gdb-common.inc
> +++ b/meta/recipes-devtools/gdb/gdb-common.inc
> @@ -1,6 +1,5 @@
>  SUMMARY = "GNU debugger"
>  HOMEPAGE = "http://www.gnu.org/software/gdb/"
> -LICENSE = "GPLv3+"
>  SECTION = "devel"
>  DEPENDS = "expat zlib ncurses virtual/libiconv ${LTTNGUST}"
>
> @@ -16,33 +15,10 @@ LTTNGUST_mips64eln32 = ""
>  LTTNGUST_sh4 = ""
>  LTTNGUST_libc-musl = ""
>
> -LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
> -               file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
> -               file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
> -               file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
> -
>  inherit autotools texinfo
>
> -SRCREV = "1a982b689ce4e20523bdf69e47fdd574c4f63934"
> -
> -SRC_URI = "git://sourceware.org/git/binutils-gdb.git;branch=gdb-7.
> 11-branch \
> -           file://0001-include-sys-types.h-for-mode_t.patch \
> -           file://0002-make-man-install-relative-to-DESTDIR.patch \
> -           file://0003-mips-linux-nat-Define-_ABIO32-if-not-defined.patch
> \
> -           file://0004-ppc-ptrace-Define-pt_regs-uapi_pt_regs-on-GLIBC-syst.patch
> \
> -           file://0005-Add-support-for-Renesas-SH-sh4-architecture.patch
> \
> -           file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch
> \
> -           file://0007-use-asm-sgidefs.h.patch \
> -           file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \
> -           file://0009-Change-order-of-CFLAGS.patch \
> -           file://0010-resolve-restrict-keyword-conflict.patch \
> -           file://0011-avx_mpx.patch \
> -"
> -
>  UPSTREAM_CHECK_GITTAGREGEX = "gdb\-(?P<pver>.+)\-release"
>
> -S = "${WORKDIR}/git"
> -
>  B = "${WORKDIR}/build-${TARGET_SYS}"
>
>  EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc
> utils'"
> diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.bb
> b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb
> similarity index 100%
> rename from meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.bb
> rename to meta/recipes-devtools/gdb/gdb-cross-canadian_7.11.1.bb
> diff --git a/meta/recipes-devtools/gdb/gdb-cross_7.11.bb
> b/meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb
> similarity index 100%
> rename from meta/recipes-devtools/gdb/gdb-cross_7.11.bb
> rename to meta/recipes-devtools/gdb/gdb-cross_7.11.1.bb
> diff --git a/meta/recipes-devtools/gdb/gdb_7.11.bb
> b/meta/recipes-devtools/gdb/gdb_7.11.1.bb
> similarity index 100%
> rename from meta/recipes-devtools/gdb/gdb_7.11.bb
> rename to meta/recipes-devtools/gdb/gdb_7.11.1.bb
> --
> 1.9.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 10841 bytes --]

^ permalink raw reply

* Re: version of gdb in morty
From: Khem Raj @ 2016-11-03  0:27 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer
In-Reply-To: <CAMKF1src9Pw2=6T7V3J7vmrccFkU5-POCukerpZYFQDxj8we+A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

I think doing an upgrade to 7.11.1 and Backporting that to morty is a
reasonable option here

On Nov 2, 2016 4:15 PM, "Burton, Ross" <ross.burton@intel.com> wrote:


On 2 November 2016 at 20:41, Andre McCurdy <armccurdy@gmail.com> wrote:

> It looks like morty (and master) are building gdb from git (ie cloning
> a ~660MB repo) with the git revision set to a snapshot mid-way between
> the 7.11 and 7.11.1 release tags.
>
> Was that the intention? Or is there a patch somewhere to switch to
> building from the official 7.11.1 tar file?
>

That was introduced by Khem with the commit message of "gdb: Upgrade to
7.11", so clearly we should have validated that the hash matches the tag
and that there wasn't the option of a tarball.

For master we can obviously take a 7.11.1 upgrade, for morty there is a
case to be made that a git clone is sufficiently huge and inconvenient for
users who are not tracking master that an upgrade to get the tarball is
reasonable.

Ross

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

[-- Attachment #2: Type: text/html, Size: 2346 bytes --]

^ permalink raw reply

* Re: [PATCH 2/2] runqemu: Allow the user to specity no kernel or rootFS
From: Alistair Francis @ 2016-11-03  0:19 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: OE-core
In-Reply-To: <CAJ86T=WY7SJu1s271hhVjh5x9ismvGW_2baJSsX6zZdiURMz7Q@mail.gmail.com>

On Wed, Nov 2, 2016 at 5:13 PM, Andre McCurdy <armccurdy@gmail.com> wrote:
> On Wed, Nov 2, 2016 at 4:30 PM, Alistair Francis <alistair23@gmail.com> wrote:
>> On Wed, Nov 2, 2016 at 4:18 PM, Alistair Francis
>> <alistair.francis@xilinx.com> wrote:
>>> In some cirsumstances the user doesn't want to supply a kernel, rootFS
>>> or DTB to QEMU. This will occur more now that QEMU supports loading
>>> images using a '-device loader' method.
>>>
>>> Allow users to specify 'none' for QB_DEFAULT_FSTYPE or QB_DEFAULT_KERNEL
>>> to avoid supplying these options to QEMU.
>>>
>>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>>> ---
>>>  scripts/runqemu | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/runqemu b/scripts/runqemu
>>> index 922ebaf..ac10ee2 100755
>>> --- a/scripts/runqemu
>>> +++ b/scripts/runqemu
>>> @@ -453,7 +453,7 @@ class BaseConfig(object):
>>>      def check_rootfs(self):
>>>          """Check and set rootfs"""
>>>
>>> -        if self.fstype == 'nfs':
>>> +        if self.fstype == 'nfs' or self.fstype == "none":
>>>              return
>>>
>>>          if self.rootfs and not os.path.exists(self.rootfs):
>>> @@ -481,6 +481,10 @@ class BaseConfig(object):
>>>          # QB_DEFAULT_KERNEL is always a full file path
>>>          kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
>>>
>>> +        # The user didn't want a kernel to be loaded
>>> +        if kernel_name == "none":
>>> +            return
>>> +
>>>          deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
>>>          if not self.kernel:
>>>              kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
>>
>> This diff didn't end up making it in somehow. This is also required:
>
> Squash the two commits and send the result as a v2.

I was trying to avoid spam, but you are right. I sent a v2

Thanks,

Alistair

>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index ac10ee2..5f60312 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -861,6 +861,9 @@ class BaseConfig(object):
>>              k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server,
>> self.nfs_dir, self.unfs_opts)
>>              self.kernel_cmdline = 'root=%s rw highres=off' % k_root
>>
>> +        if self.fstype == 'none':
>> +            self.rootfs_options = ''
>> +
>>          self.set('ROOTFS_OPTIONS', self.rootfs_options)
>>
>>      def guess_qb_system(self):
>>
>> Thanks,
>>
>> Alistair
>>
>>> --
>>> 2.7.4
>>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply

* [PATCH v2 0/2] runqemu: Allow users to not specify a kernel or RootFS
From: Alistair Francis @ 2016-11-03  0:17 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core

This patch series first fixes a bug in the runqemu script and secondly gives
users the option to tell the script that they don't want to load a kernel or
rootFS when starting QEMU.

Future versions of QEMU now include a generic loader that machines can use to
load images so there are cases where the user doesn't want to specify any
-kernel, -initrd or -dtb options.

V2:
 - Squash patch I missed the first time.

Alistair Francis (2):
  runqemu: Split out the base name of QB_DEFAULT_KERNEL
  runqemu: Allow the user to specity no kernel or rootFS

 scripts/runqemu | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

-- 
2.7.4



^ permalink raw reply

* Re: [PATCH 2/2] runqemu: Allow the user to specity no kernel or rootFS
From: Andre McCurdy @ 2016-11-03  0:13 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core
In-Reply-To: <CAKmqyKNX+9gFkukkL=eN_wPrv+0tDPf5jpvnRaL6BjHe-xmkHQ@mail.gmail.com>

On Wed, Nov 2, 2016 at 4:30 PM, Alistair Francis <alistair23@gmail.com> wrote:
> On Wed, Nov 2, 2016 at 4:18 PM, Alistair Francis
> <alistair.francis@xilinx.com> wrote:
>> In some cirsumstances the user doesn't want to supply a kernel, rootFS
>> or DTB to QEMU. This will occur more now that QEMU supports loading
>> images using a '-device loader' method.
>>
>> Allow users to specify 'none' for QB_DEFAULT_FSTYPE or QB_DEFAULT_KERNEL
>> to avoid supplying these options to QEMU.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>  scripts/runqemu | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/runqemu b/scripts/runqemu
>> index 922ebaf..ac10ee2 100755
>> --- a/scripts/runqemu
>> +++ b/scripts/runqemu
>> @@ -453,7 +453,7 @@ class BaseConfig(object):
>>      def check_rootfs(self):
>>          """Check and set rootfs"""
>>
>> -        if self.fstype == 'nfs':
>> +        if self.fstype == 'nfs' or self.fstype == "none":
>>              return
>>
>>          if self.rootfs and not os.path.exists(self.rootfs):
>> @@ -481,6 +481,10 @@ class BaseConfig(object):
>>          # QB_DEFAULT_KERNEL is always a full file path
>>          kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
>>
>> +        # The user didn't want a kernel to be loaded
>> +        if kernel_name == "none":
>> +            return
>> +
>>          deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
>>          if not self.kernel:
>>              kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
>
> This diff didn't end up making it in somehow. This is also required:

Squash the two commits and send the result as a v2.

> diff --git a/scripts/runqemu b/scripts/runqemu
> index ac10ee2..5f60312 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -861,6 +861,9 @@ class BaseConfig(object):
>              k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server,
> self.nfs_dir, self.unfs_opts)
>              self.kernel_cmdline = 'root=%s rw highres=off' % k_root
>
> +        if self.fstype == 'none':
> +            self.rootfs_options = ''
> +
>          self.set('ROOTFS_OPTIONS', self.rootfs_options)
>
>      def guess_qb_system(self):
>
> Thanks,
>
> Alistair
>
>> --
>> 2.7.4
>>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply

* [PATCH 2/2] runqemu: Allow the user to specity no kernel or rootFS
From: Alistair Francis @ 2016-11-02 23:18 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core
In-Reply-To: <1478128703-12144-1-git-send-email-alistair.francis@xilinx.com>

In some cirsumstances the user doesn't want to supply a kernel, rootFS
or DTB to QEMU. This will occur more now that QEMU supports loading
images using a '-device loader' method.

Allow users to specify 'none' for QB_DEFAULT_FSTYPE or QB_DEFAULT_KERNEL
to avoid supplying these options to QEMU.

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
---
 scripts/runqemu | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/runqemu b/scripts/runqemu
index 922ebaf..ac10ee2 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -453,7 +453,7 @@ class BaseConfig(object):
     def check_rootfs(self):
         """Check and set rootfs"""
 
-        if self.fstype == 'nfs':
+        if self.fstype == 'nfs' or self.fstype == "none":
             return
 
         if self.rootfs and not os.path.exists(self.rootfs):
@@ -481,6 +481,10 @@ class BaseConfig(object):
         # QB_DEFAULT_KERNEL is always a full file path
         kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
 
+        # The user didn't want a kernel to be loaded
+        if kernel_name == "none":
+            return
+
         deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
         if not self.kernel:
             kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)
-- 
2.7.4



^ permalink raw reply related

* [PATCH 0/2] runqemu: Allow users to not specify a kernel or RootFS
From: Alistair Francis @ 2016-11-02 23:18 UTC (permalink / raw)
  To: liezhi.yang, openembedded-core

This patch series first fixes a bug in the runqemu script and secondly gives
users the option to tell the script that they don't want to load a kernel or
rootFS when starting QEMU.

Future versions of QEMU now include a generic loader that machines can use to
load images so there are cases where the user doesn't want to specify any
-kernel, -initrd or -dtb options.

Alistair Francis (2):
  runqemu: Split out the base name of QB_DEFAULT_KERNEL
  runqemu: Allow the user to specity no kernel or rootFS

 scripts/runqemu | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

-- 
2.7.4



^ permalink raw reply

* Re: [PATCH 2/2] runqemu: Allow the user to specity no kernel or rootFS
From: Alistair Francis @ 2016-11-02 23:30 UTC (permalink / raw)
  To: Alistair Francis; +Cc: OE-core
In-Reply-To: <1478128703-12144-3-git-send-email-alistair.francis@xilinx.com>

On Wed, Nov 2, 2016 at 4:18 PM, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> In some cirsumstances the user doesn't want to supply a kernel, rootFS
> or DTB to QEMU. This will occur more now that QEMU supports loading
> images using a '-device loader' method.
>
> Allow users to specify 'none' for QB_DEFAULT_FSTYPE or QB_DEFAULT_KERNEL
> to avoid supplying these options to QEMU.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>  scripts/runqemu | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/runqemu b/scripts/runqemu
> index 922ebaf..ac10ee2 100755
> --- a/scripts/runqemu
> +++ b/scripts/runqemu
> @@ -453,7 +453,7 @@ class BaseConfig(object):
>      def check_rootfs(self):
>          """Check and set rootfs"""
>
> -        if self.fstype == 'nfs':
> +        if self.fstype == 'nfs' or self.fstype == "none":
>              return
>
>          if self.rootfs and not os.path.exists(self.rootfs):
> @@ -481,6 +481,10 @@ class BaseConfig(object):
>          # QB_DEFAULT_KERNEL is always a full file path
>          kernel_name = os.path.basename(self.get('QB_DEFAULT_KERNEL'))
>
> +        # The user didn't want a kernel to be loaded
> +        if kernel_name == "none":
> +            return
> +
>          deploy_dir_image = self.get('DEPLOY_DIR_IMAGE')
>          if not self.kernel:
>              kernel_match_name = "%s/%s" % (deploy_dir_image, kernel_name)

This diff didn't end up making it in somehow. This is also required:

diff --git a/scripts/runqemu b/scripts/runqemu
index ac10ee2..5f60312 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -861,6 +861,9 @@ class BaseConfig(object):
             k_root = '/dev/nfs nfsroot=%s:%s,%s' % (self.nfs_server,
self.nfs_dir, self.unfs_opts)
             self.kernel_cmdline = 'root=%s rw highres=off' % k_root

+        if self.fstype == 'none':
+            self.rootfs_options = ''
+
         self.set('ROOTFS_OPTIONS', self.rootfs_options)

     def guess_qb_system(self):

Thanks,

Alistair

> --
> 2.7.4
>


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox