tizen 2.3.1 release
[external/busybox.git] / packaging / init-make-the-initial-TERM-value-configurable.patch
1 From 1c05303fdc302725093294eb0305adc003d52bcb Mon Sep 17 00:00:00 2001
2 From: Jeremie Koenig <jk@jk.fr.eu.org>
3 Date: Thu, 27 May 2010 15:46:07 +0200
4 Subject: [PATCH 5/9] init: make the initial $TERM value configurable
5
6 Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
8 ---
9  init/Config.src |   12 ++++++++++++
10  init/init.c     |    2 +-
11  2 files changed, 13 insertions(+), 1 deletions(-)
12
13 diff --git a/init/Config.src b/init/Config.src
14 index 590e298..2cac357 100644
15 --- a/init/Config.src
16 +++ b/init/Config.src
17 @@ -89,6 +89,18 @@ config FEATURE_INITRD
18           This does not apply to initramfs, which runs /init as PID 1 and
19           requires no special support.
20  
21 +config INIT_TERMINAL_TYPE
22 +       string "Initial terminal type"
23 +       default "linux"
24 +       depends on INIT
25 +       help
26 +         This is the initial value set by init for the TERM environment
27 +         variable. This variable is used by programs which make use of
28 +         extended terminal capabilities.
29 +
30 +         Note that on Linux, init attempts to detect serial terminal and
31 +         sets TERM to "vt102" if one is found.
32 +
33  config HALT
34         bool "poweroff, halt, and reboot"
35         default y
36 diff --git a/init/init.c b/init/init.c
37 index d8bf158..fa1af6d 100644
38 --- a/init/init.c
39 +++ b/init/init.c
40 @@ -205,7 +205,7 @@ static void console_init(void)
41         } else
42  #endif
43         if (!s)
44 -               putenv((char*)"TERM=linux");
45 +               putenv((char*)"TERM=" CONFIG_INIT_TERMINAL_TYPE);
46  }
47  
48  /* Set terminal settings to reasonable defaults.
49 -- 
50 1.7.1
51