Comment 1 for bug 2036980

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Yes, please file it upstream:

```
#if (defined(__i386__) || defined(__x86_64__)) && defined(__linux__)
# define USE_DMI
#endif

#define APPLE_DMI "Apple Computer, Inc."
#define APPLE_DMI_2 "Apple Inc."
static int is_apple = 0;

static char *
dmi_system_manufacturer (void)
{
#ifdef USE_DMI
  FILE *dmidecode;
  char *manufacturer = NULL;
  size_t manufacturer_len = 0;

  dmidecode = popen ("dmidecode -s system-manufacturer 2>/dev/null", "r");
  if (getline (&manufacturer, &manufacturer_len, dmidecode) < 0) {
    /* ignore; will return NULL */
  }
  pclose (dmidecode);
  if (manufacturer) {
    char *newline = strchr (manufacturer, '\n');
    if (newline)
      *newline = '\0';
  }
  return manufacturer;
#else /* !USE_DMI */
  return NULL;
#endif /* USE_DMI */
}

```

As indeed this should be improved / ported to do arm64 too. To have arm64 ifdef, and depend on dmidecode on arm too.