diff options
Diffstat (limited to 'mdk-stage1/mount.c')
-rw-r--r-- | mdk-stage1/mount.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c index 171bf30b5..9098456b6 100644 --- a/mdk-stage1/mount.c +++ b/mdk-stage1/mount.c @@ -99,9 +99,9 @@ static int ensure_dev_exists(char *dev) /* mounts, creating the device if needed+possible */ -int my_mount(char *dev, char *location, char *fs) +int my_mount(char *dev, char *location, char *fs, int force_rw) { - unsigned long flags; + unsigned long flags = MS_MGC_VAL | (force_rw ? 0 : MS_RDONLY); char * opts = NULL; struct stat buf; int rc; @@ -135,33 +135,24 @@ int my_mount(char *dev, char *location, char *fs) } } - flags = MS_MGC_VAL; - #ifndef DISABLE_MEDIAS if (!strcmp(fs, "vfat")) { my_insmod("vfat", ANY_DRIVER_TYPE, NULL); opts = "check=relaxed"; } - if (!strcmp(fs, "reiserfs")) { + if (!strcmp(fs, "reiserfs")) my_insmod("reiserfs", ANY_DRIVER_TYPE, NULL); - } - if (!strcmp(fs, "iso9660")) { + if (!strcmp(fs, "iso9660")) my_insmod("isofs", ANY_DRIVER_TYPE, NULL); - flags |= MS_RDONLY; - } #endif #ifndef DISABLE_NETWORK if (!strcmp(fs, "nfs")) { - int flags = 0; - + int flags = MS_RDONLY; my_insmod("nfs", ANY_DRIVER_TYPE, NULL); - flags |= MS_RDONLY; - log_message("preparing nfsmount for %s", dev); - rc = nfsmount_prepare(dev, &flags, &opts); if (rc != 0) return rc; @@ -169,7 +160,6 @@ int my_mount(char *dev, char *location, char *fs) #endif rc = mount(dev, location, fs, flags, opts); - if (rc != 0) { log_perror("mount failed"); rmdir(location); |