From 76641773be73141652c6be5c45f53c91efd144e4 Mon Sep 17 00:00:00 2001 From: Ran Hongyun Date: Thu, 23 Jul 2026 10:37:06 +0800 Subject: ubi-utils: add wear-leveling threshold parameter to ubiattach Add wl_threshold support end-to-end: expose the kernel's wear-leveling threshold via a new --wl-threshold / -w option in ubiattach, plumb it through libubi, and define it by replacing 4 bytes of padding in struct ubi_attach_req. Valid range is 2-65536; 0 means use the kernel default. Signed-off-by: Ran Hongyun Signed-off-by: David Oberhollenzer --- lib/libubi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/libubi.c') diff --git a/lib/libubi.c b/lib/libubi.c index 86736dd..5d55148 100644 --- a/lib/libubi.c +++ b/lib/libubi.c @@ -769,6 +769,7 @@ int ubi_attach(libubi_t desc, const char *node, struct ubi_attach_request *req) r.vid_hdr_offset = req->vid_hdr_offset; r.disable_fm = req->disable_fm ? 1 : 0; r.need_resv_pool = req->need_resv_pool ? 1 : 0; + r.wl_threshold = req->wl_threshold; if (req->max_beb_per1024) { /* -- cgit v1.2.3