diff options
author | jkh <jkh@FreeBSD.org> | 1999-05-15 14:34:22 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1999-05-15 14:34:22 +0000 |
commit | 33daa8b33a51b3df7dd9eb1aed37b9f6717a0cbd (patch) | |
tree | 83a93f830dc3b460a0427a856def20a44eac460b /usr.sbin/sysinstall/cdrom.c | |
parent | f1c57e949bd50b178bb720ba816780275cda469e (diff) | |
download | FreeBSD-src-33daa8b33a51b3df7dd9eb1aed37b9f6717a0cbd.zip FreeBSD-src-33daa8b33a51b3df7dd9eb1aed37b9f6717a0cbd.tar.gz |
o Prevent alpha installs from grabbing x86 bits and vice-versa, at least
on CDs and FTP sites.
o Collapse some redundant code.
o Fix typo'd menu.
o Restrict searches properly to packages rather than categories.
o Small tweaks to signal handling.
All RELENG_3 candidates.
Diffstat (limited to 'usr.sbin/sysinstall/cdrom.c')
-rw-r--r-- | usr.sbin/sysinstall/cdrom.c | 65 |
1 files changed, 43 insertions, 22 deletions
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c index 0115202..decf297 100644 --- a/usr.sbin/sysinstall/cdrom.c +++ b/usr.sbin/sysinstall/cdrom.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: cdrom.c,v 1.44 1998/12/22 12:31:24 jkh Exp $ + * $Id: cdrom.c,v 1.45 1999/01/20 12:31:42 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -112,36 +112,57 @@ mediaInitCDROM(Device *dev) } } - if (readInfo && - (!(cd_attr = read_props(string_concat(mountpoint, "/cdrom.inf"))) || - !(cp = property_find(cd_attr, "CD_VERSION")) || (strcmp(cp, variable_get(VAR_RELNAME)) && strcmp("none", variable_get(VAR_RELNAME))))) { - if (!cp) { + if (readInfo) { + if (!(cd_attr = read_props(string_concat(mountpoint, "/cdrom.inf"))) + || !(cp = property_find(cd_attr, "CD_VERSION"))) { msgConfirm("Unable to find a %s/cdrom.inf file.\n" "Either this is not a FreeBSD CDROM, there is a problem with\n" "the CDROM driver or something is wrong with your hardware.\n" "Please fix this problem (check the console logs on VTY2) and\n" "try again.", mountpoint); } - else if (!bogusCDOK) { - msgConfirm("Warning: The version of the FreeBSD CD currently in the drive\n" - "(%s) does not match the version of the boot floppy\n" - "(%s).\n\n" - "If this is intentional, to avoid this message in the future\n" - "please visit the Options editor to set the boot floppy version\n" - "string to match that of the CD before selecting it as your\n" - "installation media.", cp, variable_get(VAR_RELNAME)); - - if (msgYesNo("Would you like to try and use this CDROM anyway?") != 0) { - unmount(mountpoint, MNT_FORCE); - cdromMounted = FALSE; - properties_free(cd_attr); - return FALSE; + else { + if (variable_cmp(VAR_RELNAME, cp) + && variable_cmp(VAR_RELNAME, "none") + && variable_cmp(VAR_RELNAME, "any") && !bogusCDOK) { + msgConfirm("Warning: The version of the FreeBSD CD currently in the drive\n" + "(%s) does not match the version of the boot floppy\n" + "(%s).\n\n" + "If this is intentional, to avoid this message in the future\n" + "please visit the Options editor to set the boot floppy version\n" + "string to match that of the CD before selecting it as your\n" + "installation media.", cp, variable_get(VAR_RELNAME)); + + if (msgYesNo("Would you like to try and use this CDROM anyway?") != 0) { + unmount(mountpoint, MNT_FORCE); + cdromMounted = FALSE; + properties_free(cd_attr); + return FALSE; + } + else + bogusCDOK = TRUE; + } + if ((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) { +#ifdef __alpha__ + if (strcmp(cp, "alpha")) { +#else + if (strcmp(cp, "x86")) { +#endif + msgConfirm("Fatal: The FreeBSD install CD currently in the drive\n" + "is for the %s architecture, not the machine you're using.\n\n" + + "Please use the correct installation CD for your machine type.", cp); + + unmount(mountpoint, MNT_FORCE); + cdromMounted = FALSE; + properties_free(cd_attr); + return FALSE; + } } - else - bogusCDOK = TRUE; } } - properties_free(cd_attr); + if (cd_attr) + properties_free(cd_attr); return TRUE; } |