---
loader2/method.c | 110
--------------------------------------------------
loader2/method.h | 3 -
loader2/nfsinstall.c | 20 ++-------
loader2/urlinstall.c | 12 -----
4 files changed, 5 insertions(+), 140 deletions(-)
diff --git a/loader2/method.c b/loader2/method.c
index f1eb55d..66dff42 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -111,67 +111,6 @@ int mountLoopback(char *fsystem, char
*mntpoint, char *device) {
}
/* returns the *absolute* path (malloced) to the #1 iso image */
-char * validIsoImages(char * dirName, int *foundinvalid, int
checkStage2) {
- DIR * dir;
- struct dirent * ent;
- char isoImage[1024];
-
- if (!(dir = opendir(dirName))) {
- newtWinMessage(_("Error"), _("OK"),
- _("Failed to read directory %s: %s"),
- dirName, strerror(errno));
- return 0;
- }
-
- /* Walk through the directories looking for a CD image. */
- errno = 0;
- while ((ent = readdir(dir))) {
- if (*ent->d_name == '/')
- snprintf(isoImage, sizeof(isoImage), "%s%s", dirName,
ent->d_name);
- else
- snprintf(isoImage, sizeof(isoImage), "%s/%s", dirName,
ent->d_name);
-
- if (!fileIsIso(isoImage)) {
- errno = 0;
- continue;
- }
-
- if (mountLoopback(isoImage, "/tmp/loopimage", "/dev/
loop7")) {
- logMessage(WARNING, "failed to mount %s", isoImage);
- errno = 0;
- continue;
- }
-
- if (!checkStage2) {
- umountLoopback("/tmp/loopimage", "/dev/loop7");
- break;
- }
-
- if (mountLoopback("/tmp/loopimage/images/stage2.img", "/mnt/
runtime", "/dev/loop0")) {
- umountLoopback("/mnt/runtime", "/dev/loop0");
- } else {
- if (verifyStamp("/mnt/runtime")) {
- umountLoopback("/mnt/runtime", "/dev/loop0");
- umountLoopback("/tmp/loopimage", "/dev/loop7");
- break;
- }
- logMessage(ERROR, "disc %s is not the right image", isoImage);
- umountLoopback("/mnt/runtime", "/dev/loop0");
- if (foundinvalid) *foundinvalid = 1;
- }
-
- umountLoopback("/tmp/loopimage", "/dev/loop7");
-
- errno = 0;
- }
-
- closedir(dir);
-
- if (!ent) return NULL;
-
- return strdup(isoImage);
-}
-
/* get timestamp and description of ISO image from stamp file */
/* returns 0 on success, -1 otherwise */
int readStampFileFromIso(char *file, char **timestamp, char
**releasedescr) {
@@ -478,50 +417,6 @@ void copyProductImg(char * path) {
}
}
-
-/* verify that the stamp files in / of the initrd and the stage2
match */
-int verifyStamp(char * path) {
- char *stamp1;
- char *stamp2;
- FILE *f;
- int fail = 0;
- int i;
- char * p, *q;
-
- stamp1 = alloca(80);
- stamp2 = alloca(80);
-
- /* grab the one from the initrd */
- f = fopen("/.buildstamp", "r");
- if (!f) {
- fail = 1;
- } else {
- q = fgets(stamp1, 80, f);
- fclose(f);
-
- /* and the runtime */
- i = asprintf(&p, "%s/.buildstamp", path);
- f = fopen(p, "r");
- free(p);
- if (!f) {
- fail = 1;
- } else {
- q = fgets(stamp2, 80, f);
- fclose(f);
-
- if (strcmp(stamp1, stamp2) != 0) {
- fail = 1;
- }
- }
- }
-
- if (fail == 1) {
- return 0;
- } else {
- return 1;
- }
-}
-
/* unmount a second stage, if mounted. Used for CDs and mediacheck
mostly,
so we can eject
CDs. */
void umountStage2(void) {
@@ -539,11 +434,6 @@ int mountStage2(char *stage2path) {
return 1;
}
- if (!verifyStamp("/mnt/runtime")) {
- umountLoopback("/mnt/runtime", "/dev/loop0");
- return -1;
- }
-
return 0;
}
diff --git a/loader2/method.h b/loader2/method.h
index 36f67f3..e1918ae 100644
--- a/loader2/method.h
+++ b/loader2/method.h
@@ -43,12 +43,9 @@ struct installMethod {
int umountLoopback(char * mntpoint, char * device);
int mountLoopback(char * fsystem, char * mntpoint, char * device);
-char * validIsoImages(char * dirName, int *foundinvalid, int
checkStage2);
int readStampFileFromIso(char *file, char **descr, char **timestamp);
void queryIsoMediaCheck(char * isoDir);
-int verifyStamp(char * path);
-
void umountStage2(void);
int mountStage2(char *stage2path);
int copyFileAndLoopbackMount(int fd, char *dest, char *device, char
*mntpoint);
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 4ba3d29..9ee5f09 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -95,7 +95,7 @@ char * mountNfsImage(struct installMethod * method,
enum { NFS_STAGE_NFS, NFS_STAGE_MOUNT, NFS_STAGE_DONE,
NFS_STAGE_UPDATES } stage = NFS_STAGE_NFS;
- int rc, foundinvalid = 0;
+ int rc;
/* JKFIXME: ASSERT -- we have a network device setup when we get
here */
while (stage != NFS_STAGE_DONE) {
@@ -174,12 +174,7 @@ char * mountNfsImage(struct installMethod *
method,
logMessage(INFO, "can access %s", buf);
rc = mountStage2(buf);
- if (rc == -1) {
- foundinvalid = 1;
- logMessage(WARNING, "not the right stage2
image");
- umount("/mnt/stage2");
- free(buf);
- } else if (rc == 0) {
+ if (rc == 0) {
stage = NFS_STAGE_UPDATES;
rc = asprintf(&url, "nfs:%s:%s", host,
directory);
free(buf);
@@ -204,14 +199,9 @@ char * mountNfsImage(struct installMethod *
method,
break;
}
- if (foundinvalid)
- rc = asprintf(&buf, _("The %s installation tree in
that "
- "directory does not seem to match "
- "your boot media."),
getProductName());
- else
- rc = asprintf(&buf, _("That directory does not seem
to "
- "contain a %s installation tree."),
- getProductName());
+ rc = asprintf(&buf, _("That directory does not seem to "
+ "contain a %s installation tree."),
+ getProductName());