+int
+image_check(int imagefd, const char *mtd)
+{
+ int fd, systype;
+ size_t count;
+ char *c;
+ FILE *f;
+
+ systype = SYSTYPE_UNKNOWN;
+ f = fopen("/proc/cpuinfo", "r");
+ while (!feof(f) && (fgets(buf, BUFSIZE - 1, f) != NULL)) {
+ if ((strncmp(buf, "system type", 11) == 0) && (c = strchr(buf, ':'))) {
+ c += 2;
+ if (strncmp(c, "Broadcom BCM947XX", 17) == 0)
+ systype = SYSTYPE_BROADCOM;
+ }
+ }
+ fclose(f);
+
+ switch(systype) {
+ case SYSTYPE_BROADCOM:
+ return image_check_bcom(imagefd, mtd);
+ default:
+ return 1;
+ }
+}
+