summaryrefslogtreecommitdiff
path: root/src/libostree
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2013-07-07 14:37:59 -0400
committerColin Walters <walters@verbum.org>2013-07-07 14:37:59 -0400
commit26cef497a6bda37f8fdbe98238985f5b99e0a80a (patch)
tree511e1083111d877be45ec4eace89a2e9b5756fda /src/libostree
parentf6bca20551c994025e33972e29100ac0944cb82c (diff)
downloadostree-26cef497a6bda37f8fdbe98238985f5b99e0a80a.tar.gz
Remove built in "triggers"
Originally, the idea was that clients would replicate "OS/tree"s from a build server, but we'd run things like "ldconfig" on the client. This was to allow adding e.g. the nVidia binary driver. However, the triggers were the only thing in the system at the moment that really had expected knowledge of the *contents* of the OS, like the location of binaries. For now, it's architecturally cleaner if we move the burden of triggers to the tree builder (e.g. gnome-ostree or RPM). Eventually we may want OSTree to assist with this type of thing (perhaps something like RPM %ghost), but this is the right thing to do now.
Diffstat (limited to 'src/libostree')
-rw-r--r--src/libostree/ostree-sysroot.c105
-rw-r--r--src/libostree/ostree-sysroot.h39
-rw-r--r--src/libostree/ostree.h1
3 files changed, 0 insertions, 145 deletions
diff --git a/src/libostree/ostree-sysroot.c b/src/libostree/ostree-sysroot.c
deleted file mode 100644
index 2517c551..00000000
--- a/src/libostree/ostree-sysroot.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2012 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include <sys/wait.h>
-
-#include "ostree.h"
-#include "otutil.h"
-
-static const char * const sysroot_environ[] = {
- "HOME=/",
- "PWD=/",
- "HOSTNAME=ostreesysroot",
- "LANG=C",
- "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
- "SHELL=/bin/bash",
- "TERM=vt100",
- "TMPDIR=/tmp",
- "TZ=EST5EDT",
- NULL
-};
-
-const char *const*
-ostree_get_sysroot_environ (void)
-{
- return (const char *const*)sysroot_environ;
-}
-
-/**
- * @root: (allow-none): Change to this root; if %NULL, don't chroot
- *
- * Triggers are a set of programs to run on a root to regenerate cache
- * files. This API call will simply run them against the given root.
- */
-gboolean
-ostree_run_triggers_in_root (GFile *root,
- GCancellable *cancellable,
- GError **error)
-{
- gboolean ret = FALSE;
- int estatus;
- gs_free char *rel_triggerdir = NULL;
- gs_unref_object GFile *triggerdir = NULL;
- gs_unref_ptrarray GPtrArray *argv = NULL;
-
- rel_triggerdir = g_build_filename ("usr", "libexec", "ostree", "triggers.d", NULL);
-
- if (root)
- triggerdir = g_file_resolve_relative_path (root, rel_triggerdir);
- else
- triggerdir = g_file_new_for_path (rel_triggerdir);
-
- if (g_file_query_exists (triggerdir, cancellable))
- {
- argv = g_ptr_array_new ();
- if (root)
- {
- g_ptr_array_add (argv, "linux-user-chroot");
- g_ptr_array_add (argv, "--unshare-pid");
- g_ptr_array_add (argv, "--unshare-ipc");
- /* FIXME - unshare net too */
- g_ptr_array_add (argv, "--mount-proc");
- g_ptr_array_add (argv, "/proc");
- g_ptr_array_add (argv, "--mount-bind");
- g_ptr_array_add (argv, "/dev");
- g_ptr_array_add (argv, "/dev");
- g_ptr_array_add (argv, (char*)gs_file_get_path_cached (root));
- }
- g_ptr_array_add (argv, "ostree-run-triggers");
- g_ptr_array_add (argv, NULL);
-
- if (!g_spawn_sync (NULL, (char**)argv->pdata,
- (char**) ostree_get_sysroot_environ (),
- G_SPAWN_SEARCH_PATH,
- NULL, NULL, NULL, NULL, &estatus, error))
- goto out;
-
- if (!g_spawn_check_exit_status (estatus, error))
- goto out;
- }
-
- ret = TRUE;
- out:
- return ret;
-}
diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h
deleted file mode 100644
index b10246df..00000000
--- a/src/libostree/ostree-sysroot.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2011 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#ifndef _OSTREE_SYSROOT
-#define _OSTREE_SYSROOT
-
-#include "ostree-core.h"
-#include "ostree-types.h"
-
-G_BEGIN_DECLS
-
-const char *const* ostree_get_sysroot_environ (void);
-
-gboolean ostree_run_triggers_in_root (GFile *root,
- GCancellable *cancellable,
- GError **error);
-
-G_END_DECLS
-
-#endif
diff --git a/src/libostree/ostree.h b/src/libostree/ostree.h
index b5b50f3c..3734af66 100644
--- a/src/libostree/ostree.h
+++ b/src/libostree/ostree.h
@@ -29,7 +29,6 @@
#include <ostree-mutable-tree.h>
#include <ostree-repo-file.h>
#include <ostree-traverse.h>
-#include <ostree-sysroot.h>
#include <ostree-diff.h>
#endif