swupdate: rename swupdate recipe bbappend to append to the 2017.01 version

- In Jethro, swupdate recipe was using 'swupdate_git.bb' as the main recipe to
  build. In morty that recipe has been disabled and the '2017.01' one is used
  instead, so we have to append to this new recipe by renaming our existing one.
- Our bbappend will now point to the same SHA1 that is being used, so we can
  remove the SRCREV.
- The new code already includes the progress client patch, so it has been removed.

Signed-off-by: David Escalona <david.escalona@digi.com>
This commit is contained in:
David Escalona 2017-03-01 12:07:16 +01:00
parent 2cc93b353c
commit 2f7b062d46
4 changed files with 9 additions and 153 deletions

View File

@ -56,9 +56,6 @@ PREFERRED_VERSION_linux-yocto_qemumips ?= "4.8%"
PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.8%" PREFERRED_VERSION_linux-yocto_qemumips64 ?= "4.8%"
PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.8%" PREFERRED_VERSION_linux-yocto_qemuppc ?= "4.8%"
# Use swupdate version 2016.10
PREFERRED_VERSION_swupdate = "2016.10+git%"
SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}" SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${IMAGE_BASENAME}-${TUNE_PKGARCH}"
SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}" SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}"

View File

@ -1,133 +0,0 @@
From: Stefano Babic <sbabic@denx.de>
Date: Wed, 30 Nov 2016 18:04:21 +0100
Subject: [PATCH] progress_client: add command line parameter
Add command lin eparameter to:
- waiting forever for a connection with SWUpdate
- make psplash optional
Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: David Escalona <david.escalona@digi.com>
---
progress_client/progress.c | 67 +++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 60 insertions(+), 7 deletions(-)
diff --git a/progress_client/progress.c b/progress_client/progress.c
index b057a8f..c587dd6 100644
--- a/progress_client/progress.c
+++ b/progress_client/progress.c
@@ -34,11 +34,30 @@
#include <arpa/inet.h>
#include <netinet/in.h>
#include <pthread.h>
+#include <getopt.h>
#include <progress.h>
#define PSPLASH_MSG_SIZE 64
+static struct option long_options[] = {
+ {"psplash", no_argument, NULL, 'p'},
+ {"wait", no_argument, NULL, 'w'},
+ {NULL, 0, NULL, 0}
+};
+
+static void usage(char *programname)
+{
+ fprintf(stdout, "%s (compiled %s)\n", programname, __DATE__);
+ fprintf(stdout, "Usage %s [OPTION]\n",
+ programname);
+ fprintf(stdout,
+ " -w, --wait : wait for a connection with SWUpdate\n"
+ " -p, --psplash : send info to the psplash process\n"
+ " -h, --help : print this help and exit\n"
+ );
+}
+
static int psplash_init(char *pipe)
{
int psplash_pipe_fd;
@@ -123,7 +142,8 @@ static void psplash_progress(char *pipe, struct progress_msg *pmsg)
free(buf);
}
-int main(void) {
+int main(int argc, char **argv)
+{
int connfd;
struct sockaddr_un servaddr;
struct progress_msg msg;
@@ -135,7 +155,31 @@ int main(void) {
int percent = 0;
char bar[60];
int filled_len;
+ int opt_w = 0;
+ int opt_p = 0;
+ int c;
+ /* Process options with getopt */
+ while ((c = getopt_long(argc, argv, "wph",
+ long_options, NULL)) != EOF) {
+ switch (c) {
+ case 'w':
+ opt_w = 1;
+ break;
+ case 'p':
+ opt_p = 1;
+ break;
+ case 'h':
+ usage(argv[0]);
+ exit(0);
+ break;
+ default:
+ usage(argv[0]);
+ exit(1);
+ break;
+ }
+ }
+
tmpdir = getenv("TMPDIR");
if (!tmpdir)
tmpdir = "/tmp";
@@ -150,10 +194,18 @@ int main(void) {
servaddr.sun_family = AF_LOCAL;
strcpy(servaddr.sun_path, SOCKET_PROGRESS_PATH);
- ret = connect(connfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
- if (ret < 0) {
- fprintf(stderr, "no communication with swupdate\n");
- }
+ /* Connection to SWUpdate */
+ do {
+ ret = connect(connfd, (struct sockaddr *) &servaddr, sizeof(servaddr));
+ if (ret == 0)
+ break;
+ if (!opt_w) {
+ fprintf(stderr, "no communication with swupdate\n");
+ exit(1);
+ }
+
+ sleep(1);
+ } while (1);
while (1) {
ret = read(connfd, &msg, sizeof(msg));
@@ -161,7 +213,7 @@ int main(void) {
close(connfd);
exit(1);
}
- if (!psplash_ok) {
+ if (!psplash_ok && opt_p) {
psplash_ok = psplash_init(psplash_pipe_path);
}
@@ -193,7 +245,8 @@ int main(void) {
fprintf(stdout, "\n\n%s !\n", msg.status == SUCCESS
? "SUCCESS"
: "FAILURE");
- psplash_progress(psplash_pipe_path, &msg);
+ if (psplash_ok)
+ psplash_progress(psplash_pipe_path, &msg);
psplash_ok = 0;
break;
case DONE:

View File

@ -0,0 +1,9 @@
# Copyright (C) 2016, 2017 Digi International Inc.
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
do_install_append() {
# Copy the 'progress' binary.
install -d ${D}${bindir}/
install -m 0755 progress ${D}${bindir}/
}

View File

@ -1,17 +0,0 @@
# Copyright (C) 2016 Digi International
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
# Version 2016.10
SRCREV = "edd6559728d2e234ebdc03ba1d5444449ae2b92b"
PV = "2016.10+git${SRCPV}"
SRC_URI += "file://0001-progress_client-add-command-line-parameter.patch"
do_install_append() {
# The 'progress' command is new starting in version '2016.10', but we
# don't need to do a version check here because the bbappend is version
# specific (PV hardcoded above)
install -d ${D}${bindir}/
install -m 0755 progress ${D}${bindir}/
}