summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-08-31 18:11:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-10-04 13:26:58 +0200
commite7b29cdec9baca875437a75dee75e62d3190de25 (patch)
treeb082957dbe4d2fb27223a4291e950f5846ec7d00 /drivers
parentb15b929b4964a1967a60020cb398713b378cc9f9 (diff)
downloadbarebox-e7b29cdec9baca875437a75dee75e62d3190de25.tar.gz
barebox-e7b29cdec9baca875437a75dee75e62d3190de25.tar.xz
of: overlay: don't do fixups on empty global.of.overlay.dir
$global.of.overlay.dir is dynamically prepended with the root of the device currently being booted. This allows use of relative paths. Because $global.of.overlay.filepattern is * by default, this means that all files in the root of the device will be considered overlays and barebox will try to unflatten them leading to an error message on boot: ERROR: of_overlay: Failed to unflatten /mnt/mmc0.4//.root_is_rw: Invalid argument Fix this by not doing any fixups at all on empty global.of.overlay.dir. If for whatever reason, a user wants overlays at /, they can global.of.overlay.dir=. Fixes: 124c64af0982 ("overlay: Add filters to choose which overlays to apply") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210831161139.2988-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/overlay.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 42b309805f..25140eed31 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -460,6 +460,9 @@ static int of_overlay_global_fixup(struct device_node *root, void *data)
if (*of_overlay_dir == '/')
return of_overlay_apply_dir(root, of_overlay_dir, true);
+ if (*of_overlay_dir == '\0')
+ return 0;
+
dir = concat_path_file(of_overlay_basedir, of_overlay_dir);
ret = of_overlay_apply_dir(root, dir, true);