aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-installer/anaconda/files/0038-support-to-get-kickstart-from-network.patch
blob: 76fcf2f890af1719761a48a0351868abfa69dee6 (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
46
47
48
49
From c2645c00b53107473efcb954afb06bd6906a7b00 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Sat, 29 Jun 2019 14:25:21 +0800
Subject: [PATCH] support to get kickstart from network

We support http/https/ftp protocol to get kickstart file

Upstream-Status: Inappropriate [oe specific]

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

diff --git a/pyanaconda/startup_utils.py b/pyanaconda/startup_utils.py
index a0fca28..7b19c68 100644
--- a/pyanaconda/startup_utils.py
+++ b/pyanaconda/startup_utils.py
@@ -412,8 +412,11 @@ def parse_kickstart(options, addon_paths, pass_to_boss=False):
     :returns: kickstart parsed to a data model
     """
     ksdata = None
-    if options.ksfile and not options.liveinst:
-        if not os.path.exists(options.ksfile):
+    if options.ksfile:
+        if not os.path.exists(options.ksfile) and \
+           not options.ksfile.startswith("http://") and \
+           not options.ksfile.startswith("https://") and \
+           not options.ksfile.startswith("ftp://"):
             stdout_log.error("Kickstart file %s is missing.", options.ksfile)
             util.ipmi_report(constants.IPMI_ABORTED)
             sys.exit(1)
@@ -431,8 +434,12 @@ def parse_kickstart(options, addon_paths, pass_to_boss=False):
         ks_files = ["/tmp/updates/interactive-defaults.ks",
                     "/usr/share/anaconda/interactive-defaults.ks"]
 
+    log.info("ks_files: %s" % ks_files)
     for ks in ks_files:
-        if not os.path.exists(ks):
+        if not os.path.exists(ks) and \
+           not ks.startswith("http://") and \
+           not ks.startswith("https://") and \
+           not ks.startswith("ftp://"):
             continue
 
         kickstart.preScriptPass(ks)
-- 
2.7.4