Bug 253539

Summary: Network install (using http or ftp) does not work
Product: [Fedora] Fedora Reporter: Lorenzo Sartoratti <lorenzo.sartoratti>
Component: anacondaAssignee: David Cantrell <dcantrell>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 7CC: erik-fedora, petesbbq
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-22 18:58:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
anaconda-11.2.0.66/loader2/nfsinstall.c patch none

Description Lorenzo Sartoratti 2007-08-20 14:25:05 UTC
Hi,
this problem persists in nfs kickstart installations.
The kickstart file is not retrieved because of a wrong mount path (two leading
slashes for the remote path)
We are using an NFS Netapp Filer and mount paths with double leading slashes
are not permitted (i.e. host://vol/linux/ks.cfg)
In attachment there is a proposed patch.


+++ This bug was initially created as a clone of Bug #243528 +++

Description of problem:

The http and ftp installation methods of the official Fedora 7 for x86 DVD are
unreliable.

If you choose the installation by http, Anaconda adds a spurious slash between
the mirror address and the path to fedora directory 
( http://mirror.xyz.com//path/to/os/directory instead of
http://mirror.xyz.com/path/to/os/directory) and the download of stage2.img fails.

The ftp installation method instead works fine until the package download phase
where it fails with a similar issue (it tries to download from
ftp://mirror.xyz.com/%2F/path/to/os/Fedora/ instead of
ftp://mirror.xyz.com/path/to/os/Fedora )


Version-Release number of selected component (if applicable): 


How reproducible:
Start the installation from the official Fedora 7 i386 dvd and try to install by
http or ftp using any mirror. 

Steps to Reproduce:
1. Launch the installation of Fedora from the Dvd
2. Select any keoboard/language and then try to start second phase of the
installation from http or ftp 
3. put the mirror address and the path to Fedora 7 files and directory then
press return
  
Actual results:
Anaconda does not find the files needed for the installation/upgrade from internet.

Expected results:
Anaconda install Fedora 7 x86 by downloading the proper files from internet. 

Additional info:

-- Additional comment from stian_moltubakk on 2007-06-17 02:49 EST --
I can confirm the same problem, but on FTP anaconda add // betwen the server and
fedora location instead of only /.

When I try http something seamed to hapend and I left the computer on over the
night. When I got up the next morning nothing had hapend so I gave up and
downoaded the whole DVD iso and used hardisk install. 

I got a 64 bit version.

-- Additional comment from dcantrell on 2007-08-16 17:24 EST --
This has been fixed in rawhide.

Comment 1 Lorenzo Sartoratti 2007-08-20 14:25:05 UTC
Created attachment 161878 [details]
anaconda-11.2.0.66/loader2/nfsinstall.c patch

Comment 2 David Cantrell 2007-08-22 18:58:39 UTC
I modified your patch a bit.  I did this:

Index: loader2/nfsinstall.c
===================================================================
RCS file: /usr/local/CVS/anaconda/loader2/nfsinstall.c,v
retrieving revision 1.46
diff -u -p -r1.46 nfsinstall.c
--- loader2/nfsinstall.c        6 Aug 2007 21:36:52 -0000       1.46
+++ loader2/nfsinstall.c        22 Aug 2007 18:46:59 -0000
@@ -277,6 +277,7 @@ void setKickstartNfs(struct loaderData_s
 int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
     char ret[47];
     char * host = NULL, *path = NULL, * file = NULL, * opts = NULL;
+    char * chk = NULL;
     int failed = 0;
     struct networkDeviceConfig netCfg;
     ip_addr_t *tip;
@@ -334,7 +335,12 @@ int getFileFromNfs(char * url, char * de
         file = path;
     } else {
         *file++ ='\0';
-        host = sdupprintf("%s/%s", host, path);
+        chk = host;
+        chk += strlen(host) - 1;
+        if (*chk == '/' || *path == '/')
+            host = sdupprintf("%s%s", host, path);
+        else
+            host = sdupprintf("%s/%s", host, path);
     }
 
     logMessage(INFO, "file location: nfs://%s/%s", host, file);


So only add the slash if host doesn't end with it and path doesn't begin with it.

Thanks.