[oe-commits] [meta-openembedded] 04/23: linux-yocto-tiny-kexecboot: revert Yocto specific console check

git at git.openembedded.org git at git.openembedded.org
Thu Mar 3 15:52:52 UTC 2016


martin_jansa pushed a commit to branch master-next
in repository meta-openembedded.

commit c4c70b6d5f8f6ed69775c5faa16feda05e66e377
Author: Andrea Adami <andrea.adami at gmail.com>
AuthorDate: Sun Feb 28 23:51:25 2016 +0100

    linux-yocto-tiny-kexecboot: revert Yocto specific console check
    
    Revert Yocto-specific : "check console device file on fs when booting".
    Fix kernel panic at boot because of the missing /dev/console.
    
    Signed-off-by: Andrea Adami <andrea.adami at gmail.com>
    Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
 .../revert-check-console.patch                     | 47 ++++++++++++++++++++++
 .../linux/linux-yocto-tiny-kexecboot_4.4.bb        |  2 +
 2 files changed, 49 insertions(+)

diff --git a/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch
new file mode 100644
index 0000000..5e5e8d9
--- /dev/null
+++ b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch
@@ -0,0 +1,47 @@
+From a74e0bf51adcc867b73fc44050eb9bde985c9cba Mon Sep 17 00:00:00 2001
+From: Andrea Adami <andrea.adami at gmail.com>
+Date: Sun, 28 Feb 2016 01:09:19 +0100
+Subject: [PATCH] main.c: revert check on console device
+
+Fix kernel panic because of the missing /dev/console.
+
+Revert Yocto-specific : "check console device file on fs when booting".
+
+The initramfs used in this kernel needs to be of the smallest possible
+size so we save a few kb by deploying an empty /dev which is populated
+after boot by the init (kexecboot checks and recreates the devices
+with or without devtmpfs).
+
+Signed-off-by: Andrea Adami <andrea.adami at gmail.com>
+---
+ init/main.c | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/init/main.c b/init/main.c
+index d191d2a..9e64d70 100644
+--- a/init/main.c
++++ b/init/main.c
+@@ -976,7 +976,6 @@ static int __ref kernel_init(void *unused)
+ 
+ static noinline void __init kernel_init_freeable(void)
+ {
+-	struct stat console_stat;
+ 	/*
+ 	 * Wait until kthreadd is all set-up.
+ 	 */
+@@ -1008,12 +1007,6 @@ static noinline void __init kernel_init_freeable(void)
+ 
+ 	do_basic_setup();
+ 
+-	/* Use /dev/console to infer if the rootfs is setup properly */
+-	if (sys_newlstat((char __user *) "/dev/console", (struct stat __user *) &console_stat)
+-			|| !S_ISCHR(console_stat.st_mode)) {
+-		panic("/dev/console is missing or not a character device!\nPlease ensure your rootfs is properly configured\n");
+-	}
+-
+ 	/* Open the /dev/console on the rootfs, this should never fail */
+ 	if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+ 		pr_err("Warning: unable to open an initial console.\n");
+-- 
+1.9.1
+
diff --git a/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb
index 2904ab6..fed62a9 100644
--- a/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb
+++ b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb
@@ -1,6 +1,8 @@
 require recipes-kernel/linux/linux-yocto-tiny_${PV}.bb
 SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs"
 
+SRC_URI += "file://revert-check-console.patch"
+
 PACKAGES = ""
 PROVIDES = ""
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list