summaryrefslogtreecommitdiffstats
path: root/loader2/hdinstall.c
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-04-02 17:45:50 +0000
committerMike Fulbright <msf@redhat.com>2003-04-02 17:45:50 +0000
commit430c43f8c05aef451ea26c419fbf0eb134c1dc6e (patch)
tree1bca68926855dd847682df6c4ae98e3ff2208fe2 /loader2/hdinstall.c
parent6e6748628b4d236deb27d20f6ed41f5f980ab96f (diff)
downloadanaconda-430c43f8c05aef451ea26c419fbf0eb134c1dc6e.tar.gz
anaconda-430c43f8c05aef451ea26c419fbf0eb134c1dc6e.tar.xz
anaconda-430c43f8c05aef451ea26c419fbf0eb134c1dc6e.zip
check stamp for hd installs
Diffstat (limited to 'loader2/hdinstall.c')
-rw-r--r--loader2/hdinstall.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index cefbe2368..fc05f21ba 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -213,7 +213,8 @@ static int loadHDImages(char * prefix, char * dir, int flags,
/* mount loopback second stage image for hard drive install */
static int mountHDImages(char * prefix, char * dir, int flags,
- char * device, char * mntpoint) {
+ char * device, char * mntpoint,
+ int checkstamp) {
int idx, rc;
char * path, *target;
char *stg2list[] = {"stage2.img", "hdstg2.img", NULL};
@@ -246,6 +247,21 @@ static int mountHDImages(char * prefix, char * dir, int flags,
return rc;
}
+ /* now verify the stamp... */
+ if (checkstamp && !verifyStamp(mntpoint)) {
+ char * buf;
+
+ buf = sdupprintf(_("The %s installation tree in that directory does "
+ "not seem to match your boot media."),
+ getProductName());
+
+ newtWinMessage(_("Error"), _("OK"), buf);
+
+ umountLoopback(mntpoint, device);
+ return 1;
+ }
+
+
/* handle updates.img now before we copy stage2 over... this allows
* us to keep our ramdisk size as small as possible */
sprintf(path, "%s/%s/RedHat/base/updates.img", prefix, dir ? dir : "");
@@ -301,7 +317,7 @@ static char * setupIsoImages(char * device, char * dirName, int flags) {
/* holding the ISOs, which used to cause trouble during */
/* partitioning, but parted fixes all this now. */
rc = mountHDImages("/tmp/loopimage", "/", flags, "loop1",
- "/mnt/runtime");
+ "/mnt/runtime", 1);
#else
/* This code is for copying small stage2 into ram */
/* and mounting */