Commit Graph

1616 Commits

Author SHA1 Message Date
Colin Walters
6f959fd20f compose: Support 'remove-from-packages' entry
This is the equivalent of the 'removefrom' verb in Lorax's templating.
It's a lot more robust than a generic "rm-rf" type thing, because most
often you only want to remove files from particular packages.
2014-11-14 14:11:55 -05:00
Colin Walters
80300ba7c8 compose: Support 'install-langs'
This should exist for the same reason the yum and RPM options do; some
people want to construct more minimal systems.
2014-11-14 07:47:29 -05:00
Colin Walters
e2db99a1fb compose: Move content processing code into -postprocess
It seems clearer to me if all code which is operating on the content
(such as enabling systemd units) is under -postprocess.  The "compose
tree" code should be tying everything together and calling out to
sub-components.

This is prep for adding more postprocessing code.
2014-11-13 15:17:08 -05:00
Colin Walters
421fb94ab2 compose: Split out JSON helpers into separate file
In preparation for using some of them in the postprocessing code too.

Yeah, parsing JSON in C sucks =( Oh well.
2014-11-13 15:08:16 -05:00
Colin Walters
b393cfb727 compose: Rename _postprocess function to _prepare_rootfs_for_commit()
It's a lot clearer what we're doing.  This is preparation for further
work in cleaning up how we do content processing.
2014-11-13 14:39:46 -05:00
Colin Walters
571fa8ddec Centralize cleanup function definitions
We might as well do what systemd does and have a big header which
defines all of them, to more conveniently share them for libraries
that don't include them (like hawkey/librepo, as well as things that
libgsystem doesn't yet cover).
2014-11-11 18:40:58 -05:00
Colin Walters
a06ccfed05 Cleanup by using libgsystem cleanup functions
For some reason we ended up defining our own macro to define cleanup
functions, when libgsystem has a usable one.  Switch to that, fewer
lines of code, more consistency.
2014-11-11 18:35:24 -05:00
Colin Walters
4c405bf62f compose: Protect the system during treecompose using container APIs
I was looking again at using hawkey/librepo, and realized just how
much I'd have to fight all of these libraries to avoid affecting
the running system.

What we really want to do with librepo/hawkey is run them effectively
unprivileged, and to hide the system's RPM database from them.  This
is a baby step towards that, by confining our existing yum.

- /usr, /etc, and /var/lib/rpm are mounted read-only
- yum is now run under CLONE_NEWPID, to avoid stray %post scripts
  affecting system processes
2014-11-10 12:13:44 -05:00
Colin Walters
4ecce5884d treecompose: Replace shell callout for package caching with builtin C
This is taking us closer to deeper integration in the treecompose side
with RPM instead of forking out to things.

It works except...we end up with the dreaded __db.001, .dbenv.lock
files =/ Best option would be to teach RPM how to open a database
really read-only.  Failing that, could use the immutable bit?
2014-11-03 16:42:16 -05:00
Colin Walters
e8c53640e3 postprocess: Clean up rpmdb detritus
These lock and dbenv files are created by RPM when it accesses the
database read-write, but we only want read-only.  Sadly that turns out
to be very, very hard to plumb through all the layers in
hawkey/libsolv etc.

So let's just forcibily remove them after postprocessing.
2014-11-03 15:49:32 -05:00
Colin Walters
004f46508a treecompose: Hoist rpmdb processing into function
In preparation for future work.
2014-11-03 08:39:49 -05:00
Colin Walters
d1504d32ac treepkgdiff: Don't create hawkey cache by default
Since we're only quering the database once (and at least
one of the locations is going to be read-only), don't
create the cache.

Noted while just reading the code while working on something else.
2014-11-02 16:47:27 -05:00
James Antill
c48caca122 status: Print the version, using timestamp column if we have all versions 2014-10-24 02:03:08 -04:00
James Antill
ee1cd0d898 Workaround false GCC warning for uninit variable 2014-10-24 01:34:17 -04:00
Colin Walters
e6c42cb884 compose tree: Add --output-repodata-dir
This could be used by higher level tools like fedmsg-atomic-composer
that want to merge the yum repodata used for input with the tree
content.
2014-10-23 17:14:14 -04:00
Colin Walters
161324d73b compose: Add "remove-files" verb
I'd been resisting this for a long time - I really wanted the tree to
be a reflection of the packages; and not go down the path of
"forking".

The lorax model has shown that while you can definitely get a large
space reduction that way, you're going to be perpetually chasing
changes in the packages.  No matter how good your templates are.

Furthermore, lorax is just to generate the installer - it's an OS that
runs a single app.  Whereas here we're generating the target runtime
system; we can't add bugs.

Nevertheless, reality is that sometimes it's just too hard to change
the input package set - there's a risk of breaking things.  Namely,
we're introducing a new update system here, but obviously there's a
previous one: yum.  Upstream packages keep growing a dependency on it.

Note this patch allows *not* removing all files from the package,
because it's possible that other things (e.g. subscription-manager)
import it as a library.

So in the meantime while we're iterating on this, let's support:

  "remove-files": ["usr/bin/yum"],

The code is generic beyond yum for obvious reasons, but I don't
think we should use it for a lot more than that.
2014-10-23 11:42:52 -04:00
Colin Walters
850ad5ae6b upgrade: Honor pull flags
A user noticed --allow-downgrade wasn't actually working.
2014-10-17 13:42:25 -04:00
James Antill
5cd4a1d39b treecompose: Add --add-metadata-string argument for versioning
This will be used by rpm-ostree-toolbox to inject version numbers for
the trees.
2014-10-16 19:10:42 -04:00
James Antill
c4ac1edeae rebase: Cleanup dead variables and origin references 2014-10-16 19:10:13 -04:00
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
Colin Walters
7c71fbc077 Add new "compose" builtin, rename "treecompose" -> "compose tree"
And do the same for "sign".  This way we can have the compose server
utilities cleanly separated from what most people will see, which is
the client side tools.
2014-05-26 15:05:08 -04:00
Colin Walters
9d954d433a treecompose: s/create/treecompose/ in help text 2014-05-20 21:37:51 -04:00
Colin Walters
6fd8515f2e treecompose: Look for yum repo configs in same directory as treefiles
This is significantly easier than requiring mutation of the host yum
configuration.
2014-05-18 14:13:31 -04:00
Colin Walters
2756398d84 treecompose: Honor http_proxy environment variable 2014-05-18 09:29:51 -04:00
Colin Walters
18d0d989ae treecompose: Add initial caching
The way this works is still fairly naive in that we hash in two
inputs:

1) The treefile JSON
2) The result of rpm -qa

If both of those are a hit, we reuse the existing commit.
2014-05-16 04:29:17 -04:00
Colin Walters
ce862456e3 treecompose: De-indent unnecessarily indented region 2014-05-15 17:47:47 -04:00
Colin Walters
9eff6b5951 treecompose: Remove code to delete cached packages
No longer needed now that we recommend an HTTP proxy.
2014-05-15 16:57:43 -04:00
Colin Walters
18b2121c91 Remove internal postprocessing support
It was too hacky.  If we do this it should be a higher level language
like what Lorax has.
2014-05-14 13:59:40 -04:00
Colin Walters
d048427618 treecompose: Move yum repos out of the way *after* waiting for yum completion
Otherwise it just doesn't work.  Note this hack is only necessary for
the case where some package pulls in e.g. fedora-release in the
initial transaction set when we're trying to install nss-altfiles.
2014-05-05 18:01:45 -04:00
Colin Walters
8f519a171f treecompose: Add missing space in subprocess printing 2014-05-05 17:57:16 -04:00
Colin Walters
e8cfd7a334 treecompose: Fix use-before-alloc 2014-05-05 08:34:45 -04:00
Colin Walters
6e082af2b3 treecompose: Add support for an "include" key
This greatly increases the practiality of using treefiles directly
instead of the old products.json.
2014-05-03 10:05:43 -04:00
Colin Walters
df2b355f38 core: Remove src/autobuilder
This will move to a separate repository.  This allows a clearer
separation between the core tool (which is shipped on client systems
too), and the compose infrastructure.

