[PATCH 14/17] blspec: Apply overlays from rootfs

Sascha Hauer s.hauer at pengutronix.de
Tue Jun 22 22:16:29 PDT 2021


This sets the overlay search path to $BOOT/overlays during starting
an bootloader spec entry with the effect that overlays from there
can be applied.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/blspec.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/common/blspec.c b/common/blspec.c
index ca96a45487..07ad309814 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -75,8 +75,8 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
 	const char *abspath, *devicetree, *options, *initrd, *linuximage;
 	const char *overlays;
 	const char *appendroot;
-	const char *old_fws;
-	char *fws;
+	const char *old_fws, *old_ovld;
+	char *fws, *ovld;
 	struct bootm_data data = {
 		.dryrun = dryrun,
 	};
@@ -139,6 +139,11 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
 			(entry->cdev && entry->cdev->dev) ?
 			dev_name(entry->cdev->dev) : "none");
 
+	old_ovld = of_overlay_get_dir();
+	ovld = basprintf("%s/overlays", abspath);
+	of_overlay_set_dir(ovld);
+	free(ovld);
+
 	old_fws = firmware_get_searchpath();
 	if (old_fws && *old_fws)
 		fws = basprintf("%s/lib/firmware:%s", abspath, old_fws);
@@ -154,6 +159,7 @@ static int blspec_boot(struct bootentry *be, int verbose, int dryrun)
 	if (overlays)
 		of_unregister_fixup(blspec_overlay_fixup, entry);
 
+	of_overlay_set_dir(old_ovld);
 	firmware_set_searchpath(old_fws);
 
 err_out:
-- 
2.29.2




More information about the barebox mailing list