aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0030-detect-existence-of-Xorg.patch
blob: adac976e6585a2366e9eca7a5c673e799defaf87 (plain)
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
From 1a248f97c08dbd9d83a5cb20af8401e1268ade3b Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Tue, 24 Jul 2018 15:07:57 +0800
Subject: [PATCH 30/65] detect existence of Xorg

Detect the existence of Xorg before start it.

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 pyanaconda/display.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/pyanaconda/display.py b/pyanaconda/display.py
index d74f34c..f76bc30 100644
--- a/pyanaconda/display.py
+++ b/pyanaconda/display.py
@@ -130,10 +130,23 @@ def check_vnc_can_be_started(anaconda):
 
 
 # X11
+def has_x11():
+    exist = True
+
+    try:
+        subprocess.check_output("ps -A | grep Xorg -q", shell=True)
+    except subprocess.CalledProcessError as e:
+        exist = False
+
+    return exist
 
 def start_x11(xtimeout):
     """Start the X server for the Anaconda GUI."""
 
+    if has_x11():
+        log.info("Xorg already existed, no need to start another one")
+        return
+
     # Start Xorg and wait for it become ready
     util.startX(["Xorg", "-br", "-logfile", "/tmp/X.log",
                  ":%s" % constants.X_DISPLAY_NUMBER, "vt7", "-s", "1440", "-ac",
-- 
2.7.4