inform it as to what tags are to be expected in a stream and what
functions to call on what tags.
+config DIAG_KERNEL
+ bool "Diag kernel"
+ default n
+ help
+ Mount boot image to /root for diag image booting when the system-as-root
+ feature is enabled. This config should only be enabled when building Diag
+ kernel.
+
+ If unsure, say N.
+
source "kernel/Kconfig.locks"
void __init prepare_namespace(void)
{
int is_floppy;
+#ifdef CONFIG_DIAG_KERNEL
+ int err;
+#endif
if (root_delay) {
printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
mount_root();
out:
devtmpfs_mount("dev");
+#ifndef CONFIG_DIAG_KERNEL
sys_mount(".", "/", NULL, MS_MOVE, NULL);
sys_chroot(".");
+#else
+ /* Mount root to /system_root for Diag image */
+ sys_mount(".", "/system_root", NULL, MS_MOVE, NULL);
+ err = sys_mount("/system_root/system", "/system", NULL, MS_BIND, NULL);
+ pr_info("Diag: bind mount /system, err=%d\n", err);
+ sys_chroot("/");
+ sys_chdir("/");
+#endif
}
static bool is_tmpfs;
* check if there is an early userspace init. If yes, let it do all
* the work
*/
-
+#ifndef CONFIG_DIAG_KERNEL
if (!ramdisk_execute_command)
ramdisk_execute_command = "/init";
ramdisk_execute_command = NULL;
prepare_namespace();
}
+#else
+ pr_info("kernel-init: Diag: It's diag image, start diag kernel init.\n");
+ prepare_namespace();
+#endif
/*
* Ok, we have completed the initial bootup, and