summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/mount.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2000-12-16 22:03:06 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2000-12-16 22:03:06 +0000
commit2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915 (patch)
tree9e3e67b830f02fb32f528f391bb72a1deddade6c /mdk-stage1/mount.c
parentc930e6cc7e11b72ab1786f209dffb49a11bea8f7 (diff)
downloaddrakx-2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915.tar
drakx-2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915.tar.gz
drakx-2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915.tar.bz2
drakx-2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915.tar.xz
drakx-2766c6bb69ced7c4f33ec9d8bda56ba5b66e2915.zip
- network/nfs works
Diffstat (limited to 'mdk-stage1/mount.c')
-rw-r--r--mdk-stage1/mount.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c
index 15533e716..ade92adf5 100644
--- a/mdk-stage1/mount.c
+++ b/mdk-stage1/mount.c
@@ -31,6 +31,7 @@
#include "mount.h"
+
#ifndef DISABLE_MEDIAS
/* WARNING: this won't work if the argument is not /dev/ based */
static int ensure_dev_exists(char *dev)
@@ -106,11 +107,12 @@ int my_mount(char *dev, char *location, char *fs)
int rc;
#ifndef DISABLE_MEDIAS
- rc = ensure_dev_exists(dev);
-
- if (rc != 0) {
- log_message("could not create required device file");
- return -1;
+ if (strcmp(fs, "nfs")) {
+ rc = ensure_dev_exists(dev);
+ if (rc != 0) {
+ log_message("could not create required device file");
+ return -1;
+ }
}
#endif
@@ -147,6 +149,23 @@ int my_mount(char *dev, char *location, char *fs)
}
#endif
+#ifndef DISABLE_NETWORK
+ if (!strcmp(fs, "nfs")) {
+ int flags = 0;
+
+ my_insmod("nfs");
+ flags |= MS_RDONLY;
+
+ log_message("preparing nfsmount for %s", dev);
+
+ rc = nfsmount_prepare(dev, &flags, &opts);
+ if (rc != 0) {
+ log_perror(dev);
+ return rc;
+ }
+ }
+#endif
+
rc = mount(dev, location, fs, flags, opts);
if (rc != 0)