Furthermore, I want to make the autobuilder a Docker container.
2014-05-03 07:32:28 -04:00
Colin Walters
0ad262b2c4 treecompose: Remove internal caching, require --repo argument
It's a lot clearer if the inputs, outputs, and cache state are cleanly
separated.  At least the "lorax" tool relies on a local HTTP cache
instead of keeping around the yum repos - let's do the same.

This commit causes treecompose to require a --repo argument, and it
also gains an optional --proxy argument.
2014-05-03 06:55:35 -04:00
Colin Walters
06b766bf37 rollback: Remove unnecessary cleanup
_write_deployments() does this.
2014-04-03 18:30:36 -04:00
Colin Walters
55fe109685 upgrade: Add --allow-downgrade option
This matches the core OSTree one, and is too useful for development
purposes.
2014-04-03 18:14:34 -04:00
Colin Walters
f58a9efc29 src: Delete relabeling helper
It's now merged into the ostree sources.
2014-04-03 18:12:20 -04:00
Colin Walters
77214be079 treepkgdiff: Fix upgrade diff ordering
Oops...
2014-04-01 22:40:16 -04:00
Colin Walters
29e8505fab tasks/repoweb: Add a print message to show progress 2014-04-01 19:21:31 -04:00
Colin Walters
f7cf900f40 autobuilder: Claim ownership of command socket on startup 2014-04-01 18:36:04 -04:00
Colin Walters
9cea1c5328 treecompose: Remove some commented-out code
This bit will never really work right; the real fix is to switch to
hawkey+librepo.
2014-03-31 18:37:27 -04:00
Colin Walters
0a88e292f2 Put hawkey stuff behind --enable-patched-hawkey-and-libsolv
Right now we depend on two patches.
2014-03-28 22:04:53 -04:00
Colin Walters
50bd970791 Print treepkgdiff on rollback too
Move it to an internal API.
2014-03-28 21:55:37 -04:00
Colin Walters
441313f9ef core: Add "rollback" builtin
This is a convenient command to go back to the previous tree.
2014-03-28 20:27:35 -04:00
Colin Walters
8b32e68d41 upgrade: Add missing variable initializer 2014-03-28 20:27:35 -04:00
Colin Walters
221becaafb autobuilder: Avoid critical if there's no gpg_key 2014-03-28 20:27:35 -04:00
Colin Walters
57f8bfb63f upgrade: Print out a summary of the package delta
This requires us to link to hawkey.
2014-03-28 17:34:08 -04:00
Colin Walters
87c144269e upgrade: Consistently end status line
On error, we would append to the status line.
2014-03-27 07:59:36 -04:00
Colin Walters
cced7a74da Stop shipping yumdb entirely
We don't have the tools to read it in the host system right now, and
its one-file-per-value badly conflicts with OSTree's
one-HTTP-request-per-file.
2014-03-26 17:09:51 -04:00
Colin Walters
83fae8e058 upgrade: End status line 2014-03-25 17:38:59 -04:00
Colin Walters
bee7feb8d8 update: Print message noting reboot is required 2014-03-25 17:30:15 -04:00
Colin Walters
8fb40b75bd upgrade: Print origin description 2014-03-25 16:50:19 -04:00
Colin Walters
60a00a8544 upgrade: Fix to actually deploy on change 2014-03-25 08:21:25 -04:00
Colin Walters
c2b242f200 Add upgrade builtin
This is just the start of moving more functionality into rpm-ostree,
with the goal of more tightly binding the rpm and ostree worldviews.

