[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] 477328 - use mount -t auto



Instead of using doMultiMount, pass the filesystem type of "auto" to
doPwMount.  The downside of doing this is that we no longer enforce
driver disks and update disks being of a specific type - they could be
on any crazy thing recognized by mount now.  But, do we care?

This also removes all callers of doMultiMount.  I can remove it now,
unless anyone thinks it's worth keeping around.

- Chris


diff --git a/loader/driverdisk.c b/loader/driverdisk.c
index 33f42bf..9e7a30d 100644
--- a/loader/driverdisk.c
+++ b/loader/driverdisk.c
@@ -58,8 +58,6 @@ extern uint64_t flags;
 static char * driverDiskFiles[] = { "modinfo", "modules.dep", 
                                     "modules.cgz", "modules.alias", NULL };
 
-char *ddFsTypes[] = {"vfat", "ext2", "iso9660", NULL};
-
 static int verifyDriverDisk(char *mntpt) {
     char ** fnPtr;
     char file[200];
@@ -303,7 +301,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
             }
 
             logMessage(INFO, "trying to mount %s as partition", part);
-            if (doMultiMount(part, "/tmp/dpart", ddFsTypes, "ro", NULL)) {
+            if (doPwMount(part, "/tmp/dpart", "auto", "ro", NULL)) {
                 newtWinMessage(_("Error"), _("OK"),
                                _("Failed to mount partition."));
                 stage = DEV_PART;
@@ -369,7 +367,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
             dir = 1;
 
             logMessage(INFO, "trying to mount %s", device);
-            if (doMultiMount(device, "/tmp/drivers", ddFsTypes, "ro", NULL)) {
+            if (doPwMount(device, "/tmp/drivers", "auto", "ro", NULL)) {
                 newtWinMessage(_("Error"), _("OK"),
                                _("Failed to mount driver disk."));
                 stage = DEV_INSERT;
@@ -621,7 +619,7 @@ static void getDDFromDev(struct loaderData_s * loaderData, char * dev,
             logMessage(ERROR, "unable to mount %s as %s", dev, fs);
             return;
         }
-    } else if (doMultiMount(dev, "/tmp/drivers", ddFsTypes, "ro", NULL)) {
+    } else if (doPwMount(dev, "/tmp/drivers", "auto", "ro", NULL)) {
         logMessage(ERROR, "unable to mount driver disk %s", dev);
         return;
     }
diff --git a/loader/loader.c b/loader/loader.c
index ec54d6f..2317891 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -513,7 +513,7 @@ void loadUpdates(struct loaderData_s *loaderData) {
         case UPD_LOAD:
             logMessage(INFO, "UPDATES device is %s", part);
 
-            if (doMultiMount(part, "/tmp/update-disk", ddFsTypes, "ro", NULL)) {
+            if (doPwMount(part, "/tmp/update-disk", "auto", "ro", NULL)) {
                 newtWinMessage(_("Error"), _("OK"),
                                _("Failed to mount updates disk"));
                 stage = UPD_PROMPT;
diff --git a/loader/method.c b/loader/method.c
index b72b12e..d1ce276 100644
--- a/loader/method.c
+++ b/loader/method.c
@@ -76,7 +76,6 @@ int umountLoopback(char * mntpoint, char * device) {
 }
 
 int mountLoopback(char *fsystem, char *mntpoint, char *device) {
-    char *fstypes[] = {"iso9660", "ext2", "squashfs", "cramfs", "vfat", NULL};
     char *opts, *err = NULL;
 
     if (device == NULL) {
@@ -94,7 +93,7 @@ int mountLoopback(char *fsystem, char *mntpoint, char *device) {
         abort();
     }
 
-    if (doMultiMount(fsystem, mntpoint, fstypes, opts, &err)) {
+    if (doPwMount(fsystem, mntpoint, "auto", opts, &err)) {
         logMessage(ERROR, "failed to mount loopback device %s on %s as %s: %s",
                    device, mntpoint, fsystem, err);
         return LOADER_ERROR;
@@ -469,11 +468,10 @@ int copyFileAndLoopbackMount(int fd, char * dest, char * device, char * mntpoint
 int getFileFromBlockDevice(char *device, char *path, char * dest) {
     int rc;
     char file[4096];
-    char *fstypes[] = {"vfat", "ext2", "iso9660", NULL};
 
     logMessage(INFO, "getFileFromBlockDevice(%s, %s)", device, path);
 
-    if (doMultiMount(device, "/tmp/mnt", fstypes, "ro", NULL)) {
+    if (doPwMount(device, "/tmp/mnt", "auto", "ro", NULL)) {
         logMessage(ERROR, "failed to mount /dev/%s: %m", device);
         return 2;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]