summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-04-17 11:57:39 -0400
committerChris Lumens <clumens@redhat.com>2008-04-18 12:07:51 -0400
commit29200e3bb8aaac23ce48eeadc0922efaa40bc9bd (patch)
tree002eb59174b712964d31788ab674eba43b953177 /loader2
parentab70051870121c5f3188642cb62596267e404e6c (diff)
Revert "Don't look for a .discinfo file in rescue mode (jvonau, #442098)."
This reverts commit 4725fff23a35799137ccece6fbb7c518c57ff311.
Diffstat (limited to 'loader2')
-rw-r--r--loader2/cdinstall.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index 2f2e91a8f..1dd28cf3b 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -234,7 +234,7 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
int i, r, rc;
int foundinvalid = 0;
int stage2inram = 0;
- char *buf, *stage2loc, *imageDir;
+ char *buf, *stage2loc, *discinfoloc, *imageDir;
char *stage2img;
struct device ** devices;
char *cddev = NULL;
@@ -248,9 +248,11 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
if (loaderData && FL_STAGE2(flags)) {
stage2loc = strdup(location);
r = asprintf(&imageDir, "%.*s", (int) (strrchr(location, '/') - location), location);
+ r = asprintf(&discinfoloc, "%s/.discinfo", imageDir);
} else {
r = asprintf(&stage2loc, "%s/images/stage2.img", location);
r = asprintf(&imageDir, "%s/images", location);
+ r = asprintf(&discinfoloc, "%s/.discinfo", location);
}
/* JKFIXME: ASSERT -- we have a cdrom device when we get here */
@@ -271,8 +273,9 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
if (!(rc=doPwMount(devices[i]->device, location, "iso9660", "ro"))) {
cddev = devices[i]->device;
- if (!access(stage2loc, R_OK) && (!requirepkgs)){
-
+ if (!access(stage2loc, R_OK) &&
+ (!requirepkgs || !access(discinfoloc, R_OK))) {
+
/* if in rescue mode lets copy stage 2 into RAM so we can */
/* free up the CD drive and user can have it avaiable to */
/* aid system recovery. */
@@ -314,6 +317,7 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
free(stage2loc);
free(imageDir);
+ free(discinfoloc);
if (r == -1)
return NULL;
@@ -357,6 +361,7 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
err:
free(stage2loc);
free(imageDir);
+ free(discinfoloc);
return NULL;
}