check if BIOS is present

This commit is contained in:
AndresSM 2014-03-03 01:02:29 -05:00
parent 57aadf75b6
commit 08fadaaf8c
3 changed files with 29 additions and 0 deletions

View File

@ -353,6 +353,28 @@ static int core_info_firmware_cmp(const void *a_, const void *b_)
return strcasecmp(a->path, b->path);
}
void core_info_list_update_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir)
{
size_t i;
char path[PATH_MAX];
core_info_firmware_t *firmware = NULL;
core_info_t *info = find_core_info(core_info_list, core);
if (!info)
return;
firmware = info->firmware;
for (i = 0; i < info->firmware_count; i++)
{
fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path));
info->firmware[i].missing = !path_file_exists(path);
}
}
void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir,
const core_info_firmware_t **firmware, size_t *num_firmware)

View File

@ -73,6 +73,9 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir,
const core_info_firmware_t **firmware, size_t *num_firmware);
void core_info_list_update_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir);
// Shallow-copies internal state. Data in *info is invalidated when the core_info_list is freed.
bool core_info_list_get_info(core_info_list_t *core_info_list, core_info_t *info, const char *path);

View File

@ -1930,6 +1930,7 @@ void menu_populate_entries(void *data, unsigned menu_type)
if(rgui->core_info_current.data)
{
file_list_clear(rgui->selection_buf);
snprintf(tmp, sizeof(tmp), "Core name: %s", rgui->core_info_current.display_name ? rgui->core_info_current.display_name : "");
file_list_push(rgui->selection_buf, tmp, RGUI_SETTINGS_CORE_INFO_NONE, 0);
@ -1942,6 +1943,9 @@ void menu_populate_entries(void *data, unsigned menu_type)
if(rgui->core_info_current.firmware_count>0)
{
core_info_list_update_missing_firmware(rgui->core_info, rgui->core_info_current.path, g_settings.system_directory);
file_list_push(rgui->selection_buf, "Required firmware:", RGUI_SETTINGS_CORE_INFO_NONE, 0);
for(i=0;i<rgui->core_info_current.firmware_count;i++)
{