For exmaple, supporting package installation on top, showing the
package-level diff between trees, etc.
2014-03-24 18:11:21 -04:00
Colin Walters
1319e1616d Rename create -> treecompose
It's just a better name.  Also matches what we already did for the
autobuilder.
2014-03-22 15:20:23 -04:00
Colin Walters
05d348528e core: Move rpm-ostree-sign to "rpm-ostree sign" 2014-03-22 15:12:31 -04:00
Colin Walters
af49603d6f core: Use generic "builtin" infrastructure for command handling
I want to have more options than just "create".
2014-03-22 15:05:41 -04:00
Colin Walters
481ce2af64 autobuilder: selinux-ensure-labeled has moved to instutil 2014-03-18 18:25:11 -04:00
Colin Walters
3ba0eb2e6e autobuilder: Rename build -> treecompose
We're not building anything from source here.
2014-03-14 22:53:32 -04:00
Colin Walters
9d2124fa55 autobuilder: Remove bdiff
It only applies in Continuous.
2014-03-14 22:44:19 -04:00
Colin Walters
e989331788 core: Add rpm-ostree-sign
This uses rpm-sign which talks to a remote server for signing.
2014-03-14 22:18:17 -04:00
Colin Walters
c73bcb5112 rpm-ostree: Remove duplicate variable definition 2014-03-14 16:03:49 -04:00
Colin Walters
6e29b92035 zdisks: Run immediately after ensure-disk-caches 2014-03-14 10:55:21 -04:00
Colin Walters
394212008a When tasks are pushed from console, schedule immediately
This is so that I can force a zdisks run.
2014-03-14 10:53:32 -04:00
Colin Walters
2e97051d74 Move internal labeling helper to ostree
This way it can more easily be reused by Anaconda:
https://git.gnome.org/browse/ostree/commit/?id=e11de9357cea643b45a2e5e3f94d33dbd84d9ca3
2014-03-13 08:52:51 -04:00
Colin Walters
7057a33859 libqa: Also update default fstab 2014-03-11 18:37:25 -04:00
Colin Walters
fbfabf8574 libqa: Switch to XFS by default for /
Docker tends to trigger kernel panics in fallocate with ext4, and XFS
is the RHEL7 default.
2014-03-11 18:02:58 -04:00
Colin Walters
8e74ce423f postprocess: Remove from_repo_{revision,timestamp}
These change every time the repo changes, and don't add a lot of
value.  We mainly just want the package URL and such.
2014-03-10 14:41:38 -04:00
Colin Walters
7f3fa0d60b Add "composeui/"
The web page previously bounced out to the "fedora-atomic" component -
but we really want a bit of web UI that's shared between products.
Like how Koji is a generic frontend.

In particular, this now comes with a start of a generic "repoweb".
2014-03-05 13:16:22 -05:00
Colin Walters
d84ccd6959 ensure-disk-caches: Don't regenerate if we have exact revision 2014-03-03 07:45:47 -05:00
Colin Walters
e694106324 smoketest: Delete .qcow2 disks after completion
They can get kind of large.
2014-03-01 12:12:52 -05:00
Colin Walters
115b781729 autobuilder: Use last completed build for tasks
We can't execute a task in a *running* build.
2014-03-01 11:00:10 -05:00
Colin Walters
a1a2953d4c core: Don't make multi-user.target.wants link if it already exists 2014-02-28 10:44:43 -05:00
Colin Walters
db22ca6e92 build: Don't append lists muliple times 2014-02-28 08:54:20 -05:00
Colin Walters
0e2c40c8a8 Move demo-treefile.json to doc/ 2014-02-27 18:18:42 -05:00
Colin Walters
a9ac9dde40 core: Create multi-user.target.wants if necessary
For some reason this doesn't seem to be created with current systemd
in EL7 Beta.
2014-02-27 18:16:13 -05:00
Colin Walters
5a6ac59e66 autobuilder: Add "console" command
Implemented in C with readline.
2014-02-26 14:54:01 -05:00
Colin Walters
56ff31418c autobuilder: Add missing space 2014-02-26 10:17:52 -05:00
Colin Walters
1e194b3c0b autobuilder: Remove leftover debug print 2014-02-26 04:49:36 -05:00
Colin Walters
cf15328768 autobuilder: Add a control socket
I've always needed a way to change what the daemon is running.
2014-02-26 04:42:22 -05:00
Colin Walters
ebf5838436 Support "repos_data" in treefiles, use it for automatic overrides/
For convenience, allow users to create an "overrides/" directory which
is a repo.  If it exists, the builder automatically adds it.

(However, we should likely disallow distributing these builds on
 the network)
