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

164 {
165  char entry[256];
166  int i;
167  int ret;
168 
169  entry[0] = '\0';
170 
171  ret = read_dt_model(entry, sizeof(entry));
172  if (ret)
173  ret = read_cpuinfo(entry, sizeof(entry));
174  if (ret)
175  return "generic";
176 
177  for (i = 0; map_hardware[i].entry; i++)
178  {
179  if (!strncasecmp(map_hardware[i].entry, entry,
180  strlen(map_hardware[i].entry)))
181  {
182  return( map_hardware[i].ret );
183  }
184  }
185 
186  return "generic";
187 }
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().

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