Di_system_utils

## Functions

int | di_system_is_efi (void)
void | di_system_init (const char *progname)

## Detailed Description

## Function Documentation

## di_system_init()

void di_system_init | ( | const char * | progname | ) |

Inits the lib. In addition to di_init, this functions sets a syslog log handler.

Parameters

  progname | name of the called binary

{
di_init (_progname);
di_log_set_handler (DI_LOG_LEVEL_MASK, di_log_handler_syslog, NULL);
}
di_log_set_handler
unsigned int di_log_set_handler(di_log_level_flags log_levels, di_log_handler *log_func, void *user_data)
Definition log.c:189
di_log_handler_syslog
di_log_handler di_log_handler_syslog
Definition log.h:104
DI_LOG_LEVEL_MASK
@ DI_LOG_LEVEL_MASK
Definition log.h:45
di_init
void di_init(const char *progname)
Definition utils.c:28

References di_init(), di_log_handler_syslog, DI_LOG_LEVEL_MASK, and di_log_set_handler().

## di_system_is_efi()

int di_system_is_efi | ( | void |  | ) |

Checks if ystem is EFI based.

{
int efivars_access = access("/sys/firmware/efi/efivars", R_OK);
int vars_access = access("/sys/firmware/efi/vars", R_OK);
if (efivars_access == 0 || vars_access == 0)
{
/* Have we been told to ignore EFI in partman-efi? */
int ret = access("/var/lib/partman/ignore_uefi", R_OK);
if (ret == 0)
return 0;
else
return 1;
}
else
return 0;
}

Referenced by di_system_subarch_analyze(), and di_system_subarch_analyze_guess().