Age | Commit message (Collapse) | Author |
|
When implementing cleaner input staging for swupd during #9599
most of the places where we copy the entire mega image contents and
then prune unwanted items were removed.
This commit removes the final user of copyxattrtree() and
remove_unlisted_files_from_directory() by switching
swupd_create_rootfs() to using the copyxattrfiles() method.
[YOCTO #9325]
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
When creating a list of files to copy from the mega-rootfs to
stage the contents of a bundle which was determined via a delta
between two images, ensure each component of a path is added to
the list of files to copy.
Otherwise we end up with directories automatically created with the
default permissions which may not match the expected permissions.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Before we generate the bundle contents manifest:
* remove package manager artefacts, these never want to end up in
a bundle as the final system isn't package-manager enabled.
* remove any empty directories created by the package-manager to
reduce noise in the bundle manifest.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Mariano has proposed a similar get_package_manager method to OE-Core,
make our local copy match the implementation proposed to OE-Core so
that we can just switch to that when it lands.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
When a bundle sets BUNDLE_FEATURES we can't be certain that there's
a distinct mapping from the defined bundle contents to packages we
can install into a bundle staging directory. To ensure the bundle
contents are correctly staged we switch back to building virtual
bundle images for bundles which set BUNDLE_FEATURES and copying
only the contents of the built bundle which aren't present in the
base image's rootfs as the bundle's swupd inputs.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
The previous process of creating images for each bundle which consisted
of the base image plus the bundles contents is resource intensive,
especially when a bundle consists of only a few files.
Instead of creating bundle images and performing several copies of the
entire mega-image rootfs, then pruning it down, we now make use of the
package manager to stage the files for non os-core bundles and generate
manifests based on the files installed by the package manager.
Once the mega image has been built and post-processed the contents
are re-copied from the mega rootfs to ensure that the final files
in the bundle 'chroot' match the files that will be used to populate
the image.
This patch refactors all of the logic for deploying the required inputs
for swupd (and the do_swupd_update task) into a single task, simplifying
the task scheduling for swupd-image significantly.
[YOCTO #9599]
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Based on observation of Clear Linux's Mixer and the fact that
swupd-server, since the addition of bundle includes in 3.20,
segfaults when loading a manifest for a previous OS release that
includes the os-core (the default behaviour since the addition of
includes) we infer that it's previously expected and now required
to include the os-core bundle in the groups.ini file.
With this change generating updates beyond the first using
swupd-server v3.x no longer causes swupd_create_update to segfault.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Rebasing the fullfiles.c-work-around-pseudo-bug.patch patch for newer
swupd 3.x branches prevents it from being applied cleanly to the 2.53
version. Resolve this by keeping a separate copy of the original patch
for swupd-server-2.53
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Add some logic to do_install which writes the default settings
files for content URL, version URL and format.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
The looping checking the individual bundles used the wrong variable
name and thus failed to gather all additional image features from the
individual bundles.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
Choosing bundle features based on some (rather arbitrary) bundle name
suffix does not scale. Currently it does not support ptest-pkgs and
dbg-pkgs. Adding support for those via bundle name suffix would become
rather awkward.
So instead we now allow (and require!) that bundle features for a
bundle named "foo" are set explicitly in BUNDLE_FEATURES[foo]. The
corresponding content has to be in BUNDLE_CONTENTS[foo].
There's no sanity checking that features listed there are really
suitable for a bundle. Features adding content (like ptest-pkgs,
dbg-pkgs, dev-pkgs) are okay, features changing the os-core are not
(like debug-tweaks). This cannot be checked automatically by
meta-swupd because there is no definite list of acceptable features.
This is an API change. Users of meta-swupd need to be adapted.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
Now that we are using libarchive and bsdtar it is not necessary to
ensure the full versions of gzip, bzip2, tar and xz are included
in all swupd using images.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
When using swupd-server 3.x bsdiff native is required at runtime,
ensure it is available in the native sysroot as a dependency of
the do_swupd_update task.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
This makes it easier to override for consumers of the class.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
This makes it simpler for a consumer of the layer to override or
append to the value (i.e. using += as is commonly done).
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Move implementation details and known issues into separate files.
Enhance the How to guide to discuss some of the swupd concepts and
how they impact the way we construct a custom distro using swupd.
Specifically discuss likely pain points and how to address them,
notably:
* update-alternatives
* stateless vs. stateful (updating files in /etc)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Also apply a version of the patch from 6d5555c1 to the reciep for
swupd-client v3.x
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
c6fc2a adds a backport of a patch submitted upstream to protect
the tar command against special characters, backport the submitted
patch for use in the 3.x recipes to keep our recipes as functionaly
equivalent as possible.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
0001-manifest.c-Always-initialize-preserver-pointer-of-fi.patch
is available in v3.0.0 and newer.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
This patch adds escaping for special characters in file names
for the tar commands used to install files into target file system.
Particularly it fixes installation of nodejs libs having '#'
and '@' in file names.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|
|
We already unset IMAGE_FSTYPES to prevent any images being written
for the transient bundle images. As a logical follow on from that
change, and to prevent issues when trying to build for a MACHINE
which supports live images (due to the automatic inference of
live image support via build_live() in image.bbclass), delete the
do_bootimg task for bundle images.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
This reverts commit a7dddfbfb8f45989856c93c6f82f46d8a96e6f0b.
We can't completely disable the do_image task because we need to
allow various tasks that run during image creation which affect
the rootfs to run.
|
|
swupd upstream expects its host OS, i.e. Clear Linux, to be stateless and
thus by default ignores configuration file changes in the manifests.
Add a configure option to swupd-client to not ignore these files, matching
a similar change in swupd-server to ensure config files are included in
the manifests.
Do not enable this option by default in our recipe as we have several files
in /etc which are generated/modified on first-boot and will cause a
swupd verify to fail.
[YOCTO #9199]
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
The patch makes the function deduplicate_files_from_manifest()
return correct value always.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|
|
The layer's users are supposed to create their own update
repos. Not setting --url may lead to downloading updates
from the default repo which is http://downloads.clearlinux.com/update
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|
|
Mark do_image and do_bootimg as noexec tasks so that they don't run
but their task dependency chain is preserved. This prevents an error
in swupdbundle image building when an image for the target MACHINE
would result in a live image being built.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Errors are now printed including the "staging" filename (and without
segfaulting, which was already fixed by the previous patch), and
download performance is a lot better on Ostro OS where IMA is active
and affects the performance of the close() syscall.
The download performance patch was also ported to current swupd
master, see https://github.com/clearlinux/swupd-client/pull/42. It
does not get included here because there is a chance to get it
via an upstream update, whereas that is unlikely for 2.87.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
swupd generates and uses a Manifest.full which is a complete manifest
of all files in all bundles of the OS.
Therefore we should prevent users defining a bundle named 'full' as
this would also generate a Manifest.full file and confuse future use
of swupd.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
In many error situations a fake file struct is passed to
the logger. The filename field of the struct needs to be
checked for NULL before printing it to a log to avoid
dereference of a NULL-pointer.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|
|
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Implement a task which runs after image creation and executes the
functions defined in SWUPD_IMAGE_SANITY_CHECKS to validate the
constructed image.
do_swupd_sanity_check_image() is influenced heavily by the
sanity_check_conffiles method in OE-Core's sanity.bbclass.
Include a single QA function to start with, disabled by default,
which checks whether there are any dangling symlinks in the image
— this check is based on code from the Ostro Project by Patrick
Ohly.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
The configure.ac uses PKG_CHECK, inherit pkgconfig to ensure we
have pkg-config built before swupd-server.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
We no longer need to add a BBCLASSEXTEND = "native" as this change
has been integrated in the rsync recipe in OE-Core.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
The format version isn't static, and indeed will be bumped in the
next swupd release.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Switch 3.3.0 recipe to using bsdtar, align DEPENDS, RDEPENDS and
EXTRA_OECONF settings.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Switch 3.1.2 recipe to using bsdtar and include the patch to work
around hardlink extended attribute issues when running under
pseudo.
Move 2.53 specific patches to the swupd-server-2.53 directory.
Unify DEPENDS, RDEPENDS and EXTRA_OECONF settings.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
remove_unlisted_files_from_directory() failed to remove unwanted
symlinks to directories because it only looked at files, whereas
Python lists symlinks to directories as directories.
In Ostro OS, that affected for example /usr/lib/perl5 -> perl and
was found when adding a QA check for dangling symlinks.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
As a special optimization, updating the rootfs of the base image was
skipped if actual image creation was disabled for the base
image. However, there are reasons beyond image creation for updating
the rootfs, for example to run QA checks on it.
Therefore the change gets reverted and the code now only gets skipped
for the virtual bundle recipes.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
Add a new recipe to track the latest version, 3.3.0, from github.
We'll keep the older version around for now whilst we do some
testing.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Add a new recipe to track the latest version, 3.1.2, from github.
We'll keep the older version around for now whilst we do some
testing.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
Changing os-release in a .bbappend is undesirable for two reasons:
1. it changes the content also for images which do not use swupd
2. it causes full rebuilds even when the only thing that changed
is the OS_VERSION
The latter may or may not be desired, so we should better leave that
choice to the user, which is possible by setting VERSION_ID to
OS_VERSION in local.conf.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
We had a request to print more of the debugging around long-running
tasks to the console when using knotty using bbplain. This is undesirable
as a default but this patch enables a user to opt-in to this behaviour by
setting SWUPD_LOG_FN = "bbplain" producing output like:
NOTE: Executing RunQueue Tasks
jgl-image-swupd-1.0-r0 do_swupd_update: New OS_VERSION is 20
jgl-image-swupd-1.0-r0 do_swupd_update: Generating update from 0 to 20
jgl-image-swupd-1.0-r0 do_swupd_update: Generating fullfiles for 20
jgl-image-swupd-1.0-r0 do_swupd_update: Generating zero packs, this can take some time.
jgl-image-swupd-1.0-r0 do_swupd_update: Generating zero pack for os-core
jgl-image-swupd-1.0-r0 do_swupd_update: Generating zero pack for connman
jgl-image-swupd-1.0-r0 do_swupd_update: Generating zero pack for server
jgl-image-swupd-1.0-r0 do_swupd_update: Generating zero pack for developer
NOTE: Tasks Summary: Attempted 2857 tasks of which 2582 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
|
|
It is not guaranteed that OS versions always increment in steps of 10
and that deltas are desired for "current version - 10, -20, etc.". For
example, previous versions might be 10, 20, and the current one 21
because it is a minor update. In such a case no delta packs would be
generated because OS versions 11 and 1 do not exist.
Ostro OS outside of the CI derives the OS version from datetime, which
leads to high version numbers like 33014500. Counting down from that
in steps of ten in shell under pseudo was surprisingly slow and
unusable, running for minutes without even getting close to completion
when it does not hit existing version numbers.
So now the simplified approach is to generate delta packs for exactly
the last SWUPD_N_DELTAPACK older versions, regardless what their
numbering is.
If a more sophisticated approach is needed, it can still be added
later on, for example as part of YOCTO #9321.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
swupd-server relies on hardlinks to create a temporary directory with
the original file for the external tar command. Creating hardlinks
under pseudo leads to copies which (incorrectly) do not share the
original file's xattrs.
To work around this bug, we explicitly copy the xattrs.
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
|
|
This patch adds bsdtar support to swupd-client and swupd-server
and enables it.
The reason why it's done this way is that:
- bsdtar works better with IMA (opens files only once and then
updates content and xattrs together);
- swupd remains fully functional, including xattrs support,
even when a distro disables GPLv3 licensed code.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|
|
Some recipes may need to generate archives during build time
that are consumed on target devices, e. g. software updates.
Since the format of those archives must be identical configure
the native tool the same way as it's done for target builds:
enable xattrs if it's a distro feature. Also make the xz
compression type enabled always in addition to zlib and bzip2.
Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
|