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().

173 {
174  char entry[256];
175  int i;
176  int ret;
177 
178  entry[0] = '\0';
179 
180  ret = read_dt_model(entry, sizeof(entry));
181  if (ret)
182  ret = read_cpuinfo(entry, sizeof(entry));
183  if (ret)
184  return "generic";
185 
186  for (i = 0; map_hardware[i].entry; i++)
187  {
188  if (!strncasecmp(map_hardware[i].entry, entry,
189  strlen(map_hardware[i].entry)))
190  {
191  return( map_hardware[i].ret );
192  }
193  }
194 
195  return "generic";
196 }
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().

199 {
200  struct utsname sysinfo;
201  size_t uname_release_len, i;
202 
203  /* Attempt to determine subarch based on kernel release version */
204  uname(&sysinfo);
205  uname_release_len = strlen(sysinfo.release);
206 
207  for (i = 0; supported_generic_subarches[i] != NULL; i++)
208  {
209  size_t subarch_len = strlen (supported_generic_subarches[i]);
210  if (!strncmp(sysinfo.release+uname_release_len-subarch_len,
211  supported_generic_subarches[i],
212  subarch_len))
213  {
214  return supported_generic_subarches[i];
215  }
216  }
217 
218  /* If we get here, try falling back on the normal detection method */
219  return di_system_subarch_analyze();
220 }
const char * di_system_subarch_analyze(void)
Definition: subarch-arm-linux.c:172