Colin Walters
dc0f3c3dcb
Add support for deleting refs
...
The internal API will be used by admin, and "ostree refs --delete"
is handy for interactive management.
2013-07-01 15:41:27 -04:00
Colin Walters
5b3fca8426
Add "refs" builtin
...
This is just useful to look at before pruning, etc.
2013-06-29 14:51:08 -04:00
Colin Walters
613f57007c
Extract prune logic into an internal API
...
This will be used by ostree admin deploy.
2013-06-29 13:49:34 -04:00
Colin Walters
a167bb7342
pull-local: Support --remote argument
...
For offline upgrades, pull-local can now write the refs into a
specific remote, rather than using the local heads.
2013-06-29 13:00:42 -04:00
Colin Walters
1ba852ebaa
core: Add "refspec" which is remote:refname
...
This allows an unambiguous reference; otherwise, it was too easy to
have confusion between local heads and remotes.
2013-06-29 12:51:29 -04:00
Colin Walters
e3dc0c91df
gioutils: Many new utility functions
...
Reading symbolic links becomes a much more common thing now.
2013-06-29 12:51:29 -04:00
Colin Walters
f6946a368f
prepare-root: Only bind mount /home, /tmp, /root if they are directories
...
What we expect for new systems is for these to be symbolic links:
/home -> /sysroot/home
etc.
2013-06-23 17:56:14 -04:00
Colin Walters
7bb20b0533
core: Port more callsites to gs_file_enumerator_iterate()
...
See previous commit.
2013-06-14 19:45:40 -04:00
Colin Walters
fbd9f17e39
core: Update libgsystem, port some uses of GFileEnumerator
...
This makes the code *so* much nicer.
2013-06-14 19:14:35 -04:00
Colin Walters
c57e63a515
pull-local: Fix race condition pointed out by Benjamin
...
We could drop into g_main_loop_run() after the worker
thread had called g_main_loop_quit().
Fix this by following the pattern suggested by Ryan of a while loop
around our termination condition, and g_main_context_iteration().
2013-06-08 14:15:43 -04:00
Colin Walters
3e1e26352f
pull-local: Fix race condition
...
https://bugzilla.gnome.org/show_bug.cgi?id=701861
2013-06-08 12:58:44 -04:00
Colin Walters
7e882cc2cf
dracut: Add ostree-remount
...
Linux creates a copy of the soure mount flags when creating a bind
mount; if the source is read-only, then the bind mount is.
The problem is that systemd will remount the rootfs read/write, but
each mount (/home, /var etc.) will still be read-only. We need to
remount every bind mount except for /usr to read-write too.
This only "worked" with the old ostree-switch-root because it
effectively force mounted the rootfs read-write always, ignoring the
"ro" flag.
2013-06-04 15:59:52 -04:00
Colin Walters
26baee6c3b
dracut: Also ensure we're using the systemd module
...
I can't work out how this happens otherwise in Fedora...
2013-06-03 20:49:07 -04:00
Colin Walters
6496abacbd
Add --with-dracut
...
This installs a Dracut module which parses the ostree= kernel command
line argument, and if given, sets up the OS/ at /sysroot, which
systemd's switch-root then moves into. This only works if dracut is
configured to use systemd itself.
2013-06-03 15:28:09 -04:00
Colin Walters
35df7a7eb4
ostree-prepare-root: Don't require an extraneous argument
2013-06-02 22:19:24 -04:00
Colin Walters
8eaaea795c
ostree-prepare-root: Parse /proc/cmdline, make RPRIVATE, set up /sysroot
...
This does everything we need except for the actual switch-root.
2013-06-02 21:41:08 -04:00
Colin Walters
1e080b9c73
ostree-prepare-root: New binary, used for systemd-in-initramfs setups
...
Rather than attempting to hack up the "switch-root" functionality of
systemd, this binary allows us to simply prepare the root before we
switch into it.
2013-06-02 15:39:20 -04:00
Colin Walters
16157c61af
Drop support for generating initramfs images client side using dracut
...
This is the responsibility of whatever is generating filesystem trees.
2013-05-31 13:09:27 -04:00
Colin Walters
ba5fc5cbcc
Fold ostree-pull into main binary
...
The rationale for the separation was always kind of weak; I want to
refactor the command line argument parsing, and it was complicating
things.
2013-05-30 19:26:48 -04:00
Colin Walters
86e504ba1d
pull: Exit cleanly with an error on failure to fetch refs
2013-05-27 09:29:33 -04:00
Colin Walters
fab160562d
upgrade: Actually prune deployments again
...
That was a rather critical logic error...
2013-05-27 09:29:05 -04:00
Colin Walters
0852362efa
upgrade: Actually deploy upgraded tree again
...
I need a brown paper bag for this one...
2013-05-16 15:38:17 -04:00
Colin Walters
f9484e9bab
admin: Add -r option to upgrade to initiate a reboot if tree changes
...
$ ostree admin upgrade -r
is convenient to fire off inside a VM and come back to it later.
2013-05-16 08:29:20 -04:00
Colin Walters
18af230e17
upgrade: Don't require specification of osname
...
Since this is a highly visible command, let's have a sane default and
upgrade the currently running OS.
2013-05-15 08:18:53 -04:00
Colin Walters
82f444020e
Add a --version argument that also outputs features
...
And use it in the tests to skip libarchive tests when the build
doesn't support it.
2013-05-01 19:15:06 -04:00
Colin Walters
c60c70e9a9
checkout: Add --allow-noent option
...
This is useful for the gnome-ostree build system where each build is
one commit, but it's split up into /runtime /devel /debug etc. trees.
Ideally we wouldn't have a /debug subdirectory for "noarch"
components for example.
So add an option to not error out if the given path doesn't exist in
the commit.
2013-05-01 12:15:02 -04:00
Colin Walters
f4327cc6a0
repo: Fix race condition in async checkout
...
When multiple threads need to uncompress an object, there was
a race condition where thread A could get EEXIST, unlink,
then thread B calls linkat(), then thread A tries to link() but
fails.
We can just loop in this case.
2013-04-30 19:34:20 -04:00
Colin Walters
8e4b296a96
libotutil: Drop is-hidden from fast queryinfo
...
Since now we look at .hidden files and bang on the mainloop for every
file lookup if that's specified =(
2013-04-29 22:08:56 -04:00
Colin Walters
c110680f5d
libgsystem: Update to latest
2013-04-29 14:04:48 -04:00
Colin Walters
8c694622b1
deploy: Swap current symlink only after updating the kernel
...
While this still isn't fully atomic (that depends on the bootloader),
this better ensures that the deployed kernel is booted with the
intended tree. For example, if we get ENOSPC when writing out the
kernel, we won't have swapped the symlink.
2013-04-26 18:15:51 -04:00
Colin Walters
52a3369709
libgsystem: Update
2013-04-22 12:27:47 -04:00
Colin Walters
b06c4a2081
pull-deploy: Tweak documentation to show using it for switching trees
2013-04-21 10:39:27 -04:00
Colin Walters
5565735bcb
admin: Use linkcopy_sync_data() for initramfs instead of rename()
...
It's possible (likely even) that /tmp is on a separate filesystem; in
that case, a raw rename() is going to fail.
Saw this on the ostree.gnome.org builder.
2013-04-15 12:50:58 -04:00
Colin Walters
a01783dafd
prune: Use g_format_size() so we get a human-readable number
...
We don't really care about the precise bytes.
2013-04-08 16:56:05 -04:00
Colin Walters
4271f84755
waitablequeue: Only use API from GLib 2.34
...
As intended.
2013-04-03 00:50:16 -04:00
Colin Walters
c563d07cb6
switchroot: Suppress compiler warning for asprintf
...
We're not going to run OOM here, if we do, we're totally screwed
anyways.
2013-04-01 21:52:24 -04:00
Colin Walters
bac4d7a0d2
pull: Rework threading communication model
...
Previously, I've observed bugs where we either:
1) Exit too early, leaving undownloaded objects
2) Hang while downloading
This rewrite hopefully fixes both.
2013-04-01 18:56:38 -04:00
Colin Walters
5d1b0ec1b3
core: Fix object enumeration for archive-z2 repositories
...
This makes fsck work again, among other things.
2013-04-01 11:43:03 -04:00
Colin Walters
bde7e5c719
pull: Drop support for original archive repositories
...
For future refactoring here, it's just too complex to maintain support
for both of them, and the advantages of archive-z2 outweigh archive
too much.
2013-03-29 17:22:56 -04:00
Colin Walters
7b2fc8df36
admin: Assume we're using /ostree if there's a toplevel /usr
...
Mainly so admin install works without an existing /ostree again.
2013-03-18 18:11:00 -04:00
Colin Walters
e4faf0d98e
admin: Support installing pregenerated initramfs images from tree
...
Us running dracut is a hack, basically. We should default to
generating this on the server.
2013-03-16 17:45:15 -04:00
Colin Walters
ae3945210c
config-diff: Properly print files relative to root
...
Just less ugly.
2013-03-12 08:48:05 -04:00
Colin Walters
d6d2253f5a
admin: Fix lookup of active root
...
This should hopefully *really* fix deleting running deployments
https://bugzilla.gnome.org/show_bug.cgi?id=694762
2013-03-07 16:46:41 -05:00
Colin Walters
30d46f9a02
admin: Don't delete the running deployment
...
https://bugzilla.gnome.org/show_bug.cgi?id=694762
2013-03-04 22:52:08 -05:00
Colin Walters
dba406bb8f
deploy: Don't run triggers if /usr/share/ostree/triggers-run exists
...
This is preparatory work for a future gnome-ostree commit where we'll
default to running triggers on the build server side.
2013-03-04 11:52:43 -05:00
Colin Walters
a016d744ea
Update libgsystem
2013-02-26 12:19:05 -05:00
Colin Walters
202c5e35c9
core: Use default /sysroot/ostree/repo or just /ostree/repo as appropriate
...
The old logic was just weird, special casing root, and we can easily
autodetect the case where we need /ostree/repo.
2013-02-24 10:00:23 -05:00
Colin Walters
99fe7b66b3
pull-local: Don't call g_hash_table_init() on a NULL hash
...
Not sure why this wasn't crashing before.
2013-02-23 11:15:19 -05:00
Colin Walters
a821420711
core: Add API to convert csum -> checksum without malloc()
...
Just doing some profiling, this was in the top malloc() callers.
2013-02-23 11:02:56 -05:00
Colin Walters
a305c79f7a
pull-local: Fix uninitialized variable ref
2013-02-21 13:05:14 -05:00
Colin Walters
8521438273
pull-local: Output status even in non-tty case
...
This way I can see progress when running builddisks.
2013-02-21 08:54:13 -05:00
Colin Walters
420e5f706a
admin: Use /sysroot/ostree automatically
...
When booted inside an ostree system, we want /sysroot/ostree, not
just /ostree by default.
2013-02-19 11:02:33 -05:00
Colin Walters
c9f56564a3
switchroot: Use MS_MOVE to / rather than chroot
...
This fixes a number of bugs; the two biggest are:
1) On shutdown systemd can correctly umount /
2) We can use linux-user-chroot inside the system, as is
necessary to do upgrades
See http://lists.freedesktop.org/archives/systemd-devel/2012-September/006703.html
2013-02-11 20:46:53 -05:00
Colin Walters
1d98f8865c
pull-deploy: Allow switching trees too
...
$ ostree admin pull-deploy gnome-ostree trees/gnomeos-3.8-x86_64-devel
Now works to switch your current tree to -devel from the current
runtime.
2013-02-01 10:56:06 -05:00
Colin Walters
42e3f1f4ab
pull-local: Fix crasher in previous commit when not connected to tty
2013-01-28 15:44:13 -05:00
Colin Walters
aa5e11af12
pull-local: Port to GSConsole
2013-01-28 15:35:47 -05:00
Colin Walters
13f36aa224
pull-local: Support pulling checksums too
...
This matches what pull allows.
2013-01-28 15:32:06 -05:00
Colin Walters
5424652a7e
libgsystem: Update to the latest
2013-01-25 15:19:34 -05:00
Colin Walters
64934202e4
admin: Don't overwrite previous ref unless it's different
...
We shouldn't overwrite deploy/<osname>/previous unless we actually
have something new.
This fixes the bug where two consecutive:
$ ostree admin upgrade foo
$ ostree admin upgrade foo
would end up pruning the data for foo/previous from the repo.
2013-01-24 17:32:59 -05:00
Colin Walters
59c98d0a04
pull: Drop dead code to pad output strings too
...
This is in GSConsole now.
2013-01-24 15:38:06 -05:00
Colin Walters
6fde0b61a8
Port ostree-pull to GSConsole
...
As part of this, we need to ensure our streams are inherited across
the chain of child processes.
2013-01-24 15:22:16 -05:00
Colin Walters
fafb256f57
Update to the latest libgsystem
2013-01-23 15:20:19 -05:00
Colin Walters
13aefbc096
admin install: Ensure /ostree is initialized first
...
https://bugzilla.gnome.org/show_bug.cgi?id=692008
2013-01-18 08:38:09 -05:00
Colin Walters
341923b928
admin: Ensure /var/log/journal exists
...
This is admittedly a hack, since the story is that services should be
handling /var on their own. But on the other hand the current systemd
story is that admins should create it to enable it. Possibly a better
fix is --enable-journal-always or something for systemd.
2013-01-17 22:08:21 -05:00
Colin Walters
50ca6b672b
update-kernel: Change dracut to use tmpdir on host, fix deploy path lookup
...
We had a bit of legacy code that looked for "current" if the deploy
path was unspecified; this needs to be deploy/OSNAME/current.
Secondly, we need to point dracut at a tmpdir outside of the root when
doing FUSE, because directories with mode 0700 and owned by root:root
aren't writable.
Also update libgsystem to the latest.
2013-01-09 04:32:51 -05:00
Colin Walters
77fa143bf3
admin: Add --no-bootloader option to update-kernel
...
Will be used by the QA scripts, since we need to inspect the kernel
configuration and generate a correct grub conf from that, rather than
trying to have update-bootloader reuse an existing config, since there
won't be one initially.
2013-01-08 13:57:24 -05:00
Colin Walters
ecc0d1e07f
Update to the latest libgsystem
2013-01-08 07:04:29 -05:00
Colin Walters
1dcf796868
admin update-kernel: Drop support for booting from host kernel
...
Now that gnome-ostree has a kernel, this functionality is no longer
necessary. It was always a hack.
2013-01-06 12:37:45 -05:00
Colin Walters
6b868d84d8
admin update-kernel: Ensure initramfs has correct owner/mode
...
It was 0600, and owned by the creating process (in the fuse case,
non-root!). We want it 0644/root/root.
2013-01-06 06:43:49 -05:00
Colin Walters
9795f4a67e
admin: Propagate --boot-dir to subcommands
...
Really, I should be using internal functions here...
2013-01-06 06:12:42 -05:00
Colin Walters
ccfdf22bb8
core: Drop dead prototypes from header
...
Followup to previous commit.
2013-01-04 19:47:56 -05:00
Colin Walters
cd5fce713c
core: Reuse more libgsystem API in utils
...
More code drain to libgsystem.
2013-01-04 19:46:02 -05:00
Colin Walters
c9a840c659
core: Ensure kernel and initramfs are put into place with fdatasync()
...
Via a new libgsystem API.
2013-01-04 19:32:26 -05:00
Colin Walters
47bd290065
core: Drain fdatasync() API into libgsystem
...
Just code cleanup.
2013-01-04 17:25:32 -05:00
Colin Walters
2db497fd3f
admin: Allow specifying --boot-dir
...
This is intended for use by QA tools that want to manipulate a
loopback-mounted disk image or the like.
2013-01-02 22:44:06 -05:00
Giovanni Campagna
6c9c7b0173
admin: restore current-etc symlink
...
It is useful now like it was before, and it is used by the grub
update script.
https://bugzilla.gnome.org/show_bug.cgi?id=690743
2012-12-26 19:42:46 +01:00
Colin Walters
9bd4d35c2b
pull: Fix a race condition causing an early exit
...
This is a little less magical than what we had before.
2012-12-23 17:22:08 -05:00
Colin Walters
3c67c209db
pull: Use a basic exponential moving average for bytes/sec
...
Still should look what other downloading programs do, but this
is better then what we had before.
2012-12-23 14:29:15 -05:00
Colin Walters
0ab1f78ec8
admin: Add new run-triggers command
...
In some cases we want the ability to run triggers independently of
checking out a tree. For example, due to kernel limitations which
impact the gnome-ostree build system, we may need to run triggers on
first boot via systemd.
Secondarily, if the user installs a system extension which adds a new
shared library to /usr/lib for example, the system will need to run
the triggers again.
Also, I think I want to take triggers out of the core and put them in
ostree admin anyways.
2012-12-22 14:52:33 -05:00
Colin Walters
3832544ac4
admin: Rework /ostree/deploy to support multiple independent operating systems
...
The real vision of OSTree is to "multiple versions of multiple
operating systems". Up until now, it's worked to install gnome-ostree
inside a host distribution, but several things don't work quite right
if you try to do completely different systems.
In the new model, there's the concept of an "osname" which encompasses
a few properties:
1) Its own /var
2) A set of trees deployed in /ostree/deploy/OSNAME/
3) Its own "current" and "previous" links.
Now it no longer really makes sense to boot with "ostree=current".
Instead, you specify e.g. "ostree=gnome/current".
This is an incompatible change to the deployment code - you will need
to run init-os gnome and redeploy.
All "ostree admin" subcommands now take an OSNAME argument.
2012-12-21 13:47:15 -05:00
Colin Walters
16d312e82f
admin: Support installing a kernel from the tree, default to it
...
The "protocol" here is rather lame; we just look for
/boot/vmlinuz-RELEASE and /lib/modules/RELEASE. But good enough for
now.
2012-12-21 12:20:55 -05:00
Colin Walters
19df2d372d
core: Use new libgsystem GSSubprocess API
...
It's less screwing around with GPtrArray in most cases.
2012-12-21 11:52:28 -05:00
Colin Walters
90ccc7b2d2
core: Pick better names for tmpfiles if no prefix given
...
Just makes it easier to track down where files came from.
2012-12-21 11:30:58 -05:00
Colin Walters
3d41d1d2db
OtWorkerQueue: Don't exit until we've fulfilled initial requests
...
This counts as an implicit "hold" on the first items, which we must
complete. Otherwise there are race conditions where the queue may
signal idle when in fact the main process is still working.
2012-12-21 09:36:38 -05:00
Colin Walters
fddc11ca74
Update to latest libgsystem
...
Has a bugfix change to gs_subprocess_new().
2012-12-20 21:14:31 -05:00
Colin Walters
ad956ff9e2
core: Allow creating tempfile without associated output stream
...
Just slightly more efficient, and we'll use this for spawning curl to
a tempfile.
2012-12-20 21:14:27 -05:00
Colin Walters
a97211e3d0
core: Clean up tmpfile creation code
...
I have been seeing random failures here...not entirely sure why yet,
but this code is cleaner.
2012-12-13 15:12:51 -05:00
Colin Walters
380b54d689
Update libgsystem
...
Just keeping up.
2012-12-13 15:12:33 -05:00
Colin Walters
b637ea7674
admin init-fs: New builtin
...
Should be used when initializing a new root filesystem for a "pure
OSTree" system; for example, what "ostbuild privhelper-deploy-qemu"
does when creating a filesystem image loopback.
2012-12-09 17:01:51 -05:00
Colin Walters
a2acaedfdc
admin: Process newly added config files recursively
...
Previously we just failed out if there was a new directory in /etc
added by the user (or the system).
2012-12-07 18:29:03 -05:00
Colin Walters
227d22adca
Update to the latest libgsystem
2012-12-03 12:05:41 -05:00
Colin Walters
a9a9baeb2a
Update to latest libgsystem
...
Has a rather important bugfix.
2012-12-02 23:02:39 -05:00
Colin Walters
fc7f05940c
core: Use mmap() with O_NOATIME if merely reading archive-z2 entries
...
Previously we'd open(path, O_NOATIME) and do a series of small read()
calls to just parse the header. I think this will trigger kernel readahead
into the compressed portion, but we don't care about that.
This should be more efficient.
2012-12-02 15:20:17 -05:00
Colin Walters
7fcebed4e8
cleanup: Rebase spawn API on top of libgsystem GSSubprocess
...
We didn't need most the parameters anyways, so this is fewer lines of
code. It also helps me test GSubprocess.
2012-12-01 16:53:06 -05:00
Colin Walters
b423ea2041
Update to the latest libgsystem
2012-11-29 18:16:45 -05:00
Colin Walters
6dda8da6c5
Switch to using libgsystem shutil
...
More code moved into libgsystem.
2012-11-29 17:11:24 -05:00
Colin Walters
1ac307e6b8
Switch to libgsystem file reading API
...
More draining common utilities into libgsystem.
2012-11-29 16:58:39 -05:00
Colin Walters
f3d765c903
Switch to libgsystem directory creation API
...
More code being dropped into a common place.
2012-11-29 16:40:17 -05:00
Colin Walters
6d81120455
otutil: Move checksum related bits into checksum-utils.[ch]
...
This paves the way for slimming ot-gio-utils.[ch] into libgsystem.
2012-11-29 16:28:24 -05:00
Colin Walters
5761733218
Drop some bits from libotutil that are now merged in libgsystem
2012-11-29 16:24:49 -05:00