2014-02-25 17:07:59 -05:00
Colin Walters
c08630f5d5 autobuilder: Move data to -autobuilder subdirectory for easy packaging 2014-02-23 17:24:05 -05:00
Colin Walters
2e21ceed91 autobuilder: Default to running "autobuilder" 2014-02-23 17:05:43 -05:00
Colin Walters
0cb346b798 postprocess: Work around SELinux cross-labeling vs PCRE issue
See http://marc.info/?l=selinux&m=139282274522388&w=2
2014-02-22 01:32:20 -05:00
Colin Walters
6985805b3a rpm-ostree: Set HARDLINK=no in environment during install
This avoids the kernel pointlessly doing its own checksum of content.
2014-02-21 14:56:12 -05:00
Colin Walters
61f3066ac6 autobuilder: Inherit comment attribute into treefiles 2014-02-21 14:05:24 -05:00
Colin Walters
cced6f6874 postprocess: Always place rpmdb into /usr/share/rpm
Remove support for the case where the tree doens't have rpm - we don't
need to go quite that small yet, and having the file -> package
mapping helps with the GPL compliance story.

See https://lists.fedoraproject.org/pipermail/legal/2014-February/002393.html
2014-02-21 13:50:40 -05:00
Colin Walters
39a7c458ef Major update to SELinux handling
We use the new unified OSTree API (OstreeSePolicy) to perform
labeling, rather than having our own here.

Also create a new rpm-ostree-relabeling-helper that is run to label
any leftover files such as /etc/fstab that we create offline, and also
to relabel the entire disk.
2014-02-20 07:59:09 -05:00
Colin Walters
9be80f1775 tmpfiles: Make /var/home a directory, not a symlink by default
Because /etc/passwd may be different between OSes, let's have
/var/home be a real directory by default.  Admins can always make it a
symlink.
2014-02-15 19:35:43 -05:00
Colin Walters
97ef560a00 libqa: Set PROMPT 1 for syslinux by default
We want people to be able to easily choose between boot entries.
2014-02-15 19:35:24 -05:00
Colin Walters
fb2c568cfb postprocess: Work around SELinux issue with cross labeling
Unfortunately when composing from RHEL7 a current rawhide tree, the
PCRE version mismatch causes none of the regexps to match...

Work around this by temporarily moving the .bin files out of the way.
This is really a hack though.

The real fix is to change libselinux to check pcre_version().
2014-02-15 18:41:22 -05:00
Colin Walters
23e42af3ac postprocess: Remove var_uuid files from yumdb
These differ each run, polluting upgrades.  James says we don't need
them anyways.postprocess: Remove var_uuid files from yumdb

These differ each run, polluting upgrades.  James says we don't need
them anyways.
2014-02-15 18:40:47 -05:00
Colin Walters
f686bb345a demo-treefile: Remove extraneous postprocessing 2014-02-12 19:58:00 -05:00
Colin Walters
ff08e35f98 tasks: Update for new products-built.json syntax 2014-02-12 19:25:42 -05:00
Colin Walters
148ca0d74e tasks/build: Automatically use override repo 2014-02-12 19:25:31 -05:00
Colin Walters
a3a65fd7b5 Switch to taking JSON as input, generate "treefile" from products.json
This is somewhat similar to what we've been doing with Continuous; we
take the manifest.json, and turn it into a "snapshot".  Except here
there is a notion of inheritance.

This gets stored into the tree as /usr/share/rpm-ostree/treefile.json.

