All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua G Lock <joshua.g.lock@linux.intel.com>
To: Maciej Borzecki <maciej.borzecki@open-rnd.pl>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 04/10] swupd-client: Add recipe
Date: Thu, 25 Feb 2016 08:50:04 +0000	[thread overview]
Message-ID: <1456390204.3610.10.camel@linux.intel.com> (raw)
In-Reply-To: <20160225080706.GA3868@comp-006-thk.openrnd.local>

On Thu, 2016-02-25 at 09:07 +0100, Maciej Borzecki wrote:
> On 02/24 14:52, Joshua Lock wrote:
> > 
> > From: Mariano Lopez <mariano.lopez@linux.intel.com>
> > 
> > This commit adds the Clear Linux client updater.
> > This is experimental and bleeding edge, including the comments on
> > the recipe.
> > 
> > Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
> > Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
> > ---
> >  .../0001-Tolerate-quotes-in-os-release-files.patch | 59
> > ++++++++++++++++++++++
> >  ...hange-systemctl-path-to-OE-systemctl-path.patch | 31
> > ++++++++++++
> >  .../swupd-client/Fix-build-failure-on-Yocto.patch  | 36
> > +++++++++++++
> >  .../Right-usage-of-AC_ARG_ENABLE-on-bzip2.patch    | 38
> > ++++++++++++++
> >  meta/recipes-devtools/swupd/swupd-client_2.87.bb   | 49
> > ++++++++++++++++++
> >  5 files changed, 213 insertions(+)
> >  create mode 100644 meta/recipes-devtools/swupd/swupd-client/0001-
> > Tolerate-quotes-in-os-release-files.patch
> >  create mode 100644 meta/recipes-devtools/swupd/swupd-
> > client/Change-systemctl-path-to-OE-systemctl-path.patch
> >  create mode 100644 meta/recipes-devtools/swupd/swupd-client/Fix-
> > build-failure-on-Yocto.patch
> >  create mode 100644 meta/recipes-devtools/swupd/swupd-client/Right-
> > usage-of-AC_ARG_ENABLE-on-bzip2.patch
> >  create mode 100644 meta/recipes-devtools/swupd/swupd-
> > client_2.87.bb
> > 
> > diff --git a/meta/recipes-devtools/swupd/swupd-client/0001-
> > Tolerate-quotes-in-os-release-files.patch b/meta/recipes-
> > devtools/swupd/swupd-client/0001-Tolerate-quotes-in-os-release-
> > files.patch
> > new file mode 100644
> > index 0000000..49c71ae
> > --- /dev/null
> > +++ b/meta/recipes-devtools/swupd/swupd-client/0001-Tolerate-
> > quotes-in-os-release-files.patch
> > @@ -0,0 +1,59 @@
> > +From 586e7b927461f6604ee3a3159cd7a6d4ac22ef30 Mon Sep 17 00:00:00
> > 2001
> > +From: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
> > +Date: Thu, 11 Feb 2016 13:29:57 +0200
> > +Subject: [PATCH 1/2] Tolerate quotes in os-release files
> > +
> > +Some systems like Yocto or OpenSUSE prefer to wrap values in
> > +/etc/os-release file with quotes always and that still conforms
> > +to the format defined in systemd.
> > +
> > +This patch removes quotes from the values before trying to
> > +transform them into integer version id.
> > +
> > +Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
> > +
> > +Upstream-Status: Backport (v3.0.0+)
> > +
> > +---
> > + src/version.c | 18 +++++++++++++++++-
> > + 1 file changed, 17 insertions(+), 1 deletion(-)
> > +
> > +diff --git a/src/version.c b/src/version.c
> > +index 0e09cd9..83d6ad4 100644
> > +--- a/src/version.c
> > ++++ b/src/version.c
> > +@@ -88,6 +88,7 @@ int read_version_from_subvol_file(char
> > *path_prefix)
> > + 	FILE *file;
> > + 	int v = -1;
> > + 	char *buildstamp;
> > ++	char *src, *dest;
> > +
> > + 	string_or_die(&buildstamp, "%s/usr/lib/os-release",
> > path_prefix);
> > + 	file = fopen(buildstamp, "rm");
> > +@@ -106,7 +107,22 @@ int read_version_from_subvol_file(char
> > *path_prefix)
> > + 			break;
> > + 		}
> > +
> > +-		if (strncmp(line,"VERSION_ID=", 11) == 0) {
> > ++		if (strncmp(line, "VERSION_ID=", 11) == 0) {
> > ++			src = &line[11];
> > ++
> > ++			/* Drop quotes and newline in value */
> > ++			dest = src;
> > ++			while (*src) {
> > ++				if (*src == '\'' || *src == '"'
> > || *src == '\n') {
> > ++					++src;
> > ++				} else {
> > ++					*dest = *src;
> > ++					++dest;
> > ++					++src;
> > ++				}
> > ++			}
> > ++			*dest = 0;
> > ++
> > + 			v = strtoull(&line[11], NULL, 10);
> > + 			break;
> > + 		}
> > +--
> > +2.5.0
> > +
> > diff --git a/meta/recipes-devtools/swupd/swupd-client/Change-
> > systemctl-path-to-OE-systemctl-path.patch b/meta/recipes-
> > devtools/swupd/swupd-client/Change-systemctl-path-to-OE-systemctl-
> > path.patch
> > new file mode 100644
> > index 0000000..5ca6373
> > --- /dev/null
> > +++ b/meta/recipes-devtools/swupd/swupd-client/Change-systemctl-
> > path-to-OE-systemctl-path.patch
> > @@ -0,0 +1,31 @@
> > +From 259d86e64146c3156eccfcce0351a9cdc4714766 Mon Sep 17 00:00:00
> > 2001
> > +From: Jaska Uimonen <jaska.uimonen@intel.com>
> > +Date: Thu, 14 Jan 2016 10:17:43 +0200
> > +Subject: [PATCH] change systemctl path to OE systemctl path
> > +
> > +Upstream-Status: Inappropriate
> > +
> > +---
> > + src/scripts.c | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/src/scripts.c b/src/scripts.c
> > +index e426272..9bec0f5 100644
> > +--- a/src/scripts.c
> > ++++ b/src/scripts.c
> > +@@ -84,10 +84,10 @@ static void update_triggers(void)
> > + 	int ret;
> > + 	LOG_INFO(NULL, "calling systemd trigger", class_scripts,
> > "");
> > +
> > +-	ret = system("/usr/bin/systemctl daemon-reload");
> > ++	ret = system("/bin/systemctl daemon-reload");
> > + 	if (ret != 0)
> > + 		LOG_ERROR(NULL, "systemd daemon reload failed",
> > class_scripts, "%d", ret);
> > +-	ret = system("/usr/bin/systemctl restart update-
> > triggers.target");
> > ++	ret = system("/bin/systemctl restart update-
> > triggers.target");
> > + 	if (ret != 0)
> > + 		LOG_ERROR(NULL, "systemd update triggers failed",
> > class_scripts, "%d", ret);
> > + }
> > +--
> > +2.5.0
> > +
> > diff --git a/meta/recipes-devtools/swupd/swupd-client/Fix-build-
> > failure-on-Yocto.patch b/meta/recipes-devtools/swupd/swupd-
> > client/Fix-build-failure-on-Yocto.patch
> > new file mode 100644
> > index 0000000..73f1728
> > --- /dev/null
> > +++ b/meta/recipes-devtools/swupd/swupd-client/Fix-build-failure-
> > on-Yocto.patch
> > @@ -0,0 +1,36 @@
> > +From ccce73a2d703e6789ded87ca5aa9f3b7c506892a Mon Sep 17 00:00:00
> > 2001
> > +From: Amarnath Valluri <amarnath.valluri@intel.com>
> > +Date: Thu, 7 Jan 2016 16:19:34 +0200
> > +Subject: [PATCH] Fix build failure on Yocto
> > +
> > +On install phase certificate files are being installed twice as
> > included in
> > +_DATA twice. We can use EXTRA_DIST than dist_.
> > +
> > +Upstream-Status: Inappropriate
> > +
> > +Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
> > +---
> > + Makefile.am | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/Makefile.am b/Makefile.am
> > +index 1e65d3d..4d15c55 100644
> > +--- a/Makefile.am
> > ++++ b/Makefile.am
> > +@@ -111,11 +111,11 @@ SWUPD_CERTS = certs/157753a5.0 \
> > + 	certs/d6325660.0 \
> > + 	certs/d6325660.1
> > + swupdcerts_DATA = $(SWUPD_CERTS)
> > +-dist_swupdcerts_DATA = $(SWUPD_CERTS)
> > +
> > + EXTRA_DIST += \
> > + 	data/check-update.service \
> > +-	data/check-update.timer
> > ++	data/check-update.timer \
> > ++	$(SWUPD_CERTS)
> > +
> > + DISTCHECK_CONFIGURE_FLAGS = \
> > +         --with-
> > systemdsystemunitdir=$$dc_install_base/$(systemdunitdir)
> > +--
> > +2.1.4
> > +
> > diff --git a/meta/recipes-devtools/swupd/swupd-client/Right-usage-
> > of-AC_ARG_ENABLE-on-bzip2.patch b/meta/recipes-
> > devtools/swupd/swupd-client/Right-usage-of-AC_ARG_ENABLE-on-
> > bzip2.patch
> > new file mode 100644
> > index 0000000..e5b53ef
> > --- /dev/null
> > +++ b/meta/recipes-devtools/swupd/swupd-client/Right-usage-of-
> > AC_ARG_ENABLE-on-bzip2.patch
> > @@ -0,0 +1,38 @@
> > +From d80ae9954c5e5b720766274249dbf5309b7c70a9 Mon Sep 17 00:00:00
> > 2001
> > +From: Amarnath Valluri <amarnath.valluri@intel.com>
> > +Date: Wed, 13 Jan 2016 15:46:19 +0200
> > +Subject: [PATCH] Right usage of AC_ARG_ENABLE on bzip2
> > +
> > +Upstream-Status: Pending[Not submitted]
> > +
> > +Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
> > +---
> > + configure.ac | 12 +++++++-----
> > + 1 file changed, 7 insertions(+), 5 deletions(-)
> > +
> > +diff --git a/configure.ac b/configure.ac
> > +index f94a17d..b11ef0a 100644
> > +--- a/configure.ac
> > ++++ b/configure.ac
> > +@@ -20,11 +20,13 @@ AC_CONFIG_HEADERS([config.h])
> > + PKG_CHECK_MODULES([lzma], [liblzma])
> > + PKG_CHECK_MODULES([zlib], [zlib])
> > + AC_ARG_ENABLE(
> > +-	bzip2,
> > +-	AS_HELP_STRING([--disable-bzip2],[Do not use bzip2
> > compression (uses bzip2 by default)]),
> > +-	AC_DEFINE(SWUPD_WITHOUT_BZIP2,1,[Do not use bzip2
> > compression]) ,
> > +-	AC_DEFINE(SWUPD_WITH_BZIP2,1,[Use bzip2 compression])
> > +-	AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [],
> > [AC_MSG_ERROR([the libbz2 library is missing])])
> > ++	[bzip2],
> > ++	AS_HELP_STRING([--disable-bzip2],[Do not use bzip2
> > compression (uses bzip2 by default)])
> > ++)
> > ++AS_IF([test "x$enable_bzip2" = "xyes" ],
> > ++  [AC_DEFINE(SWUPD_WITH_BZIP2,1,[Use bzip2 compression])
> > ++	 AC_CHECK_LIB([bz2], [BZ2_bzBuffToBuffCompress], [],
> > [AC_MSG_ERROR([the libbz2 library is missing])])],
> > ++  [AC_DEFINE(SWUPD_WITHOUT_BZIP2,1,[Do not use bzip2
> > compression])]
> > + )
> > +
> > + AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-
> > systemdsystemunitdir=DIR],
> > +--
> > +2.1.4
> > +
> > diff --git a/meta/recipes-devtools/swupd/swupd-client_2.87.bb
> > b/meta/recipes-devtools/swupd/swupd-client_2.87.bb
> > new file mode 100644
> > index 0000000..a5afdd6
> > --- /dev/null
> > +++ b/meta/recipes-devtools/swupd/swupd-client_2.87.bb
> > @@ -0,0 +1,49 @@
> > +SUMMARY = "swupd sofware update from Clear Linux - client
> > component"
> > +LICENSE = "GPL-2.0"
> > +LIC_FILES_CHKSUM =
> > "file://COPYING;md5=04d0b48662817042d80393e7511fa41b \
> > +                    file://bsdiff/LICENSE;md5=0dbe7a50f02826975063
> > 1fcbded3846a"
> > +
> > +SRC_URI = "\
> > +    https://download.clearlinux.org/releases/5700/clear/source/SRP
> > MS/${BPN}-${PV}-105.src.rpm;extract=${BP}.tar.gz \
> > +    file://Fix-build-failure-on-Yocto.patch \
> > +    file://Right-usage-of-AC_ARG_ENABLE-on-bzip2.patch \
> > +    file://Change-systemctl-path-to-OE-systemctl-path.patch \
> > +    file://0001-Tolerate-quotes-in-os-release-files.patch \
> > +"
> > +
> > +SRC_URI[md5sum] = "5d272c62edb8a9c576005ac5e1182ea3"
> > +SRC_URI[sha256sum] =
> > "45df259a7dc2fed985ee9961e112120fc46670dd75476c3262fc6804b1c66fb8"
> > +
> > +DEPENDS = "glib-2.0 curl zlib bzip2 xz openssl"
> > +RDEPENDS_${PN} = "gzip bzip2 tar xz"
> > +# swupd requires at least an update-triggers target, should it be
> > part of the
> > +# swupd-client package?
> > +RDEPENDS_${PN} = "swupd-units"
> > +# We check /etc/os-release for the current OS version number
> > +RRECOMMENDS_${PN} = "os-release"
> > +
> > +inherit pkgconfig autotools-brokensep systemd
> > +
> > +EXTRA_OECONF = "--with-
> > systemdsystemunitdir=${systemd_system_unitdir}"
> > +
> > +#TODO: create and install /var/lib/swupd/{delta,staged/download}
> > +do_install_append () {
> > +    # swupd-client 2.87 doesn't (succesfully) create these and
> > fails to update
> > +    # should they not exist. This is due to a bash-specific shell
> > command
> > +    # called to create the directories 'mkdir -p
> > /var/lib/{delta,staged,download}'
> > +    install -d ${D}/var/lib/swupd/delta
> > +    install -d ${D}/var/lib/swupd/download
> > +    install -d ${D}/var/lib/swupd/staged
> > +
> > +    # TODO: This should be a less os-specific directory and not
> > hard-code datadir
> > +    install -d ${D}/usr/share/clear/bundles
> > +}
> > +
> > +FILES_${PN} += "\
> > +    /usr/share/clear \
> > +    ${systemd_system_unitdir}/multi-user.target.wants* \
> > +    /var/lib/swupd \
> Try using ${datadir} and ${localstatedir} if possible:
>     ${datadir}/clear
>     ${localstatedir}/lib//swupd
>     install -d ${D}${datadir}/clear/bundles

