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

Sascha Hauer s.hauer at pengutronix.de
Wed Mar 10 13:28:26 GMT 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 fd3e088920..ded149d715 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();
 	fws = basprintf("%s/lib/firmware:%s", abspath, old_fws);
 	firmware_set_searchpath(fws);
@@ -151,6 +156,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