scripts: fix finding nand/mtd boot on some devices

Fixes #2619
This commit is contained in:
Chris Renshaw 2020-03-31 14:13:06 -03:00 committed by John Wu
parent fef2da3c0b
commit 11102b4dd6

View File

@ -165,7 +165,7 @@ recovery_cleanup() {
# find_block [partname...]
find_block() {
for BLOCK in "$@"; do
DEVICE=`find /dev/block -type l -iname $BLOCK | head -n 1` 2>/dev/null
DEVICE=`find /dev \( -type b -o -type c -o -type l \) -iname $BLOCK | head -n 1` 2>/dev/null
if [ ! -z $DEVICE ]; then
readlink -f $DEVICE
return 0
@ -372,7 +372,7 @@ find_boot_image() {
fi
if [ -z $BOOTIMAGE ]; then
# Lets see what fstabs tells me
BOOTIMAGE=`grep -v '#' /etc/*fstab* | grep -E '/boot[^a-zA-Z]' | grep -oE '/dev/[a-zA-Z0-9_./-]*' | head -n 1`
BOOTIMAGE=`grep -v '#' /etc/*fstab* | grep -E '/boot(img)?[^a-zA-Z]' | grep -oE '/dev/[a-zA-Z0-9_./-]*' | head -n 1`
fi
}