Changeset 3665 in MondoRescue for branches


Ignore:
Timestamp:
Jun 6, 2017, 8:20:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

Fix a bug when burning directly media to take back boot params (the recent changes in boot options management was only done for ISO images, not for physical media burnt).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/common/libmondo-tools.c

    r3654 r3665  
    314314}
    315315
     316/*  compute the final options for bootable media, considering the comand and the boot type */
     317char *mr_compute_uefi_string(char *isofs_cmd) {
     318
     319    char *uefistr = NULL;
     320    char *mondo_mkisofs_sz = NULL;
     321
     322    /*  real media */
     323    if (strstr(isofs_cmd,"growisofs")) {
     324        mr_asprintf(mondo_mkisofs_sz, MONDO_GROWISOFS_REGULAR_SYSLINUX);
     325    } else {
     326        /*  iso image */
     327        if (bkpinfo->boot_type == UEFI) {
     328            if (strstr(isofs_cmd,"xorriso")) {
     329                /*  xorriso needs another '-' before efi-boot */
     330                mr_asprintf(uefistr, "%s -%s", MONDO_UEFI_PREFIX, MONDO_MKISOFS_UEFI);
     331            } else {
     332                mr_asprintf(uefistr, "%s %s", MONDO_UEFI_PREFIX, MONDO_MKISOFS_UEFI);
     333            }
     334        } else {
     335            mr_asprintf(uefistr, "%s",MONDO_MKISOFS_CMS);
     336        }
     337        mr_asprintf(mondo_mkisofs_sz, "%s%s%s ", isofs_cmd, MONDO_MKISOFS_REGULAR_SYSLINUX, uefistr);
     338    }
     339
     340    return(mondo_mkisofs_sz);
     341}
     342
    316343/**
    317344 * Finish configuring the backup information structure. Call this function
     
    359386    char *iso_tmp = NULL;
    360387    char *iso_dir = NULL;
    361     char *uefistr = NULL;
    362388
    363389    assert(bkpinfo != NULL);
     
    439465#endif
    440466        else {
    441             mr_asprintf(mondo_mkisofs_sz, MONDO_GROWISOFS_REGULAR_SYSLINUX);
     467            mondo_mkisofs_sz = mr_compute_uefi_string(cdr_exe);
    442468        }
    443469        if (bkpinfo->manual_cd_tray) {
     
    507533#endif
    508534        else {
    509             if (bkpinfo->boot_type == UEFI) {
    510                 if (strstr(isofs_cmd,"xorriso")) {
    511                     /*  xorriso needs another '-' before efi-boot */
    512                     mr_asprintf(uefistr, "%s -%s", MONDO_UEFI_PREFIX, MONDO_MKISOFS_UEFI);
    513                 } else {
    514                     mr_asprintf(uefistr, "%s %s", MONDO_UEFI_PREFIX, MONDO_MKISOFS_UEFI);
    515                 }
    516             } else {
    517                 mr_asprintf(uefistr, "%s",MONDO_MKISOFS_CMS);
    518             }
    519 
    520             mr_asprintf(mondo_mkisofs_sz, "%s%s%s ", isofs_cmd, MONDO_MKISOFS_REGULAR_SYSLINUX,uefistr);
     535                mondo_mkisofs_sz = mr_compute_uefi_string(isofs_cmd);
    521536        }
    522537        mr_free(isofs_cmd);
Note: See TracChangeset for help on using the changeset viewer.