Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose: Add support for "default_target" #10

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/treefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Treefile

* `units`: Array of strings, optional: Systemd units to enable by default

* `default_target`: String, optional: Set the default systemd target

* `include`: string, optional: Path to another treefile which will be
used as an inheritance base. The semantics for inheritance are:
Non-array values in child values override parent values. Array
Expand Down
19 changes: 19 additions & 0 deletions src/rpmostree-compose-builtin-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,25 @@ rpmostree_compose_builtin_tree (int argc,
cancellable, NULL, NULL, error))
goto out;
}

{
const char *default_target = NULL;
gs_unref_object GFile *default_target_path =
g_file_resolve_relative_path (yumroot, "usr/etc/systemd/system/default.target");

if (!object_get_optional_string_member (treefile, "default_target",
&default_target, error))
goto out;

if (default_target != NULL)
{
(void) gs_file_unlink (default_target_path, NULL, NULL);

if (!g_file_make_symbolic_link (default_target_path, default_target,
cancellable, error))
goto out;
}
}

{
const char *gpgkey;
Expand Down