Changeset 1966 in MondoRescue for branches/2.2.6/mondo/src/mondorestore/mondorestore.c
- Timestamp:
- May 29, 2008, 10:38:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.6/mondo/src/mondorestore/mondorestore.c
r1947 r1966 3121 3121 } 3122 3122 3123 if (argc == 3 && strcmp(argv[1], "-p") == 0) {3124 strcpy(bkpinfo->prefix,argv[2]);3125 log_msg(1,"Prefix forced to %s",bkpinfo->prefix);3126 }3127 3128 if (argc == 3 && strcmp(argv[1], "-K") == 0) {3129 g_loglevel = atoi(argv[2]);3130 log_msg(1,"Loglevel forced to %d",g_loglevel);3131 }3132 3133 3123 if (argc == 2 && strcmp(argv[1], "--live-grub") == 0) { 3134 3124 retval = run_grub(FALSE, "/dev/hda"); … … 3142 3132 pause_and_ask_for_cdr(5, NULL); 3143 3133 paranoid_MR_finish(0); 3144 } else if (!bkpinfo->disaster_recovery) { // live! 3145 if (argc != 1) { 3146 popup_and_OK 3147 ("Live mode doesn't support command-line parameters yet."); 3148 paranoid_MR_finish(1); 3149 // return(1); 3150 } 3134 } 3135 if ((argc == 2 && strcmp(argv[1], "--partition-only") == 0) && (bkpinfo->disaster_recovery)) { 3136 log_msg(0, "Partitioning only."); 3137 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3138 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3139 load_mountlist(mountlist, g_mountlist_fname); 3140 res = partition_everything(mountlist); 3141 finish(res); 3142 } 3143 3144 if ((argc == 2 && strcmp(argv[1], "--format-only") == 0) && (bkpinfo->disaster_recovery)) { 3145 log_msg(0, "Formatting only."); 3146 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3147 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3148 load_mountlist(mountlist, g_mountlist_fname); 3149 res = format_everything(mountlist, FALSE, raidlist); 3150 finish(res); 3151 } 3152 3153 if ((argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) && (bkpinfo->disaster_recovery)) { 3154 log_msg(0, "Stopping LVM and RAID"); 3155 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME); 3156 strcpy(g_mountlist_fname, "/tmp/mountlist.txt"); 3157 load_mountlist(mountlist, g_mountlist_fname); 3158 res = do_my_funky_lvm_stuff(TRUE, FALSE); 3159 res += stop_all_raid_devices(mountlist); 3160 finish(res); 3161 } 3162 3163 if ((argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) && (!bkpinfo->disaster_recovery)) { 3164 g_restoring_live_from_cd = TRUE; 3165 } 3166 3167 // Handle params here first 3168 handle_incoming_parameters(argc,argv); 3169 3170 if (!bkpinfo->disaster_recovery) { // live! 3151 3171 log_msg(1, "I am in normal, live mode."); 3152 3172 log_msg(2, "FYI, MOUNTLIST_FNAME = %s", g_mountlist_fname); 3153 3173 mount_boot_if_necessary(); /* for Gentoo users */ 3154 3174 log_msg(2, "Still here."); 3155 if (argc > 1 && strcmp(argv[argc - 1], "--live-from-cd") == 0) {3156 g_restoring_live_from_cd = TRUE;3157 }3158 3175 if (bkpinfo->backup_media_type == nfs) { 3159 3176 g_restoring_live_from_nfs = TRUE; … … 3162 3179 retval = 3163 3180 restore_live_from_monitas_server(argv[2], 3164 3181 argv[3], argv[4]); 3165 3182 } else { 3166 3183 log_msg(2, "Calling restore_to_live_filesystem()"); … … 3178 3195 log_msg(1, "I must be in disaster recovery mode."); 3179 3196 log_msg(2, "FYI, MOUNTLIST_FNAME = %s ", g_mountlist_fname); 3180 if (argc == 3 && strcmp(argv[1], "--monitas-memorex") == 0) {3181 log_to_screen("Uh, that hasn't been implemented yet.");3182 paranoid_MR_finish(1);3183 }3184 3197 3185 3198 iamhere("About to call load_mountlist and load_raidtab"); … … 3191 3204 ("Returned from calling load_mountlist and load_raidtab successfully"); 3192 3205 3206 // BCO:To be reviewed 3193 3207 if (argc > 1 3194 3208 && (strcmp(argv[1], "--compare") == 0 … … 3205 3219 } 3206 3220 3207 3208 3221 if (retval) { 3209 3222 log_to_screen … … 3211 3224 } 3212 3225 3213 3214 3226 log_msg(1, "Send in the clowns."); 3215 3227 3216 if (argc == 2 && strcmp(argv[1], "--partition-only") == 0) {3217 log_msg(0, "Partitioning only.");3218 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3219 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3220 load_mountlist(mountlist, g_mountlist_fname);3221 res = partition_everything(mountlist);3222 finish(res);3223 }3224 3225 if (argc == 2 && strcmp(argv[1], "--format-only") == 0) {3226 log_msg(0, "Formatting only.");3227 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3228 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3229 load_mountlist(mountlist, g_mountlist_fname);3230 res = format_everything(mountlist, FALSE, raidlist);3231 finish(res);3232 }3233 3234 if (argc == 2 && strcmp(argv[1], "--stop-lvm-and-raid") == 0) {3235 log_msg(0, "Stopping LVM and RAID");3236 load_raidtab_into_raidlist(raidlist, RAIDTAB_FNAME);3237 strcpy(g_mountlist_fname, "/tmp/mountlist.txt");3238 load_mountlist(mountlist, g_mountlist_fname);3239 res = do_my_funky_lvm_stuff(TRUE, FALSE);3240 res += stop_all_raid_devices(mountlist);3241 finish(res);3242 }3243 3228 3244 3229 if (argc == 2 && strcmp(argv[1], "--nuke") == 0) {
Note:
See TracChangeset
for help on using the changeset viewer.