+static int match_arch(const char *name)
+{
+ static prom_handle root;
+ static char model[256], *p;
+
+ if (!root) {
+ if (!(root = prom_finddevice("/")))
+ return 0;
+ }
+
+ if (!model[0]) {
+ if (!prom_getprop(root, "compatible", model, sizeof(model)))
+ return 0;
+ }
+
+ for (p = model; *p; p += strlen(p) + 1) {
+ if (!strcasecmp(p, name))
+ return 1;
+ }
+
+ return 0;
+}
+
+static void check_for_obsolete(const char *label)
+{
+ struct IMAGES *p;
+ char *cur_label;
+
+ /* Make sure our current entry isn't obsolete (ignored) */
+ for (p = images; p; p = p->next) {
+ if (curr_table == p->table && p->obsolete)
+ return;
+ }
+
+ for (p = images; p; p = p->next) {
+ if (curr_table == p->table)
+ continue;
+
+ cur_label = cfg_get_strg_i (p->table, "label");
+ if (!cur_label)
+ cur_label = cfg_get_strg_i (p->table, "image");
+
+ if (!cur_label)
+ continue;
+
+ if (!strcasecmp(cur_label, label))
+ p->obsolete = 1;
+ }
+}
+