diff options
author | Chris Lumens <clumens@redhat.com> | 2009-04-17 15:01:21 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-04-17 16:32:15 -0400 |
commit | 7005258fe0c58c558e50080bd962e5953fdade7b (patch) | |
tree | 2f22361265dd7b5bfb427bc775bf9d8866e3d532 /loader | |
parent | 86fd30b278edd55db53175b8b4f5b25e0610916b (diff) | |
download | anaconda-7005258fe0c58c558e50080bd962e5953fdade7b.tar.gz anaconda-7005258fe0c58c558e50080bd962e5953fdade7b.tar.xz anaconda-7005258fe0c58c558e50080bd962e5953fdade7b.zip |
No longer force ISOs to be on ext2, ext3, or vfat partitions.
This also changes it so the test for testing mode doesn't mean the rest of
the function gets indented.
Diffstat (limited to 'loader')
-rw-r--r-- | loader/hdinstall.c | 111 |
1 files changed, 51 insertions, 60 deletions
diff --git a/loader/hdinstall.c b/loader/hdinstall.c index e27b04a92..46f604e66 100644 --- a/loader/hdinstall.c +++ b/loader/hdinstall.c @@ -58,85 +58,76 @@ extern uint64_t flags; static char * setupIsoImages(char * device, char * dirName, char * location) { int rc = 0; char *url = NULL, *dirspec, *updpath, *path; - char *typetry[] = {"ext3", "ext2", "vfat", NULL}; - char **type; logMessage(INFO, "mounting device %s for hard drive install", device); - if (!FL_TESTING(flags)) { - for (type=typetry; *type; type++) { - if (!doPwMount(device, "/mnt/isodir", *type, "ro", NULL)) - break; - } + if (FL_TESTING(flags)) + return NULL; - if (!type) - return NULL; + if (doPwMount(device, "/mnt/isodir", "auto", "ro", NULL)) + return NULL; - if (asprintf(&dirspec, "/mnt/isodir%.*s", - (int) (strrchr(dirName, '/') - dirName), dirName) == -1) { - logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); - abort(); - } + if (asprintf(&dirspec, "/mnt/isodir%.*s", + (int) (strrchr(dirName, '/') - dirName), dirName) == -1) { + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); + abort(); + } - if (asprintf(&path, "/mnt/isodir%s", dirName) == -1) { - logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); - abort(); - } + if (asprintf(&path, "/mnt/isodir%s", dirName) == -1) { + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); + abort(); + } - if (path) { - logMessage(INFO, "Path to stage2 image is %s", path); + if (path) { + logMessage(INFO, "Path to stage2 image is %s", path); - rc = copyFile(path, "/tmp/install.img"); - rc = mountStage2("/tmp/install.img"); + rc = copyFile(path, "/tmp/install.img"); + rc = mountStage2("/tmp/install.img"); - free(path); + free(path); - if (rc) { - umountLoopback("/mnt/runtime", "/dev/loop0"); - umount("/mnt/isodir"); - goto err; - } + if (rc) { + umountLoopback("/mnt/runtime", "/dev/loop0"); + umount("/mnt/isodir"); + goto err; + } - if (asprintf(&updpath, "%s/updates.img", dirspec) == -1) { - logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); - abort(); - } + if (asprintf(&updpath, "%s/updates.img", dirspec) == -1) { + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); + abort(); + } - logMessage(INFO, "Looking for updates for HD in %s", updpath); - copyUpdatesImg(updpath); - free(updpath); + logMessage(INFO, "Looking for updates for HD in %s", updpath); + copyUpdatesImg(updpath); + free(updpath); - if (asprintf(&updpath, "%s/product.img", dirspec) == -1) { - logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); - abort(); - } + if (asprintf(&updpath, "%s/product.img", dirspec) == -1) { + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); + abort(); + } - logMessage(INFO, "Looking for product for HD in %s", updpath); - copyProductImg(updpath); + logMessage(INFO, "Looking for product for HD in %s", updpath); + copyProductImg(updpath); - free(updpath); - free(dirspec); - umount("/mnt/isodir"); + free(updpath); + free(dirspec); + umount("/mnt/isodir"); - if (asprintf(&url, "hd:%s:/%s", device, - dirName ? dirName : ".") == -1) { - logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); - abort(); - } + if (asprintf(&url, "hd:%s:/%s", device, + dirName ? dirName : ".") == -1) { + logMessage(CRITICAL, "%s: %d: %m", __func__, __LINE__); + abort(); + } - return url; - } else { - free(dirspec); - free(path); + return url; + } else { + free(dirspec); + free(path); - if (rc) { - umount("/mnt/isodir"); - return NULL; - } + if (rc) { + umount("/mnt/isodir"); + return NULL; } - } else { - /* in test mode I dont know what to do - just pretend I guess */ - type = typetry; } err: |