summaryrefslogtreecommitdiffstats
path: root/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch')
-rw-r--r--recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch92
1 files changed, 0 insertions, 92 deletions
diff --git a/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch b/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch
deleted file mode 100644
index 0905cc1..0000000
--- a/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From bbb7a8ce89e3e13672c63fd4f1f19988fdf40014 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
3Date: Thu, 5 Nov 2015 17:37:54 +0100
4Subject: [PATCH 1/2] Allow updating files on the boot partition
5
6Until now OSTree copied only vmlinuz and initramfs
7binaries to the boot partition. This patch adds support
8for copying other files from the /boot directory of the
9tree.
10
11How this works:
12
13Ignore subdirectories, only files in root of the boot
14directory are copied. There is overhead of copying files
15to boot partition, therefore the amount of files in the
16boot/ should be kept to the minimum and subdirectories
17shouldn't really be necessary.
18
19Files on the boot partition are updated only with major
20releases, when kernel/initramfs bootcsum changes. Files
21that require frequent updates should not be stored here.
22---
23 src/libostree/ostree-sysroot-deploy.c | 53 +++++++++++++++++++++++++++++++++++
24 1 file changed, 53 insertions(+)
25
26diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
27index f7afe3d..4d6534d 100644
28--- a/src/libostree/ostree-sysroot-deploy.c
29+++ b/src/libostree/ostree-sysroot-deploy.c
30@@ -1340,6 +1340,59 @@ install_deployment_kernel (OstreeSysroot *sysroot,
31 }
32 }
33
34+ {
35+ /* Copy other files that are stored in the boot directory. Lets keep this simple:
36+ *
37+ * - Ignore subdirectories, only files in root of the boot directory are copied. There is
38+ * overhead of copying files to boot partition, therefore the amount of files in the boot/
39+ * should be kept to the minimum and subdirectories shouldn't really be necessary.
40+ * - Files on the boot partition are updated only with major releases, when kernel/initramfs
41+ * bootcsum changes. Files that require frequent updates should not be stored here.
42+ */
43+ g_autoptr(GFileEnumerator) dir_enum = NULL;
44+ g_autoptr(GFile) deployments_bootdir = g_file_get_child (deployment_dir, "boot");
45+ dir_enum = g_file_enumerate_children (deployments_bootdir, OSTREE_GIO_FAST_QUERYINFO,
46+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
47+ NULL, error);
48+ while (TRUE)
49+ {
50+ GFileInfo *file_info = NULL;
51+ g_autoptr(GFile) source_file = NULL;
52+ g_autoptr(GFile) dest_file = NULL;
53+ g_autoptr(GFile) symlink_target = NULL;
54+ GFileType type;
55+ const char *name;
56+
57+ if (!gs_file_enumerator_iterate (dir_enum, &file_info, NULL, cancellable, error))
58+ goto out;
59+ if (file_info == NULL)
60+ break;
61+
62+ type = g_file_info_get_file_type (file_info);
63+ name = g_file_info_get_name (file_info);
64+ if (type == G_FILE_TYPE_DIRECTORY)
65+ continue;
66+ if (type == G_FILE_TYPE_SYMBOLIC_LINK)
67+ {
68+ symlink_target = g_file_get_child (bootcsumdir, g_file_info_get_symlink_target(file_info));
69+ if (!g_file_query_exists (symlink_target, NULL))
70+ continue;
71+ }
72+ if (g_str_has_prefix (name, "vmlinuz-") || g_str_has_prefix (name, "initramfs-"))
73+ continue;
74+
75+ dest_file = g_file_get_child (bootcsumdir, name);
76+ if (!g_file_query_exists (dest_file, NULL))
77+ {
78+ source_file = g_file_enumerator_get_child (dir_enum, file_info);
79+ if (!gs_file_linkcopy_sync_data (source_file, dest_file,
80+ G_FILE_COPY_OVERWRITE | G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_ALL_METADATA,
81+ cancellable, error))
82+ goto out;
83+ }
84+ }
85+ }
86+
87 if (fstatat (deployment_dfd, "usr/lib/os-release", &stbuf, 0) != 0)
88 {
89 if (errno != ENOENT)
90--
912.1.4
92