summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-05-01 16:55:56 +0000
committerJeremy Katz <katzj@redhat.com>2006-05-01 16:55:56 +0000
commit9398d4fc0aff2fc8a85252f1314667d51bbd13c3 (patch)
tree97ff9486b3e87bc008f516419b8100c26ad9fd1e
parent2642ce0db4e9817f29cc8922c35011cbe532095d (diff)
downloadanaconda-9398d4fc0aff2fc8a85252f1314667d51bbd13c3.tar.gz
anaconda-9398d4fc0aff2fc8a85252f1314667d51bbd13c3.tar.xz
anaconda-9398d4fc0aff2fc8a85252f1314667d51bbd13c3.zip
2006-05-01 Jeremy Katz <katzj@redhat.com>
* loader2/nfsinstall.c: Handle nfs mount options (Dave Lehman, #168384) * loader2/nfsinstall.h: Add mount opts to struct
-rw-r--r--ChangeLog5
-rw-r--r--loader2/nfsinstall.c27
-rw-r--r--loader2/nfsinstall.h1
3 files changed, 27 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ccbe924f6..a83cd7c2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-01 Jeremy Katz <katzj@redhat.com>
+
+ * loader2/nfsinstall.c: Handle nfs mount options (Dave Lehman, #168384)
+ * loader2/nfsinstall.h: Add mount opts to struct
+
2006-05-01 Chris Lumens <clumens@redhat.com>
* anaconda: Remove syslogd mode.
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 03ea6ea82..5d8644470 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -76,6 +76,7 @@ char * mountNfsImage(struct installMethod * method,
moduleDeps * modDepsPtr, int flags) {
char * host = NULL;
char * directory = NULL;
+ char * mountOpts = NULL;
char * fullPath = NULL;
char * path;
char * url = NULL;
@@ -96,8 +97,9 @@ char * mountNfsImage(struct installMethod * method,
loaderData->methodData) {
host = ((struct nfsInstallData *)loaderData->methodData)->host;
directory = ((struct nfsInstallData *)loaderData->methodData)->directory;
+ mountOpts = ((struct nfsInstallData *)loaderData->methodData)->mountOpts;
- logMessage(INFO, "host is %s, dir is %s", host, directory);
+ logMessage(INFO, "host is %s, dir is %s, opts are '%s'", host, directory, mountOpts);
if (!host || !directory) {
logMessage(ERROR, "missing host or directory specification");
@@ -145,7 +147,7 @@ char * mountNfsImage(struct installMethod * method,
stage = NFS_STAGE_NFS;
if (!doPwMount(fullPath, "/mnt/source", "nfs",
- IMOUNT_RDONLY, NULL)) {
+ IMOUNT_RDONLY, mountOpts)) {
char mntPath[1024];
snprintf(mntPath, sizeof(mntPath), "/mnt/source/%s/base/stage2.img", getProductPath());
@@ -243,12 +245,13 @@ char * mountNfsImage(struct installMethod * method,
void setKickstartNfs(struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr) {
- char * host = NULL, * dir = NULL;
+ char * host = NULL, * dir = NULL, * mountOpts = NULL;
poptContext optCon;
int rc;
struct poptOption ksNfsOptions[] = {
{ "server", '\0', POPT_ARG_STRING, &host, 0, NULL, NULL },
{ "dir", '\0', POPT_ARG_STRING, &dir, 0, NULL, NULL },
+ { "opts", '\0', POPT_ARG_STRING, &mountOpts, 0, NULL, NULL},
{ 0, 0, 0, 0, 0, 0, 0 }
};
@@ -275,14 +278,16 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc,
((struct nfsInstallData *)loaderData->methodData)->host = host;
if (dir)
((struct nfsInstallData *)loaderData->methodData)->directory = dir;
+ if (mountOpts)
+ ((struct nfsInstallData *)loaderData->methodData)->mountOpts = mountOpts;
- logMessage(INFO, "results of nfs, host is %s, dir is %s", host, dir);
+ logMessage(INFO, "results of nfs, host is %s, dir is %s, opts are '%s'", host, dir, mountOpts);
}
int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData,
int flags) {
- char * host = NULL, *path = NULL, * file = NULL;
+ char * host = NULL, *path = NULL, * file = NULL, * opts = NULL;
int failed = 0;
struct networkDeviceConfig netCfg;
@@ -314,6 +319,16 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData,
getHostandPath(url, &host, &path, inet_ntoa(netCfg.dev.ip));
+ opts = strchr(host, ':');
+ if (opts && (strlen(opts) > 1)) {
+ char * c = opts;
+ opts = host;
+ host = c + 1;
+ *c = '\0';
+ } else {
+ opts = NULL;
+ }
+
/* nfs has to be a little bit different... split off the last part as
* the file and then concatenate host + dir path */
file = strrchr(path, '/');
@@ -326,7 +341,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData,
logMessage(INFO, "file location: nfs://%s/%s", host, file);
- if (!doPwMount(host, "/tmp/mnt", "nfs", IMOUNT_RDONLY, NULL)) {
+ if (!doPwMount(host, "/tmp/mnt", "nfs", IMOUNT_RDONLY, opts)) {
char * buf;
buf = alloca(strlen(file) + 10);
diff --git a/loader2/nfsinstall.h b/loader2/nfsinstall.h
index 2e4b97efb..190cf0fb2 100644
--- a/loader2/nfsinstall.h
+++ b/loader2/nfsinstall.h
@@ -6,6 +6,7 @@
struct nfsInstallData {
char * host;
char * directory;
+ char * mountOpts;
};