mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
init: pre-create /dev/console
This commit is contained in:
parent
a1a37cabe9
commit
14700621ef
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -43,11 +43,12 @@ if [ "$INITRAMFS_PARTED_SUPPORT" = yes ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
cd $ROOT/$BUILD/initramfs
|
( cd $ROOT/$BUILD/initramfs
|
||||||
if [ "$TARGET_ARCH" = "x86_64" -o "$TARGET_ARCH" = "powerpc64" ]; then
|
if [ "$TARGET_ARCH" = "x86_64" -o "$TARGET_ARCH" = "powerpc64" ]; then
|
||||||
ln -s /lib $ROOT/$BUILD/initramfs/lib64
|
ln -s /lib $ROOT/$BUILD/initramfs/lib64
|
||||||
fi
|
fi
|
||||||
mkdir -p $ROOT/$BUILD/image/
|
mkdir -p $ROOT/$BUILD/image/
|
||||||
find . | cpio -H newc -ov -R 0:0 > $ROOT/$BUILD/image/initramfs.cpio
|
fakeroot -- sh -c \
|
||||||
cd -
|
"mkdir -p dev; mknod -m 600 dev/console c 5 1; find . | cpio -H newc -ov -R 0:0 > $ROOT/$BUILD/image/initramfs.cpio"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
diff -Naur a/init/main.c b/init/main.c
|
|
||||||
--- a/init/main.c 2016-08-22 17:01:25.000000000 +0200
|
|
||||||
+++ b/init/main.c 2016-08-22 17:09:48.000000000 +0200
|
|
||||||
@@ -915,8 +915,14 @@
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
@ -1,21 +0,0 @@
|
|||||||
diff --git a/init/main.c b/init/main.c
|
|
||||||
index 9484f4b..db55edd 100644
|
|
||||||
--- a/init/main.c
|
|
||||||
+++ b/init/main.c
|
|
||||||
@@ -880,8 +880,14 @@ static noinline void __init kernel_init_freeable(void)
|
|
||||||
do_basic_setup();
|
|
||||||
|
|
||||||
/* 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");
|
|
||||||
+ char *console = "/dev_console";
|
|
||||||
+
|
|
||||||
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0) {
|
|
||||||
+ sys_mknod(console, S_IFCHR|0600, (TTYAUX_MAJOR<<8)|1);
|
|
||||||
+ if (sys_open(console, O_RDWR, 0) < 0)
|
|
||||||
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
|
|
||||||
+ sys_unlink(console);
|
|
||||||
+ }
|
|
||||||
|
|
||||||
(void) sys_dup(0);
|
|
||||||
(void) sys_dup(0);
|
|
Loading…
x
Reference in New Issue
Block a user