diff options
-rw-r--r-- | package/cfgfs/src/fwcf.sh | 5 |
1 files changed, 3 insertions, 2 deletions
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 |