recovery: squashfs: change the way to determine nand device

There is a corner case in the cc6ul where the update from
recovery was failing.

If the u-boot variable rootfstype is set to squashfs u-boot
modify the bootargs adding "root=/dev/ubiblock1_0". The grep
of the command line was failing and detecting the device as
mmc and making the firmware update process fail.

Modify the grep to use the same system that we are using in
the update-firmware script.

Signed-off-by: Francisco Gil <francisco.gilmartinez@digi.com>
This commit is contained in:
Francisco Gil 2023-08-22 16:28:12 +02:00
parent a56790c072
commit c85d064bdd
1 changed files with 3 additions and 3 deletions

View File

@ -169,10 +169,10 @@ quit_with_error() {
# @return - "yes" if the system is running in NAND, "no" otherwise
#------------------------------------------------------------------------------
is_nand() {
if grep -qs "\broot=\(ubi\|mtd\)" /proc/cmdline; then
echo "yes"
else
if grep -qs 'root=PARTUUID.*' /proc/cmdline; then
echo "no"
else
echo "yes"
fi
}