--- /dev/null
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2015 Colin Walters <walters@verbum.org>
+ *
+ * This program 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 licence 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.
+ */
+
+#pragma once
+
+#include "ostree-deployment.h"
+
+G_BEGIN_DECLS
+
+void _ostree_deployment_set_bootcsum (OstreeDeployment *self, const char *bootcsum);
+
+G_END_DECLS
#include "config.h"
-#include "ostree-deployment.h"
+#include "ostree-deployment-private.h"
#include "libglnx.h"
struct _OstreeDeployment
self->origin = g_key_file_ref (origin);
}
+void
+_ostree_deployment_set_bootcsum (OstreeDeployment *self,
+ const char *bootcsum)
+{
+ g_free (self->bootcsum);
+ self->bootcsum = g_strdup (bootcsum);
+}
+
/**
* ostree_deployment_clone:
* @self: Deployment
#include <gio/gunixoutputstream.h>
#include "ostree-sysroot-private.h"
+#include "ostree-deployment-private.h"
#include "ostree-core-private.h"
#include "ostree-linuxfsutil.h"
#include "otutil.h"
glnx_unref_object OstreeRepo *repo = NULL;
g_autoptr(GFile) osdeploydir = NULL;
g_autoptr(GFile) deployment_var = NULL;
- g_autoptr(GFile) commit_root = NULL;
g_autoptr(GFile) tree_kernel_path = NULL;
g_autoptr(GFile) tree_initramfs_path = NULL;
glnx_fd_close int deployment_dfd = -1;
if (!ostree_sysroot_get_repo (self, &repo, cancellable, error))
goto out;
- if (!ostree_repo_read_commit (repo, revision, &commit_root, NULL, cancellable, error))
- goto out;
-
- if (!get_kernel_from_tree (commit_root, &tree_kernel_path, &tree_initramfs_path,
- cancellable, error))
- goto out;
-
- if (tree_initramfs_path != NULL)
- {
- if (!checksum_from_kernel_src (tree_initramfs_path, &new_bootcsum, error))
- goto out;
- }
- else
- {
- if (!checksum_from_kernel_src (tree_kernel_path, &new_bootcsum, error))
- goto out;
- }
-
if (provided_merge_deployment != NULL)
merge_deployment = g_object_ref (provided_merge_deployment);
goto out;
}
+ deployment_dir = ostree_sysroot_get_deployment_directory (self, new_deployment);
+
+ if (!get_kernel_from_tree (deployment_dir, &tree_kernel_path, &tree_initramfs_path,
+ cancellable, error))
+ goto out;
+
+ if (tree_initramfs_path != NULL)
+ {
+ if (!checksum_from_kernel_src (tree_initramfs_path, &new_bootcsum, error))
+ goto out;
+ }
+ else
+ {
+ if (!checksum_from_kernel_src (tree_kernel_path, &new_bootcsum, error))
+ goto out;
+ }
+
+ _ostree_deployment_set_bootcsum (new_deployment, new_bootcsum);
+
/* Create an empty boot configuration; we will merge things into
* it as we go.
*/