Procházet zdrojové kódy

Merge branch 'master' into krogoth

 Conflicts:
	recipes-support/swupdate/swupdate.inc
	recipes-support/swupdate/swupdate_2016.07.bb
	recipes-support/swupdate/swupdate_git.bb

Signed-off-by: Stefano Babic <sbabic@denx.de>
Stefano Babic před 9 roky
rodič
revize
2bdf1d1be5

+ 0 - 31
recipes-bsp/u-boot/files/0001-Allow-fw-env-tools-to-be-available-as-library.patch

@@ -1,31 +0,0 @@
-From e6850fcf6273b2068c5ae659bbacd8c7f664fd26 Mon Sep 17 00:00:00 2001
-From: Stefano Babic <sbabic@denx.de>
-Date: Mon, 22 Jun 2015 14:58:24 +0200
-Subject: [PATCH] Allow fw env tools to be available as library
-
-Signed-off-by: Stefano Babic <sbabic@denx.de>
----
- tools/env/Makefile | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/tools/env/Makefile b/tools/env/Makefile
-index 40164f7..38ad118 100644
---- a/tools/env/Makefile
-+++ b/tools/env/Makefile
-@@ -23,10 +23,12 @@ endif
- always := fw_printenv
- hostprogs-y := fw_printenv
- 
--fw_printenv-objs := fw_env.o fw_env_main.o \
-+lib-y += fw_env.o \
- 	crc32.o ctype.o linux_string.o \
- 	env_attr.o env_flags.o aes.o
- 
-+fw_printenv-objs := fw_env_main.o $(lib-y)
-+
- quiet_cmd_crosstools_strip = STRIP   $^
-       cmd_crosstools_strip = $(STRIP) $^; touch $@
- 
--- 
-1.9.1
-

+ 0 - 2
recipes-bsp/u-boot/u-boot-fw-utils%.bbappend

@@ -1,5 +1,3 @@
-FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
-
 do_install_append() {
     install -d ${D}${libdir}
     install -m 644  ${S}/tools/env/lib.a ${D}${libdir}/libubootenv.a

+ 1 - 1
recipes-extended/images/swupdate-image.bb

@@ -49,4 +49,4 @@ fix_inittab_swupdate () {
 
 # remove not needed ipkg informations
 ROOTFS_POSTPROCESS_COMMAND += "remove_locale_data_files ; "
-ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('SWUPDATE_INIT', 'tiny', '', 'fix_inittab_swupdate', d)}"
+ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('SWUPDATE_INIT', 'tiny', 'fix_inittab_swupdate', '',  d)}"

+ 54 - 1
recipes-support/swupdate/swupdate.inc

@@ -1,7 +1,7 @@
 SUMMARY="Image updater for Yocto projects"
 DESCRIPTION = "Application for automatic software update from USB Pen"
 SECTION="swupdate"
-DEPENDS = "mtd-utils libconfig libarchive openssl lua curl json-c u-boot-fw-utils gnutls"
+DEPENDS = "libconfig openssl gnutls"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
 
@@ -13,6 +13,8 @@ SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=git \
      file://swupdate.service \
      "
 
+SRCREV = "${AUTOREV}"
+
 PACKAGES =+ "${PN}-www"
 
 FILES_${PN}-www = "/www/*"
@@ -24,6 +26,50 @@ S = "${WORKDIR}/git/"
 
 EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
 
+python () {
+    try:
+        defconfig = bb.fetch2.localpath('file://defconfig', d)
+    except bb.fetch2.FetchError:
+        return
+
+    try:
+        configfile = open(defconfig)
+    except IOError:
+        return
+
+    features = configfile.readlines()
+    configfile.close()
+
+    if 'CONFIG_REMOTE_HANDLER=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' zeromq')
+
+    if 'CONFIG_JSON=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' json-c')
+
+    if 'CONFIG_ARCHIVE=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' libarchive')
+
+    if 'CONFIG_LUA=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' lua')
+
+    if 'CONFIG_UBOOT=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' u-boot-fw-utils')
+
+    if 'CONFIG_DOWNLOAD=y\n' in features or 'CONFIG_SURICATTA=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' curl')
+
+    if 'CONFIG_MTD=y\n' in features:
+        depends = d.getVar('DEPENDS', False)
+        d.setVar('DEPENDS', depends + ' mtd-utils')
+
+}
+
 do_configure () {
   cp ${WORKDIR}/defconfig ${S}/.config
   cml1_do_configure
@@ -33,6 +79,11 @@ do_compile() {
   unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
   oe_runmake swupdate_unstripped
   cp swupdate_unstripped swupdate
+
+  if [ "${@bb.utils.vercmp_string('${PV}', '2016.07')}" = "1"  ]; then
+    oe_runmake progress_unstripped
+    cp progress_unstripped progress
+  fi
 }
 
 do_install () {
@@ -45,6 +96,8 @@ do_install () {
   install -d ${D}${libdir}/
   install -d ${D}${includedir}/
   install -m 0644 ${S}include/network_ipc.h ${D}${includedir}
+  install -m 0644 ${S}include/swupdate_status.h ${D}${includedir}
+  install -m 0644 ${S}include/progress.h ${D}${includedir}
   install -m 0755 ${S}ipc/lib.a ${D}${libdir}/libswupdate.a
 
   install -d ${D}${sysconfdir}/init.d

+ 1 - 5
recipes-support/swupdate/swupdate_2016.07.bb

@@ -1,7 +1,3 @@
 require swupdate.inc
 
-SRC_URI = "git://github.com/sbabic/swupdate.git;protocol=git;tag=2016.07 \
-     file://defconfig \
-     file://swupdate \
-     file://swupdate.service \
-     "
+SRCREV = "458d8122cf93ec295195342846cc6e879951aa44"

+ 3 - 0
recipes-support/swupdate/swupdate_2016.10.bb

@@ -0,0 +1,3 @@
+require swupdate.inc
+
+SRCREV = "edd6559728d2e234ebdc03ba1d5444449ae2b92b"

+ 1 - 3
recipes-support/swupdate/swupdate_git.bb

@@ -1,5 +1,3 @@
 require swupdate.inc
 
-# this is 2016.10-rc1
-SRCREV = "8abacd3613410002c0cd05a12e82d695d3e4bf6f"
-
+DEFAULT_PREFERENCE = "-1"