summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtin-os-init.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: Run clang-formatColin Walters2023-05-021-8/+8
| | | | | This is a one-time tree wide reformatting to ensure consistency going forward.
* cli/os-init: Port to C99 styleColin Walters2022-06-141-14/+8
| | | | | General background cleanup; motivated by a recent PR which was using pre-C99 code as a base.
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* bash-completion: Remove `admin` completionsColin Walters2018-02-271-5/+0
| | | | | | | | | | | | | | | The `admin` commandline should be considered a demo; I just added the `pin` command *mostly* so we could use it for unit tests, although I can imagine other people using it. But maintaining completions is a lot of overhead right now, let's not do it for `admin`. The other command line options that operate on repos we will definitely maintain since they're used in releng contexts. Closes: #1468 Approved by: jlebon
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* ostree: provide command description in a better placeRuixin Bao2017-10-201-1/+1
| | | | | | | | | | | | | | | | | | | This is similar idea as https://github.com/projectatomic/rpm-ostree/pull/916/commits/5c0bf889155573feec108501ce849ac09a0c9567, The duplicated description is now removed, and the description of the command is now displayed beneath the Usage. For example: ostree cat -h will output the following: "Usage: ostree cat [OPTION?] COMMIT PATH... Concatenate contents of files" Closes: #1267 Approved by: cgwalters
* ostree: move flags into command struct, pass down through builtinsRuixin Bao2017-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | This is a similar approach as https://github.com/projectatomic/rpm-ostree/commit/12c34bb2491a07079c911ef26401fee939e5573c. One thing to note is when we parse the admin related functions, we still keep the old admin related flags, and added a new parameter to represent the command struct. This allows us to identify the caller of the function, making it easier for us to possibly deduplicate the subcommand handling in the future. A similar approach is done in rpm-ostree: https://github.com/projectatomic/rpm-ostree/commit/83aeb018c1012c7a43783c09b74ec71bc9c45826 This also makes it easier for us to change the prototype of the function. If we want to add something new in the future, we won't need to touch every prototype. Closes: #1267 Approved by: cgwalters
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* ostree: Add naggy comments to help keep options in syncMatthew Barnes2017-08-151-0/+5
| | | | | | | | | | /* ATTENTION: * Please remember to update the bash-completion script (bash/ostree) and * man page (man/ostree-$COMMANDNAME.xml) when changing the option list. */ Closes: #1080 Approved by: cgwalters
* tree-wide: Use g_autoptr(Ostree*)Colin Walters2017-08-031-1/+1
| | | | | | | | | | | Part of cleaning up our usage of libglnx; we want to use what's in GLib where we can. Had to change a few .c files to `#include ostree.h` early on to pick up autoptrs for the core types. Closes: #1040 Approved by: jlebon
* tree-wide: Switch to autoptr for GOptionContextColin Walters2016-12-081-3/+1
| | | | | | | | | | We were leaking in a few places that I noticed in an ASAN run. Also, this was one of the last non-autoptr cleanup sections we have in `out:` cleanup sections, making us a lot closer to a potential full-tree rewrite to `return FALSE`. Closes: #624 Approved by: jlebon
* lib: Add ostree_sysroot_init_osname() API, bump mtimeColin Walters2016-03-031-42/+2
| | | | | | | | | | And change the command line to use it. rpm-ostree had a copy of this code, and thus there's a clear reason to have an API. While we're moving this into API, ensure the mtime on deploy is bumped after an osname is created, so that daemons like rpm-ostree can notice changes. (In reality, creating the directory should do this, but let's be double sure)
* admin: Use locking for most sysroot commandsColin Walters2015-05-131-1/+1
| | | | | | | | | | The previous commit introduced locking for `ostree admin deploy`, but we do expect people to possibly accidentally do e.g. `ostree admin upgrade` concurrently. Using consistent locking in the admin commands will help rpm-ostree. Closes: https://github.com/GNOME/ostree/pull/110
* Remove unnecessary #include "libgsystem.h"Matthew Barnes2015-05-061-1/+0
|
* Use glnx_unref_object instead of gs_unref_objectMatthew Barnes2015-05-061-1/+1
| | | | | For non-GIO object types, at least until autocleanup support for GObject based types becomes more widespread.
* Use g_autoptr() for GIO object typesMatthew Barnes2015-05-061-2/+2
| | | | | GLib 2.44 supplies all the necessary autocleanup macros for GIO types, and libglnx backports the relevant macros for ostree.
* Add OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSERMatthew Barnes2015-03-251-1/+1
| | | | | | | Indicates the command requires superuser privilege. Fails early with a more helpful message than would otherwise be returned by libostree. Currently all admin commands except 'status' require superuser.
* Add OstreeAdminBuiltinFlags for admin commandsMatthew Barnes2015-03-251-1/+3
| | | | Only OSTREE_ADMIN_BUILTIN_FLAG_NONE so far; does nothing.
* Port to libgsystem errno API, hard depend on 2014.3Colin Walters2015-01-041-3/+3
| | | | This is long overdue to make it to libgsystem. Update our dependency.
* Refactor command-line parsingMatthew Barnes2014-11-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Here's a sample: $ ostree admin --help Usage: ostree admin [OPTION...] --print-current-dir|COMMAND Builtin "admin" Commands: cleanup config-diff deploy init-fs instutil os-init status switch undeploy upgrade Help Options: -h, --help Show help options Application Options: --sysroot=PATH Create a new OSTree sysroot at PATH -v, --verbose Print debug information during command processing --version Print version information and exit https://bugzilla.gnome.org/show_bug.cgi?id=740295
* os-init: don't create /var/log/journal on deployCosimo Cecchi2014-04-251-7/+1
| | | | | | | Leave the policy of whether to persistently store journal logs to the system integrator when the default journald configuration is in use. https://bugzilla.gnome.org/show_bug.cgi?id=728762
* os-init: also create a symlink for /var/lockCosimo Cecchi2014-02-121-0/+10
| | | | | After creating one for /var/run. This is needed at least on Debian systems.
* libostree: Move sysroot initialization API hereColin Walters2013-09-151-1/+1
|
* libostree: Add new OstreeSysroot classColin Walters2013-09-151-3/+3
| | | | | At the moment, just a container for a path, but we will start moving admin functionality here.
* admin: Clean up builtin prototypeColin Walters2013-07-291-4/+3
| | | | | Pass through GCancellable, and just use GFile *sysroot, since that's all OtAdminBuiltinOpts was.
* Install a shared libraryColin Walters2013-07-261-0/+1
| | | | | This required a fair bit of surgery because previously ostree.h included otutil.h, but that's supposed to be a private library.
* Switch to libgsystem local allocation macrosColin Walters2013-07-071-2/+2
| | | | And drop our compatibility wrapper.
* [INCOMPATIBLE CHANGE] Implement new deployment modelColin Walters2013-07-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | See https://wiki.gnome.org/OSTree/DeploymentModel2 This is a major rework of the on-disk filesystem layout, and the boot process. OSTree now explicitly supports upgrading kernels, and these upgrades are also atomic. The core concept of the new model is the "deployment list", which is an ordered list of bootable operating system trees. The deployment list is reflected in the bootloader configuration; which has a kernel argument that tells the initramfs (dracut) which operating system root to use. Invidiual notable changes that come along with this: 1) Operating systems should now come with their etc in usr/etc; OSTree will perform a 3-way merge at deployment time, and place etc in the actual root. This avoids the need for a bind mount, and is just a lot cleaner. 2) OSTree no longer bind mounts /root, /home, and /tmp. It is expected that the the OS/ has these as symbolic links into /var. At the moment, OSTree only supports managing syslinux; other bootloader backends will follow.
* admin: Ensure /var/log/journal existsColin Walters2013-01-171-2/+3
| | | | | | | 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.
* admin: Allow specifying --boot-dirColin Walters2013-01-021-1/+2
| | | | | This is intended for use by QA tools that want to manipulate a loopback-mounted disk image or the like.
* admin: Rework /ostree/deploy to support multiple independent operating systemsColin Walters2012-12-211-0/+105
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.