[PATCH] Do not bring up network for non-remote kickstart locations (#471658)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the user passes ks=hd: or another non-remote kickstart location,
do not bring up networking during installation.  However, if they
pass the 'vnc' parameter, make sure we do bring up networking early
because we can't let them configure it by the time we get to stage2.
---
 loader/kickstart.c |   21 +++++++++++++++++++++
 loader/kickstart.h |    1 +
 loader/loader.c    |   13 +++++++------
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/loader/kickstart.c b/loader/kickstart.c
index 2a3226f..75231c4 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -401,6 +401,27 @@ static char *newKickstartLocation(const char *origLocation) {
     return retval;
 }
 
+int isKickstartFileRemote(char *ksFile) {
+    char *location = NULL;
+
+    if (ksFile == NULL) {
+        return 0;
+    }
+
+    if (!strncmp(ksFile, "ks=", 3)) {
+        location = ksFile + 3;
+    }
+
+    if (!strncmp(location, "ks", 2) ||
+        !strncmp(location, "http://";, 7) ||
+        !strncmp(location, "ftp://";, 6) ||
+        !strncmp(location, "nfs:", 4))
+        return 1;
+    } else {
+        return 0;
+    }
+}
+
 void getKickstartFile(struct loaderData_s *loaderData) {
     char *c;
     int rc = 1;
diff --git a/loader/kickstart.h b/loader/kickstart.h
index c8d4a78..0ca12dc 100644
--- a/loader/kickstart.h
+++ b/loader/kickstart.h
@@ -45,6 +45,7 @@ int ksReadCommands(char * cmdFile);
 int ksGetCommand(int cmd, char ** last, int * argc, char *** argv);
 int ksHasCommand(int cmd);
 
+int isKickstartFileRemote(char *ksFile);
 void getKickstartFile(struct loaderData_s * loaderData);
 void runKickstart(struct loaderData_s * loaderData);
 int getKickstartFromBlockDevice(char *device, char *path);
diff --git a/loader/loader.c b/loader/loader.c
index 575aa7f..6df8a75 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1121,7 +1121,13 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData,
                     flags |= LOADER_FLAGS_GRAPHICAL;
                 }
 
-                if (!strncasecmp(argv[i], "syslog", 6)) {
+                /* the following things require networking to be configured
+                 * by loader, so an active connection is ready once we get
+                 * to anaconda
+                 */
+                if (!strncasecmp(argv[i], "syslog", 6) ||
+                    !strncasecmp(argv[i], "vnc", 3) ||
+                    isKickstartFileRemote(loaderData->ksFile)) {
                     logMessage(INFO, "early networking required for syslog");
                     flags |= LOADER_FLAGS_EARLY_NETWORKING;
                 }
@@ -1979,11 +1985,6 @@ int main(int argc, char ** argv) {
      * kind of weird. */
     if (loaderData.ksFile || ksFile) {
         logMessage(INFO, "getting kickstart file");
-        iface_init_iface_t(&iface);
-
-        if (kickstartNetworkUp(&loaderData, &iface)) {
-            logMessage(ERROR, "failed to bring up %s for kickstart", loaderData.netDev);
-        }
 
         if (!ksFile)
             getKickstartFile(&loaderData);
-- 
1.6.0.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux