[BUG v1.4.6] `ubinfo -a' confused about non-consecutive UBI device numbers
Brian Foster
brian.foster at maxim-ic.com
Tue Jan 24 04:24:22 EST 2012
Hello,
Using mtd-utils v1.4.6 with a v2.6.36 Linux kernel,
if I have non-consecutive UBI device numbers (in the
example below, ‘ubi0’ and ‘ubi10’), then ‘ubinfo -a’,
after printing the info for ‘ubi0’, errors with:
ubinfo: error!: cannot get information about UBI device 1
error 2 (No such file or directory)
In case it matters, ‘ubi0’ was attached/mounted by
kernel command-line (it's my rootfs). My normal
practice is for manually attached MTD and UBI device
numbers to be the same (with 12(!) MTD devices this
greatly reduces confusion!).
─────────────────────────────────────────────────────
# ubinfo --version
1.1
#
# ubinfo -a # Only `ubi0' (rootfs) is attached...
UBI version: 1
Count of UBI devices: 1
UBI control device major/minor: 10:63
Present UBI devices: ubi0
ubi0
Volumes count: 1
[...]
#
# cat /proc/mtd
dev: size erasesize name
mtd0: 02000000 00020000 "physmap-flash.0"
mtd1: 00004000 00000001 "maximasp-nvram"
mtd2: 00002000 00000001 "maximasp-snvram"
mtd3: 00200000 00020000 "u-boot"
mtd4: 00080000 00020000 "env0"
mtd5: 00080000 00020000 "env1"
mtd6: 00400000 00020000 "kernel0"
mtd7: 00400000 00020000 "kernel1"
mtd8: 00500000 00020000 "kernel2"
mtd9: 06400000 00020000 "root0"
mtd10: 06400000 00020000 "root1"
mtd11: 12800000 00020000 "other"
#
# ubiattach -m10 -d10 # Now attach `mtd10' as `ubi10'...
UBI device number 10, total 800 LEBs (103219200 bytes, 98.4 MiB), \
available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
#
# ubinfo -a # `ubinfo -a' is now confused...
UBI version: 1
Count of UBI devices: 2
UBI control device major/minor: 10:63
Present UBI devices: ubi0, ubi10
ubi0
Volumes count: 1
[...]
===================================
ubinfo: error!: cannot get information about UBI device 1
error 2 (No such file or directory)
#
# ubinfo -d10 # However, `ubinfo -d10' is happy...
ubi10
Volumes count: 1
[...]
#
─────────────────────────────────────────────────────
Notice that ‘ubinfo -a’ is fully and correctly aware of
the attached devices, listing only ‘ubi0’ and ‘ubi10’.
Nonetheless, it tries to print information about/from
the non-existent ‘ubi1’.
I have not investigated, nor tried other/recent versions.
cheers!
-blf-
--
Brian Foster
Principal MTS, Software | La Ciotat, France
Maxim Integrated Products | Web: http://www.maxim-ic.com/
More information about the linux-mtd
mailing list