Commit Graph

910 Commits

Author SHA1 Message Date
Colin Walters
9d928b19bc Merge pull request #200 from cgwalters/postprocess-cleanup
/var -> tmpfiles postprocess cleanup
2016-01-04 14:25:16 -05:00
Colin Walters
5cd40e6d86 postprocess: Cleanup more /var -> tmpfiles code to fd relative
Besides porting GFile -> fd, I specifically want it to operate in an
append mode for package layering.  Then given an existing tree, we
ensure we're not deleting the underlying tree's autovar files.
2016-01-04 12:47:31 -05:00
Colin Walters
cca057d24b postprocess: Convert some of the /var -> tmpfiles to fd relative
Part of an ongoing effort to port away from `GFile`.

Conflicts:
	src/libpriv/rpmostree-postprocess.c
2016-01-04 12:47:14 -05:00
Colin Walters
637ab495eb Merge pull request #199 from cgwalters/postprocess-selinux-prep
Postprocess selinux prep
2016-01-03 09:54:01 -05:00
Colin Walters
8de94004df libpriv: Change internal API to prepare SELinux
This function will be made public for use in package layering.
2016-01-03 09:45:14 -05:00
Colin Walters
e2fa1675f8 libpriv: Convert some SELinux labeling code to dirfd-relative
This is preparatory work for the package layering branch, which
will also reuse this code.
2016-01-03 08:00:10 -05:00
Colin Walters
49b4d721bb Merge pull request #198 from cgwalters/libglnx-update
libglnx: Update
2015-12-30 06:27:30 -05:00
Colin Walters
3f43bfb5e4 libglnx: Update
Nothing right now needs this, but I plan to use the new mkdtemp API in
a later patch.
2015-12-30 06:22:14 -05:00
Colin Walters
6d622e17ec Merge pull request #197 from cgwalters/daemon-local-gpg-verify
daemon: Treat local deployments as gpg-verify=false
2015-12-29 08:25:57 -05:00
Colin Walters
2adf0fce47 daemon: Treat local deployments as gpg-verify=false
Otherwise we trip an assertion.  In the future I think we should
likely encourage `file:///ostree/repo` or so, and thus support
`gpg-verify`.
2015-12-29 08:20:05 -05:00
Colin Walters
900da5190b Merge pull request #196 from miabbott/bootstrap
docs: Removing old content
2015-12-18 18:41:30 -05:00
Micah Abbott
2f0214fd69 docs: Removing old content
compose-server.md:  Removed redundant treefile section

treefile.md:  Edited to indicate that `bootstrap_packages` is no longer
              mandatory and is effectively deprecated
2015-12-18 16:42:42 -05:00
Colin Walters
538a9decbe Release 2015.11 2015-12-15 09:37:47 -05:00
Colin Walters
517bc2b8fb Merge pull request #189 from jlebon/pr/print-before
postprocess.c: be more verbose when running script
2015-12-10 15:30:43 -05:00
Jonathan Lebon
033830e0c0 postprocess.c: be more verbose when running script
We should tell the user that we will run the postprocess script *before*
we run it to help them diagnose issues if things go wrong.

Resolves: #188
2015-12-10 14:49:57 -05:00
Matthew Barnes
fa83724187 status: Fix some crashes
Encountered a couple crash scenarios:

1) A commit with an invalid timestamp trips an assertion.  Instead
   show the timestamp as "invalid".

2) If a deployed commit is unsigned, the daemon will not include a
   "signatures" array in the deployment's GVariant representation.
   The logic for --pretty was assuming the "signatures" array is
   always present.
