Changeset 1216 in MondoRescue
- Timestamp:
- Feb 27, 2007, 7:56:09 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1213 r1216 5 5 6 6 #include <pthread.h> 7 #include <unistd.h> 7 8 #include "my-stuff.h" 8 9 #include "mr_mem.h" … … 13 14 #include "libmondo.h" 14 15 #include "mr-externs.h" 15 //#include "mondo-restore.h"16 //#include "mondo-rstr-compare-EXT.h"17 16 #include "mondo-rstr-tools.h" 18 17 … … 40 39 41 40 extern t_bkptype g_backup_media_type; 41 extern char *g_backup_media_string; 42 42 43 43 extern int g_partition_table_locked_up; … … 59 59 mr_free(g_filelist_full); 60 60 mr_free(g_filelist_imagedevs); 61 // mr_free (g_imagedevs_pot );62 61 mr_free(g_imagedevs_restthese); 63 62 mr_free(g_mondo_cfg_file); … … 66 65 mr_free(g_isodir_device); 67 66 mr_free(g_isodir_format); 68 69 } 70 67 } 71 68 72 69 … … 80 77 void ask_about_these_imagedevs(char *infname, char *outfname) 81 78 { 82 FILE *fin ;83 FILE *fout ;79 FILE *fin = NULL; 80 FILE *fout = NULL; 84 81 /************************************************************************ 85 82 * allocate memory regions. test and set -sab 16 feb 2003 * 86 83 ************************************************************************/ 87 char *incoming_ptr; 88 char *question_ptr; 89 90 char incoming[MAX_STR_LEN] = "\0"; 91 char question[MAX_STR_LEN]; 84 char *incoming = NULL; 85 char *question = NULL; 86 87 size_t n = 0; 92 88 93 89 assert_string_is_neither_NULL_nor_zerolength(infname); 94 90 assert_string_is_neither_NULL_nor_zerolength(outfname); 95 91 96 incoming_ptr = mr_malloc(sizeof(incoming));97 question_ptr = mr_malloc(sizeof(question));98 99 memset(incoming_ptr, '\0', sizeof(incoming));100 memset(question_ptr, '\0', sizeof(question));101 102 103 104 92 if (!(fin = fopen(infname, "r"))) { 105 93 fatal_error("Cannot openin infname"); … … 108 96 fatal_error("Cannot openin outfname"); 109 97 } 110 for ( fgets(incoming_ptr, MAX_STR_LEN, fin);111 !feof(fin); fgets(incoming_ptr, MAX_STR_LEN, fin)) {112 mr_strip_spaces(incoming _ptr);98 for (mr_getline(&incoming, &n, fin); 99 !feof(fin); mr_getline(&incoming, &n, fin)) { 100 mr_strip_spaces(incoming); 113 101 114 102 if (incoming[0] == '\0') { … … 116 104 } 117 105 118 sprintf(question_ptr, 119 "Should I restore the image of %s ?", incoming_ptr); 120 121 if (ask_me_yes_or_no(question_ptr)) { 122 fprintf(fout, "%s\n", incoming_ptr); 123 } 106 mr_asprintf(&question, 107 _("Should I restore the image of %s ?"), incoming); 108 109 if (ask_me_yes_or_no(question)) { 110 fprintf(fout, "%s\n", incoming); 111 } 112 mr_free(question); 124 113 } 125 114 126 115 /*** free memory ***********/ 127 mr_free(incoming_ptr); 128 incoming_ptr = NULL; 129 mr_free(question_ptr); 130 question_ptr = NULL; 131 116 mr_free(incoming); 132 117 133 118 paranoid_fclose(fout); … … 138 123 *ASK_ABOUT_THESE_IMAGEDEVS * 139 124 **************************************************************************/ 140 141 142 143 144 145 146 125 147 126 … … 161 140 char *output_mountlist_file) 162 141 { 163 char *mountpt ;164 char *command ;165 char *orig_fname ;142 char *mountpt = NULL; 143 char *command = NULL; 144 char *orig_fname = NULL; 166 145 int retval = 0; 167 146 168 147 assert(bkpinfo != NULL); 169 malloc_string(mountpt);170 malloc_string(command);171 malloc_string(orig_fname);172 148 assert_string_is_neither_NULL_nor_zerolength(ramdisk_fname); 173 149 assert_string_is_neither_NULL_nor_zerolength(output_cfg_file); 174 150 assert_string_is_neither_NULL_nor_zerolength(output_mountlist_file); 175 sprintf(mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir);176 sprintf(command, "mkdir -p %s", mountpt);151 mr_asprintf(&mountpt, "%s/mount.bootdisk", bkpinfo->tmpdir); 152 mr_asprintf(&command, "mkdir -p %s", mountpt); 177 153 run_program_and_log_output(command, FALSE); 178 sprintf(command, "gzip -dc %s > %s/mindi.rd 2> /dev/null", 154 mr_free(command); 155 156 mr_asprintf(&command, "gzip -dc %s > %s/mindi.rd 2> /dev/null", 179 157 ramdisk_fname, bkpinfo->tmpdir); 180 181 158 run_program_and_log_output(command, FALSE); 182 sprintf(command, "umount %s", mountpt); 183 159 mr_free(command); 160 161 mr_asprintf(&command, "umount %s", mountpt); 184 162 run_program_and_log_output(command, FALSE); 185 186 sprintf(command, "mount -o loop %s/mindi.rd -t ext2 %s", 163 mr_free(command); 164 165 mr_asprintf(&command, "mount -o loop %s/mindi.rd -t ext2 %s", 187 166 bkpinfo->tmpdir, mountpt); 188 189 167 run_program_and_log_output(command, FALSE); 190 191 sprintf(command, "mkdir -p %s/tmp", bkpinfo->tmpdir); 192 168 mr_free(command); 169 170 mr_asprintf(&command, "mkdir -p %s/tmp", bkpinfo->tmpdir); 193 171 run_program_and_log_output(command, FALSE); 194 195 sprintf(command, "cp -f %s/%s %s", // %s/%s becomes {mountpt}/tmp/m*ndo-restore.cfg 172 mr_free(command); 173 174 mr_asprintf(&command, "cp -f %s/%s %s", // %s/%s becomes {mountpt}/tmp/m*ndo-restore.cfg 196 175 mountpt, g_mondo_cfg_file, output_cfg_file); 197 176 run_program_and_log_output(command, FALSE); 198 199 sprintf(orig_fname, "%s/%s", mountpt, g_mountlist_fname); 177 mr_free(command); 178 179 mr_asprintf(&orig_fname, "%s/%s", mountpt, g_mountlist_fname); 200 180 if (does_file_exist(orig_fname)) { 201 sprintf(command, "cp -f %s %s", orig_fname, output_mountlist_file);181 mr_asprintf(&command, "cp -f %s %s", orig_fname, output_mountlist_file); 202 182 run_program_and_log_output(command, FALSE); 203 } 204 sprintf(command, "umount %s", mountpt); 183 mr_free(command); 184 } 185 mr_asprintf(&command, "umount %s", mountpt); 186 mr_free(mountpt); 187 205 188 run_program_and_log_output(command, FALSE); 189 mr_free(command); 190 206 191 if (!does_file_exist(output_cfg_file) 207 192 || (!does_file_exist(output_mountlist_file) … … 213 198 retval = 0; 214 199 } 215 mr_free(mountpt);216 mr_free(command);217 200 mr_free(orig_fname); 218 201 return (retval); 219 220 } 221 222 202 } 223 203 224 204 … … 231 211 while (get_cfg_file_from_archive(bkpinfo)) { 232 212 if (!ask_me_yes_or_no 233 ("Failed to find config file/archives. Choose another source?")) 213 (_ 214 ("Failed to find config file/archives. Choose another source?"))) 234 215 { 235 216 fatal_error("Could not find config file/archives. Aborting."); … … 251 232 252 233 /** needs malloc **/ 253 char *command; 254 char *file; 255 char *tmp; 256 int res; 257 258 malloc_string(command); 259 malloc_string(file); 260 malloc_string(tmp); 234 char *command = NULL; 235 char *file = NULL; 236 char *tmp = NULL; 237 int res = 0; 238 261 239 assert_string_is_neither_NULL_nor_zerolength(f); 262 240 assert_string_is_neither_NULL_nor_zerolength(list_fname); … … 264 242 265 243 if (strncmp(preamble, f, strlen(preamble)) == 0) { 266 strcpy(file, f + strlen(preamble));267 } else { 268 strcpy(file, f);244 mr_asprintf(&file, f + strlen(preamble)); 245 } else { 246 mr_asprintf(&file, f); 269 247 } 270 248 if (file[0] == '/' && file[1] == '/') { 271 strcpy(tmp, file); 272 strcpy(file, tmp + 1); 273 } 274 sprintf(tmp, 275 "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 249 mr_asprintf(&tmp, file); 250 mr_free(file); 251 mr_asprintf(&file, tmp + 1); 252 mr_free(tmp); 253 } 254 mr_msg(2, "Checking to see if f=%s, file=%s, is in the list of biggiefiles", 276 255 f, file); 277 mr_msg(2, tmp); 278 sprintf(command, "grep -E '^%s$' %s", file, list_fname); 256 mr_asprintf(&command, "grep -E '^%s$' %s", file, list_fname); 257 mr_free(file); 258 279 259 res = run_program_and_log_output(command, FALSE); 280 260 mr_free(command); 281 mr_free(file);282 mr_free(tmp);283 261 if (res) { 284 262 return (FALSE); … … 287 265 } 288 266 } 289 290 267 /************************************************************************** 291 268 *END_IS_FILE_IN_LIST * 292 269 **************************************************************************/ 293 294 270 295 271 … … 305 281 int iso_fiddly_bits(struct s_bkpinfo *bkpinfo, bool nuke_me_please) 306 282 { 307 char *mount_isodir_command, *tmp, *command; 308 int retval = 0, i; 283 char *mount_isodir_command = NULL; 284 char *tmp = NULL; 285 char *command = NULL; 286 int retval = 0, i = 0; 309 287 bool already_mounted = FALSE; 310 288 311 289 assert(bkpinfo != NULL); 312 malloc_string(mount_isodir_command); 313 malloc_string(tmp); 314 malloc_string(command); 290 315 291 g_ISO_restore_mode = TRUE; 316 292 read_cfg_var(g_mondo_cfg_file, "iso-dev", g_isodir_device); 317 293 if (bkpinfo->disaster_recovery) { 318 /* Patch Conor Daly 26-june-2004319 * Don't let this clobber an existing bkpinfo->isodir */320 if (!bkpinfo->isodir [0]) {321 strcpy(bkpinfo->isodir, "/tmp/isodir");294 /* Patch Conor Daly 26-june-2004 295 * Don't let this clobber an existing bkpinfo->isodir */ 296 if (!bkpinfo->isodir) { 297 mr_allocstr(bkpinfo->isodir, "/tmp/isodir"); 322 298 } 323 299 /* End patch */ 324 sprintf(command, "mkdir -p %s", bkpinfo->isodir);300 mr_asprintf(&command, "mkdir -p %s", bkpinfo->isodir); 325 301 run_program_and_log_output(command, 5); 302 mr_free(command); 326 303 mr_msg(2, "Setting isodir to %s", bkpinfo->isodir); 327 304 } … … 335 312 336 313 if (is_this_device_mounted(g_isodir_device)) { 337 log_to_screen( "WARNING - isodir is already mounted");314 log_to_screen(_("WARNING - isodir is already mounted")); 338 315 already_mounted = TRUE; 339 316 } else { 340 sprintf(mount_isodir_command, "mount %s", g_isodir_device);341 317 if (strlen(g_isodir_format) > 1) { 342 sprintf(mount_isodir_command + strlen(mount_isodir_command), 343 " -t %s", g_isodir_format); 344 } 345 strcat(mount_isodir_command, " -o ro "); 346 strcat(mount_isodir_command, bkpinfo->isodir); 318 mr_asprintf(&mount_isodir_command, "mount %s -t %s -o ro %s", g_isodir_device, g_isodir_format, bkpinfo->isodir); 319 } else { 320 mr_asprintf(&mount_isodir_command, "mount %s -o ro %s", g_isodir_device, bkpinfo->isodir); 321 } 347 322 run_program_and_log_output("df -m", FALSE); 348 sprintf(tmp, 349 "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 323 mr_msg(1, "The 'mount' command is '%s'. PLEASE report this command to be if you have problems, ok?", 350 324 mount_isodir_command); 351 mr_msg(1, tmp);352 325 if (run_program_and_log_output(mount_isodir_command, FALSE)) { 353 326 popup_and_OK 354 ("Cannot mount the device where the ISO files are stored."); 327 (_ 328 ("Cannot mount the device where the ISO files are stored.")); 329 mr_free(mount_isodir_command); 355 330 return (1); 356 331 } 332 mr_free(mount_isodir_command); 357 333 log_to_screen 358 ("I have mounted the device where the ISO files are stored."); 334 (_ 335 ("I have mounted the device where the ISO files are stored.")); 359 336 } 360 337 if (!IS_THIS_A_STREAMING_BACKUP(bkpinfo->backup_media_type)) { … … 362 339 } 363 340 i = what_number_cd_is_this(bkpinfo); /* has the side-effect of calling mount_cdrom() */ 364 sprintf(tmp, "%s #%d has been mounted via loopback mount", 365 media_descriptor_string(bkpinfo->backup_media_type), i); 366 mr_msg(1, tmp); 341 mr_msg(1, "%s #%d has been mounted via loopback mount", 342 bkpinfo->backup_media_string, i); 367 343 if (i < 0) { 368 344 popup_and_OK 369 ( "Cannot find ISO images in the directory you specified.");345 (_("Cannot find ISO images in the directory you specified.")); 370 346 retval = 1; 371 347 } 372 348 mr_msg(2, "%ld: bkpinfo->isodir is now %s", __LINE__, 373 349 bkpinfo->isodir); 374 mr_free(mount_isodir_command);375 mr_free(tmp);376 mr_free(command);377 350 return (retval); 378 351 } 379 352 380 353 381 382 383 354 /** 384 355 * Kill all Petris processes. … … 386 357 void kill_petris(void) 387 358 { 388 char *command; 389 malloc_string(command); 390 sprintf(command, 359 char *command = NULL; 360 mr_asprintf(&command, 391 361 "kill `ps 2> /dev/null | grep petris 2> /dev/null | grep -v grep | cut -d' ' -f2` 2> /dev/null"); 392 362 paranoid_system(command); … … 398 368 **************************************************************************/ 399 369 400 401 /** 402 * (Disabled) Modify rc.local to fix some things on first boot.403 * This function currently doesn't do anything except make sure /tmp has the404 * right permissions.405 * @param path The path to /etc on the user's filesystem.370 /** 371 * Mount @p device at @p mpt as @p format. 372 * @param device The device (/dev entry) to mount. 373 * @param mpt The directory to mount it on. 374 * @param format The filesystem type of @p device. 375 * @param writeable If TRUE, mount read-write; if FALSE, mount read-only. 406 376 * @return 0 for success, nonzero for failure. 407 377 */ 408 int modify_rclocal_one_time(char *path) 409 { 410 /** malloc **/ 411 char *rclocal_fname; 412 char *newfile_fname; 413 char *tmp; 414 415 malloc_string(rclocal_fname); 416 malloc_string(newfile_fname); 378 int mount_device(char *device, char *mpt, char *format, bool writeable) 379 { 380 int res = 0; 381 382 char *tmp = NULL; 383 char *command = NULL; 384 char *mountdir = NULL; 385 char *mountpoint = NULL; 386 char *additional_parameters = NULL; 387 char *p1 = NULL; 388 char *p2 = NULL; 389 char *p3 = NULL; 390 391 assert_string_is_neither_NULL_nor_zerolength(device); 392 assert_string_is_neither_NULL_nor_zerolength(mpt); 393 assert(format != NULL); 417 394 malloc_string(tmp); 418 assert_string_is_neither_NULL_nor_zerolength(path); 419 420 sprintf(rclocal_fname, "%s/rc.local", path); 421 422 // sprintf(tmp, "chmod 1777 %s/tmp", MNT_RESTORING); 423 // run_program_and_log_output( tmp, FALSE ); 424 return (0); /* remove this line to open the floodgates... */ 425 426 if (!does_file_exist(rclocal_fname)) { 427 sprintf(rclocal_fname, "%s/rc.d/rc.local", path); 428 } 429 if (!does_file_exist(rclocal_fname)) { 430 mr_free(rclocal_fname); 431 mr_free(newfile_fname); 432 mr_free(tmp); 433 return (1); 434 } 435 sprintf(newfile_fname, "%s/rc.local.mondorescue", path); 436 sprintf(tmp, "grep mondorescue %s > /dev/null 2> /dev/null", 437 rclocal_fname); 438 if (system(tmp)) { 439 sprintf(tmp, "echo \"[ -e %s ] && %s\n\" >> %s", 440 newfile_fname, newfile_fname, rclocal_fname); 441 442 paranoid_system(tmp); 443 } 444 sprintf(tmp, "echo -en \"#!/bin/sh\ 445 \\n\ 446 \\n\ 447 grep -v mondorescue %s > %s\\n\ 448 rm -f /var/lock/subsys/*xfs*\\n\ 449 rm -f /var/run/xfs.*\\n\ 450 killall xfs\\n\ 451 service xfs start\\n\ 452 yes | rm -f %s\\n\ 453 \" > %s", rclocal_fname, rclocal_fname, newfile_fname, newfile_fname); 454 sprintf(tmp, "chmod +x \"%s\"", newfile_fname); 455 run_program_and_log_output(tmp, FALSE); 456 mr_free(rclocal_fname); 457 mr_free(newfile_fname); 395 malloc_string(command); 396 malloc_string(mountdir); 397 malloc_string(additional_parameters); 398 399 if (!strcmp(mpt, "/1")) { 400 mr_asprintf(&mountpoint, "/"); 401 mr_msg(3, "Mommm! SME is being a dildo!"); 402 } else { 403 mr_asprintf(&mountpoint, mpt); 404 } 405 406 if (!strcmp(mountpoint, "lvm")) { 407 mr_free(mountpoint); 408 return (0); 409 } 410 if (!strcmp(mountpoint, "image")) { 411 mr_free(mountpoint); 412 return (0); 413 } 414 sprintf(tmp, "Mounting device %s ", device); 415 mr_msg(1, tmp); 416 if (writeable) { 417 strcpy(additional_parameters, "-o rw"); 418 } else { 419 strcpy(additional_parameters, "-o ro"); 420 } 421 if (find_home_of_exe("setfattr")) { 422 strcat(additional_parameters, ",user_xattr"); 423 } 424 if (find_home_of_exe("setfacl")) { 425 strcat(additional_parameters, ",acl"); 426 } 427 428 if (!strcmp(mountpoint, "swap")) { 429 sprintf(command, "swapon %s", device); 430 } else { 431 if (!strcmp(mountpoint, "/")) { 432 strcpy(mountdir, MNT_RESTORING); 433 } else { 434 sprintf(mountdir, "%s%s", MNT_RESTORING, mountpoint); 435 } 436 sprintf(command, "mkdir -p %s", mountdir); 437 run_program_and_log_output(command, FALSE); 438 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device, 439 additional_parameters, mountdir, MONDO_LOGFILE); 440 mr_msg(2, "command='%s'", command); 441 } 442 res = run_program_and_log_output(command, TRUE); 443 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) { 444 mr_msg(1, "Re-trying without the fancy extra parameters"); 445 sprintf(command, "mount -t %s %s %s 2>> %s", format, device, 446 mountdir, MONDO_LOGFILE); 447 res = run_program_and_log_output(command, TRUE); 448 } 449 if (res) { 450 mr_msg(1, "Unable to mount device %s (type %s) at %s", device, 451 format, mountdir); 452 mr_msg(1, "command was '%s'", command); 453 if (!strcmp(mountpoint, "swap")) { 454 log_to_screen(tmp); 455 } else { 456 mr_msg(2, "Retrying w/o the '-t' switch"); 457 sprintf(command, "mount %s %s 2>> %s", device, mountdir, 458 MONDO_LOGFILE); 459 mr_msg(2, "2nd command = '%s'", command); 460 res = run_program_and_log_output(command, TRUE); 461 if (res == 0) { 462 mr_msg(1, 463 "That's OK. I called mount w/o a filesystem type and it worked fine in the end."); 464 } else { 465 log_to_screen(tmp); 466 } 467 } 468 } 469 if (res && !strcmp(mountpoint, "swap")) { 470 mr_msg(2, "That's ok. It's just a swap partition."); 471 mr_msg(2, "Non-fatal error. Returning 0."); 472 res = 0; 473 } 474 458 475 mr_free(tmp); 459 return (0); 476 mr_free(command); 477 mr_free(mountdir); 478 mr_free(mountpoint); 479 mr_free(additional_parameters); 480 481 return (res); 460 482 } 461 483 462 484 /************************************************************************** 463 *END_ MODIFY_RCLOCAL_ONE_TIME*485 *END_MOUNT_DEVICE * 464 486 **************************************************************************/ 465 466 487 467 488 … … 690 711 *END_MOUNT_CDROM * 691 712 **************************************************************************/ 692 693 694 /**695 * Mount @p device at @p mpt as @p format.696 * @param device The device (/dev entry) to mount.697 * @param mpt The directory to mount it on.698 * @param format The filesystem type of @p device.699 * @param writeable If TRUE, mount read-write; if FALSE, mount read-only.700 * @return 0 for success, nonzero for failure.701 */702 int mount_device(char *device, char *mpt, char *format, bool writeable)703 {704 int res = 0;705 706 /** malloc **/707 char *tmp, *command, *mountdir, *mountpoint, *additional_parameters;708 709 assert_string_is_neither_NULL_nor_zerolength(device);710 assert_string_is_neither_NULL_nor_zerolength(mpt);711 assert(format != NULL);712 malloc_string(tmp);713 malloc_string(command);714 malloc_string(mountdir);715 malloc_string(mountpoint);716 malloc_string(additional_parameters);717 718 if (!strcmp(mpt, "/1")) {719 strcpy(mountpoint, "/");720 mr_msg(3, "Mommm! SME is being a dildo!");721 } else {722 strcpy(mountpoint, mpt);723 }724 725 if (!strcmp(mountpoint, "lvm")) {726 return (0);727 }728 if (!strcmp(mountpoint, "image")) {729 return (0);730 }731 sprintf(tmp, "Mounting device %s ", device);732 mr_msg(1, tmp);733 if (writeable) {734 strcpy(additional_parameters, "-o rw");735 } else {736 strcpy(additional_parameters, "-o ro");737 }738 if (find_home_of_exe("setfattr")) {739 strcat(additional_parameters, ",user_xattr");740 }741 if (find_home_of_exe("setfacl")) {742 strcat(additional_parameters, ",acl");743 }744 745 if (!strcmp(mountpoint, "swap")) {746 sprintf(command, "swapon %s", device);747 } else {748 if (!strcmp(mountpoint, "/")) {749 strcpy(mountdir, MNT_RESTORING);750 } else {751 sprintf(mountdir, "%s%s", MNT_RESTORING, mountpoint);752 }753 sprintf(command, "mkdir -p %s", mountdir);754 run_program_and_log_output(command, FALSE);755 sprintf(command, "mount -t %s %s %s %s 2>> %s", format, device,756 additional_parameters, mountdir, MONDO_LOGFILE);757 mr_msg(2, "command='%s'", command);758 }759 res = run_program_and_log_output(command, TRUE);760 if (res && (strstr(command, "xattr") || strstr(command, "acl"))) {761 mr_msg(1, "Re-trying without the fancy extra parameters");762 sprintf(command, "mount -t %s %s %s 2>> %s", format, device,763 mountdir, MONDO_LOGFILE);764 res = run_program_and_log_output(command, TRUE);765 }766 if (res) {767 mr_msg(1, "Unable to mount device %s (type %s) at %s", device,768 format, mountdir);769 mr_msg(1, "command was '%s'", command);770 if (!strcmp(mountpoint, "swap")) {771 log_to_screen(tmp);772 } else {773 mr_msg(2, "Retrying w/o the '-t' switch");774 sprintf(command, "mount %s %s 2>> %s", device, mountdir,775 MONDO_LOGFILE);776 mr_msg(2, "2nd command = '%s'", command);777 res = run_program_and_log_output(command, TRUE);778 if (res == 0) {779 mr_msg(1,780 "That's OK. I called mount w/o a filesystem type and it worked fine in the end.");781 } else {782 log_to_screen(tmp);783 }784 }785 }786 if (res && !strcmp(mountpoint, "swap")) {787 mr_msg(2, "That's ok. It's just a swap partition.");788 mr_msg(2, "Non-fatal error. Returning 0.");789 res = 0;790 }791 792 mr_free(tmp);793 mr_free(command);794 mr_free(mountdir);795 mr_free(mountpoint);796 mr_free(additional_parameters);797 798 return (res);799 }800 801 /**************************************************************************802 *END_MOUNT_DEVICE *803 **************************************************************************/804 805 713 806 714
Note:
See TracChangeset
for help on using the changeset viewer.