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

154 {
155  char entry[256];
156  int i;
157  int ret;
158 
159  entry[0] = '\0';
160 
161  ret = read_dt_model(entry, sizeof(entry));
162  if (ret)
163  ret = read_cpuinfo(entry, sizeof(entry));
164  if (ret)
165  return "generic";
166 
167  for (i = 0; map_hardware[i].entry; i++)
168  {
169  if (!strncasecmp(map_hardware[i].entry, entry,
170  strlen(map_hardware[i].entry)))
171  {
172  return( map_hardware[i].ret );
173  }
174  }
175 
176  return "generic";
177 }
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().

180 {
181  struct utsname sysinfo;
182  size_t uname_release_len, i;
183 
184  /* Attempt to determine subarch based on kernel release version */
185  uname(&sysinfo);
186  uname_release_len = strlen(sysinfo.release);
187 
188  for (i = 0; supported_generic_subarches[i] != NULL; i++)
189  {
190  size_t subarch_len = strlen (supported_generic_subarches[i]);
191  if (!strncmp(sysinfo.release+uname_release_len-subarch_len,
192  supported_generic_subarches[i],
193  subarch_len))
194  {
195  return supported_generic_subarches[i];
196  }
197  }
198 
199  /* If we get here, try falling back on the normal detection method */
200  return di_system_subarch_analyze();
201 }
const char * di_system_subarch_analyze(void)
Definition: subarch-arm-linux.c:153