2015-12-01 12:11:40 -05:00
Colin Walters
154318aff3 Merge pull request #185 from cgwalters/client-notty
app: Handle progress when not being connected to a tty
2015-11-23 21:07:47 -05:00
Colin Walters
5d4c173a9e app: Handle progress when not being connected to a tty
`rpm-ostree deploy X.Y.Z | cat` was aborting on the client side.  I
noticed this when using it via Ansible.
2015-11-23 16:53:24 -05:00
Colin Walters
b82f7338ea src: Quiet a few gcc -Wmaybe-uninitialized warnings
GCC (at least 5.2.1) isn't smart enough to figure out these are always
initialized.
2015-11-23 12:08:37 -05:00
Colin Walters
8d357565b6 Release 2015.10 2015-11-21 10:07:53 -05:00
Colin Walters
54d9263149 man: Document deploy 2015-11-21 10:07:53 -05:00
Colin Walters
f18ef6d291 Merge pull request #183 from miabbott/version
Use PACKAGE_STRING for version output
2015-11-19 17:00:51 -05:00
Micah Abbott
25ae79bc98 Use PACKAGE_STRING for version output
We are currently using PACKAGE_NAME for version output, which returns
exactly what it says it does: the package name.  Not very useful when
looking for version information.

PACKAGE_STRING, on the the other hand, returns the package name and the
version.  Much better!

This is nicely documented in the autoconf manual [1].

[1] http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Initializing-configure.html#Initializing-configure

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2015-11-19 14:22:48 -05:00
Colin Walters
37ef92b966 Merge pull request #182 from mbarnes/rebase-tolerant-cleanup
Don't fail during rebase cleanup
2015-11-16 15:43:29 -05:00
Matthew Barnes
6c197455e1 daemon: Don't fail during rebase cleanup
Ignore errors during cleanup after a successful rebase.  The source
origin ref may not actually exist.  The issue linked below describes
one such case.

Fixes https://github.com/projectatomic/rpm-ostree/issues/179
2015-11-16 15:35:39 -05:00
Matthew Barnes
e1dc5fdbac libglnx: Pick up g_autoptr backport for GCancellable 2015-11-06 10:07:36 -05:00
Matthew Barnes
e61fbd144c Merge pull request #178 from mbarnes/enhanced-rebase 2015-11-06 09:16:09 -05:00
Matthew Barnes
9c81c47f2f tests: Add deploy command tests 2015-11-06 09:10:48 -05:00
Matthew Barnes
63d7ff8d5f daemon: Add rpmostreed_parse_revision()
Determines a revision argument to either be a SHA256 checksum or a version
metadata value.

The revision string may have a "revision=" prefix to denote a SHA256
checksum, or a "version=" prefix to denote a version metadata value.  If
the revision string lacks either prefix, the function attempts to infer
the type of revision.  The prefixes are case-insensitive.
2015-11-06 09:10:48 -05:00
Matthew Barnes
6114255b8e app: Split upgrade --check-diff into separate options
rpm-ostree upgrade --preview   - Just preview package differences,
                                 like deploy --preview
rpm-ostree upgrade --check     - Just check if an upgrade is available

In both cases, the exit codes are 0 (upgrade available), 77 (no upgrade
available) and 1 (error).

The --check-diff option still works but is deprecated and not shown in
the --help option listing.
2015-11-06 09:10:48 -05:00
Matthew Barnes
1c01141e0c app: Define a special exit code for no changes (77)
Used by upgrade and deploy to allow scripts to test for changes.
2015-11-06 09:10:48 -05:00
Matthew Barnes
a555af0050 app: Redo "update --check-diff" implementation
Don't remember why we're not using the daemon for this, but I already
went to the trouble of writing rpmostree_print_package_diffs() for the
"deploy" command.  Use it here as well.
2015-11-06 09:10:48 -05:00
Matthew Barnes
6f184d6072 daemon: Remove equivalence check for details variant
rpmostreed_commit_generate_cached_details_variant() returns NULL if the
origin checksum of an OstreeDeployment matches the checksum of a refspec,
which may also be the OstreeDeployment's origin.

I don't understand the reasoning for that, especially since none of the
callers are prepared to deal with a NULL return.  Nor is there a comment,
so remove the check.

This was making the daemon crash on

  rpm-ostree deploy --preview <current-deployment-checksum>

