summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-10-22 17:34:46 +0000
committerChris Lumens <clumens@redhat.com>2007-10-22 17:34:46 +0000
commit4543fd44f15a204b342336fe2947ce66030ca327 (patch)
tree5cd1b38ef3598d53fc4aacbab6087ac85393a72d
parent8c7f2368b4d3cd015c4a6454bcfa14ff9f278af7 (diff)
downloadanaconda-4543fd44f15a204b342336fe2947ce66030ca327.tar.gz
anaconda-4543fd44f15a204b342336fe2947ce66030ca327.tar.xz
anaconda-4543fd44f15a204b342336fe2947ce66030ca327.zip
Fix processing of ks=<whatever> ksdevice=(link|bootif). Free some more
memory.
-rw-r--r--ChangeLog8
-rw-r--r--loader2/nfsinstall.c22
-rw-r--r--loader2/urlinstall.c1
3 files changed, 22 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c1e289da5..9f8926cee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,14 @@
* kickstart.py (Bootloader): Fix typo.
+ * loader2/nfsinstall.c (getFileFromNfs): Clear out the netlink cache
+ prior to looking up the IP address in case kickstartNetworkUp was the
+ first time networking was brought up.
+ * loader2/urlinstall.c (getFileFromUrl): Likewise.
+
+ * loader2/nfsinstall.c (getFileFromNfs): Fix processing of ks=nfs:
+ parameter. Free some more memory.
+
2007-10-21 Jeremy Katz <katzj@redhat.com>
* anaconda.spec: Bump version.
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index ddbe168bc..a3cce7298 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -341,6 +341,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
}
/* get the IP of the target system */
+ netlink_init_interfaces_list();
if (ip == NULL && (ip = netlink_interfaces_ip2str(loaderData->netDev)) == NULL) {
logMessage(ERROR, "netlink_interfaces_ip2str returned NULL");
return 1;
@@ -366,13 +367,12 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
file = path;
} else {
*file++ ='\0';
- chk = host;
- chk += strlen(host) - 1;
- char c = '/';
+ chk = host + strlen(host)-1;
if (*chk == '/' || *path == '/')
- c = '\0';
- i = asprintf(&host, "%s%c%s", host, c, path);
+ i = asprintf(&host, "%s%s", host, path);
+ else
+ i = asprintf(&host, "%s/%s", host, path);
}
logMessage(INFO, "file location: nfs://%s/%s", host, file);
@@ -380,18 +380,22 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
if (!doPwMount(host, "/tmp/mnt", "nfs", IMOUNT_RDONLY, opts)) {
char * buf;
- buf = alloca(strlen(file) + 10);
- sprintf(buf, "/tmp/mnt/%s", file);
+ i = asprintf(&buf, "/tmp/mnt/%s", file);
if (copyFile(buf, dest)) {
logMessage(ERROR, "failed to copy file to %s", dest);
failed = 1;
}
-
+
+ free(buf);
} else {
logMessage(ERROR, "failed to mount nfs source");
failed = 1;
}
+ free(host);
+ free(path);
+ if (ip) free(ip);
+
umount("/tmp/mnt");
unlink("/tmp/mnt");
@@ -399,7 +403,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
}
int kickstartFromNfs(char * url, struct loaderData_s * loaderData) {
- return getFileFromNfs(url, "/tmp/ks.cfg", loaderData);
+ return getFileFromNfs(url, "/tmp/ks.cfg", loaderData);
}
/* vim:set shiftwidth=4 softtabstop=4: */
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index cdc28184b..023f6d720 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -362,6 +362,7 @@ int getFileFromUrl(char * url, char * dest,
memset(&ui, 0, sizeof(ui));
ui.protocol = proto;
+ netlink_init_interfaces_list();
if ((ip = netlink_interfaces_ip2str(loaderData->netDev)) == NULL) {
logMessage(ERROR, "getFileFromUrl: no client IP information");
return 1;