Commit Graph

443 Commits

Author SHA1 Message Date
Matthew Barnes
2d21a9a621 Refactor command-line parsing for "rpm" command.
Similar to the previous commit, but the "rpm" command needed some extra
attention.

I stopped short of splitting the subcommands into separate files (like
for "compose"), but refactored the parsing as though they were separate.
2014-12-01 09:25:53 -05:00
Matthew Barnes
9b413dad5d Refactor command-line parsing.
Refactor command-line parsing to better utilize GOptionContext.  This
eliminates most of the manual parsing and global options are now shown
in the help output.

Some of the changes here are not strictly necessary for rpm-ostree,
but are done for consistency with ostree's command-line parsing.

The "rpm" subcommand needs some extra attention, so that's been split
into a separate commit.
2014-12-01 09:25:53 -05:00
Matthew Barnes
a7b04e2276 Simple help output corrections. 2014-12-01 09:24:21 -05:00
Kenjiro Nakayama
c62ad4d691 Show capability list with --version option 2014-11-26 14:09:15 -05:00
Colin Walters
3ffbaf3031 Release 2014.113 2014-11-25 13:35:44 -05:00
Colin Walters
308c994d82 libcontainer: Fix inverted logic
=/

Originally it was "container_disabled" but the double negatives
started being awkward, I missed converting this negation.

This should really make us work again on RHEL6.
2014-11-24 21:53:25 -05:00
Kenjiro Nakayama
7520570a7a docs: Update sample treefile example and add example repo file 2014-11-24 17:52:58 -05:00
Colin Walters
874c9f9620 Release 2014.112 2014-11-23 21:51:03 -05:00
Colin Walters
4f01e7b63c postprocess: Make use of _prefix_error for format printing
Followup from https://github.com/projectatomic/rpm-ostree/pull/55
2014-11-21 13:18:45 -05:00
Colin Walters
389c36ab7c postprocess: Use run_sync_in_root() for other subprocesses
Let's use these new libcontainer bits instead of invoking chroot().
It's stronger security.
2014-11-21 13:16:49 -05:00
Colin Walters
901917ff85 compose: Introduce a little 'libcontainer', use it for the post script
The current motivation for this is that

https://github.com/fedora-infra/fedmsg-atomic-composer

started using mock --new-chroot (which uses systemd-nspawn) to run
rpm-ostree, which in turn uses systemd-nspawn to run the post script.
Now systemd-nspawn is not really nestable (it wants to link up
journald, resolv.conf handling, etc).

First, dropping nspawn and going to raw containers fixes the nesting
problem.

Second, we don't need all the features of systemd-nspawn.  We are ok
with log messages going to stdout, and we don't use networking, so no
resolv.conf is needed.

Third, this sets a bit of a stage for more sandboxing internally when
run on real systems.  I already have a prototype branch which runs
librepo as an unprivileged user, that could be combined with this for
even stronger security.

Why not use systemd?  Well...I'm still debating that.  But the core
problem is systemd isn't a library in the C sense - to use its
sandboxing features we have to use unit files.  It's harder to have a
daemon that looks like a single service from a management perspective,
but uses sandboxing internally.
2014-11-21 13:16:49 -05:00
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