1From 42b56fd583ff37fdd965a6e037a4cf69e6971441 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Thu, 9 Jun 2022 17:00:32 +0800 4Subject: [PATCH 3/9] Support using shell instead of getty 5 6Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 7--- 8 Makefile | 5 +++++ 9 term.c | 15 ++++++++++++--- 10 2 files changed, 17 insertions(+), 3 deletions(-) 11 12diff --git a/Makefile b/Makefile 13index a2e0d43..1f44dcf 100644 14--- a/Makefile 15+++ b/Makefile 16@@ -6,6 +6,11 @@ include common.mk 17 18 FRECON_LITE ?= 0 19 CHROMEOS ?= 1 20+USE_GETTY ?= 1 21+ 22+ifeq ($(USE_GETTY),1) 23+CPPFLAGS += -DUSE_GETTY=1 24+endif 25 26 PC_DEPS = libdrm libpng libtsm 27 ifeq ($(FRECON_LITE),1) 28diff --git a/term.c b/term.c 29index c66f088..7b6383a 100644 30--- a/term.c 31+++ b/term.c 32@@ -50,14 +50,23 @@ struct _terminal_t { 33 char** exec; 34 }; 35 36- 37-static char* interactive_cmd_line[] = { 38- "/sbin/agetty", 39+#ifdef USE_GETTY 40+static char* interactive_cmd_line[] = 41+{ 42+ "/sbin/getty", 43 "-", 44 "9600", 45 "xterm", 46 NULL 47 }; 48+#else 49+static char* interactive_cmd_line[] = 50+{ 51+ "/bin/sh", 52+ "-il", 53+ NULL 54+}; 55+#endif 56 57 static bool in_background = false; 58 static bool hotplug_occured = false; 59-- 602.20.1 61 62