[ostree] core: Ensure kernel and initramfs are put into place with fdatasync()



commit c9a840c65991c9d3a79d1b8e9648b62430fc29ff
Author: Colin Walters <walters verbum org>
Date:   Fri Jan 4 19:32:26 2013 -0500

    core: Ensure kernel and initramfs are put into place with fdatasync()
    
    Via a new libgsystem API.

 src/libgsystem                              |    2 +-
 src/ostree/ot-admin-builtin-update-kernel.c |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/libgsystem b/src/libgsystem
index 6c736d9..ce441a7 160000
--- a/src/libgsystem
+++ b/src/libgsystem
@@ -1 +1 @@
-Subproject commit 6c736d9309d5ffbc60ed0a58e21f0f8ad609ba10
+Subproject commit ce441a7a7bd987265588674a11d62965e81bdf94
diff --git a/src/ostree/ot-admin-builtin-update-kernel.c b/src/ostree/ot-admin-builtin-update-kernel.c
index b43c74e..8e57709 100644
--- a/src/ostree/ot-admin-builtin-update-kernel.c
+++ b/src/ostree/ot-admin-builtin-update-kernel.c
@@ -157,9 +157,7 @@ setup_kernel (OtAdminUpdateKernel *self,
   prefix = g_strndup (kernel_name, release - kernel_name);
   self->kernel_path = ot_gfile_get_child_strconcat (self->boot_ostree_dir, prefix, "-", self->release, NULL);
 
-  if (!g_file_copy (src_kernel_path, self->kernel_path,
-                    G_FILE_COPY_OVERWRITE | G_FILE_COPY_ALL_METADATA | G_FILE_COPY_NOFOLLOW_SYMLINKS,
-                    cancellable, NULL, NULL, error))
+  if (!gs_file_linkcopy_sync_data (src_kernel_path, self->kernel_path, cancellable, error))
     goto out;
 
   g_print ("ostadmin: Deploying kernel %s\n", gs_file_get_path_cached (self->kernel_path));
@@ -258,7 +256,7 @@ update_initramfs (OtAdminUpdateKernel  *self,
           goto out;
         }
 
-      if (!g_file_copy (initramfs_tmp_file, initramfs_file, 0, cancellable, NULL, NULL, error))
+      if (!gs_file_linkcopy_sync_data (initramfs_tmp_file, initramfs_file, cancellable, error))
         goto out;
           
       g_print ("Created: %s\n", gs_file_get_path_cached (initramfs_file));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]