[PATCH 3/3] ARM: Rockchip: bbu: allow forcing barebox update handler despite size

Ahmad Fatoum a.fatoum at pengutronix.de
Sun Apr 14 22:28:15 PDT 2024


The update handler correctly refuses to write a bootloader when it would
interfere with partitioning.

Depending on use case, the user may want to override this check though,
so allow the barebox update force parameter to override it.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 arch/arm/mach-rockchip/bbu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rockchip/bbu.c b/arch/arm/mach-rockchip/bbu.c
index f9681aad1aa4..f15b32937c3e 100644
--- a/arch/arm/mach-rockchip/bbu.c
+++ b/arch/arm/mach-rockchip/bbu.c
@@ -63,9 +63,9 @@ static int rockchip_bbu_mmc_handler(struct bbu_handler *handler,
 	space = cdev_unallocated_space(cdev_by_name(cdevname));
 
 	if (space < IMG_OFFSET_0 + data->len) {
-		pr_err("Unallocated space on %s (%lld) is too small for one image\n",
-		       data->devicefile, space);
-		return -ENOSPC;
+		if (!bbu_force(data, "Unallocated space on %s (%lld) is too small for one image\n",
+			       data->devicefile, space))
+			return -ENOSPC;
 	}
 
 	fd = open(data->devicefile, O_WRONLY);
-- 
2.39.2




More information about the barebox mailing list