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

[PATCH master f15-branch NTH?] Check repo instead of method type when enabling network in loader (#673824)



Now when we have stage 2 in initrd.img.

This change fixes netinstall which is not identified as METHOD_CDROM
because of missing .treeinfo/.discinfo so initial METHOD_URL is kept.

I wonder if this this check is also worth fixing, or if we even should
add .treeinfo to netinst.iso.

---
 loader/kickstart.c  |    8 +-------
 loader/loader.c     |    4 ++--
 loader/loadermisc.c |   14 ++++++++++++++
 loader/loadermisc.h |    1 +
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/loader/kickstart.c b/loader/kickstart.c
index 7e7379b..89cff39 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -412,13 +412,7 @@ int isKickstartFileRemote(char *ksFile) {
         location = ksFile + 3;
     }
 
-    if (!strncmp(location, "http", 4) ||
-        !strncmp(location, "ftp://";, 6) ||
-        !strncmp(location, "nfs:", 4)) {
-        return 1;
-    } else {
-        return 0;
-    }
+    return isURLRemote(location);
 }
 
 void getKickstartFile(struct loaderData_s *loaderData) {
diff --git a/loader/loader.c b/loader/loader.c
index 47021cc..9c0ca77 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1459,8 +1459,8 @@ static void doLoaderMain(struct loaderData_s *loaderData,
             }
 
             case STEP_NETWORK: {
-                if (((installMethods[validMethods[loaderData->method]].type !=
-                       DEVICE_NETWORK) && (!hasGraphicalOverride()) &&
+                if ((!isURLRemote(loaderData->instRepo) &&
+                      !hasGraphicalOverride() &&
                       !FL_ASKNETWORK(flags) &&
                       !FL_EARLY_NETWORKING(flags) && 
                       !ibft_present()) ||
diff --git a/loader/loadermisc.c b/loader/loadermisc.c
index d0ff3d4..9f0c795 100644
--- a/loader/loadermisc.c
+++ b/loader/loadermisc.c
@@ -166,3 +166,17 @@ int simpleStringCmp(const void * a, const void * b) {
 
     return strverscmp(first, second);
 }
+
+int isURLRemote(char *url) {
+    if (url == NULL) {
+        return 0;
+    }
+
+    if (!strncmp(url, "http", 4) ||
+        !strncmp(url, "ftp://";, 6) ||
+        !strncmp(url, "nfs:", 4)) {
+        return 1;
+    } else {
+        return 0;
+    }
+}
diff --git a/loader/loadermisc.h b/loader/loadermisc.h
index 3ffacb2..b59016b 100644
--- a/loader/loadermisc.h
+++ b/loader/loadermisc.h
@@ -29,5 +29,6 @@ int copyFileFd(int infd, char * dest, progressCB pbcb,
                struct progressCBdata *data, long long total);
 int recursiveRemove(int fd);
 int simpleStringCmp(const void * a, const void * b);
+int isURLRemote(char *url);
 
 #endif
-- 
1.7.2


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