Package: busybox / 1:1.17.1-8+deb6u11

init-make-the-initial-TERM-value-configurable.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 1c05303fdc302725093294eb0305adc003d52bcb Mon Sep 17 00:00:00 2001
From: Jeremie Koenig <jk@jk.fr.eu.org>
Date: Thu, 27 May 2010 15:46:07 +0200
Subject: [PATCH 5/9] init: make the initial $TERM value configurable

Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 init/Config.src |   12 ++++++++++++
 init/init.c     |    2 +-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/init/Config.src b/init/Config.src
index 590e298..2cac357 100644
--- a/init/Config.src
+++ b/init/Config.src
@@ -89,6 +89,18 @@ config FEATURE_INITRD
 	  This does not apply to initramfs, which runs /init as PID 1 and
 	  requires no special support.
 
+config INIT_TERMINAL_TYPE
+	string "Initial terminal type"
+	default "linux"
+	depends on INIT
+	help
+	  This is the initial value set by init for the TERM environment
+	  variable. This variable is used by programs which make use of
+	  extended terminal capabilities.
+
+	  Note that on Linux, init attempts to detect serial terminal and
+	  sets TERM to "vt102" if one is found.
+
 config HALT
 	bool "poweroff, halt, and reboot"
 	default y
diff --git a/init/init.c b/init/init.c
index d8bf158..fa1af6d 100644
--- a/init/init.c
+++ b/init/init.c
@@ -205,7 +205,7 @@ static void console_init(void)
 	} else
 #endif
 	if (!s)
-		putenv((char*)"TERM=linux");
+		putenv((char*)"TERM=" CONFIG_INIT_TERMINAL_TYPE);
 }
 
 /* Set terminal settings to reasonable defaults.
-- 
1.7.1