Skip to content

Commit

Permalink
Update ostree and rpm-ostree versions (#1741)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalamalasetty authored and jslobodzian committed Dec 8, 2021
1 parent 16b2a76 commit 92b8ff5
Show file tree
Hide file tree
Showing 12 changed files with 258 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,20 @@ Signed-off-by: Ankit Jain <[email protected]>
---
src/libostree/ostree-sysroot-deploy.c | 70 +++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
mode change 100644 => 100755 src/libostree/ostree-sysroot-deploy.c

diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
old mode 100644
new mode 100755
index 3ca6c14..0744d7e
--- a/src/libostree/ostree-sysroot-deploy.c
diff --git a/src/libostree/ostree-sysroot-deploy.c.newold b/src/libostree/ostree-sysroot-deploy.c
index 6a13a41..976c4b5 100644
--- a/src/libostree/ostree-sysroot-deploy.c.newold
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -876,12 +876,17 @@ ostree_sysroot_write_origin_file (OstreeSysroot *sysroot,
@@ -987,6 +987,7 @@ ostree_sysroot_write_origin_file (OstreeSysroot *sysroot,

typedef struct {
int boot_dfd;
+ int ostree_boot_dfd;
char *kernel_srcpath;
char *kernel_namever;
char *initramfs_srcpath;
char *kernel_hmac_srcpath;
@@ -995,6 +996,10 @@ typedef struct {
char *initramfs_namever;
char *devicetree_srcpath;
char *devicetree_namever;
Expand All @@ -37,7 +35,7 @@ index 3ca6c14..0744d7e
char *bootcsum;
} OstreeKernelLayout;
static void
@@ -894,6 +899,10 @@ _ostree_kernel_layout_free (OstreeKernelLayout *layout)
@@ -1009,6 +1014,10 @@ _ostree_kernel_layout_free (OstreeKernelLayout *layout)
g_free (layout->initramfs_namever);
g_free (layout->devicetree_srcpath);
g_free (layout->devicetree_namever);
Expand All @@ -48,13 +46,13 @@ index 3ca6c14..0744d7e
g_free (layout->bootcsum);
g_free (layout);
}
@@ -1031,6 +1040,25 @@ get_kernel_from_tree_usrlib_modules (int deployment_dfd,
@@ -1182,6 +1191,26 @@ get_kernel_from_tree_usrlib_modules (OstreeSysroot *sysroot,
ret_layout->kernel_hmac_namever = g_strdup_printf (".%s.hmac", ret_layout->kernel_namever);
}

g_clear_object (&in);
glnx_close_fd (&fd);
+/* Setting the param for Copying Photon Specific config files to sutiable location */
+ if (!glnx_opendirat (deployment_dfd, "usr/lib/ostree-boot", FALSE, &ret_layout->ostree_boot_dfd, error))
+ return FALSE;
+ return FALSE;
+ if (!ot_openat_ignore_enoent (ret_layout->ostree_boot_dfd, "photon.cfg", &fd, error))
+ return FALSE;
+ if (fd != -1)
Expand All @@ -71,24 +69,24 @@ index 3ca6c14..0744d7e
+ ret_layout->systemdcfg_namever = g_strdup ("systemd.cfg");
+ }
+ glnx_close_fd (&fd);
+
char hexdigest[OSTREE_SHA256_STRING_LEN+1];
ot_checksum_get_hexdigest (&checksum, hexdigest, sizeof (hexdigest));
@@ -1686,6 +1714,35 @@ install_deployment_kernel (OstreeSysroot *sysroot,
}
ret_layout->bootcsum = g_strdup (hexdigest);
@@ -1897,6 +1926,34 @@ install_deployment_kernel (OstreeSysroot *sysroot,
g_ptr_array_add (overlay_initrds, g_steal_pointer (&destpath));
}

+/* Copying Photon Specific config files to sutiable location */
+ /* Copying Photon Specific config files to sutiable location */
+ if (kernel_layout->kernelcfg_srcpath)
+ {
+ if (!glnx_fstatat_allow_noent (bootcsum_dfd, kernel_layout->kernelcfg_namever, &stbuf, 0, error))
+ return FALSE;
+ if (errno == ENOENT)
+ {
+ if (!install_into_boot (sepolicy, kernel_layout->ostree_boot_dfd, kernel_layout->kernelcfg_srcpath,
+ bootcsum_dfd, kernel_layout->kernelcfg_namever,
+ sysroot->debug_flags,
+ cancellable, error))
+ if (!install_into_boot (repo, sepolicy, kernel_layout->ostree_boot_dfd, kernel_layout->kernelcfg_srcpath,
+ bootcsum_dfd, kernel_layout->kernelcfg_namever,
+ cancellable, error))
+ return FALSE;
+ }
+ }
Expand All @@ -99,37 +97,33 @@ index 3ca6c14..0744d7e
+ return FALSE;
+ if (errno == ENOENT)
+ {
+ if (!install_into_boot (sepolicy, kernel_layout->ostree_boot_dfd, kernel_layout->systemdcfg_srcpath,
+ bootcsum_dfd, kernel_layout->systemdcfg_namever,
+ sysroot->debug_flags,
+ cancellable, error))
+ return FALSE;
+ if (!install_into_boot (repo, sepolicy, kernel_layout->ostree_boot_dfd, kernel_layout->systemdcfg_srcpath,
+ bootcsum_dfd, kernel_layout->systemdcfg_namever,
+ cancellable, error))
+ return FALSE;
+ }
+ }
+
+
g_autofree char *contents = NULL;
if (!glnx_fstatat_allow_noent (deployment_dfd, "usr/lib/os-release", &stbuf, 0, error))
return FALSE;
@@ -1775,6 +1832,19 @@ install_deployment_kernel (OstreeSysroot *sysroot,
_ostree_kernel_args_replace_take (kargs, g_steal_pointer (&prepare_root_arg));
@@ -1992,6 +2049,18 @@ install_deployment_kernel (OstreeSysroot *sysroot,
ostree_kernel_args_replace_take (kargs, g_steal_pointer (&prepare_root_arg));
}

+ if (kernel_layout->systemdcfg_namever)
+ {
+ g_autofree char * boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->systemdcfg_namever, NULL);
+ ostree_bootconfig_parser_set (bootconfig, "systemdcfg", boot_relpath);
+ g_autofree char * systemdcfg_boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->systemdcfg_namever, NULL);
+ ostree_bootconfig_parser_set (bootconfig, "systemdcfg", systemdcfg_boot_relpath);
+ }
+
+ if (kernel_layout->kernelcfg_namever)
+ {
+ g_autofree char * boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->kernelcfg_namever, NULL);
+ ostree_bootconfig_parser_set (bootconfig, "kernelcfg", boot_relpath);
+ g_autofree char * kernelcfg_boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->kernelcfg_namever, NULL);
+ ostree_bootconfig_parser_set (bootconfig, "kernelcfg", kernelcfg_boot_relpath);
+ }
+
+
if (kernel_layout->devicetree_namever)
{
g_autofree char * boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->devicetree_namever, NULL);
--
2.7.4

