libdebian-installer
Functions
Di_system_subarch

Functions

const char * di_system_subarch_analyze (void)
 
const char * di_system_subarch_analyze_guess (void)
 

Detailed Description

Function Documentation

const char* di_system_subarch_analyze ( void  )

Returns a string describing the current subarchitecture, e.g. "powermac_newworld".

References di_system_is_efi().

Referenced by di_system_subarch_analyze_guess().

163 {
164  char entry[256];
165  int i;
166  int ret;
167 
168  entry[0] = '\0';
169 
170  ret = read_dt_model(entry, sizeof(entry));
171  if (ret)
172  ret = read_cpuinfo(entry, sizeof(entry));
173  if (ret)
174  return "generic";
175 
176  for (i = 0; map_hardware[i].entry; i++)
177  {
178  if (!strncasecmp(map_hardware[i].entry, entry,
179  strlen(map_hardware[i].entry)))
180  {
181  return( map_hardware[i].ret );
182  }
183  }
184 
185  return "generic";
186 }
const char* di_system_subarch_analyze_guess ( void  )

Return a string with a best-guess of the current subarchitecture

Only present on armel currently, and is a stub on all other architectures

References di_system_subarch_analyze().

189 {
190  struct utsname sysinfo;
191  size_t uname_release_len, i;
192 
193  /* Attempt to determine subarch based on kernel release version */
194  uname(&sysinfo);
195  uname_release_len = strlen(sysinfo.release);
196 
197  for (i = 0; supported_generic_subarches[i] != NULL; i++)
198  {
199  size_t subarch_len = strlen (supported_generic_subarches[i]);
200  if (!strncmp(sysinfo.release+uname_release_len-subarch_len,
201  supported_generic_subarches[i],
202  subarch_len))
203  {
204  return supported_generic_subarches[i];
205  }
206  }
207 
208  /* If we get here, try falling back on the normal detection method */
209  return di_system_subarch_analyze();
210 }
const char * di_system_subarch_analyze(void)
Definition: subarch-arm-linux.c:162