]> git.sur5r.net Git - u-boot/commitdiff
cmd: ubi: Add additional message upon UBI attach error
authorStefan Roese <sr@denx.de>
Tue, 26 Jun 2018 06:12:32 +0000 (08:12 +0200)
committerHeiko Schocher <hs@denx.de>
Thu, 12 Jul 2018 05:26:18 +0000 (07:26 +0200)
When trying to attach an UBI MTD partition via "ubi part", it may happen
that the MTD partition defined in U-Boot (via mtdparts) is not big
enough than the one, where the UBI device has been created on. This
may lead to errors, which are not really descriptive to debug and
solve this issue, like:

ubi0 error: vtbl_check: too large reserved_pebs 1982, good PEBs 1020
ubi0 error: vtbl_check: volume table check failed: record 0, error 9

or:

ubi0 error: init_volumes: not enough PEBs, required 1738, available 1020
ubi0 error: ubi_wl_init: no enough physical eraseblocks (-718, need 1)
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -12

Lets add an additional message upon attach failure, to aid the U-Boot
user to solve this problem.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
cmd/ubi.c

index 9c3cabc262aaa692ca8fbe3b630d6810450e8db6..0e935e34b8e626fb5ec916109ae013aee07e3048 100644 (file)
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -512,6 +512,7 @@ int ubi_part(char *part_name, const char *vid_header_offset)
                        vid_header_offset);
        if (err) {
                printf("UBI init error %d\n", err);
                        vid_header_offset);
        if (err) {
                printf("UBI init error %d\n", err);
+               printf("Please check, if the correct MTD partition is used (size big enough?)\n");
                ubi_dev.selected = 0;
                return err;
        }
                ubi_dev.selected = 0;
                return err;
        }