aboutsummaryrefslogtreecommitdiff
path: root/lib/libubi.c
diff options
context:
space:
mode:
authorRan Hongyun <ranhongyun1@huawei.com>2026-07-23 10:37:06 +0800
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2026-08-03 07:42:07 +0200
commit76641773be73141652c6be5c45f53c91efd144e4 (patch)
tree7839e77069f3b22136cb6d136ad4e7ada15a0f37 /lib/libubi.c
parentd1f2d1270c15e373c4e4b5bfbe0a83c7bcf6e793 (diff)
ubi-utils: add wear-leveling threshold parameter to ubiattachHEADmaster
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 <ranhongyun1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/libubi.c')
-rw-r--r--lib/libubi.c1
1 files changed, 1 insertions, 0 deletions
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) {
/*