[Feature][ZXW-452]merge P54U02 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: I17e6795ab66e2b9d1cbbfec4b7c0028d666e177d
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
index 580705c..1e5b080 100755
--- a/ap/os/linux/linux-3.4.x/init/do_mounts.c
+++ b/ap/os/linux/linux-3.4.x/init/do_mounts.c
@@ -389,18 +389,12 @@
"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");
+ extern int flags_sys_switch(void);
+ printk(KERN_EMERG "VFS: Unable to mount root fs on %s", b);
+ if (flags_sys_switch() < 0)
+ panic("VFS: flags_sys_switch fail");
else
- kernel_restart("VFS: Switch to others system, please reset machine");
+ kernel_restart("VFS: Switch to another system, please reset machine");
#endif
panic("VFS: Unable to mount root fs on %s", b);
}
diff --git a/ap/os/linux/linux-3.4.x/init/main.c b/ap/os/linux/linux-3.4.x/init/main.c
old mode 100644
new mode 100755
index 482385f..8570e3a
--- a/ap/os/linux/linux-3.4.x/init/main.c
+++ b/ap/os/linux/linux-3.4.x/init/main.c
@@ -81,6 +81,11 @@
#include <asm/smp.h>
#endif
+#ifdef CONFIG_FLAGS_UTILS
+#include <linux/reboot.h>
+#include "pub_flags.h"
+#endif
+
static int kernel_init(void *);
extern void init_IRQ(void);
@@ -867,6 +872,17 @@
run_init_process("/bin/init");
run_init_process("/bin/sh");
#endif
+#ifdef CONFIG_FLAGS_UTILS
+{
+ extern int flags_sys_switch(void);
+ printk(KERN_EMERG "No init found. Try passing init= option to kernel. "
+ "See Linux Documentation/init.txt for guidance.");
+ if (flags_sys_switch() < 0)
+ panic("init: flags_sys_switch fail");
+ else
+ kernel_restart("init: Switch to another system, please reset machine");
+}
+#endif
panic("No init found. Try passing init= option to kernel. "
"See Linux Documentation/init.txt for guidance.");
}