Additionally, it goes into the autobuilder directory in
products-built.json.  Though really we should split up that file,
since it will be kind of...large.
2014-02-12 18:28:42 -05:00
Colin Walters
e5e260ff3a postprocess: Downgrade warning about files in /var to print
It's really just informative...
2014-02-12 15:29:11 -05:00
Colin Walters
e3eb4d1735 task: Clean up previous dir before executing
This is mainly useful for local builds.
2014-02-11 20:10:36 -05:00
Colin Walters
a7d2f081e5 Add image_formats parameter, default fedostree/ to qcow2
The vdi export is really only for a different use case.
2014-02-11 19:55:40 -05:00
Colin Walters
9762c20fdc core/postprocess: Move /usr/lib/yum to /usr/share/yumdb 2014-02-07 11:35:27 -05:00
Colin Walters
aaaed643af core/post: Fix detection of /usr/bin/rpm in target
We've already moved /usr, so we need to look for /usr/bin/rpm in the
target.
2014-02-06 18:37:09 -05:00
Colin Walters
7a9ea01040 autobuilder: Don't put trees which failed to compose into products-built.json
Otherwise we attempt to run ensure-disk-caches on them which won't
work.
2014-02-04 11:37:17 -05:00
Colin Walters
1cb62d25fb core/post: Warn when we fail to find a filename in the policy 2014-02-02 16:30:15 -05:00
Colin Walters
7729c682f2 zdisks: Put autogenerated images in "images/auto"
We'll then use say releases/ for official releases, so people aren't
blinded by checksums.
2014-02-01 17:26:47 -05:00
Colin Walters
7f189c326d libqa: Append root= kernel argument again
Oops.
2014-02-01 16:40:17 -05:00
Colin Walters
b1ca14333d Support adding default kernel arguments, use enforcing=0 for now
We're quite close with SELinux, but let's not wait until we are
AVC-free before shipping.  Just use enforcing=0 for now.
2014-02-01 16:20:48 -05:00
Colin Walters
64bd4fc414 zdisks: Use .bz2 for VDI files
It turns out OS X has bzip2 but not xz installed by default, so let's
use that instead.  QCOW2 stays as xz since we can assume GNU/Linux
users have it better.
2014-02-01 15:27:22 -05:00
Colin Walters
709ff9f332 Export compressed disks from cache, add VirtualBox VDI export 2014-01-31 22:45:28 -05:00
Colin Walters
5b37f7c9e5 libqa: Make use of --disable-fsync
This is way faster.
2014-01-31 22:19:27 -05:00
Colin Walters
0f4ff6c2cf autobuilder: Stick 'buildmaster' in ref names
Then later we can put 'smoketested' there, and such.
2014-01-31 17:11:43 -05:00
Colin Walters
c76cee28fc Add option to disable SELinux, use it for now
While it works during commit, it doesn't work with libguestfs/FUSE =(

Back it out until we have a way to generate images.
2014-01-31 11:59:50 -05:00
Colin Walters
8543a6108d Support SELinux
This commit labels all of the files on the server side, if a policy is
installed.
2014-01-31 10:13:18 -05:00
Colin Walters
654cb99599 Add support for enabling services by default 2014-01-30 19:56:13 -05:00
Colin Walters
194e7365a9 core: Use --setopt=cachedir rather than copying/moving
I don't know why I wasn't doing this before, it's clearly better.
2014-01-30 19:04:58 -05:00
Colin Walters
ad831af3be autobuilder: Log command invocation 2014-01-30 18:02:13 -05:00
Colin Walters
7a0676a001 Add support for GPG signing builds 2014-01-30 16:36:47 -05:00
Colin Walters
31b11a7512 build: Don't accumulate postprocessing steps 2014-01-30 12:41:06 -05:00
Colin Walters
69132953f3 libqa: Make disk generation more flexible, with an eye to single-partition layout
The Fedora cloud disk just has one ext4 partition, we should be able
to do that as well.
2014-01-30 11:17:01 -05:00
Colin Walters
9e351af1fa libqa: Generate 0.10 qcow images by default
So they can be read by EL6 era qemu.
2014-01-30 09:47:20 -05:00
Colin Walters
63cf003481 postprocessing/remove-docs: Also remove manpages 2014-01-30 06:01:03 -05:00
Colin Walters
fe53891d6c core/postprocess: If there's no /usr/bin/rpm, add rpm-manifest.txt
We really want people using these trees to know what went in it.  If
the tree doesn't actually have /usr/bin/rpm inside it, then do an
"rpm -qa | sort" and dump that into: /usr/share/rpm-manifest.txt

