path: root/recipes-core/swupd-client/swupd-client_2.87.bb
diff options
authorJoshua Lock <joshua.g.lock@intel.com>2016-02-25 21:13:00 +0000
committerJoshua Lock <joshua.g.lock@intel.com>2016-02-25 21:28:43 +0000
commitaf788a23eece3405e171bcd5ba247db49ad9ef62 (patch)
treecc3afb6a1533cb2edb180e78c46f78ba8af3b7fb /recipes-core/swupd-client/swupd-client_2.87.bb
Initial population
This initial layer version provides an initial set of metadata to enable integration of the swupd (https://clearlinux.org/features/software-update) software updater into an image. Approach: An image that inherits the swupd-image bbclass will automatically have bundle 'chroots' created which contain the filesystem contents of the specified bundles, with the contents of the inheriting image forming the default os-core bundle. The mechanism to achieve this is that several virtual image recipes are created using the swupdbundle class, one for each defined bundle plus a 'mega' image recipe. The 'mega' image contains the base image plus the contents of all of the bundles, whilst bundle images contain only the base image plus the contents of a single bundle. We build the mega image first, then the base image (the one which inherits this class) and finally all of the bundle images. Each non-mega image has a manifest generated that lists the file contents of the image. We took the approach of building images, rather than populating the chroot-like bundle directories with a package manager, because various layers and recipes make changes to the rootfs contents outside of the package manager, particularly with IMAGE_POSTPROCESS_COMMAND, etc. Once the images and their manifests have been created each bundle image manifest is compared to the base image manifest in order to generate a list of files in the bundle image which don't exist in the base image. Files in this list are then preserved in the bundle directory for processing by swupd-server in order to generate update artefacts. Finally the binaries from swupd-server are called on the bundle directories to generate the artefacts for consumption by a swupd client. How to: * inherit the swupd-image class in your core OS image. swupd-based OS's use bundles, the primary one of which, os-core, is defined as the contents of this image. * Assign a list of names for bundles you wish to generate to the SWUPD_BUNDLES variable i.e. SWUPD_BUNDLES = "feature_one feature_two" * Assign a list of packages for which their content should be included in a bundle to a varflag of BUNDLE_CONTENTS which matches the bundle name i.e. BUNDLE_CONTENTS[feature_one] = "package_one package_three package_six" * Ensure the OS_VERSION variable is assigned an integer value and increased before each image build which should generate swupd update artefacts. This variable must echo the same version number as is used to set the VERSION_ID field of os-release as swupd-client will use it to check for updates. * Publish the contents of ${DEPLOY_DIR}/swupd/${MACHINE}/${IMAGE_BASENAME}/www on a server for consumption by swupd-client * Use swupd client sub-commands with the -u argument pointing to the contents published above Known issues: * shared pseudo database: the bundle chroot-like directories are generated per-recipe and processed by a task of the inheriting recipe. In order for the files generated outside of the base recipe to have correct permissions when processed by swupd-server we need to share a pseudo database across the recipes. This database is currently never cleaned up, which is likely to cause headaches due to the way pseudo operates on inodes that could be reused outside of pseudo's influence. We have yet to determine an appropriate time to perform housekeeping on this database (we essentially need the database to be removed when DEPLOY_DIR_SWUPD is removed). * oe-swupd-helpers: this recipe provides stub implementations only of some swupd-client helpers. Anyone wishing to utilise swupd in a deployed image will need to at least override kernel_updater.sh and systemdboot_updater.sh. * hard-coded paths: swupd assumes Clear Linux as a host OS and hard-codes several paths to directories, programs and configuration files on Clear. * builds a lot of images: due to the approach taken there are n+2 images built, where n is the number of bundles defined in SWUPD_BUNDLES. * creates a lot of duplicate files: due to the way swupd works by processing chroot-like bundle directories on each os release we potentially end up carrying a lot of duplicate files in DEPLOY_DIR_SWUPD. We intend to look at using the hardlink program to replace duplicate files in that directory with hard links in order to save disk space. * requires far more testing: there are a lot of combinations of bundle contents, rootfs modification commands (IMAGE_POSTPROCESS_COMMAND, IMAGE_PREPROCESS_COMMAND, etc) that can affect the inputs to swupd and our testing has likely missed areas of issue. * OS_VERSION: introduces a new variable for the OS version number when we already have a DISTRO_VERSION variable. This was done because swupd makes various assumptions about the version number which aren't necessarily true for traditional DISTRO_VERSION values in OE et al. Co-authored-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Diffstat (limited to 'recipes-core/swupd-client/swupd-client_2.87.bb')
1 files changed, 49 insertions, 0 deletions
diff --git a/recipes-core/swupd-client/swupd-client_2.87.bb b/recipes-core/swupd-client/swupd-client_2.87.bb
new file mode 100644
index 0000000..8226624
--- /dev/null
+++ b/recipes-core/swupd-client/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=0dbe7a50f028269750631fcbded3846a"
+SRC_URI = "\
+ https://download.clearlinux.org/releases/5700/clear/source/SRPMS/${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"
+RDEPENDS_${PN}_class-target = "oe-swupd-helpers"
+# We check /etc/os-release for the current OS version number
+RRECOMMENDS_${PN}_class-target = "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 \
+SYSTEMD_SERVICE_${PN} = "check-update.timer check-update.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"