summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-05-01 17:20:47 +0000
committerJeremy Katz <katzj@redhat.com>2006-05-01 17:20:47 +0000
commit687930bc787b15768c6c096ba61fd1df36a27f0a (patch)
tree9df51a60cb1aa42a274fc23867d803bde231c27c
parentf826ab15c4bec2ef113144303e7c779cb1d517f0 (diff)
downloadanaconda-687930bc787b15768c6c096ba61fd1df36a27f0a.tar.gz
anaconda-687930bc787b15768c6c096ba61fd1df36a27f0a.tar.xz
anaconda-687930bc787b15768c6c096ba61fd1df36a27f0a.zip
2006-05-01 Jeremy Katz <katzj@redhat.com>
* loader2/nfsinstall.c Add support for passing nfs mount options by specifying nfsmountopts= on the boot command line. NOTE: this syntax will only exist in RHEL4. For future major releases of RHEL, this will be handled on a more fine-grained basis. (Brian Long, #168384) * loader/loader.c: Likewise. * loader2/loader.h: Likewise. * isys/imount.c (doPwMount): Pass extra parameters * isys/imount.h: (doPwMount): Prototype. * isys/isys.c: Adjust for new parameter. * loader2/cdinstall.c: Likewise. * loader2/driverdisk.c: Likewise. * loader2/hdinstall.c: Likewise. * loader2/method.c: Likewise. * loader2/usb.c: Likewise.
-rw-r--r--ChangeLog18
-rw-r--r--isys/imount.c8
-rw-r--r--isys/imount.h2
-rw-r--r--isys/isys.c2
-rw-r--r--loader2/cdinstall.c4
-rw-r--r--loader2/driverdisk.c20
-rw-r--r--loader2/hdinstall.c2
-rw-r--r--loader2/loader.c10
-rw-r--r--loader2/loader.h1
-rw-r--r--loader2/method.c16
-rw-r--r--loader2/nfsinstall.c12
-rw-r--r--loader2/usb.c2
12 files changed, 64 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index 919572865..8211bd904 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2006-05-01 Jeremy Katz <katzj@redhat.com>
+
+ * loader2/nfsinstall.c Add support for passing nfs mount options
+ by specifying nfsmountopts= on the boot command line. NOTE: this
+ syntax will only exist in RHEL4. For future major releases of
+ RHEL, this will be handled on a more fine-grained basis. (Brian
+ Long, #168384)
+ * loader/loader.c: Likewise.
+ * loader2/loader.h: Likewise.
+ * isys/imount.c (doPwMount): Pass extra parameters
+ * isys/imount.h: (doPwMount): Prototype.
+ * isys/isys.c: Adjust for new parameter.
+ * loader2/cdinstall.c: Likewise.
+ * loader2/driverdisk.c: Likewise.
+ * loader2/hdinstall.c: Likewise.
+ * loader2/method.c: Likewise.
+ * loader2/usb.c: Likewise.
+
2006-04-24 David Cantrell <dcantrell@redhat.com>
* rescue.py: Added runShell() to handle spawning the tty1 shell for
diff --git a/isys/imount.c b/isys/imount.c
index 4f5725373..7af27658c 100644
--- a/isys/imount.c
+++ b/isys/imount.c
@@ -15,7 +15,7 @@
static int mkdirIfNone(char * directory);
int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
- char * acct, char * pw, int bindmnt, int remount) {
+ char * acct, char * pw, int bindmnt, int remount, char * extra_opts) {
char * buf = NULL;
int isnfs = 0;
char * mount_opt = NULL;
@@ -65,12 +65,14 @@ int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
strcat(buf, dev);
} else {
#ifndef DISABLE_NETWORK
- char * extra_opts = NULL;
+ /* char * extra_opts = NULL; */
int flags = 0;
buf = dev;
- /*logMessage("calling nfsmount(%s, %s, &flags, &extra_opts, &mount_opt)",
+ /* logMessage("calling nfsmount(%s, %s, &flags, &extra_opts, &mount_opt)",
buf, where);*/
+ fprintf(stderr, "calling nfsmount(%s, %s, &flags, %s, &mount_opt)",
+ buf, where, extra_opts);
if (nfsmount(buf, where, &flags, &extra_opts, &mount_opt, 0)) {
/*logMessage("\tnfsmount returned non-zero");*/
diff --git a/isys/imount.h b/isys/imount.h
index 0907629b9..6bf7ff27f 100644
--- a/isys/imount.h
+++ b/isys/imount.h
@@ -7,7 +7,7 @@
#include <sys/mount.h> /* for umount() */
int doPwMount(char * dev, char * where, char * fs, int rdonly, int istty,
- char * acct, char * pw, int bindmnt, int remount);
+ char * acct, char * pw, int bindmnt, int remount, char * extra_opts);
int mkdirChain(char * origChain);
#endif
diff --git a/isys/isys.c b/isys/isys.c
index 17b46f381..e7cecf875 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -473,7 +473,7 @@ static PyObject * doMount(PyObject * s, PyObject * args) {
if (!PyArg_ParseTuple(args, "sssiii", &fs, &device, &mntpoint,
&readOnly, &bindMount, &reMount)) return NULL;
- rc = doPwMount(device, mntpoint, fs, readOnly, 0, NULL, NULL, bindMount, reMount);
+ rc = doPwMount(device, mntpoint, fs, readOnly, 0, NULL, NULL, bindMount, reMount, NULL);
if (rc == IMOUNT_ERR_ERRNO)
PyErr_SetFromErrno(PyExc_SystemError);
else if (rc)
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index af842229c..afbe8efe6 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -152,7 +152,7 @@ static void mountCdromStage2(char *cddev) {
do {
do {
if (doPwMount("/tmp/cdrom", "/mnt/source",
- "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
ejectCdrom();
wrongCDMessage();
} else {
@@ -312,7 +312,7 @@ char * setupCdrom(char * location,
logMessage("trying to mount CD device %s", devices[i]->device);
devMakeInode(devices[i]->device, "/tmp/cdrom");
if (!doPwMount("/tmp/cdrom", "/mnt/source", "iso9660", 1, 0,
- NULL, NULL, 0, 0)) {
+ NULL, NULL, 0, 0, NULL)) {
char path[1024];
snprintf(path, sizeof(path), "/mnt/source/%s/base/stage2.img", getProductPath());
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 3ffcec634..9e9793734 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -332,9 +332,9 @@ int loadDriverFromMedia(int class, moduleList modLoaded,
logMessage("trying to mount %s as partition", part);
devMakeInode(part + 5, "/tmp/ddpart");
- if (doPwMount("/tmp/ddpart", "/tmp/dpart", "vfat", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/ddpart", "/tmp/dpart", "ext2", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/ddpart", "/tmp/dpart", "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ if (doPwMount("/tmp/ddpart", "/tmp/dpart", "vfat", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/ddpart", "/tmp/dpart", "ext2", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/ddpart", "/tmp/dpart", "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount partition."));
stage = DEV_PART;
@@ -398,9 +398,9 @@ int loadDriverFromMedia(int class, moduleList modLoaded,
devMakeInode(device, "/tmp/dddev");
logMessage("trying to mount %s", device);
- if (doPwMount("/tmp/dddev", "/tmp/drivers", "vfat", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/dddev", "/tmp/drivers", "ext2", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/dddev", "/tmp/drivers", "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ if (doPwMount("/tmp/dddev", "/tmp/drivers", "vfat", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/dddev", "/tmp/drivers", "ext2", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/dddev", "/tmp/drivers", "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount driver disk."));
stage = DEV_INSERT;
@@ -658,13 +658,13 @@ static void getDDFromDev(struct loaderData_s * loaderData, char * dev,
devMakeInode(dev, "/tmp/dddev");
if (fstype) {
if (doPwMount("/tmp/dddev", "/tmp/drivers", fstype, 1, 0,
- NULL, NULL, 0, 0)) {
+ NULL, NULL, 0, 0, NULL)) {
logMessage("unable to mount %s as %s", dev, fstype);
return;
}
- } else if (doPwMount("/tmp/dddev", "/tmp/drivers", "vfat", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/dddev", "/tmp/drivers", "ext2", 1, 0, NULL, NULL, 0, 0)) {
- if (doPwMount("/tmp/dddev", "/tmp/drivers", "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ } else if (doPwMount("/tmp/dddev", "/tmp/drivers", "vfat", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/dddev", "/tmp/drivers", "ext2", 1, 0, NULL, NULL, 0, 0, NULL)) {
+ if (doPwMount("/tmp/dddev", "/tmp/drivers", "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
logMessage("unable to mount driver disk %s", dev);
return;
}
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index d6fc72d5c..ecd05872d 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -189,7 +189,7 @@ static char * setupIsoImages(char * device, char * dirName, int flags) {
/* XXX try to mount as ext2 and then vfat */
for (type=typetry; *type; type++) {
- if (!doPwMount("/tmp/hddev", "/tmp/hdimage", *type, 1, 0, NULL, NULL, 0, 0))
+ if (!doPwMount("/tmp/hddev", "/tmp/hdimage", *type, 1, 0, NULL, NULL, 0, 0, NULL))
break;
}
diff --git a/loader2/loader.c b/loader2/loader.c
index 652d31435..803186a66 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -150,7 +150,7 @@ int setupRamdisk(void) {
gunzip_close(f);
}
- if (doPwMount(RAMDISK_DEVICE, "/tmp/ramfs", "ext2", 0, 0, NULL, NULL, 0, 0))
+ if (doPwMount(RAMDISK_DEVICE, "/tmp/ramfs", "ext2", 0, 0, NULL, NULL, 0, 0, NULL))
logMessage("failed to mount ramfs image");
return 0;
@@ -159,7 +159,7 @@ int setupRamdisk(void) {
void setupRamfs(void) {
mkdirChain("/tmp/ramfs");
- doPwMount("none", "/tmp/ramfs", "ramfs", 0, 0, NULL, NULL, 0, 0);
+ doPwMount("none", "/tmp/ramfs", "ramfs", 0, 0, NULL, NULL, 0, 0, NULL);
}
@@ -345,9 +345,9 @@ void loadUpdates(int flags) {
devMakeInode(device, "/tmp/upd.disk");
if (doPwMount("/tmp/upd.disk", "/tmp/update-disk", "ext2", 1, 0,
- NULL, NULL, 0, 0) &&
+ NULL, NULL, 0, 0, NULL) &&
doPwMount("/tmp/upd.disk", "/tmp/update-disk", "iso9660", 1, 0,
- NULL, NULL, 0, 0)) {
+ NULL, NULL, 0, 0, NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount updates disk"));
} else {
@@ -645,6 +645,8 @@ static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
flags &= ~LOADER_FLAGS_SELINUX;
else if (!strncasecmp(argv[i], "selinux", 7))
flags |= LOADER_FLAGS_SELINUX;
+ else if (!strncasecmp(argv[i], "nfsmountopts=", 13))
+ loaderData->nfsmountopts = strdup(argv[i] + 13);
else if (numExtraArgs < (MAX_EXTRA_ARGS - 1)) {
/* go through and append args we just want to pass on to */
/* the anaconda script, but don't want to represent as a */
diff --git a/loader2/loader.h b/loader2/loader.h
index 0c35e9280..735f8c27e 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -101,6 +101,7 @@ struct loaderData_s {
char * method;
char * ddsrc;
void * methodData;
+ char * nfsmountopts;
moduleList modLoaded;
moduleDeps * modDepsPtr;
diff --git a/loader2/method.c b/loader2/method.c
index 04d9beb2e..78b39b838 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -123,13 +123,13 @@ int mountLoopback(char * fsystem, char * mntpoint, char * device) {
/* FIXME: really, mountLoopback() should take a list of "valid"
* filesystems for the specific type of image being mounted */
if (doPwMount(filename, mntpoint, "iso9660", 1,
- 0, NULL, NULL, 0, 0)) {
+ 0, NULL, NULL, 0, 0, NULL)) {
if (doPwMount(filename, mntpoint, "ext2", 1,
- 0, NULL, NULL, 0, 0)) {
+ 0, NULL, NULL, 0, 0, NULL)) {
if (doPwMount(filename, mntpoint, "cramfs", 1,
- 0, NULL, NULL, 0, 0)) {
+ 0, NULL, NULL, 0, 0, NULL)) {
if (doPwMount(filename, mntpoint, "vfat", 1,
- 0, NULL, NULL, 0, 0)) {
+ 0, NULL, NULL, 0, 0, NULL)) {
logMessage("failed to mount loop: %s",
strerror(errno));
loopfd = open(filename, O_RDONLY);
@@ -209,7 +209,7 @@ int readStampFileFromIso(char *file, char **timestamp, char **releasedescr) {
if (S_ISBLK(sb.st_mode)) {
filetype = 1;
if (doPwMount(file, "/tmp/testmnt",
- "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
logMessage("Failed to mount device %s to get description", file);
return -1;
}
@@ -647,9 +647,9 @@ int getFileFromBlockDevice(char *device, char *path, char * dest) {
if (devMakeInode(device, "/tmp/srcdev"))
return 1;
- if ((doPwMount("/tmp/srcdev", "/tmp/mnt", "vfat", 1, 0, NULL, NULL, 0, 0)) &&
- doPwMount("/tmp/srcdev", "/tmp/mnt", "ext2", 1, 0, NULL, NULL, 0, 0) &&
- doPwMount("/tmp/srcdev", "/tmp/mnt", "iso9660", 1, 0, NULL, NULL, 0, 0)) {
+ if ((doPwMount("/tmp/srcdev", "/tmp/mnt", "vfat", 1, 0, NULL, NULL, 0, 0, NULL)) &&
+ doPwMount("/tmp/srcdev", "/tmp/mnt", "ext2", 1, 0, NULL, NULL, 0, 0, NULL) &&
+ doPwMount("/tmp/srcdev", "/tmp/mnt", "iso9660", 1, 0, NULL, NULL, 0, 0, NULL)) {
logMessage("failed to mount /dev/%s: %s", device, strerror(errno));
return 2;
}
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 6288360b8..d90cbec88 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -120,6 +120,7 @@ char * mountNfsImage(struct installMethod * method,
int foundinvalid = 0;
char * buf;
struct in_addr ip;
+ char * nfsMountOpts = NULL;
if (loaderData->noDns && !(inet_aton(host, &ip))) {
newtWinMessage(_("Error"), _("OK"),
@@ -134,6 +135,13 @@ char * mountNfsImage(struct installMethod * method,
fullPath = alloca(strlen(host) + strlen(directory) + 2);
sprintf(fullPath, "%s:%s", host, directory);
+ if (loaderData->nfsmountopts && *loaderData->nfsmountopts) {
+ nfsMountOpts = strdup(loaderData->nfsmountopts);
+ logMessage("mounting nfs path %s with options %s", fullPath, nfsMountOpts);
+ } else {
+ logMessage("mounting nfs path %s", fullPath);
+ }
+
logMessage("mounting nfs path %s", fullPath);
if (FL_TESTING(flags)) {
@@ -144,7 +152,7 @@ char * mountNfsImage(struct installMethod * method,
stage = NFS_STAGE_NFS;
- if (!doPwMount(fullPath, "/mnt/source", "nfs", 1, 0, NULL, NULL, 0, 0)) {
+ if (!doPwMount(fullPath, "/mnt/source", "nfs", 1, 0, NULL, NULL, 0, 0, nfsMountOpts)) {
char mntPath[1024];
logMessage("mounted %s on /mnt/source", fullPath);
@@ -325,7 +333,7 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData,
logMessage("file location: nfs://%s/%s", host, file);
- if (!doPwMount(host, "/tmp/mnt", "nfs", 1, 0, NULL, NULL, 0, 0)) {
+ if (!doPwMount(host, "/tmp/mnt", "nfs", 1, 0, NULL, NULL, 0, 0, NULL)) {
char * buf;
buf = alloca(strlen(file) + 10);
diff --git a/loader2/usb.c b/loader2/usb.c
index d05c96db9..7c91d22e9 100644
--- a/loader2/usb.c
+++ b/loader2/usb.c
@@ -97,7 +97,7 @@ int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
if (FL_TESTING(flags)) return 0;
if (doPwMount("/proc/bus/usb", "/proc/bus/usb", "usbfs", 0, 0,
- NULL, NULL, 0, 0))
+ NULL, NULL, 0, 0, NULL))
logMessage("failed to mount device usbfs: %s", strerror(errno));
/* sleep so we make sure usb devices get properly enumerated.