This will help our story with GPL compliance too.
2014-01-29 18:37:54 -05:00
Colin Walters
87bdf29192 core: Fix rpmqa-sorted script to operate on $(pwd)
I'm not sure why it needs $(pwd) over ".", but oh well.
2014-01-29 18:37:26 -05:00
Colin Walters
f6076b13a0 core: Add an environment variable to breakpoint post-yum 2014-01-29 18:37:05 -05:00
Colin Walters
f07f054efb Add postprocessing infrastructure
We remove the root password from all images.  The core/docker tree
also gets docs and some kernel drivers removed.
2014-01-29 18:12:50 -05:00
Colin Walters
802cace05f Unify rpm-ostree into one binary
And start making an internal library.
2014-01-29 14:37:44 -05:00
Colin Walters
f8ddf38aa2 postprocess: Synthesize tmpfiles.d from /var RPM content
OSTree really wants /var to come empty; it's not going to be practical
to change every RPM right now though.  So, let's dynamically turn the
content from /var into systemd-tmpfiles.d snippets.
2014-01-28 11:37:11 -05:00
Colin Walters
be0b25c493 testbase: Fix updating a non-exact disk image 2014-01-26 17:13:42 -05:00
Colin Walters
f8444e6638 Resolve dependencies before building
This allows us to skip the whole install process if the
RPMs haven't changed, which is a rather large win.

Part of this commit involves some code to attempt to talk to "yum
shell" for dependency resolution, in an attempt to avoid depsolving
twice, which just isn't really going to work, since "yum shell" isn't
an API as it turns out.

The only other real alternative is doing something PackageKit-like,
which is ~4000 lines of very nontrivial Python.
2014-01-26 17:07:09 -05:00
Colin Walters
f4952a0c4f testbase: Put overlay qcow2 in working directory, not toplevel 2014-01-26 10:15:52 -05:00
Colin Walters
14fe66e01d libqa: Also look for qemu-system-x86_64
This is unfortunate, but the current rpm-ostree.cloud.fp.org instance
is in OpenStack, so we're in nested virt land =(
2014-01-26 09:51:54 -05:00
Colin Walters
1fac73c484 build: Write a modified.json
This ensures we don't trigger smoketest/etc. if the trees haven't
changed.
2014-01-26 05:02:01 -05:00
Colin Walters
8fa595cca7 build: Fix exception if we don't have a previous build 2014-01-26 05:01:42 -05:00
Colin Walters
06a6c2878a testbase: Fix successful return value 2014-01-25 21:36:27 -05:00
Colin Walters
c2c7756336 testbase: Test each disk in serial, don't abort if one fails 2014-01-25 21:28:19 -05:00
Colin Walters
eb8c4483dc Make smoketest work 2014-01-25 21:25:27 -05:00
Colin Walters
1ea30df70c Make disk image creation work 2014-01-25 20:22:54 -05:00
Colin Walters
90eca9c7c2 libqa: Fix extlinux installation 2014-01-25 20:20:48 -05:00
Colin Walters
58d75e65ca core: Fix packageset diff comparison 2014-01-25 19:19:20 -05:00
Colin Walters
141bc3406e Drop last leftover bit of Python code 2014-01-25 09:22:46 -05:00
Colin Walters
05872052b1 Rewrite core utilities in C
There are two major reasons:
1) I want to do things like process SELinux labels here, and that
   type of thing is best done in C.
2) There are presently 3 languages in this code, and this takes us
   down to just two.
2014-01-25 09:19:18 -05:00
Colin Walters
7718a22bc5 libqa: Port disk construction to introspection
Hooray for g-i!
2014-01-23 19:34:04 +00:00
Colin Walters
0891d38975 builddisks: Implement disk building
This is a bit raw, but functions.
2014-01-23 00:23:12 +00:00
Colin Walters
7345f2b9f5 autobuilder: Ensure timeout really runs, drop it to every hour 2014-01-22 14:02:02 +00:00
Colin Walters
587a97121c rpmostree: Cache rpm -qa between runs, don't commit if packageset is unchanged
At the moment, a lot of RPM content has files whose content derives
from timestamps (like .pyc files).  We really don't need to do another
commit to the repository if it's just these files which changed.

