hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
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
52
53
54
55
56
57
58
59
60
From cd3fe38ace9f4eb3792ebb5c50956d58cd58e976 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 9 Jun 2022 17:00:32 +0800
Subject: [PATCH 3/8] Support using shell instead of getty
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 Makefile |  5 +++++
 term.c   | 15 ++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)
 
diff --git a/Makefile b/Makefile
index 7e955e1..8d3a04b 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,11 @@ include common.mk
 
 FRECON_LITE ?= 0
 CHROMEOS ?= 1
+USE_GETTY ?= 1
+
+ifeq ($(USE_GETTY),1)
+CPPFLAGS += -DUSE_GETTY=1
+endif
 
 PC_DEPS = libdrm libpng libtsm
 ifeq ($(FRECON_LITE),1)
diff --git a/term.c b/term.c
index 7446c66..1f69c47 100644
--- a/term.c
+++ b/term.c
@@ -50,14 +50,23 @@ struct _terminal_t {
     char** exec;
 };
 
-
-static char* interactive_cmd_line[] = {
-    "/sbin/agetty",
+#ifdef USE_GETTY
+static char* interactive_cmd_line[] =
+{
+    "/sbin/getty",
     "-",
     "9600",
     "xterm",
     NULL
 };
+#else
+static char* interactive_cmd_line[] =
+{
+    "/bin/sh",
+    "-il",
+    NULL
+};
+#endif
 
 static bool in_background = false;
 static bool hotplug_occured = false;
-- 
2.20.1