Unfortunately swupd hard-codes various paths including these, if we use
the variables and the distro has defined those differently than what
swupd expects this will fail. 

I do intend to fix swupd-client to take these paths as arguments and
will switch to the variables then.

Until that's done I will add a comment above FILES_${PN}.

Regards,

Joshua


  reply	other threads:[~2016-02-25  8:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 14:52 [PATCH 00/10] Integrate swupd software updater Joshua Lock
2016-02-24 14:52 ` [PATCH 01/10] rsync: add native variant Joshua Lock
2016-02-24 14:52 ` [PATCH 02/10] swupd-server: initial recipe 2.53 Joshua Lock
2016-02-25  8:11   ` Maciej Borzecki
2016-02-25  8:51     ` Joshua G Lock
2016-02-24 14:52 ` [PATCH 03/10] hardlink: add new recipe Joshua Lock
2016-02-24 21:00   ` Burton, Ross
2016-02-24 22:57   ` Andre McCurdy
2016-02-25  8:48     ` Joshua G Lock
2016-02-25 17:13   ` Mark Hatle
2016-02-25 21:40     ` Joshua G Lock
2016-02-25 21:57       ` Mark Hatle
2016-02-24 14:52 ` [PATCH 04/10] swupd-client: Add recipe Joshua Lock
2016-02-25  8:07   ` Maciej Borzecki
2016-02-25  8:50     ` Joshua G Lock [this message]
2016-02-24 14:52 ` [PATCH 05/10] swupdbundle: new class to generate virtual images for swupd-image Joshua Lock
2016-02-25  8:19   ` Maciej Borzecki
2016-02-25  8:47     ` Joshua G Lock
2016-02-25 17:06   ` Patrick Ohly
2016-03-01 13:45     ` Joshua G Lock
2016-02-24 14:52 ` [PATCH 06/10] swupd-image.bbclass: initial class to support swupd updater Joshua Lock
2016-02-24 14:52 ` [PATCH 07/10] oe-swupd-helpers: provide swupd-client required helper scripts and units Joshua Lock
2016-02-24 14:52 ` [PATCH 08/10] swupd-client: RDEPENDS on oe-swupd-helpers Joshua Lock
2016-02-24 14:52 ` [PATCH 09/10] swupd-client: enable native builds Joshua Lock
2016-02-24 14:52 ` [PATCH 10/10] os-release: sanitise VERSION_ID field Joshua Lock
2016-02-24 15:37 ` [PATCH 00/10] Integrate swupd software updater Patrick Ohly
2016-02-24 16:14   ` Joshua G Lock
     [not found]   ` <1456330147.5333.14.camel@intel.com>
2016-02-24 18:49     ` Patrick Ohly
2016-03-01 16:18       ` Joshua G Lock
2016-02-24 16:06 ` Trevor Woerner
2016-02-24 16:35   ` Philip Balister
2016-02-24 18:36     ` Maciej Borzecki
2016-02-24 19:51     ` Paul Eggleton
2016-02-24 20:40       ` Philip Balister
2016-02-25 21:42         ` Joshua G Lock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456390204.3610.10.camel@linux.intel.com \
    --to=joshua.g.lock@linux.intel.com \
    --cc=maciej.borzecki@open-rnd.pl \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.