summaryrefslogtreecommitdiff
path: root/package/cfgfs
diff options
context:
space:
mode:
authorJoerg Seitter <adk@seitter.net>2021-01-03 21:59:19 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2021-01-08 19:19:00 +0100
commitb19a2db16fcdc319056a32feab298d0afad827d6 (patch)
tree80306ba37727bd5f441c42ce55a8c9d1d9f76910 /package/cfgfs
parentaf0062c6d688bd534b8ab85a5c409878d9d885b1 (diff)
improved detection of the cfgfs partition by checking for the ID of the partition
Signed-off-by: Joerg Seitter <adk@seitter.net>
Diffstat (limited to 'package/cfgfs')
-rw-r--r--package/cfgfs/src/fwcf.sh5
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