Compare commits

...

2 Commits

Author SHA1 Message Date
Chen Qi
ec69f0c5a2
Merge a76d28f07f into 64a38aec8c 2024-12-18 10:55:45 -05:00
Hongxu Jia
a76d28f07f u-boot: add 'bootdir' to the generated uEnv.txt
When doing a full copy of:

$deployment/usr/lib/ostree-boot -> /boot/ostree/$os-$bootcsum/

U-Boot bootscript can use the 'bootdir' to find, for example,
the Device Tree (dtb) file, as in:

load ${dtype} ${disk}:${bootpart} ${a_fdt} ${bootdir}${dtbname}

Or u-boot external bootscript:

load ${dtype} ${disk}:${bootpart} ${a_scr} ${bootdir}${scriptname}

It could also be possible to point 'bootdir' directly to the
$deployment/usr/lib/ostree-boot, but this would add unnecessary
restrictions on what file system can be used for rootfs as u-boot,
for example, can not read from BTRFS. So having
bootdir=/boot/ostree/$os-$bootcsum/ is a better approach here, as
/boot can be on a separate partition with its own file system type.

Signed-off-by: Gatis Paeglis <gatis.paeglis@qt.io>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
2024-06-25 20:13:39 -07:00

View File

@ -114,6 +114,7 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, int bootver
for (int i = 0; i < boot_loader_configs->len; i++)
{
g_autofree char *index_suffix = NULL;
g_autofree char *bootdir = NULL;
if (i == 0)
index_suffix = g_strdup ("");
else
@ -129,6 +130,9 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, int bootver
}
g_ptr_array_add (new_lines, g_strdup_printf ("kernel_image%s=/boot%s", index_suffix, val));
bootdir = strndup (val, strrchr(val, '/') - val);
g_ptr_array_add (new_lines, g_strdup_printf ("bootdir%s=%s/", index_suffix, bootdir));
val = ostree_bootconfig_parser_get (config, "initrd");
if (val)
g_ptr_array_add (new_lines, g_strdup_printf ("ramdisk_image%s=/boot%s", index_suffix, val));