Changeset 2982 in MondoRescue for branches/3.0/mondo/src/mondoarchive


Ignore:
Timestamp:
Mar 30, 2012, 2:43:01 AM (13 years ago)
Author:
Bruno Cornec
Message:

r4605@localhost: bruno | 2012-03-29 15:44:39 +0200

  • change create_raidtab_from_mdstat and parse_mdstat to have an additional parameter being the location of the /proc/mdstat file
  • adds a mkraidtab CLI parameter to test raidtab generation, allowed by the previous feature
  • cleanup libmondo-raid.c parse_mdstat function with correct indentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondoarchive/mondoarchive.c

    r2687 r2982  
    169169    int res, retval;
    170170    char *say_at_end = NULL;
     171    FILE *fin = NULL;
    171172
    172173/* Make sure I'm root; abort if not */
     
    275276        setup_newt_stuff();
    276277        finish(set_acl_list(argv[2], argv[3]));
     278    }
     279    if (argc >= 2 && !strcmp(argv[1], "mkraidtab")) {
     280        g_loglevel = 10;
     281        g_text_mode = TRUE;
     282        setup_newt_stuff();
     283#undef MDSTAT_FILE
     284#define MDSTAT_FILE "/tmp/mdstat"
     285        if (!(fin = fopen(MDSTAT_FILE, "r"))) {
     286            log_msg(1, "Could not open %s.\n", MDSTAT_FILE);
     287                finish(1);
     288        }
     289
     290        create_raidtab_from_mdstat(MDSTAT_FILE,"/tmp/raidtab");
     291        finish(0);
    277292    }
    278293
Note: See TracChangeset for help on using the changeset viewer.