Skip to content

Commit 19a8e5d

Browse files
committed
HACK: common: bootdef: set appendroot flag for all bootdef boots
I now think it would be better to have an explicit linux-appendroot in the bootloader spec entry file. I submitted a proposal here: uapi-group/specifications#136 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
1 parent 24788c3 commit 19a8e5d

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

common/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ config BOOT_DEFAULTS
12111211
bool "default boot targets"
12121212
select BOOT
12131213
select CDEV_ALIAS
1214+
select BOOT_OVERRIDE
12141215
default BLSPEC && OFDEVICE
12151216
help
12161217
Say y here to enable a number of default boot targets that

common/bootdef.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,23 @@
1313

1414
static int bootdev_process(struct cdev *cdev, void *entries)
1515
{
16-
return bootentry_create_from_name(entries, cdev->name);
16+
struct bootentries *bootdef_entries;
17+
struct bootentry *entry;
18+
int ret;
19+
20+
bootdef_entries = bootentries_alloc_list();
21+
22+
ret = bootentry_create_from_name(bootdef_entries, cdev->name);
23+
24+
bootentries_for_each_entry(bootdef_entries, entry)
25+
entry->overrides.appendroot = BOOTM_OVERRIDE_TRUE;
26+
27+
/* Now that we have iterated over the bootdef entries only,
28+
* merge it into the sum of all bootentries
29+
*/
30+
bootentries_merge(entries, bootdef_entries);
31+
32+
return ret;
1733
}
1834

1935
static int bootdef_add_entry(struct bootentries *entries, const char *name)

0 commit comments

Comments
 (0)