diff options
| -rw-r--r-- | meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch | 47 | ||||
| -rw-r--r-- | meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot_4.4.bb | 2 |
2 files changed, 49 insertions, 0 deletions
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 0000000000..5e5e8d9f9a --- /dev/null +++ b/meta-initramfs/recipes-kernel/linux/linux-yocto-tiny-kexecboot/revert-check-console.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From a74e0bf51adcc867b73fc44050eb9bde985c9cba Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrea Adami <andrea.adami@gmail.com> | ||
| 3 | Date: Sun, 28 Feb 2016 01:09:19 +0100 | ||
| 4 | Subject: [PATCH] main.c: revert check on console device | ||
| 5 | |||
| 6 | Fix kernel panic because of the missing /dev/console. | ||
| 7 | |||
| 8 | Revert Yocto-specific : "check console device file on fs when booting". | ||
| 9 | |||
| 10 | The initramfs used in this kernel needs to be of the smallest possible | ||
| 11 | size so we save a few kb by deploying an empty /dev which is populated | ||
| 12 | after boot by the init (kexecboot checks and recreates the devices | ||
| 13 | with or without devtmpfs). | ||
| 14 | |||
| 15 | Signed-off-by: Andrea Adami <andrea.adami@gmail.com> | ||
| 16 | --- | ||
| 17 | init/main.c | 7 ------- | ||
| 18 | 1 file changed, 7 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/init/main.c b/init/main.c | ||
| 21 | index d191d2a..9e64d70 100644 | ||
| 22 | --- a/init/main.c | ||
| 23 | +++ b/init/main.c | ||
| 24 | @@ -976,7 +976,6 @@ static int __ref kernel_init(void *unused) | ||
| 25 | |||
| 26 | static noinline void __init kernel_init_freeable(void) | ||
| 27 | { | ||
| 28 | - struct stat console_stat; | ||
| 29 | /* | ||
| 30 | * Wait until kthreadd is all set-up. | ||
| 31 | */ | ||
| 32 | @@ -1008,12 +1007,6 @@ static noinline void __init kernel_init_freeable(void) | ||
| 33 | |||
| 34 | do_basic_setup(); | ||
| 35 | |||
| 36 | - /* Use /dev/console to infer if the rootfs is setup properly */ | ||
| 37 | - if (sys_newlstat((char __user *) "/dev/console", (struct stat __user *) &console_stat) | ||
| 38 | - || !S_ISCHR(console_stat.st_mode)) { | ||
| 39 | - panic("/dev/console is missing or not a character device!\nPlease ensure your rootfs is properly configured\n"); | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | /* Open the /dev/console on the rootfs, this should never fail */ | ||
| 43 | if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) | ||
| 44 | pr_err("Warning: unable to open an initial console.\n"); | ||
| 45 | -- | ||
| 46 | 1.9.1 | ||
| 47 | |||
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 2904ab6b35..fed62a9260 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 @@ | |||
| 1 | require recipes-kernel/linux/linux-yocto-tiny_${PV}.bb | 1 | require recipes-kernel/linux/linux-yocto-tiny_${PV}.bb |
| 2 | SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs" | 2 | SUMMARY = "Yocto tiny kernel embedding a minimalistic kexecboot initramfs" |
| 3 | 3 | ||
| 4 | SRC_URI += "file://revert-check-console.patch" | ||
| 5 | |||
| 4 | PACKAGES = "" | 6 | PACKAGES = "" |
| 5 | PROVIDES = "" | 7 | PROVIDES = "" |
| 6 | 8 | ||
