FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 04-13-2011, 03:48 PM
Chris Lumens
 
Default Move most anaconda mount points to be under /mnt/install.

/mnt/sysimage stays where it is because that's fairly widely established and
known outside anaconda, whereas all these other mount points are private
anaconda knowledge. /mnt/source is somewhat widely used, but I have cautioned
people about getting used to that.
---
loader/cdinstall.c | 30 +++++++++---------
loader/driverdisk.c | 54 +++++++++++++++++-----------------
loader/hdinstall.c | 38 ++++++++++++------------
loader/loader.c | 6 ++--
loader/method.c | 38 ++++++++++++------------
loader/nfsinstall.c | 44 ++++++++++++++--------------
loader/urlinstall.c | 16 +++++-----
pyanaconda/image.py | 24 ++++++++--------
pyanaconda/storage/__init__.py | 4 +-
pyanaconda/yuminstall.py | 10 +++---
tests/pyanaconda_test/image_test.py | 18 ++++++------
11 files changed, 141 insertions(+), 141 deletions(-)

diff --git a/loader/cdinstall.c b/loader/cdinstall.c
index e1e5fe7..b0f8ffb 100644
--- a/loader/cdinstall.c
+++ b/loader/cdinstall.c
@@ -217,18 +217,18 @@ void queryCDMediaCheck(char *instRepo) {
* media. Now we need to unmount it to perform the check, then
* remount to pretend nothing ever happened.
*/
- umount("/mnt/source");
+ umount("/mnt/install/source");
mediaCheckCdrom(device);

do {
- if (doPwMount(device, "/mnt/source", "iso9660", "ro", NULL)) {
+ if (doPwMount(device, "/mnt/install/source", "iso9660", "ro", NULL)) {
ejectCdrom(device);
wrongCDMessage();
continue;
}

- if (access("/mnt/source/.discinfo", R_OK)) {
- umount("/mnt/source");
+ if (access("/mnt/install/source/.discinfo", R_OK)) {
+ umount("/mnt/install/source");
ejectCdrom(device);
wrongCDMessage();
continue;
@@ -266,7 +266,7 @@ int findInstallCD(struct loaderData_s *loaderData) {
devices[i]->device = tmp;
}

- logMessage(INFO, "trying to mount CD device %s on /mnt/source",
+ logMessage(INFO, "trying to mount CD device %s on /mnt/install/source",
devices[i]->device);

if (!FL_CMDLINE(flags))
@@ -302,16 +302,16 @@ int findInstallCD(struct loaderData_s *loaderData) {
if (!FL_CMDLINE(flags))
newtPopWindow();

- if ((rc = doPwMount(devices[i]->device, "/mnt/source", "iso9660", "ro", NULL)) == 0) {
- if (!access("/mnt/source/.treeinfo", R_OK) && !access("/mnt/source/.discinfo", R_OK)) {
+ if ((rc = doPwMount(devices[i]->device, "/mnt/install/source", "iso9660", "ro", NULL)) == 0) {
+ if (!access("/mnt/install/source/.treeinfo", R_OK) && !access("/mnt/install/source/.discinfo", R_OK)) {
loaderData->method = METHOD_CDROM;
- checked_asprintf(&loaderData->instRepo, "cdrom://%s:/mnt/source", devices[i]->device);
+ checked_asprintf(&loaderData->instRepo, "cdrom://%s:/mnt/install/source", devices[i]->device);
return LOADER_OK;
} else {
/* This wasn't the CD we were looking for. Clean up and
* try the next drive.
*/
- umount("/mnt/source");
+ umount("/mnt/install/source");
}
}
}
@@ -360,16 +360,16 @@ int loadCdromImages(struct loaderData_s *loaderData) {
tmp = loaderData->instRepo+8;
checked_asprintf(&device, "%.*s", (int) (strchr(tmp, ':')-tmp), tmp);

- if (doPwMount(device, "/mnt/source", "auto", "ro", NULL))
+ if (doPwMount(device, "/mnt/install/source", "auto", "ro", NULL))
return 0;

- logMessage(INFO, "Looking for updates in /mnt/source/images/updates.img");
- copyUpdatesImg("/mnt/source/images/updates.img");
+ logMessage(INFO, "Looking for updates in /mnt/install/source/images/updates.img");
+ copyUpdatesImg("/mnt/install/source/images/updates.img");

- logMessage(INFO, "Looking for product in /mnt/source/images/product.img");
- copyProductImg("/mnt/source/images/product.img");
+ logMessage(INFO, "Looking for product in /mnt/install/source/images/product.img");
+ copyProductImg("/mnt/install/source/images/product.img");

- umount("/mnt/source");
+ umount("/mnt/install/source");
return 1;
}

diff --git a/loader/driverdisk.c b/loader/driverdisk.c
index 506ac32..f6af331 100644
--- a/loader/driverdisk.c
+++ b/loader/driverdisk.c
@@ -443,7 +443,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
break;
}
/* make sure nothing is mounted when we get here */
- num = umount("/tmp/dpart");
+ num = umount("/mnt/install/dpart");
if (num == -1) {
logMessage(ERROR, "error unmounting: %m");
if ((errno != EINVAL) && (errno != ENOENT))
@@ -451,7 +451,7 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
}

logMessage(INFO, "trying to mount %s as partition", part);
- if (doPwMount(part, "/tmp/dpart", "auto", "ro", NULL)) {
+ if (doPwMount(part, "/mnt/install/dpart", "auto", "ro", NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount partition."));
stage = DEV_PART;
@@ -461,9 +461,9 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
ddfile = newt_select_file(_("Select driver disk image"),
_("Select the file which is your driver "
"disk image."),
- "/tmp/dpart", NULL);
+ "/mnt/install/dpart", NULL);
if (ddfile == NULL) {
- umount("/tmp/dpart");
+ umount("/mnt/install/dpart");
stage = DEV_PART;
dir = -1;
break;
@@ -480,13 +480,13 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
break;
}
if (dir == -1) {
- umount("/tmp/drivers");
- unlink("/tmp/drivers");
+ umount("/mnt/install/drivers");
+ unlink("/mnt/install/drivers");
ddfile = NULL;
stage = DEV_CHOOSEFILE;
break;
}
- if (doPwMount(ddfile, "/tmp/drivers", "auto", "ro", NULL)) {
+ if (doPwMount(ddfile, "/mnt/install/drivers", "auto", "ro", NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to load driver disk from file."));
stage = DEV_CHOOSEFILE;
@@ -514,19 +514,19 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
dir = 1;

logMessage(INFO, "trying to mount %s", device);
- if (doPwMount(device, "/tmp/drivers", "auto", "ro", NULL)) {
+ if (doPwMount(device, "/mnt/install/drivers", "auto", "ro", NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount driver disk."));
stage = DEV_INSERT;
break;
}

- rc = verifyDriverDisk("/tmp/drivers");
+ rc = verifyDriverDisk("/mnt/install/drivers");
if (rc == LOADER_BACK) {
newtWinMessage(_("Error"), _("OK"),
_("Driver disk is invalid for this "
"release of %s."), getProductName());
- umount("/tmp/drivers");
+ umount("/mnt/install/drivers");
stage = DEV_INSERT;
break;
}
@@ -544,8 +544,8 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
if (devices)
for(; devices[before]; before++);

- rc = loadDriverDisk(loaderData, "/tmp/drivers");
- umount("/tmp/drivers");
+ rc = loadDriverDisk(loaderData, "/mnt/install/drivers");
+ umount("/mnt/install/drivers");
if (rc == LOADER_BACK) {
dir = -1;
if (ddfile != NULL)
@@ -558,9 +558,9 @@ int loadDriverFromMedia(int class, struct loaderData_s *loaderData,
stage = DEV_PROBE;

if (ddfile != NULL) {
- umount("/tmp/drivers");
- unlink("/tmp/drivers");
- umount("/tmp/dpart");
+ umount("/mnt/install/drivers");
+ unlink("/mnt/install/drivers");
+ umount("/mnt/install/dpart");
}
}

@@ -700,24 +700,24 @@ void getDDFromSource(struct loaderData_s * loaderData, char * src, GTree *module
return;
}

- if (!doPwMount(path, "/tmp/drivers", "auto", "ro", NULL)) {
- loadFromLocation(loaderData, "/tmp/drivers", moduleState);
- umount("/tmp/drivers");
- unlink("/tmp/drivers");
+ if (!doPwMount(path, "/mnt/install/drivers", "auto", "ro", NULL)) {
+ loadFromLocation(loaderData, "/mnt/install/drivers", moduleState);
+ umount("/mnt/install/drivers");
+ unlink("/mnt/install/drivers");
if (unlinkf) unlink(path);
}

}

void getDDFromDev(struct loaderData_s * loaderData, char * dev, GTree* moduleState) {
- if (doPwMount(dev, "/tmp/drivers", "auto", "ro", NULL)) {
+ if (doPwMount(dev, "/mnt/install/drivers", "auto", "ro", NULL)) {
logMessage(ERROR, "unable to mount driver disk %s", dev);
return;
}

- loadFromLocation(loaderData, "/tmp/drivers", moduleState);
- umount("/tmp/drivers");
- unlink("/tmp/drivers");
+ loadFromLocation(loaderData, "/mnt/install/drivers", moduleState);
+ umount("/mnt/install/drivers");
+ unlink("/mnt/install/drivers");
}


@@ -771,12 +771,12 @@ int loadDriverDiskFromPartition(struct loaderData_s *loaderData, char* device)
int rc;

logMessage(INFO, "trying to mount %s", device);
- if (doPwMount(device, "/tmp/drivers", "auto", "ro", NULL)) {
+ if (doPwMount(device, "/mnt/install/drivers", "auto", "ro", NULL)) {
logMessage(ERROR, "Failed to mount driver disk.");
return -1;
}

- rc = verifyDriverDisk("/tmp/drivers");
+ rc = verifyDriverDisk("/mnt/install/drivers");
if (rc == LOADER_BACK) {
logMessage(ERROR, "Driver disk is invalid for this "
"release of %s.", getProductName());
@@ -784,8 +784,8 @@ int loadDriverDiskFromPartition(struct loaderData_s *loaderData, char* device)
return -2;
}

- rc = loadDriverDisk(loaderData, "/tmp/drivers");
- umount("/tmp/drivers");
+ rc = loadDriverDisk(loaderData, "/mnt/install/drivers");
+ umount("/mnt/install/drivers");
if (rc == LOADER_BACK) {
return -3;
}
diff --git a/loader/hdinstall.c b/loader/hdinstall.c
index ce70fc8..b336690 100644
--- a/loader/hdinstall.c
+++ b/loader/hdinstall.c
@@ -106,13 +106,13 @@ int loadHdImages(struct loaderData_s *loaderData) {

parseDeviceAndDir(loaderData->instRepo, &device, &dir);

- if (doPwMount(device, "/mnt/isodir", "auto", "ro", NULL))
+ if (doPwMount(device, "/mnt/install/isodir", "auto", "ro", NULL))
return 0;

if (dir[0] == '/') {
- checked_asprintf(&path, "/mnt/isodir%s/updates.img", dir);
+ checked_asprintf(&path, "/mnt/install/isodir%s/updates.img", dir);
} else {
- checked_asprintf(&path, "/mnt/isodir/%s/updates.img", dir);
+ checked_asprintf(&path, "/mnt/install/isodir/%s/updates.img", dir);
}

logMessage(INFO, "Looking for updates for HD in %s", path);
@@ -120,9 +120,9 @@ int loadHdImages(struct loaderData_s *loaderData) {
free(path);

if (dir[0] == '/') {
- checked_asprintf(&path, "/mnt/isodir%s/product.img", dir);
+ checked_asprintf(&path, "/mnt/install/isodir%s/product.img", dir);
} else {
- checked_asprintf(&path, "/mnt/isodir/%s/product.img", dir);
+ checked_asprintf(&path, "/mnt/install/isodir/%s/product.img", dir);
}

logMessage(INFO, "Looking for product for HD in %s", path);
@@ -131,7 +131,7 @@ int loadHdImages(struct loaderData_s *loaderData) {
free(device);
free(dir);
free(path);
- umount("/mnt/isodir");
+ umount("/mnt/install/isodir");

return 1;
}
@@ -266,22 +266,22 @@ int promptForHardDrive(struct loaderData_s *loaderData) {
logMessage(INFO, "partition %s selected", selpart);

/* Now verify the ISO images pointed to contain an installation source. */
- if (doPwMount(selpart, "/mnt/isodir", "auto", "ro", NULL)) {
+ if (doPwMount(selpart, "/mnt/install/isodir", "auto", "ro", NULL)) {
logMessage(ERROR, "couldn't mount %s to verify images", selpart);
continue;
}

if (dir[0] == '/') {
- checked_asprintf(&buf, "/mnt/isodir%s", dir);
+ checked_asprintf(&buf, "/mnt/install/isodir%s", dir);
} else {
- checked_asprintf(&buf, "/mnt/isodir/%s", dir);
+ checked_asprintf(&buf, "/mnt/install/isodir/%s", dir);
}

files = get_file_list(buf, ends_with_iso);
if (!files) {
newtWinMessage(_("Error"), _("OK"),
_("That directory does not contain an installable tree."));
- umount("/mnt/isodir");
+ umount("/mnt/install/isodir");
free(buf);
continue;
}
@@ -290,31 +290,31 @@ int promptForHardDrive(struct loaderData_s *loaderData) {

/* mount the first image and check for a .treeinfo file */
if (dir[0] == '/') {
- checked_asprintf(&buf, "/mnt/isodir%s/%s", dir, files[0]);
+ checked_asprintf(&buf, "/mnt/install/isodir%s/%s", dir, files[0]);
} else {
- checked_asprintf(&buf, "/mnt/isodir/%s/%s", dir, files[0]);
+ checked_asprintf(&buf, "/mnt/install/isodir/%s/%s", dir, files[0]);
}

- if (doPwMount(buf, "/tmp/testmnt", "auto", "ro", NULL)) {
+ if (doPwMount(buf, "/mnt/install/testmnt", "auto", "ro", NULL)) {
free(buf);
newtWinMessage(_("Error"), _("OK"),
_("That directory does not contain an installable tree."));
- umount("/mnt/isodir");
+ umount("/mnt/install/isodir");
continue;
}

free(buf);

- if (access("/tmp/testmnt/.treeinfo", R_OK)) {
+ if (access("/mnt/install/testmnt/.treeinfo", R_OK)) {
newtWinMessage(_("Error"), _("OK"),
_("That directory does not contain an installable tree."));
- umount("/tmp/testmnt");
- umount("/mnt/isodir");
+ umount("/mnt/install/testmnt");
+ umount("/mnt/install/isodir");
continue;
}

- umount("/tmp/testmnt");
- umount("/mnt/isodir");
+ umount("/mnt/install/testmnt");
+ umount("/mnt/install/isodir");
break;
}

diff --git a/loader/loader.c b/loader/loader.c
index 992e023..6b450d7 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -478,7 +478,7 @@ void loadUpdates(struct loaderData_s *loaderData) {
case UPD_LOAD:
logMessage(INFO, "UPDATES device is %s", part);

- if (doPwMount(part, "/tmp/update-disk", "auto", "ro", NULL)) {
+ if (doPwMount(part, "/mnt/install/update-disk", "auto", "ro", NULL)) {
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount updates disk"));
stage = UPD_PROMPT;
@@ -486,14 +486,14 @@ void loadUpdates(struct loaderData_s *loaderData) {
} else {
/* Copy everything to /tmp/updates so we can unmount the disk */
winStatus(40, 3, _("Updates"), _("Reading anaconda updates"));
- if (!copyDirectory("/tmp/update-disk", "/tmp/updates", copyWarnFn,
+ if (!copyDirectory("/mnt/install/update-disk", "/tmp/updates", copyWarnFn,
copyErrorFn)) {
dir = 1;
stage = UPD_DONE;
}

newtPopWindow();
- umount("/tmp/update-disk");
+ umount("/mnt/install/update-disk");
}

case UPD_DONE:
diff --git a/loader/method.c b/loader/method.c
index 35dbf69..2fb9de5 100644
--- a/loader/method.c
+++ b/loader/method.c
@@ -72,13 +72,13 @@ int readStampFileFromIso(char *file, char **timestamp, char **releasedescr) {

lstat(file, &sb);
if (S_ISBLK(sb.st_mode)) {
- if (doPwMount(file, "/tmp/testmnt", "iso9660", "ro", NULL)) {
+ if (doPwMount(file, "/mnt/install/testmnt", "iso9660", "ro", NULL)) {
logMessage(ERROR, "Failed to mount device %s to get description",
file);
return -1;
}
} else if (S_ISREG(sb.st_mode)) {
- if (doPwMount(file, "/tmp/testmnt", "auto", "ro", NULL)) {
+ if (doPwMount(file, "/mnt/install/testmnt", "auto", "ro", NULL)) {
logMessage(ERROR, "Failed to mount iso %s to get description",
file);
return -1;
@@ -89,8 +89,8 @@ int readStampFileFromIso(char *file, char **timestamp, char **releasedescr) {
return -1;
}

- if (!(dir = opendir("/tmp/testmnt"))) {
- umount("/tmp/testmnt");
+ if (!(dir = opendir("/mnt/install/testmnt"))) {
+ umount("/mnt/install/testmnt");
return -1;
}

@@ -107,7 +107,7 @@ int readStampFileFromIso(char *file, char **timestamp, char **releasedescr) {
descr = NULL;
tstamp = NULL;
if (stampfile) {
- snprintf(tmpstr, sizeof(tmpstr), "/tmp/testmnt/%s", stampfile);
+ snprintf(tmpstr, sizeof(tmpstr), "/mnt/install/testmnt/%s", stampfile);
f = fopen(tmpstr, "r");
if (f) {
char *tmpptr;
@@ -131,7 +131,7 @@ int readStampFileFromIso(char *file, char **timestamp, char **releasedescr) {

free(stampfile);

- umount("/tmp/testmnt");
+ umount("/mnt/install/testmnt");

if (descr != NULL && tstamp != NULL) {
descr[strlen(descr)-1] = '';
@@ -268,11 +268,11 @@ static void copyErrorFn (char *msg) {

void copyUpdatesImg(char * path) {
if (!access(path, R_OK)) {
- if (!doPwMount(path, "/tmp/update-disk", "auto", "ro", NULL)) {
- copyDirectory("/tmp/update-disk", "/tmp/updates", copyWarnFn,
+ if (!doPwMount(path, "/mnt/install/update-disk", "auto", "ro", NULL)) {
+ copyDirectory("/mnt/install/update-disk", "/tmp/updates", copyWarnFn,
copyErrorFn);
- umount("/tmp/update-disk");
- unlink("/tmp/update-disk");
+ umount("/mnt/install/update-disk");
+ unlink("/mnt/install/update-disk");
} else {
unpack_archive_file(path, "/tmp/updates");
}
@@ -281,11 +281,11 @@ void copyUpdatesImg(char * path) {

void copyProductImg(char * path) {
if (!access(path, R_OK)) {
- if (!doPwMount(path, "/tmp/product-disk", "auto", "ro", NULL)) {
- copyDirectory("/tmp/product-disk", "/tmp/product", copyWarnFn,
+ if (!doPwMount(path, "/mnt/install/product-disk", "auto", "ro", NULL)) {
+ copyDirectory("/mnt/install/product-disk", "/tmp/product", copyWarnFn,
copyErrorFn);
- umount("/tmp/product-disk");
- unlink("/tmp/product-disk");
+ umount("/mnt/install/product-disk");
+ unlink("/mnt/install/product-disk");
}
}
}
@@ -304,11 +304,11 @@ int getFileFromBlockDevice(char *device, char *path, char * dest) {

/* some USB thumb drives and hard drives are slow to initialize */
/* retry up to 5 times or 31 seconds */
- rc = doPwMount(device, "/tmp/mnt", "auto", "ro", NULL);
+ rc = doPwMount(device, "/mnt/install/testmnt", "auto", "ro", NULL);
for (i = 0; mountMightSucceedLater(rc) && i < 5; ++i) {
logMessage(INFO, "sleeping to wait for USB storage devices");
sleep(1 << i);
- rc = doPwMount(device, "/tmp/mnt", "auto", "ro", NULL);
+ rc = doPwMount(device, "/mnt/install/testmnt", "auto", "ro", NULL);
logMessage(ERROR, "error code: %d", rc);
}
if (rc) {
@@ -316,7 +316,7 @@ int getFileFromBlockDevice(char *device, char *path, char * dest) {
return 2;
}

- snprintf(file, sizeof(file), "/tmp/mnt/%s", path);
+ snprintf(file, sizeof(file), "/mnt/install/testmnt/%s", path);
logMessage(INFO, "Searching for file on path %s", file);

if (access(file, R_OK)) {
@@ -327,7 +327,7 @@ int getFileFromBlockDevice(char *device, char *path, char * dest) {
logMessage(INFO, "file copied to %s", dest);
}

- umount("/tmp/mnt");
- unlink("/tmp/mnt");
+ umount("/mnt/install/testmnt");
+ unlink("/mnt/install/testmnt");
return rc;
}
diff --git a/loader/nfsinstall.c b/loader/nfsinstall.c
index a9584ab..ffaa51b 100644
--- a/loader/nfsinstall.c
+++ b/loader/nfsinstall.c
@@ -184,25 +184,25 @@ static unsigned int isNfsIso(struct loaderData_s *loaderData) {
parseNfsHostPathOpts(loaderData->instRepo, &host, &path, &opts);
checked_asprintf(&url, "%s:%s", host, path);

- if (doPwMount(url, "/mnt/isodir", "nfs", opts, NULL)) {
+ if (doPwMount(url, "/mnt/install/isodir", "nfs", opts, NULL)) {
logMessage(ERROR, "couldn't mount %s to look for NFSISO", url);
goto cleanup1;
}

- files = get_file_list("/mnt/isodir", ends_with_iso);
+ files = get_file_list("/mnt/install/isodir", ends_with_iso);
if (!files) {
- logMessage(ERROR, "no ISO images present in /mnt/isodir");
+ logMessage(ERROR, "no ISO images present in /mnt/install/isodir");
goto cleanup2;
}

/* mount the first image and check for a .treeinfo file */
- checked_asprintf(&buf, "/mnt/isodir/%s", files[0]);
- if (doPwMount(buf, "/tmp/testmnt", "auto", "ro", NULL)) {
+ checked_asprintf(&buf, "/mnt/install/isodir/%s", files[0]);
+ if (doPwMount(buf, "/mnt/install/testmnt", "auto", "ro", NULL)) {
logMessage(ERROR, "ISO image %s does not contain a .treeinfo file", files[0]);
goto cleanup3;
}

- if (access("/tmp/testmnt/.treeinfo", R_OK)) {
+ if (access("/mnt/install/testmnt/.treeinfo", R_OK)) {
logMessage(ERROR, ".treeinfo file is not accessible");
goto cleanup4;
}
@@ -217,11 +217,11 @@ static unsigned int isNfsIso(struct loaderData_s *loaderData) {
}

cleanup4:
- umount("/tmp/testmnt");
+ umount("/mnt/install/testmnt");
cleanup3:
free(buf);
cleanup2:
- umount("/mnt/isodir");
+ umount("/mnt/install/isodir");
cleanup1:
g_free(host);
g_free(path);
@@ -280,11 +280,11 @@ int loadNfsImages(struct loaderData_s *loaderData) {
checked_asprintf(&url, "%s:%s/RHupdates", host, path);
logMessage(INFO, "Looking for updates in %s", url);

- if (!doPwMount(url, "/tmp/update-disk", "nfs", opts, NULL)) {
+ if (!doPwMount(url, "/mnt/install/update-disk", "nfs", opts, NULL)) {
logMessage(INFO, "Using RHupdates/ for NFS install");
- copyDirectory("/tmp/update-disk", "/tmp/updates", NULL, NULL);
- umount("/tmp/update-disk");
- unlink("/tmp/update-disk");
+ copyDirectory("/mnt/install/update-disk", "/tmp/updates", NULL, NULL);
+ umount("/mnt/install/update-disk");
+ unlink("/mnt/install/update-disk");
} else {
logMessage(INFO, "No RHupdates/ directory found, skipping");
}
@@ -292,17 +292,17 @@ int loadNfsImages(struct loaderData_s *loaderData) {
free(url);
checked_asprintf(&url, "%s:%s", host, path);

- if (!doPwMount(url, "/tmp/disk-image", "nfs", opts, NULL)) {
+ if (!doPwMount(url, "/mnt/install/disk-image", "nfs", opts, NULL)) {
free(url);

logMessage(INFO, "Looking for updates in %s/updates.img", loaderData->instRepo);
- copyUpdatesImg("/tmp/disk-image/updates.img");
+ copyUpdatesImg("/mnt/install/disk-image/updates.img");

logMessage(INFO, "Looking for product in %s/product.img", loaderData->instRepo);
- copyProductImg("/tmp/disk-image/product.img");
+ copyProductImg("/mnt/install/disk-image/product.img");

- umount("/tmp/disk-image");
- unlink("/tmp/disk-image");
+ umount("/mnt/install/disk-image");
+ unlink("/mnt/install/disk-image");
} else {
logMessage(INFO, "Couldn't mount %s for updates and product", loaderData->instRepo);
free(url);
@@ -435,10 +435,10 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {

logMessage(INFO, "file location: nfs:%s/%s", host, file);

- if (!doPwMount(host, "/tmp/mnt", "nfs", opts, NULL)) {
+ if (!doPwMount(host, "/mnt/install/testmnt", "nfs", opts, NULL)) {
char * buf;

- checked_asprintf(&buf, "/tmp/mnt/%s", file);
+ checked_asprintf(&buf, "/mnt/install/testmnt/%s", file);

if (copyFile(buf, dest)) {
logMessage(ERROR, "failed to copy file to %s", dest);
@@ -456,10 +456,10 @@ int getFileFromNfs(char * url, char * dest, struct loaderData_s * loaderData) {
g_free(opts);
if (ip) free(ip);

- if (umount("/tmp/mnt") == -1)
- logMessage(ERROR, "could not unmount /tmp/mnt in getFileFromNfs: %s", strerror(errno));
+ if (umount("/mnt/install/testmnt") == -1)
+ logMessage(ERROR, "could not unmount /mnt/install/testmnt in getFileFromNfs: %s", strerror(errno));
else
- unlink("/tmp/mnt");
+ unlink("/mnt/install/testmnt");

return failed;
}
diff --git a/loader/urlinstall.c b/loader/urlinstall.c
index 23fe7b3..f3713d0 100644
--- a/loader/urlinstall.c
+++ b/loader/urlinstall.c
@@ -171,12 +171,12 @@ int loadUrlImages(struct loaderData_s *loaderData) {

checked_asprintf(&url, "%s/images/%s", loaderData->instRepo, "updates.img");

- if (!loadSingleUrlImage(loaderData, url, "/tmp/updates-disk.img", "/tmp/update-disk", 1)) {
- copyDirectory("/tmp/update-disk", "/tmp/updates", copyWarnFn,
+ if (!loadSingleUrlImage(loaderData, url, "/tmp/updates-disk.img", "/mnt/install/update-disk", 1)) {
+ copyDirectory("/mnt/install/update-disk", "/tmp/updates", copyWarnFn,
copyErrorFn);
- umount("/tmp/update-disk");
+ umount("/mnt/install/update-disk");
unlink("/tmp/updates-disk.img");
- unlink("/tmp/update-disk");
+ unlink("/mnt/install/update-disk");
} else if (!access("/tmp/updates-disk.img", R_OK)) {
unpack_archive_file("/tmp/updates-disk.img", "/tmp/updates");
unlink("/tmp/updates-disk.img");
@@ -186,12 +186,12 @@ int loadUrlImages(struct loaderData_s *loaderData) {

checked_asprintf(&url, "%s/images/%s", loaderData->instRepo, "product.img");

- if (!loadSingleUrlImage(loaderData, url, "/tmp/product-disk.img", "/tmp/product-disk", 1)) {
- copyDirectory("/tmp/product-disk", "/tmp/product", copyWarnFn,
+ if (!loadSingleUrlImage(loaderData, url, "/tmp/product-disk.img", "/mnt/install/product-disk", 1)) {
+ copyDirectory("/mnt/install/product-disk", "/tmp/product", copyWarnFn,
copyErrorFn);
- umount("/tmp/product-disk");
+ umount("/mnt/install/product-disk");
unlink("/tmp/product-disk.img");
- unlink("/tmp/product-disk");
+ unlink("/mnt/install/product-disk");
}

free(url);
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index a17ac2d..180ac7f 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -40,18 +40,18 @@ def findFirstIsoImage(path, messageWindow):
if not isys.isIsoImage(what):
continue

- log.debug("mounting %s on /mnt/cdimage", what)
+ log.debug("mounting %s on /mnt/install/cdimage", what)
try:
- isys.mount(what, "/mnt/cdimage", fstype="iso9660", readOnly=True)
+ isys.mount(what, "/mnt/install/cdimage", fstype="iso9660", readOnly=True)
except SystemError:
continue

- if not os.access("/mnt/cdimage/.discinfo", os.R_OK):
- isys.umount("/mnt/cdimage", removeDir=False)
+ if not os.access("/mnt/install/cdimage/.discinfo", os.R_OK):
+ isys.umount("/mnt/install/cdimage", removeDir=False)
continue

log.debug("Reading .discinfo")
- f = open("/mnt/cdimage/.discinfo")
+ f = open("/mnt/install/cdimage/.discinfo")
f.readline() # skip timestamp
f.readline() # skip release description
discArch = f.readline().strip() # read architecture
@@ -59,14 +59,14 @@ def findFirstIsoImage(path, messageWindow):

log.debug("discArch = %s" % discArch)
if discArch != arch:
- isys.umount("/mnt/cdimage", removeDir=False)
+ isys.umount("/mnt/install/cdimage", removeDir=False)
continue

# If there's no repodata, there's no point in trying to
# install from it.
- if not os.access("/mnt/cdimage/repodata", os.R_OK):
+ if not os.access("/mnt/install/cdimage/repodata", os.R_OK):
log.warning("%s doesn't have repodata, skipping" %(what,))
- isys.umount("/mnt/cdimage", removeDir=False)
+ isys.umount("/mnt/install/cdimage", removeDir=False)
continue

# warn user if images appears to be wrong size
@@ -86,7 +86,7 @@ def findFirstIsoImage(path, messageWindow):
sys.exit(0)

log.info("Found disc at %s" % f)
- isys.umount("/mnt/cdimage", removeDir=False)
+ isys.umount("/mnt/install/cdimage", removeDir=False)
return f

return None
@@ -102,7 +102,7 @@ def getMediaId(path):
return None

# This mounts the directory containing the iso images, and places the
-# mount point in /mnt/isodir.
+# mount point in /mnt/install/isodir.
def mountDirectory(methodstr, messageWindow):
if methodstr.startswith("hd:"):
method = methodstr[3:]
@@ -124,12 +124,12 @@ def mountDirectory(methodstr, messageWindow):
return

# No need to mount it again.
- if os.path.ismount("/mnt/isodir"):
+ if os.path.ismount("/mnt/install/isodir"):
return

while True:
try:
- isys.mount(device, "/mnt/isodir", fstype=fstype, options=options)
+ isys.mount(device, "/mnt/install/isodir", fstype=fstype, options=options)
break
except SystemError as msg:
log.error("couldn't mount ISO source directory: %s" % msg)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 889c3a1..b0411a9 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1470,8 +1470,8 @@ def mountExistingSystem(anaconda, rootEnt,
else:
readOnly = ""

- if rootDevice.protected and os.path.ismount("/mnt/isodir"):
- isys.mount("/mnt/isodir",
+ if rootDevice.protected and os.path.ismount("/mnt/install/isodir"):
+ isys.mount("/mnt/install/isodir",
rootPath,
fstype=rootDevice.format.type,
bindMount=True)
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index fc3c3dc..1dac081 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -316,7 +316,7 @@ class AnacondaYum(yum.YumBase):

# Where is the source media mounted? This is the directory
# where Packages/ is located.
- self.tree = "/mnt/source"
+ self.tree = "/mnt/install/source"

if hasattr(self, "use_txmbr_in_callback"):
log.debug("enabling new callback mode")
@@ -445,15 +445,15 @@ class AnacondaYum(yum.YumBase):
else:
(device, fstype, path) = m[3:].split(":")

- self.isodir = "/mnt/isodir/%s" % path
+ self.isodir = "/mnt/install/isodir/%s" % path

- # This takes care of mounting /mnt/isodir first.
+ # This takes care of mounting /mnt/install/isodir first.
self._mountInstallImage()
self.mediagrabber = self.mediaHandler
elif m.startswith("nfsiso:"):
- self.isodir = "/mnt/isodir"
+ self.isodir = "/mnt/install/isodir"

- # Calling _mountInstallImage takes care of mounting /mnt/isodir first.
+ # Calling _mountInstallImage takes care of mounting /mnt/install/isodir first.
if not network.hasActiveNetDev():
if not self.anaconda.intf.enableNetwork():
self._baseRepoURL = None
diff --git a/tests/pyanaconda_test/image_test.py b/tests/pyanaconda_test/image_test.py
index d6c95e1..f3faeac 100644
--- a/tests/pyanaconda_test/image_test.py
+++ b/tests/pyanaconda_test/image_test.py
@@ -21,7 +21,7 @@ class ImageTest(mock.TestCase):
DISCINFO2 += "i386
"
DISCINFO2 += "1,2
"

- self.fs.open('/mnt/cdimage/.discinfo', 'w').write(DISCINFO)
+ self.fs.open('/mnt/install/cdimage/.discinfo', 'w').write(DISCINFO)
self.fs.open('/tmp/.discinfo', 'w').write(DISCINFO2)

import pyanaconda.image
@@ -43,7 +43,7 @@ class ImageTest(mock.TestCase):

def get_media_id_1_test(self):
import pyanaconda.image
- ret = pyanaconda.image.getMediaId('/mnt/cdimage')
+ ret = pyanaconda.image.getMediaId('/mnt/install/cdimage')
self.assertEqual(ret, '1273712438.740122')

def get_media_id_2_test(self):
@@ -57,14 +57,14 @@ class ImageTest(mock.TestCase):
pyanaconda.image.os.path.ismount = mock.Mock(return_value=False)
pyanaconda.image.mountDirectory('hd:/dev/sda1:/', mock.Mock())
self.assertEqual(pyanaconda.image.isys.method_call s,
- [('mount', ('/dev/sda1', '/mnt/isodir'), {'fstype': 'auto', 'options':'})])
+ [('mount', ('/dev/sda1', '/mnt/install/isodir'), {'fstype': 'auto', 'options':'})])

def mount_directory_2_test(self):
import pyanaconda.image
pyanaconda.image.os.path.ismount = mock.Mock(return_value=False)
pyanaconda.image.mountDirectory('hd:sda1:/', mock.Mock())
self.assertEqual(pyanaconda.image.isys.method_call s,
- [('mount', ('/dev/sda1', '/mnt/isodir'), {'fstype': 'auto', 'options':'})])
+ [('mount', ('/dev/sda1', '/mnt/install/isodir'), {'fstype': 'auto', 'options':'})])

def mount_directory_3_test(self):
import pyanaconda.image
@@ -74,19 +74,19 @@ class ImageTest(mock.TestCase):

def mount_image_1_test(self):
import pyanaconda.image
- self.assertRaises(SystemError, pyanaconda.image.mountImage, ', '/mnt/cdimage', mock.Mock())
+ self.assertRaises(SystemError, pyanaconda.image.mountImage, ', '/mnt/install/cdimage', mock.Mock())

def mount_image_2_test(self):
import pyanaconda.image
pyanaconda.image.os.path.ismount = mock.Mock(return_value=False)
- ret = pyanaconda.image.mountImage(', '/mnt/cdimage', mock.Mock())
+ ret = pyanaconda.image.mountImage(', '/mnt/install/cdimage', mock.Mock())

self.assertEqual(pyanaconda.image.isys.method_call s,
[('isIsoImage', ('/Fedora-13-i386-DVD.iso',), {}),
- ('mount', ('/Fedora-13-i386-DVD.iso', '/mnt/cdimage'),
+ ('mount', ('/Fedora-13-i386-DVD.iso', '/mnt/install/cdimage'),
{'readOnly': True, 'fstype': 'iso9660'}),
- ('umount', ('/mnt/cdimage',), {'removeDir': False}),
- ('mount', ('/Fedora-13-i386-DVD.iso', '/mnt/cdimage'),
+ ('umount', ('/mnt/install/cdimage',), {'removeDir': False}),
+ ('mount', ('/Fedora-13-i386-DVD.iso', '/mnt/install/cdimage'),
{'readOnly': True, 'fstype': 'iso9660'}),
])

--
1.7.4.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 04:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org