Commit Graph

982 Commits

Author SHA1 Message Date
Colin Walters
bedf113636 util: Move _rpmostree_perror_fatal here
Will be used in other places in later commits.
2014-11-21 13:16:13 -05:00
Colin Walters
6faaf1fd65 cleanup: Add a _cleanup_close_
Matching systemd.
2014-11-21 13:16:13 -05:00
Colin Walters
2a1f4f6dca compose: Refactor sync waitpid into helper
Will be used for a future commit.
2014-11-21 13:16:13 -05:00
Colin Walters
e021bc2951 util: Add helper function to set GError from errno
Really this should be in libgsystem (or possibly glib-unix.h), we have
a copy in ostree.  But we can refactor to use a shared version later.
2014-11-21 13:16:13 -05:00
Colin Walters
7bc1e08c7d ostree-nspawn: Obsolete, delete
It's useful as a demo, but doesn't need to live here.
2014-11-19 15:57:43 -05:00
Matthew Barnes
5f5a5823ab Fix help output for "rpm-ostree compose"
"rpm-ostree compose {tree,sign} --help" acted as if no subcommand was
given.  But the compose subcommands each have a good number of options
so it's particularly important to list them.
2014-11-19 15:17:45 -05:00
Colin Walters
cb5681a4f4 Delete rpmqa-sorted-and-clean
This is no longer needed now that we use hawkey for this.
2014-11-17 17:46:40 -05:00
Colin Walters
c7fc352ce6 Release 2014.111 2014-11-17 16:22:50 -05:00
Colin Walters
9ad31df1ee jsonutil: Remove useless GCancellable
Spotted by mbarnes from review of
https://github.com/projectatomic/rpm-ostree/pull/52/commits
2014-11-17 16:08:25 -05:00
Colin Walters
15216eacda compose: Make 'bootstrap_packages' actually optional now
It has in practice been optional since:
827e711eb7

Now let's let people write treefiles without it.
2014-11-17 15:48:08 -05:00
Luke Macken
7a3b4d5c3c doc/treefile.md: The repos are not pulled from the system /etc/yum.repos.d 2014-11-17 12:11:42 -07:00
Colin Walters
9a20073893 compose: Add 'etc-group-members'
Currently adding human users to a system group such as 'wheel' does
not work with shadow-utils as it exists now.  This is admittedly
a hack; basically we single out "wheel" as going in /etc/group, via:

    "etc-group-members": ["wheel"],

A more comprehensive solution to this will be:
https://github.com/projectatomic/rpm-ostree/issues/49
2014-11-17 12:40:38 -05:00
Colin Walters
3380682cc8 compose: Move boot-location handling to postprocessing
Originally I was trying to have all of the treefile parsing
in treecompose, and then call other functions as API.  But that
turns out to be unrealistic.  We'll need finer grained control
over this in the future.

Therefore, let's move the boot-location handling down, in preparation
for further commits which parse the treefile in the commit phase.
2014-11-17 09:18:02 -05:00
Colin Walters
d32d35500d compose: Move 'workdir' to be 'self' member
This avoids passing another parameter around.
2014-11-16 20:05:47 -05:00
Colin Walters
39cbc2998b packaging: Update BRs 2014-11-14 18:07:47 -05:00
Colin Walters
f98b0aff0b Release 2014.110 2014-11-14 17:51:06 -05:00
Colin Walters
51fbd8c920 compose: Support 'postprocess-script'
This is obviously a total cop-out.  However, without glibc fixes, we
can't do better.  See:

https://bugzilla.redhat.com/show_bug.cgi?id=156477
2014-11-14 14:12:15 -05:00
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
8b845e8a55 doc/treefile.md: Document remove-files 2014-11-13 14:19:06 -05:00
Colin Walters
1dfb9ce6e6 doc: Restore treefile.md docs 2014-11-13 14:13:23 -05:00
James Antill
b15c75686a Merge pull request #45 from cgwalters/cleanup-cleanup
Looks great.
2014-11-11 20:32:55 -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
Colin Walters
c5d3e9cb0a doc: More updates, note atomic status, flesh out tradeoffs 2014-11-01 10:33:39 -04:00
Colin Walters
9e6231407c README.md: Add more docs 2014-10-31 14:39:57 -04:00
Colin Walters
66b0737720 README.md: Update a bit 2014-10-30 17:04:45 -04:00
Colin Walters
9f60549896 Release 2014.109 2014-10-28 16:38:26 -04:00
James Antill
9503d608ee Check rpm-ostree status output 2014-10-28 13:30:08 -04:00
James Antill
7a51eff547 Import latest libtest from ostree 2014-10-28 00:47:01 -04: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
Colin Walters
3c26cbc17f Release 2014.108 2014-10-16 19:13:06 -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