g_autofree char * dt_boot_relpath = g_strconcat ("/", bootcsumdir, "/", kernel_layout->devicetree_namever, NULL);
11 changes: 4 additions & 7 deletions SPECS/ostree/0002-ostree-Adding-load-env-to-menuentry.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ to add kernel and systemd commandline parameter
Signed-off-by: Ajay Kaher <[email protected]>
Signed-off-by: Ankit Jain <[email protected]>
---
src/libostree/ostree-bootloader-grub2.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
src/libostree/ostree-bootloader-grub2.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
index ee3ae6f..ad74509 100644
index 22037f1..53fbfa6 100644
--- a/src/libostree/ostree-bootloader-grub2.c
+++ b/src/libostree/ostree-bootloader-grub2.c
@@ -193,6 +193,8 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
Expand All @@ -25,14 +25,11 @@ index ee3ae6f..ad74509 100644
char *quoted_title = NULL;
char *uuid = NULL;
char *quoted_uuid = NULL;
@@ -217,6 +219,25 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
@@ -217,6 +219,22 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
g_string_append (output, grub2_prepare_root_cache);
g_string_append_c (output, '\n');

+
+
+ kernelcfg = ostree_bootconfig_parser_get (config, "kernelcfg");
+
+ if(kernelcfg)
+ {
+ g_string_append (output, "load_env -f ");
Expand Down
22 changes: 11 additions & 11 deletions SPECS/ostree/0003-ostree-converting-osname-to-mariner.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c
index 0744d7e..634101e 100755
--- a/src/libostree/ostree-sysroot-deploy.c
diff --git a/src/libostree/ostree-sysroot-deploy.c.old2 b/src/libostree/ostree-sysroot-deploy.c
index 976c4b5..263e2f5 100644
--- a/src/libostree/ostree-sysroot-deploy.c.old2
+++ b/src/libostree/ostree-sysroot-deploy.c
@@ -1040,15 +1040,15 @@ get_kernel_from_tree_usrlib_modules (int deployment_dfd,
@@ -1191,15 +1191,15 @@ get_kernel_from_tree_usrlib_modules (OstreeSysroot *sysroot,
ret_layout->kernel_hmac_namever = g_strdup_printf (".%s.hmac", ret_layout->kernel_namever);
}

g_clear_object (&in);
glnx_close_fd (&fd);
-/* Setting the param for Copying Photon Specific config files to sutiable location */
+/* Setting the param for Copying Mariner Specific config files to sutiable location */
if (!glnx_opendirat (deployment_dfd, "usr/lib/ostree-boot", FALSE, &ret_layout->ostree_boot_dfd, error))
return FALSE;
return FALSE;
- if (!ot_openat_ignore_enoent (ret_layout->ostree_boot_dfd, "photon.cfg", &fd, error))
+ if (!ot_openat_ignore_enoent (ret_layout->ostree_boot_dfd, "mariner.cfg", &fd, error))
return FALSE;
Expand All @@ -21,12 +21,12 @@ index 0744d7e..634101e 100755
}
glnx_close_fd (&fd);
if (!ot_openat_ignore_enoent (ret_layout->ostree_boot_dfd, "systemd.cfg", &fd, error))
@@ -1714,7 +1714,7 @@ install_deployment_kernel (OstreeSysroot *sysroot,
}
@@ -1926,7 +1926,7 @@ install_deployment_kernel (OstreeSysroot *sysroot,
g_ptr_array_add (overlay_initrds, g_steal_pointer (&destpath));
}

-/* Copying Photon Specific config files to sutiable location */
+/* Copying Mariner Specific config files to sutiable location */
- /* Copying Photon Specific config files to sutiable location */
+ /* Copying Mariner Specific config files to sutiable location */
if (kernel_layout->kernelcfg_srcpath)
{
if (!glnx_fstatat_allow_noent (bootcsum_dfd, kernel_layout->kernelcfg_namever, &stbuf, 0, error))
7 changes: 4 additions & 3 deletions SPECS/ostree/dualboot-support.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
index ceea682..ee3ae6f 100644
index 0ef751d..22037f1 100644
--- a/src/libostree/ostree-bootloader-grub2.c
+++ b/src/libostree/ostree-bootloader-grub2.c
@@ -174,6 +174,7 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
Expand All @@ -10,7 +10,7 @@ index ceea682..ee3ae6f 100644

g_autoptr(GOutputStream) out_stream = g_unix_output_stream_new (target_fd, FALSE);

@@ -219,10 +220,12 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
@@ -220,10 +220,12 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
if (!kernel)
return glnx_throw (error, "No \"linux\" key in bootloader config");
g_string_append (output, "linux");
Expand All @@ -25,7 +25,7 @@ index ceea682..ee3ae6f 100644
g_string_append_c (output, ' ');
g_string_append (output, kernel);

@@ -238,10 +241,12 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
@@ -239,10 +241,12 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot *sysroot
if (initrd)
{
g_string_append (output, "initrd");
Expand All @@ -40,3 +40,4 @@ index ceea682..ee3ae6f 100644
g_string_append_c (output, ' ');
g_string_append (output, initrd);
g_string_append_c (output, '\n');

2 changes: 1 addition & 1 deletion SPECS/ostree/ostree.signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Signatures": {
"91-ostree.preset": "24cdb413163cec872dda583cc55eb070ee1472e6fb1fbf1a4a5e8aeafbeb8b8c",
"ostree-2019.2-withsubmodules.tar.gz": "62bb190feefa4256a1e9cecea7e1da6d63a2bd60a40a54270984541dbb91d5e6"
"libostree-2021.4.tar.xz": "db5ce01a1606af3466ec77236700f53a63ce20e4984a549d0eaba3f66a3d9361"
}
}
Loading

0 comments on commit 92b8ff5

Please sign in to comment.