Commit Graph

197 Commits

Author SHA1 Message Date
Colin Walters
9e2f6e0c40 rpm: Check out rpmdb in user mode
We may be running as non-root against a root-owned repository; in that
case, there's no need to try to copy the SELinux context or chown()
the files.
2014-10-16 14:22:11 -04:00
Colin Walters
15ecaacd36 compose: Support 'boot_location' to facilitate GRUB2
Having content in /boot in OSTree was always ugly, because we ended up
mounting over it in the deployment location at boot.

This was even worse in the anaconda rpmostreepayload code, because of
the juggling of the mount point that needed to take place.

Trying to add a GRUB2 backend to OSTree is what finally forced this
change.  Now, we put kernels (in the tree) by default in *both* /boot
and /usr/lib/ostree-boot.

OSTree itself knows to look in both locations.  Anaconda is going to
just hard require trees with the new location though.
2014-10-15 22:10:15 -04:00
Colin Walters
2d2a27e6de rebase: Fix status line ending
This was fixed in ostree commit 4d04b148d8b6abad6b6ebc2685e67fc9421b308f
where this code was adapted from.
2014-10-15 22:06:29 -04:00
Colin Walters
03c368fec4 compose: Fix setting of default.target
This would probably be best if we invoked systemctl in the compose
tooling, but at the moment we don't have any execution of target code
on the host.  It's fine to assume that it's in /usr/lib.

We can revisit this if we start doing chrooted/containerized
execution.
2014-10-14 08:28:17 -04:00
Colin Walters
c9219181c4 status: Consistently use malloc'd() memory for status
This crashed when "atomic status" on an origin that didn't have a
refspec, which happened via my new atomic-pkglayer demo script.
2014-10-04 15:08:49 -04:00
Colin Walters
8dab8d551c rebase: Make use of new upgrader API to ignore unconfigured state
"atomic rebase" is mostly a copy of "ostree admin switch", so let's
also pick up the changes in ostree admin switch for the new
unconfigured state flag.

This allows a user to "atomic rebase" on an unconfigured system.

Related: #31
2014-10-03 20:02:24 -04:00
Colin Walters
d3babd8a93 compose: Serialize treefile early
This way we don't emit a critical if we exit due to having already
cached content.
2014-09-29 16:25:36 -04:00
Colin Walters
963f2082cc treepkgdiff: Don't require a booted deployment
For the test suite, we're doing an upgrade offline of another OS root.
What we should maybe do is print the package diff from the merge
deployment, if not the booted one.

However, I think this is OK for now.
2014-09-29 16:25:36 -04:00
Colin Walters
0f16e2e252 Add --disable-compose-tooling build option
Some downstreams want the ability to separate the compose tooling from
the client, for e.g. support reasons.

This approach supports generating a tarball without the source for the
compose command, and requires specifying a config option to disable
it.
2014-09-16 21:45:30 -04:00
Colin Walters
297dbb0c73 compose: Put the expanded treefile content in /usr/share/rpm-ostree/treefile.json
Since the treefile format now supports includes, we would need to
either include the whole chain, or just the expanded portion we use in
the compose.  This patch does the latter.

This should allow a client to take the same treefile and generate a
similar tree (if they want to reproduce with the same RPMs, those can
be extracted from the RPM database inside the tree).
2014-09-07 12:48:05 -04:00
Anne LoVerso
00162a2eea upgrade: Download only /usr/share/rpm in check-diff
This improves on the check-diff option by only downloading the
/usr/share/rpm directory to do a package diff.  This prevents downloading
the whole deployment and the necessity to do a cleanup later.
2014-08-22 15:57:27 -04:00
Colin Walters
acfb219c36 Merge remote-tracking branch 'james/master' 2014-07-31 14:53:17 -04:00
James Antill
a436d47e90 rpm: Change default diff format to block, from diff 2014-07-30 02:11:36 -04:00
James Antill
e9fdbd16bb rpm: Add changelog entries to block diff. output
Diff. output in block mode is now very similar to repodiff.
2014-07-30 02:10:05 -04:00
Colin Walters
e17419b978 compose: Add a --add-override-pkg-repo argument
As a developer, a workflow I have for testing things is to create
an RPM, toss it into a local yum repository, then do a compose.

However at the moment to add the local overrides I have to edit the
treefile, which is annoying.  Let's add a commandline override for
this.

