kernel: bump 5.15 to 5.15.70
[openwrt/openwrt.git] / target / linux / uml / patches-5.15 / 001-um-fix-default-console-kernel-parameter.patch
1 From 53b5c5f559cc95fc676cb4cc9e5a8d9f0cb8f58c Mon Sep 17 00:00:00 2001
2 Message-Id: <53b5c5f559cc95fc676cb4cc9e5a8d9f0cb8f58c.1659815468.git.chunkeey@gmail.com>
3 From: Christian Lamparter <chunkeey@gmail.com>
4 Date: Sat, 6 Aug 2022 21:22:01 +0200
5 Subject: [PATCH v1 1/2] um: fix default console kernel parameter
6 To: linux-um@lists.infradead.org
7 Cc: Richard Weinberger <richard@nod.at>,
8 Anton Ivanov <anton.ivanov@cambridgegreys.com>,
9 Johannes Berg <johannes@sipsolutions.net>
10
11 OpenWrt's UML with 5.15 was producing odd errors/warnings during preinit
12 part of the early userspace portion:
13
14 |[ 0.000000] Kernel command line: ubd0=root.img root=98:0 console=tty
15 |[...]
16 |[ 0.440000] random: jshn: uninitialized urandom read (4 bytes read)
17 |[ 0.460000] random: jshn: uninitialized urandom read (4 bytes read)
18 |/etc/preinit: line 47: can't create /dev/tty: No such device or address
19 |/etc/preinit: line 48: can't create /dev/tty: No such device or address
20 |/etc/preinit: line 58: can't open /dev/tty: No such device or address
21 |[...] repeated many times
22
23 That "/dev/tty" came from the command line (which is automatically
24 added if no console= parameter was specified for the uml binary).
25
26 The TLDP project tells the following about the /dev/tty:
27 <https://tldp.org/HOWTO/Text-Terminal-HOWTO-7.html#ss7.3>
28 | /dev/tty stands for the controlling terminal (if any) for the current
29 | process.[...]
30 | /dev/tty is something like a link to the actually terminal device[..]
31
32 The "(if any)" is important here, since it's possible for processes to
33 not have a controlling terminal.
34
35 I think this was a simple typo and the author wanted tty0 there.
36
37 CC: Thomas Meyer <thomas@m3y3r.de>
38 Fixes: d7ffac33631b ("um: stdio_console: Make preferred console")
39 Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
40 ---
41 arch/um/kernel/um_arch.c | 2 +-
42 1 file changed, 1 insertion(+), 1 deletion(-)
43
44 --- a/arch/um/kernel/um_arch.c
45 +++ b/arch/um/kernel/um_arch.c
46 @@ -31,7 +31,7 @@
47 #include <os.h>
48
49 #define DEFAULT_COMMAND_LINE_ROOT "root=98:0"
50 -#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty"
51 +#define DEFAULT_COMMAND_LINE_CONSOLE "console=tty0"
52
53 /* Changed in add_arg and setup_arch, which run before SMP is started */
54 static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 };