Fix this by caching the package list at the rpm-ostree level, and
don't commit if it hasn't changed.
2014-01-20 15:18:07 -05:00
Colin Walters
f2b4ea425d rpmostreepost: Support env var to preserve root that we committed
I'll be using this to test SELinux support.
2014-01-20 12:10:24 -05:00
Colin Walters
bf0acf54ed autobuilder: Add onlyTreesMatching parameter to build
This is a convenient way to test, run:

$ rpm-ostree-autobuilder make -n build onlyTreesMatching=\"20/x86_64/base/minimal"
2014-01-20 12:10:24 -05:00
Colin Walters
84d6f10495 autobuilder: Implement basic autobuilder which does build every 3 hours 2014-01-18 16:29:36 -05:00
Colin Walters
99c11cb374 rpmostree: Use workdir/cache instead of /var
We're moving more towards the autobuilder model; this allows us to
keep all of the data in one place.  Important for the
cloud.fedoraproject.org instance since /mnt/ostree is the large
filesystem.
2014-01-18 16:27:23 -05:00
Colin Walters
cad6760b6a build: Move copr repo into products.json 2014-01-16 16:35:59 -05:00
Colin Walters
7333091db4 Split out postprocess+commit to separate script
As this logic is of most interest to potential other consumers; it's
not entangled with yum for example.
2014-01-16 11:43:17 -05:00
Colin Walters
df1db5f85b build: Correctly inherit base packages 2014-01-16 06:48:09 -05:00
Colin Walters
94bf3c731d autobuilder: Mostly functional operation on products.json 2014-01-16 06:23:35 -05:00
Colin Walters
1c4262d273 rpmostree: Fix typo in error path 2014-01-16 06:23:26 -05:00
Colin Walters
e8633e4e6e Add some stub code to build from a "products.json" 2014-01-14 18:04:21 -05:00
Colin Walters
8250481b46 Accept arbitrary refname instead of using os/version/name
I want to use "fedostree" for now, so let's allow the caller to
specify whatever refname they want.
2014-01-12 13:46:49 -05:00
Colin Walters
a593335ce3 Install shadow-utils in root, move breakpoint to post-NSS
For more easily debuging nss-altfiles; one can set a breakpoint here,
and then chroot in to test things.
2014-01-08 14:56:25 -05:00
Colin Walters
66a19b6475 Import lots of code from gnome-continuous
This doesn't really do anything yet, but the idea is to start doing
Continuous-like things (such as actually booting the result).
2014-01-03 17:14:10 -05:00
Colin Walters
a1e5ee0a9c Flush log messages immediately
Otherwise we end up with desynchronized stdout/stderr which is
confusing.
2013-12-23 15:00:48 -05:00
Colin Walters
453667e41e Add --gpg-sign argument
Can't quite use it yet, but will be able to with the next OSTree
release.
2013-12-23 14:22:43 -05:00
Colin Walters
02b85c0885 Use "yum shell" to execute group add and package install as one unit
The two transaction thing is bad for multiple reasons, but what bit me
specifically was something in the group transaction pulling in
'kernel-debug', and then installing 'kernel' later.
2013-12-23 10:10:35 -05:00
Colin Walters
3b975343d4 Include kernel version in initramfs filename 2013-12-23 10:10:01 -05:00
Colin Walters
cc0922e655 Move/restore ${sysroot}/etc/yum.repos.d to work around yum bug
We really want it to use the *host*'s yum repos, even after the chroot
is constructed.
2013-12-22 10:59:17 -05:00
Colin Walters
02c2e619d7 README.md: Move to toplevel 2013-12-22 10:59:00 -05:00
Colin Walters
3362b7da4b Fix name of installed tmpfiles 2013-12-22 10:58:38 -05:00
Colin Walters
f578eeba9d Fix missing argument 2013-12-21 22:21:48 -05:00
Colin Walters
8ecc47ac87 Various fixes to finish import from pkgsys-ostree 2013-12-21 22:15:57 -05:00
Colin Walters
958dfa435e Initial import from pkgsys-ostree 2013-12-21 19:41:30 -05:00