Note this also deletes the old "repos_data" code which was not being
used.
2014-07-28 17:16:09 -04:00
Dusty Mabe
48e8c126f2 compose: Delete dead code that copies aside yum repos
In 827e711 we stopped running two yum transactions. This means the
code that detects if the repodir exists in the yum installroot will
always return false and the code is dead.
2014-07-28 13:55:17 -04:00
James Antill
6ae8462398 rpm: Add --format=block mode format for diff command. 2014-07-24 23:38:51 -04:00
James Antill
9af4822bbd Split diff into algo./print functions. 2014-07-24 23:13:18 -04:00
James Antill
0b6bc7d243 Fix pkg_yumdb_strdup leaking error, and returning NULL. 2014-07-24 22:58:32 -04:00
James Antill
a7e86812f2 rpm: automatically turn fsync off when using mkdtemp dirs. 2014-07-21 00:55:39 -04:00
Colin Walters
7ab2325081 ostree-nspawn: Correctly shift initial root argument 2014-07-20 07:33:47 -04:00
James Antill
c547c8a3f6 Give the user a nice rpm init failure message. 2014-07-18 00:46:17 -04:00
James Antill
cb91fb9494 Fix the error paths for ost_get_commit_hashes.
Simplyfy the code.
 Stop leaking parent/beg_commit.
 Give a real error when a user specified range is bad, and thus. insta.
 fail from callers.
2014-07-18 00:27:28 -04:00
James Antill
23ad6c0310 Use ostree_commit_get_parent in ost_get_prev_commit. 2014-07-17 23:54:50 -04:00
Colin Walters
711745bbc6 Add: --sysroot and --os arguments
These match OSTree.  There are a variety of use cases here.  One is
for test suites; we can stand up a temporary sysroot directory, and
operate on content inside there.

Another is doing virtual machine upgrades offline from a host system,
or upgrading a different OS.

The duplication here is a bit unfortunate; if we add a lot more
commands we should revisit this and perhaps have a common option
group.
2014-07-17 12:59:38 -04:00
Colin Walters
f642512ae6 status: Don't require a booted deployment
I'm working on a patch to add --sysroot support, and for testing
OSTree stuff I often work from a "traditional" host workstation, and
then I have OSTree content in /.

This makes "atomic status" just work for that; I simply have no booted
deployment.
2014-07-16 16:17:59 -04:00
James Antill
634541f722 Allow sequence REFSPECs for version/list.
API probably needs to move to ostree library. Allows us to get a "list"
of REFSPECs, Eg.

"<newest>..<oldest>"

...as a REFSPEC will turn into a list of all the commits, inclusive.
2014-07-16 01:00:36 -04:00
James Antill
c88545d272 Fix 64bit problem when int != gsize to printf. 2014-07-16 01:00:30 -04:00
James Antill
3d85ab99dc Don't leak subtree when /usr/lib/rpm doesn't exist. 2014-07-16 00:59:57 -04:00
James Antill
8a67101de7 Namespace and share DEFINE_TRIVIAL_CLEANUP_FUNC via. rpmostree-util.h
Conflicts:
	src/rpmostree-builtin-rpm.c
2014-07-11 16:47:05 -04:00
James Antill
b65365ac31 Move from using user commit name, to found commit checksum.
We don't want dirs. for branch names etc. so always use the checksum.
2014-07-11 02:35:34 -04:00
James Antill
60ade7d146 Add two column output for rpm list/diff, to look more like yum list. 2014-07-11 02:31:49 -04:00
James Antill
0e7ba9077f Namespace and share DEFINE_TRIVIAL_CLEANUP_FUNC via. rpmostree-util.h 2014-07-11 02:07:31 -04:00
James Antill
b7dbabe065 Add "rpm" command, for doing rpm/yum queries on commits.
It currently has the following sub-commands:

diff COMMIT COMMIT
 for rpmtree diff.
list [prefix...] COMMIT...
 for "yum list" like command.
version COMMIT...
 for "yum version" like command.

...bunch of FIXME's, UI output isn't great, needs docs.
 We also don't use the same code as the treediff on upgrade atm.
2014-07-11 02:01:41 -04:00
Colin Walters
827e711eb7 compose: Migrate content of /etc/{passwd,group} to /usr/lib more sanely
I had an epiphany today while working on
https://bugzilla.redhat.com/show_bug.cgi?id=1098304 - I realized that
I can just do an install, and then copy over everything except the
root entries from /etc/passwd into /usr/lib/passwd.

No need for a patched shadow-utils.  No need to modify the
/etc/nsswitch.conf before doing the install root.  It totally works.
I have no idea why I originally overcomplicated this.

The thing that sucks a bit about this code is that I have to drop to
the FILE * APIs so that I can use the glibc APIs for processing
group/shadow.

Also, the way I deduplicated the code paths for processing
passwd/group is crappy, but I think it's better than duplicating them
(as systemd-sysusers does).

The good: We don't need a two-step RPM transaction, we don't need
          a patch for shadow-utils, it's just saner
