[master 1/2] loader: strip trailing slash character from stage2= URL.

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

 



previously, the URL could only be "*.img" anyway. If we are going to be
mounting directories, let's have the URL in the same form all the time.
---
 loader/method.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/loader/method.c b/loader/method.c
index d6f83e6..1937b5a 100644
--- a/loader/method.c
+++ b/loader/method.c
@@ -59,6 +59,15 @@
 /* boot flags */
 extern uint64_t flags;
 
+static void stripTrailingSlash(char *path) {
+    size_t len = strlen(path);
+
+    if (len == 0)
+        return;
+    if (path[len-1] == '/')
+        path[len-1] = '\0';
+}
+
 int umountLoopback(char * mntpoint, char * device) {
     int loopfd;
 
@@ -508,6 +517,7 @@ void setStage2LocFromCmdline(char * arg, struct loaderData_s * ld) {
           &(((struct nfsInstallData *)ld->stage2Data)->host),
           &(((struct nfsInstallData *)ld->stage2Data)->directory),
           &(((struct nfsInstallData *)ld->stage2Data)->mountOpts));
+        stripTrailingSlash(((struct nfsInstallData *)ld->stage2Data)->directory);
     } else if (!strncmp(arg, "nfsiso:", 7)) {
         ld->method = METHOD_NFS;
         ld->stage2Data = calloc(sizeof(struct nfsInstallData *), 1);
-- 
1.6.6

_______________________________________________
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