Changeset 3375


Ignore:
Timestamp:
Apr 27, 2015, 4:25:30 PM (5 years ago)
Author:
Bruno Cornec
Message:
  • Create a new mr_boot_type function and boot_type mondo struct entry to manage BIOS/EFI/UEFI types
Location:
branches/3.2/mondo/src/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mondo/src/common/libmondo-devices.c

    r3374 r3375  
    21042104
    21052105
     2106/**
     2107 * Return the type of boot of the system (UEFI, EFI or BIOS)
     2108 */
     2109t_boot mr_boot_type() {
     2110
     2111    t_boot ret = BIOS;
     2112    FILE *fd = NULL;
     2113
     2114#ifdef __IA64__
     2115    ret = EFI;
     2116#endif
     2117    /* Try to detect whether we are in fact in UEFI mode */
     2118    /* TODO: find the right trigger */
     2119    fd = fopen("/sys/module/efi", "r");
     2120    if (fd != NULL) {
     2121        ret = UEFI;
     2122    }
     2123    return(ret);
     2124}
    21062125
    21072126
     
    26422661        }
    26432662        bkpinfo->boot_loader = i;
     2663        bkpinfo->boot_type = mr_boot_type();
     2664        /* TODO: Chcek consisytency of boot type and boot loader */
    26442665
    26452666        if (bkpinfo->include_paths) {
  • branches/3.2/mondo/src/common/libmondo-tools.c

    r3373 r3375  
    830830    bkpinfo->use_obdr = FALSE;
    831831    bkpinfo->restore_mode = interactive;
     832    bkpinfo->boot_type = BIOS;
    832833}
    833834
  • branches/3.2/mondo/src/common/mondostructures.h

    r3373 r3375  
    181181    udev                        ///< Back up to another unsupported device; just send a stream of bytes.
    182182} t_bkptype;
     183
     184/**
     185 * A type of boot
     186 */
     187typedef enum {
     188    BIOS,                       /// System uses Legacy Boot mode (aka BIOS)
     189    EFI,                        /// System uses EFI Boot mode
     190    UEFI,                       /// System uses UEFI Boot mode
     191} t_boot;
    183192
    184193/**
     
    639648   */
    640649    t_restore_mode restore_mode;
     650
     651  /**
     652   * The type of boot of our ssytem
     653   */
     654    t_boot boot_type;
     655
    641656};
    642657
Note: See TracChangeset for help on using the changeset viewer.