The bad: Code is not the most beautiful?  Not really bad.
The ugly: I didn't think of this in the first place and spent
          months beating my head against the wall of shadow-utils...
2014-07-10 18:50:54 -04:00
Colin Walters
aa5ae877de compose: Set SHADOW_USE_USRLIB
See https://bugzilla.redhat.com/show_bug.cgi?id=1098304
2014-07-09 17:29:28 -04:00
Colin Walters
fdb4724d69 compose tree: Read in security.capability xattrs
Per http://fedoraproject.org/wiki/Features/RemoveSETUID
many programs (famously /usr/bin/ping) switched to using
"file capabilities" instead of setuid.

rpm-ostree had code to specially handle SELinux labels, but was
discarding other xattrs.  Let's just whitelist reading in
security.capability.

Closes #14
2014-07-03 15:14:53 -04:00
Colin Walters
19d093a496 compose: Add --workdir-tmpfs
This ~halves the write traffic to my SSD when doing local composes.
My laptop has 12GiB of RAM, plenty for this.
2014-07-02 08:43:59 -04:00
Colin Walters
d63bc65a06 compose: Tell yum not to cache packages locally
They get deleted anyways since we blow away the tmpdir, but we expect
people to be using a local HTTP proxy.  We stopped trying to cache
packages internally as that caused conflicts with the yum lock with
concurrently executing composes.
2014-06-19 11:57:33 -04:00
Anne LoVerso
e498016ff6 status: Rework format into columns
After a discussion on what the status command should offer a
sysadmin, we decided to try a column output format similar to that
of systemctl or docker images.  This will print the timestamp,
a truncated checksum, the osname, and the refspec of each
deployment.  It also includes a --pretty option to print
the information formatted in rows with the full checksum and a
title to specify the default and the rollback target.
2014-06-17 14:47:01 -04:00
Anne LoVerso
7ef1108a96 status: Rework code organization and readability
This includes several changes to format the code to follow GNU Coding Standards as per
the restof rpm-ostree.  This includes fixing indentations, adding spaces between
identifers and parentheses, replacing "goto print" with an else structure, and
reformatting print statements into complete sentences for internationalization.
2014-06-17 14:47:01 -04:00
Anne LoVerso
489b2e301f status: New builtin for system administrators to see deployments
This allows administrators to configure between deployments and easily see which deployment
they are booted into as well as indicating which is chronologically most recent.  This makes
the process more user-friendly, rather than requiring the user to remember which deployment
checksum corresponds to the most recent upgrade.
2014-06-17 14:47:01 -04:00
Colin Walters
227137ed41 compose: Add support for "default_target"
Currently the systemd RPM ships with default.target ->
graphical.target, which is either itself changed by Anaconda (via
parsing /etc/sysconfig/desktop, which...anyways let's stop here).

Or anaconda might set it directly to multi-user.target.

For rpm-ostree, we perform some minimal level of "preconfiguration"
per tree, so they are directly usable without an intervening
installer.

As an example for fedora-atomic/base/core, we just want
multi-user.target.  Thus, this patch provides the treefile author a
declarative mechanism to set it.
2014-06-17 13:49:15 -04:00
Colin Walters
c151b56595 compose tree: Cleanup workdir always
Particularly if we hit the cached case, but we might as well always do
it.
2014-06-11 07:27:31 -04:00
Colin Walters
87a00befe2 compose-tree: Auto-create cache directory
It's just more friendly.
2014-06-06 18:25:08 -04:00
Colin Walters
1613435f7d tree compose: Delete .dbenv.lock and __db.* files from /usr/share/rpm
Currently on an Atomic compose, I'm seeing abrtd trying to write to
/usr/share/rpm/.dbenv.lock, which is denied by policy because it's
usr_t.  There are multiple ways to address this, but there's no good
reason to leave the lock files and __db* files around.

rpm appears to operate correctly without them if calling process
merely gets EROFS.
2014-06-06 16:28:19 -04:00
Colin Walters
c8c54d5095 Delete repoquery-sorted script
This was used previously by the caching infrastructure, but is no
longer used.
2014-06-06 14:57:54 -04:00
Anne LoVerso
bbbf28db30 rollback: Add comment 2014-06-05 16:51:12 -04:00
Colin Walters
976c68542b Add a "rebase" builtin
This is exactly the code from "ostree admin switch", except it's
called "rebase" because in the future it will also carry along any
locally layered packages.
2014-05-29 18:00:11 -04:00
Colin Walters
7ba1a9b46f compose-tree: Fix location of rpmdb querying for caching
We were just repeatedly hitting the cache...oops.

Also add an assertion that the returned data isn't empty.
2014-05-29 14:57:55 -04:00