which should just indicate no package differences.
2015-11-06 09:10:48 -05:00
Matthew Barnes
56d28a76f3 app: Add "deploy" command
Command-line interface for new D-Bus "Deploy" methods.
2015-11-06 09:10:48 -05:00
Matthew Barnes
de7b750728 app: Add rpmostree_print_package_diffs()
Takes a GVariant returned by the daemon's various "PkgDiff" methods.
2015-11-06 09:10:48 -05:00
Matthew Barnes
0a7706c241 daemon: Strip override-commit when upgrading
Deploy method locks the deployment at a particular commit by adding an
"override-commit" line to the origin file.

Upgrade method must undo the override so we always upgrade to the latest
available commit.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9eabc1ba3c daemon: Add "RpmDiff" methods to supplement Deploy
DownloadDeployRpmDiff and GetCachedDeployRpmDiff, which take the same
revision argument as Deploy.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9a13d39a25 daemon: Add Deploy() method
Deploy(revision) pulls and deploys a particular revision on the
branch of the currently booted deployment.  The revision can be
expressed as a SHA256 checksum or as a version metadata value.
2015-11-06 09:10:48 -05:00
Matthew Barnes
316f927aef daemon: Add rpmostreed_repo_lookup_cached_version()
Similar to rpmostreed_repo_lookup_version(), except without pulling from
a remote repository.  It traverses whatever commits are available in the
local repository.
2015-11-06 09:10:48 -05:00
Matthew Barnes
b3ecdd10b6 daemon: Add primitives for version lookup
rpmostreed_repo_pull_ancestry() downloads an ancestry of commit objects
starting from a given refspec.  An optional visitor function is called
for each commit object.  The visitor function can stop the recursion,
such as when looking for a particular commit.

rpmostreed_repo_lookup_version() builds on this by supplying a visitor
function that examines commit metadata for a particular version value.
When the version value is found, the commit's checksum is returned to
the caller.
2015-11-06 09:10:48 -05:00
Matthew Barnes
a5dd7d1a1a daemon: Miscellaneous diff operation cleanups 2015-11-06 09:10:48 -05:00
Matthew Barnes
1af2a08e54 app: Allow for custom exit status codes
Change the command callback return type to integer, so commands can
return a custom exit status.  Usually it should be EXIT_SUCCESS (0)
or EXIT_FAILURE (1).
2015-11-06 09:10:48 -05:00
Matthew Barnes
554a631ca7 app: Add rpmostree_usage_error()
Convenience function for missing or invalid command-line arguments.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9b5cc4af9a app: Frivolous GError cleanup 2015-11-06 09:10:48 -05:00
Colin Walters
f84ad5d954 Merge pull request #181 from giuseppe/giuseppe/dracut-reproducible
postprocess: provide --gzip and --reproducible to dracut if supported
2015-11-05 21:32:35 -05:00
Giuseppe Scrivano
bb2f32502b postprocess: provide --gzip and --reproducible to dracut if supported
This should help to generate the same initrd when the files didn't
change.

Newer versions of gzip (or pigz when available) can generate rsync
friendly files and if present, Dracut already takes advantage of it.

Also use --reproducible, to instruct Dracut to generate CPIO
reproducible files.  It is required a version of GNU CPIO that
has support for it.

Check that Dracut has --reproducible in its --help output before
setting it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-04 12:33:55 +01:00
Colin Walters
b7e8c7bdc5 compose: Ensure we've cleaned up references to tmpfs workdir before umount
Otherwise the `umount()` will always fail.  This hasn't been a problem
so far while running in a external container (docker/systemd-nspawn),
but is when running in `mock` because it doesn't set its namespace to
be private.

This should help Fedora's Bodhi, which uses rpm-ostree inside mock.
2015-10-30 21:40:14 -04:00
Colin Walters
054ceebb76 Merge pull request #175 from giuseppe/giuseppe/reboot-after-upgrade
giuseppe/reboot-after-upgrade
2015-10-08 13:37:57 -04:00
Giuseppe Scrivano
4b0b2b94f1 rebase,rollback,upgrade: use rpm-ostreed to reboot
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:46:30 +02:00
Giuseppe Scrivano
aa6415bb9c upgrade: reject --reboot and --check-diff used together
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:42:11 +02:00