Browse Source

search as fallback on /dev/sda for cfgfs partition

Waldemar Brodkorb 13 years ago
parent
commit
03db81babf
2 changed files with 8 additions and 4 deletions
  1. 1 1
      package/cfgfs/Makefile
  2. 7 3
      package/cfgfs/src/fwcf.sh

+ 1 - 1
package/cfgfs/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		cfgfs
 PKG_VERSION:=		1.0.8
-PKG_RELEASE:=		6
+PKG_RELEASE:=		7
 PKG_DESCR:=		compressed config filesystem
 PKG_SECTION:=		base
 PKG_URL:=		http://openadk.org/

+ 7 - 3
package/cfgfs/src/fwcf.sh

@@ -130,9 +130,13 @@ rootdisk=${rootdisk%p*}
 rootdisk=${rootdisk%[1-9]}
 part=$(fdisk -l /dev/$rootdisk 2>/dev/null|awk '$5 == 88 { 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
-	mtd=1
+	# fallback to /dev/sda in case of encrypted root
+	part=$(fdisk -l /dev/sda 2>/dev/null|awk '$5 == 88 { 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
+		mtd=1
+	fi
 fi
 
 if [[ ! -e $part ]]; then