Ignore:
Timestamp:
May 20, 2007, 10:53:34 PM (13 years ago)
Author:
Bruno Cornec
Message:

Attempt to fix #117 (all paritions are now looked at if no grub or lilo found in MBR)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.4/mondo/src/mondorestore/mondo-rstr-tools.c

    r1406 r1451  
    846846
    847847if (!strcmp(mpt, "/1")) {
    848 strcpy(mountpoint, "/");
    849 log_msg(3, "Mommm! SME is being a dildo!");
     848    strcpy(mountpoint, "/");
     849    log_msg(3, "Mommm! SME is being a dildo!");
    850850} else {
    851 strcpy(mountpoint, mpt);
     851    strcpy(mountpoint, mpt);
    852852}
    853853
    854854if (!strcmp(mountpoint, "lvm")) {
    855 return (0);
     855    return (0);
    856856}
    857857if (!strcmp(mountpoint, "image")) {
    858 return (0);
     858    return (0);
    859859}
    860860sprintf(tmp, "Mounting device %s   ", device);
    861861log_msg(1, tmp);
    862862if (writeable) {
    863 strcpy(additional_parameters, "-o rw");
     863    strcpy(additional_parameters, "-o rw");
    864864} else {
    865 strcpy(additional_parameters, "-o ro");
     865    strcpy(additional_parameters, "-o ro");
    866866}
    867867if (find_home_of_exe("setfattr")) {
    868 strcat(additional_parameters, ",user_xattr");
     868    strcat(additional_parameters, ",user_xattr");
    869869}
    870870if (find_home_of_exe("setfacl")) {
    871 strcat(additional_parameters, ",acl");
     871    strcat(additional_parameters, ",acl");
    872872}
    873873
    874874if (!strcmp(mountpoint, "swap")) {
    875 sprintf(command, "swapon %s", device);
     875    sprintf(command, "swapon %s", device);
    876876} else {
    877877if (!strcmp(mountpoint, "/")) {
     
    888888res = run_program_and_log_output(command, TRUE);
    889889if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {
    890 log_msg(1, "Re-trying without the fancy extra parameters");
    891 sprintf(command, "mount -t %s %s %s 2>> %s", format, device,
     890    log_msg(1, "Re-trying without the fancy extra parameters");
     891    sprintf(command, "mount -t %s %s %s 2>> %s", format, device,
    892892        mountdir, MONDO_LOGFILE);
    893 res = run_program_and_log_output(command, TRUE);
     893    res = run_program_and_log_output(command, TRUE);
    894894}
    895895if (res) {
    896 log_msg(1, "Unable to mount device %s (type %s) at %s", device,
     896    log_msg(1, "Unable to mount device %s (type %s) at %s", device,
    897897        format, mountdir);
    898 log_msg(1, "command was '%s'", command);
    899 if (!strcmp(mountpoint, "swap")) {
    900     log_to_screen(tmp);
    901 } else {
    902     log_msg(2, "Retrying w/o the '-t' switch");
    903     sprintf(command, "mount %s %s 2>> %s", device, mountdir,
     898    log_msg(1, "command was '%s'", command);
     899    if (!strcmp(mountpoint, "swap")) {
     900        log_to_screen(tmp);
     901    } else {
     902        log_msg(2, "Retrying w/o the '-t' switch");
     903        sprintf(command, "mount %s %s 2>> %s", device, mountdir,
    904904            MONDO_LOGFILE);
    905     log_msg(2, "2nd command = '%s'", command);
    906     res = run_program_and_log_output(command, TRUE);
    907     if (res == 0) {
    908         log_msg(1,
     905        log_msg(2, "2nd command = '%s'", command);
     906        res = run_program_and_log_output(command, TRUE);
     907        if (res == 0) {
     908            log_msg(1,
    909909                "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");
    910     } else {
    911         log_to_screen(tmp);
    912     }
    913 }
     910        } else {
     911            log_to_screen(tmp);
     912        }
     913    }
    914914}
    915915if (res && !strcmp(mountpoint, "swap")) {
    916 log_msg(2, "That's ok. It's just a swap partition.");
    917 log_msg(2, "Non-fatal error. Returning 0.");
    918 res = 0;
     916    log_msg(2, "That's ok. It's just a swap partition.");
     917    log_msg(2, "Non-fatal error. Returning 0.");
     918    res = 0;
    919919}
    920920
Note: See TracChangeset for help on using the changeset viewer.