Skip to content
Snippets Groups Projects
Commit b8a746ab authored by Ronny Nilsson's avatar Ronny Nilsson
Browse files

base-files: ensure to return a match for non-UBI partitions only.

MTD and UBI use separate tools.
parent 0c9baffc
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,16 @@ bcm_get_chip_id() {
#--------------------------------------------------------------
# Return the string integer of the MTD device
# having name "$1" which is not an UBI volume.
bcm_find_mtd() {
local part=$(awk -F: "/\"$1\"/ { print \$1 }" /proc/mtd)
local part
if [ -e "/sys/class/ubi/ubi0" ]; then # Ensure the device is not an UBI MTD.
grep -q "$1" /sys/class/ubi/*/name && return 0
fi
part=$(awk -F: "/\"$1\"/ { print \$1 }" /proc/mtd)
echo ${part##mtd}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment