[Feature][ZXW-130]merge P50U02 version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I4f29ec5bb7c59385f23738d2b7ca84e67c100f69
diff --git a/ap/os/linux/linux-3.4.x/init/do_mounts.c b/ap/os/linux/linux-3.4.x/init/do_mounts.c
old mode 100644
new mode 100755
index 7f112bd..580705c
--- a/ap/os/linux/linux-3.4.x/init/do_mounts.c
+++ b/ap/os/linux/linux-3.4.x/init/do_mounts.c
@@ -20,8 +20,12 @@
 #include <linux/nfs_fs.h>
 #include <linux/nfs_fs_sb.h>
 #include <linux/nfs_mount.h>
+#include <linux/reboot.h>
 
 #include "do_mounts.h"
+#ifdef CONFIG_FLAGS_UTILS
+#include "pub_flags.h"
+#endif
 
 int __initdata rd_doload;	/* 1 = load RAM disk, 0 = don't load */
 
@@ -384,6 +388,20 @@
 		printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify "
 		       "explicit textual name for \"root=\" boot option.\n");
 #endif
+#ifdef CONFIG_FLAGS_UTILS
+	extern int flags_get(T_FLAGS_INFO *p_flags_info);
+	extern int flags_set(T_FLAGS_INFO *p_flags_info);
+	T_FLAGS_INFO flags_info;
+	int ret;
+	if (ret = flags_get(&flags_info) < 0)
+		panic("VFS: Unable get flags");
+	flags_info.boot_fota_flag.boot_to = (flags_info.boot_fota_flag.boot_to == DUAL_SYSTEM) ?
+		DUAL_SYSTEM2 : DUAL_SYSTEM;
+	if (ret = flags_set(&flags_info) < 0)
+		panic("VFS: Unable set flags");
+	else
+		kernel_restart("VFS: Switch to others system, please reset machine");
+#endif
 		panic("VFS: Unable to mount root fs on %s", b);
 	}