[Feature][T108][task-view-1590] mount gsw oemdata

Only Configure: No
Affected branch: GSW_V1453
Affected module: ALL
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no

Change-Id: If4659919b494ab7796599dccefb8edaf372bd903
diff --git a/target/linux/mmp/base-files/lib/preinit/81_mount_ubifs_overlay b/target/linux/mmp/base-files/lib/preinit/81_mount_ubifs_overlay
index 58e51aa..61042d3 100755
--- a/target/linux/mmp/base-files/lib/preinit/81_mount_ubifs_overlay
+++ b/target/linux/mmp/base-files/lib/preinit/81_mount_ubifs_overlay
@@ -156,12 +156,9 @@
 	return 0
 }
 
-
 ubifs_oemdata_mount() {
-
 	mtdpart_idx_oemdata="$(find_mtd_index oemdata)"
 	[ -z "$mtdpart_idx_oemdata" ] && return 1
-
 	recover_ubifs=0
 	[ ! -e /dev/ubi2 ] && ubiattach /dev/ubi_ctrl -m $mtdpart_idx_oemdata -d 2 || recover_ubifs=1
 	if [ $recover_ubifs -eq 0 ]
@@ -180,22 +177,22 @@
 			recover_ubifs=1
 		fi
 	fi
+
 	if [ $recover_ubifs -eq 1 ]
 	then
-		echo "ubifs oemdata partition is damaged"
-		echo "try to recover by formatting $mtdpart..."
-		[ -e /dev/ubi2 ] && ubidetach -m $mtdpart_idx_oemdata
-		ubiformat -y -q /dev/mtd$mtdpart_idx_oemdata
-		ubiattach -m $mtdpart_idx_oemdata /dev/ubi_ctrl
-		ubi2_nod_id=`cat /sys/class/ubi/ubi2/dev | tr -s ":" " "`
-		[ ! -e /dev/ubi2 ] && mknod /dev/ubi2 c ${ubi2_nod_id}
-		ubimkvol /dev/ubi2 -n 0 -N oemdata -t dynamic --maxavsize
+		echo "err: ubi attach failed, oemdata partition damaged?"
 	fi
 
 	mkdir -p /oemdata
+	if [ -e /etc/selinux ]
+	then
+	mount -t ubifs -o noatime,bulk_read,rw,context=u:r:tmp.fs ubi2_0 /oemdata
+	else
 	mount -t ubifs -o noatime,bulk_read,rw ubi2_0 /oemdata
+	fi
 	return 0
 }
+
 #LYNQ_MODFIY_END for gsw partition
 
 pivot() { # <new_root> <old_root>