From b19a2db16fcdc319056a32feab298d0afad827d6 Mon Sep 17 00:00:00 2001 From: Joerg Seitter Date: Sun, 3 Jan 2021 21:59:19 +0100 Subject: improved detection of the cfgfs partition by checking for the ID of the partition Signed-off-by: Joerg Seitter --- package/cfgfs/src/fwcf.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'package') diff --git a/package/cfgfs/src/fwcf.sh b/package/cfgfs/src/fwcf.sh index ea8452850..c6008e93a 100644 --- a/package/cfgfs/src/fwcf.sh +++ b/package/cfgfs/src/fwcf.sh @@ -132,12 +132,13 @@ echo $rootdisk|grep mmcblk >/dev/null 2>&1 if [ $? -ne 0 ]; then rootdisk=${rootdisk%[1-9]} fi -part=$(fdisk -l $rootdisk 2>/dev/null|grep '^/dev'|tail -1|awk '{ print $1 }') +# find last partition with an 88 id +part=$(fdisk -l $rootdisk 2>/dev/null|awk '{if ($2=="*") { print $1" "$9} else {print $1" "$8}}'|grep '^/dev.*88.*'|tail -1|awk '{ print $1 }') if [ -f .cfgfs ]; then . /.cfgfs fi if [ -z $part ]; then - part=$(fdisk -l /dev/sda 2>/dev/null|grep '^/dev'|tail -1|awk '{ print $1 }') + part=$(fdisk -l /dev/sda 2>/dev/null|awk '{if ($2=="*") { print $1" "$9} else {print $1" "$8}}'|grep '^/dev.*88.*'|tail -1|awk '{ print $1 }') if [ -z $part ]; then # otherwise search for MTD device with name cfgfs part=/dev/mtd$(fgrep '"cfgfs"' /proc/mtd 2>/dev/null | sed 's/^mtd\([^:]*\):.*$/\1/')ro -- cgit v1.2.3