184 Commits
Author SHA1 Message Date
Patrick McCarty 8ac1869adf Call checkrenamed() with correct arguments
Some of the renames tests omitted the leading forward slash for the two
function arguments, so add them here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Patrick McCarty fde00265e2 test: fix some typos in checkrenamed()
Due to these typos being present, several tests were passing that should
not have been.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Matthew Johnson 25d3ef658d Add deprecation message to README
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-04-19 11:04:08 -07:00
Matthew Johnson 3cf2ade205 Release v3.7.5
This release specifies that /usr/src/kernel/* files are not state files.
These files are needed to ship kernel source files for kernel
development.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.5
2017-12-13 16:47:30 -08:00
Miguel Bernal Marin e814a73480 heuristics: set /usr/src/kernel as not state dir
The kernel sources will be shipped in /usr/src/kernel but /usr/src/* is
state.

This commit enables /usr/src/kernel and its contents as a no state
directory.

Fixes #108

Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
2017-12-13 16:40:27 -08:00
Matthew Johnson 9d3a813859 Release v3.7.4
This release cleans up renamed-to files by unsetting their rename flag
when orphaned. This was previously only being done for renamed-from
files.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.4
2017-12-05 12:21:44 -08:00
Matthew Johnson 5aa1bf9188 Also clean renamed-to files by unsetting the rename bit
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-05 12:21:35 -08:00
Matthew Johnson de04b8400c Release v3.7.3
This release fixes a bug causing fullfile creation to be attempted for
ghosted files.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.3
2017-12-04 14:15:15 -08:00
Matthew Johnson f5b614e39c Add comments to pack.c
As I was trying to understand the flow of pack.c I added comments as
notes to myself. These are helpful enough to be in the source.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-02 11:56:42 -08:00
Matthew Johnson 03feb2af49 Do not attempt full file creation for ghosted files
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-02 11:56:42 -08:00
Matthew Johnson f3f1524f34 Refactor match_manifests function
This function had multiple sections of copy-pasted code. This was
causing an issue of bug-fixes being added to one part of code but not
the other. This patch refactors it to use internal functions where
appropriate and removes some dead code.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-02 11:56:01 -08:00
Matthew Johnson 90c1c89183 Release v3.7.2
This release fixes a bug that caused ghosted files to only be deprecated
over format bumps. Ghosted files are now removed from the manifest every
build.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.2
2017-11-28 13:39:54 -08:00
Matthew Johnson 010131eb85 Fix ghosted-file deprecation
Ghosted files were only being deprecated over format bumps. Move the
format-bump-check logic out to the calling function to allow ghosted
files to be removed on every build. Also assign the is_ghosted flag when
adding "deleted" files from the old manifest so that the file will
actually be removed.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-28 13:39:38 -08:00
Matthew Johnson fcf4e0d7fc Release v3.7.1
This release fixes the bug introduced in v3.7.0 that caused valid
renames from old versions to be dropped. Instead of pruning orphaned
renames, they are now marked as deleted as well.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.1
2017-11-28 09:19:14 -08:00
Matthew Johnson 6d3121cdc6 Add test cases for orphaned renames
* test that renames from old manifests persist
* test that renamed-to deleted is handled properly with the renamed-from
  becoming deleted.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-27 17:22:50 -08:00
Matthew Johnson 6190894f40 Do not delete renames from old versions
Perform a final link on all renames in the manifest in order to track
renames from older versions. Do not remove orphaned renames but instead
keep them around as deleted files as well.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-27 17:22:50 -08:00
Matthew Johnson e554a06ea6 Release v3.7.0
- Track ghosted files to enable renames on files that will be deleted by
  third-party programs (boot files via clr-boot-manager).
- Prune orphaned renames from manifest (renamed-to deleted or renamed
  again)

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.7.0
2017-11-21 14:10:00 -08:00
Matthew Johnson 599ce7cb77 Add functional test for ghosting files
Adds ability to create test files with custom content to swupdlib.bash
as well.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:06:14 -08:00
Matthew Johnson b8c5bdd2f3 Enable ghosted file generation
Ghost files that will be deleted by third-party software on the
client-side instead of marking them as deleted in the manifest. This
allows the client to treat these as deleted when doing rename detection.
Remove those ghosted files from the manifest in the next update.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:06:14 -08:00
Matthew Johnson 14cef226d1 Add test for orphaned rename removal
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:03:45 -08:00
Matthew Johnson 83a9c39556 Prune orphaned rename files from manifest
When renamed-to files are deleted or are renamed again, the original
renamed-from file is orphaned as it has no renamed-to peer. Prune these
from the manifests by checking if the rename_peer field is NULL.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:03:45 -08:00
Patrick McCarty b0c4a1c24e Enable rename support for Travis testing
Because renames are an opt-in feature (i.e. not enabled by default),
pass the required configure option for Travis builds, which enables the
rename tests.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-10-31 09:51:26 -07:00
Matthew Johnson 302ab343ca Use readdir instead of deprecated readdir_r in version.c
Fixes #78

Instead of using the deprecated readdir_r convert to readdir(3). This
fixes a compiler warning in version.c.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-12 10:35:44 -07:00
Matthew Johnson 073b1fe062 Fix unused parameter compiler warnings in rename.c
Fixes #77

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-10-12 10:35:09 -07:00
Matthew Johnson 47addb4fa4 Release v3.6.3
This release improves full-file creation to make it thread-safe,
allowing parallelized runs of many instances of swupd_make_fullfiles.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.6.3
2017-10-05 13:33:28 -07:00
George T Kramer 557fb493ca Make full file creation for directories thread-safe
When running many instances of swupd_make_fullfiles in parallel, the
read end of the pipe between the tar's for creating the full file of a
directory becomes reused.  The observed behavior of this is
swupd_make_fullfiles hangs indefinitely with the expected tar reader
missing.  The corresponding tar writer is not killed with SIGPIPE because
there is at least one reader still for the pipe, swupd_make_fullfiles.
First forking from swupd_make_fullfiles, creating the pipe, and then
fork-and-exec'ing for each tar ensures that pipe and file descriptor
management is contained for the directory rename in question and cannot
be reused by other directory renames.

Signed-off-by: George T Kramer <george.t.kramer@intel.com>
2017-10-05 13:30:20 -07:00
Matthew Johnson ded4f3003d Travis: Use github as upstream for check
Recent outages to sourceforge break Travis CI runs. Use the github
release instead and update to the latest version of libcheck (0.11.0).

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-27 11:25:09 -07:00
Matthew Johnson cb9fe9f208 Improve debuginfo ban test
Improve the test for banning debuginfo via server.ini by first creating
an update without the ban followed by an update with the ban to make
sure the debuginfo is being properly pruned from the manifest.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-21 09:17:24 -07:00
Matthew Johnson 5ecb58edff Release v3.6.2
The previous release (v3.6.1) was tagged at the wrong commit. This
release includes the changes described in that release note.

This release fixes a bug where swupd-server was creating the staged and
delta directories within the packs with 0750 permissions instead of the
expected 0700 permissions. It also adds a configuration option to
server.ini to ban debuginfo from the manifests and configure where
debuginfo libs and src are stored. Also prunes mistakenly added
debuginfo from the manifests when added accidentally and configured to
do so via server.ini.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.6.2
2017-09-20 11:02:18 -07:00
Matthew Johnson e3ca1cc566 Prune debuginfo when configured to do so
Fixes #71

Prune debuginfo from manifests when the [Debuginfo][pruned]
configuration is set to "true" in server.ini.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-18 12:56:31 -07:00
Matthew Johnson 330bede498 Release v3.6.1
This release fixes a bug where swupd-server was creating the staged and
delta directories within the packs with 0750 permissions instead of the
expected 0700 permissions. It also adds a configuration option to
server.ini to ban debuginfo from the manifests and configure where
debuginfo libs and src are stored.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-15 16:02:41 -07:00
Matthew Johnson 0fe32ce8fb Allow configuration to ban debuginfo from manifests
Use server.ini to optionally ban debuginfo from the manifests at
configurable paths.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-15 15:56:02 -07:00
Matthew Johnson 31aec4684f Create staged and delta directories with 700 permissions
These directories were previously created with 750 permissions, which
caused a new check in swupd-client to remove them in order to correct
the permissions to 700. Create them the right way in the first place.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-15 10:43:42 -07:00
Matthew Johnson 1fa24df6d6 Release v3.6.0
Calculate contentsize for all files in the manifest, not just in the
current update.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v3.6.0
2017-08-30 15:29:39 -07:00
Matthew Johnson e84600c21d Merge pull request #65 from matthewrsj/contentsize-fix
Calculate entire contentsize for manifest
2017-08-18 10:40:27 -07:00
Matthew Johnson 350bb54fdf Add functional test for contentsize fix
Add functional test to check manifest contentsize across versions and
includes.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-18 10:13:11 -07:00
Matthew Johnson 15e6b1466f Calculate entire contentsize for manifest
Instead of only calculating the contentsize for files that were updated
in the current version (an inaccurate number for download size since
this is not the compressed size), calculate for all files in the
manifest. Additionally, do not add submanifest contentsizes to the
current manifest contentsize, as this will result in overcount on client
systems when multiple bundles include the same bundle.

With this change the contentsize field of the manifests will only report
the size of the files unique to that bundle. It is then the client's
responsibility to calculate total bundle size including included
bundles. This is reasonably easy to accomplish with the upcoming
swupd-client bundle-list --deps feature.

Although the above use case is a bit more work for the client, it
additionally allows a user to calculate the installation size of
multiple bundles much more easily, since it only has to count bundle
dependencies once to ensure files are not over counted.

If two bundles not in the same include chain have overlapping content,
summing the include chain of each bundle in the client will result in an
over-estimation of the total size on the system. The more content is
shared, the higher the over-estimation. In reality this overlap will not
be large, but it is currently impossible to calculate the exact
installed size using just the contentsize.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-18 10:11:58 -07:00
Tudor Marcu f9ec967aa2 Release v3.5.0
This release removes a stale, unused script, adds a check to ensure format
number validity to ensure format numbers do not decrease, and enables adding
an actions: field in the Manifest.MoM to tell swupd-client to perform certain
actions post update.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.5.0
2017-07-28 23:54:30 -07:00
Matthew Johnson 925a5203f4 Add functional test for format bump actions field
Adds a functional test to check for the

actions:	update

line in the Manifest.MoM for the new format.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-07-28 23:13:21 -07:00
Matthew Johnson 31bb949b9b Add actions field to Manifest.MoM for format bumps
When a format bump occurs and the new format is greater than the old
format, an actions field is written to the Manifest.MoM containing the
string "update". This "update" action tells the client that it is
necessary to re-execute swupd update to bring the client to the latest
version within the new format.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-07-28 23:13:21 -07:00
Patrick McCarty a0c7025a9b Add basic check for format number validity
Because the intention is for swupd format numbers to either remain the
same between LAST_VER and current, or to increase as part of a format
bump, this leaves the remaining undesirable case.

Add a basic check to make sure the format never decreases, and add a
functional test.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-07-24 15:00:39 -07:00
Patrick McCarty 06320f2862 Remove unused script
The packfsck.pl is unused, so we can safely remove it from the repo.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-07-05 11:23:07 -07:00
Tudor Marcu 4f84b66321 Release v3.4.0
This release adds rename detection support which can be enabled via the
--enable-rename-detection option during configure time.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.4.0
2017-05-10 11:33:07 -07:00
Tudor Marcu 0d352881e7 Fix code style issues
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2017-05-10 11:05:28 -07:00
Icarus Sparry 7eff79397c Rename support
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry 37f84501eb Additional tests for renames
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry 850e6b9a92 Allow running only a single test
If the environment variable RUN_JUST_ONE is set then skip any test
which is not numerically equal to it.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry ce594a6529 Helper routine to generate files with content
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry cfb0406b2e Fix creating test files in subdirectories
Allow the filenames to contain directory names

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Tudor Marcu 3a46cb6a9d Release v3.3.5
This release fixes duplicate includes lines being printed in manifests.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v3.3.5
2017-04-17 12:58:10 -07:00