deploy: Change BootLoaderSpec filenames so they can be used for sorting
Currently the BLS snippets are named ostree-$ID-$VARIANT_ID-$index.conf, but the BLS config files are actually sorted by using the version field which is the inverse of the index. In most places, _ostree_sysroot_read_boot_loader_configs() is used to get the BLS files and this function already returns them sorted by the version field. The only place where the index trailing number is used is in the ostree-grub-generator script that lists the BLS files to populate the grub config file. But for some bootloaders the BLS filename is the criteria for sorting by taking the filename as a string version. So on these bootloaders the BLS entries will be listed in the reverse order. To avoid that, change the BLS snippets filename to have the version field instead of the index and also to have the version before deployment name. Make the filenames to be of the form ostree-$version-$ID-$VARIANT_ID.conf so the version is before the deployment name. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Closes: #1654 Approved by: cgwalters
This commit is contained in:
1 parent
47ae4f5c7e
commit
9f48e212a3
10 files changed
+63
-62
No files matched your search
@@ -66,7 +66,7 @@ populate_menu()
|
||||
else
|
||||
boot_prefix="${OSTREE_BOOT_PARTITION}"
|
||||
fi
|
||||
for config in $(ls -v $entries_path/*.conf); do
|
||||
for config in $(ls -v -r $entries_path/*.conf); do
|
||||
read_config ${config}
|
||||
menu="${menu}menuentry '${title}' {\n"
|
||||
menu="${menu}\t linux ${boot_prefix}${linux} ${options}\n"
|
||||
|
||||
@@ -1628,8 +1628,9 @@ install_deployment_kernel (OstreeSysroot *sysroot,
|
||||
g_assert_cmpstr (kernel_layout->bootcsum, ==, bootcsum);
|
||||
g_autofree char *bootcsumdir = g_strdup_printf ("ostree/%s-%s", osname, bootcsum);
|
||||
g_autofree char *bootconfdir = g_strdup_printf ("loader.%d/entries", new_bootversion);
|
||||
g_autofree char *bootconf_name = g_strdup_printf ("ostree-%s-%d.conf", osname,
|
||||
ostree_deployment_get_index (deployment));
|
||||
g_autofree char *bootconf_name = g_strdup_printf ("ostree-%d-%s.conf",
|
||||
n_deployments - ostree_deployment_get_index (deployment),
|
||||
osname);
|
||||
if (!glnx_shutil_mkdir_p_at (boot_dfd, bootcsumdir, 0775, cancellable, error))
|
||||
return FALSE;
|
||||
|
||||
|
||||
Reference in new issue
Block a user