- Timestamp:
- Nov 19, 2005, 2:27:31 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/Mindi/DiskSize/lib/DiskSize.c
r30 r127 4 4 #include "DiskSize.h" 5 5 6 long 7 get_size_of_disk(disk) 8 const char * disk; 6 long get_size_of_disk(disk) 7 const char *disk; 9 8 { 10 intfd;11 12 if ((fd = open(disk, O_RDONLY)) == -1) {13 return 0;/* couldn't open */14 15 if (ioctl(fd, BLKGETSIZE, &ul) == -1) {16 return 0;/* couldn't ioctl */17 18 close(fd);19 9 int fd; 10 unsigned long ul; 11 if ((fd = open(disk, O_RDONLY)) == -1) { 12 return 0; /* couldn't open */ 13 } 14 if (ioctl(fd, BLKGETSIZE, &ul) == -1) { 15 return 0; /* couldn't ioctl */ 16 } 17 close(fd); 18 return ul / 2; 20 19 } -
trunk/mindi/Mindi/DiskSize/lib/DiskSize.h
r30 r127 1 extern long get_size_of_disk(const char *disk);1 extern long get_size_of_disk(const char *disk); -
trunk/mondo/mondo/common/libmondo-archive.c
r89 r127 358 358 paranoid_free(command); 359 359 360 asprintf(&command, " cat %s | afio -o -b %ld -M 16m %s%s 2>> %s",361 filelist, TAPE_BLOCK_SIZE, zipparams, fname, MONDO_LOGFILE);360 asprintf(&command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", 361 TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE); 362 362 paranoid_free(zipparams); 363 363 … … 556 556 557 557 asprintf(&tmp, 558 "echo \"%s\" | tr -s ' ' '\n' | grep -x \"/dev/.*\"| tr -s '\n' ' ' | awk '{print $0\"\\n\";}'",558 "echo '%s' | tr -s ' ' '\n' | grep -x '/dev/.*' | tr -s '\n' ' ' | awk '{print $0\"\\n\";}'", 559 559 bkpinfo->exclude_paths); 560 560 asprintf(&devs_to_exclude, … … 832 832 6=\"%s\" 7=%ld 8=\"%s\" 9=\"%s\" 10=\"%s\" \ 833 833 11=\"%s\" 12=%s 13=%ld 14=\"%s\" 15=\"%s\" 16=\"%s\" 17=\"%s\" 18=%ld 19=%d",*/ 834 "mindi --custom %s %s/images \"%s\" \"%s\"\835 \"%s\" %ld \"%s\" \"%s\" \"%s\"\836 \"%s\" %s %ld \"%s\" \"%s\" \"%s\" \"%s\"%ld %d %s", bkpinfo->tmpdir, // parameter #2834 "mindi --custom %s %s/images '%s' '%s' \ 835 '%s' %ld '%s' '%s' '%s' \ 836 '%s' %s %ld '%s' '%s' '%s' '%s' %ld %d %s", bkpinfo->tmpdir, // parameter #2 837 837 bkpinfo->scratchdir, // parameter #3 838 838 bkpinfo->kernel_path, // parameter #4 … … 917 917 } else { 918 918 log_to_screen("Mindi failed to create your boot+data disks."); 919 asprintf(&command, "cat %s | grep \"Fatal error\"", 920 "/var/log/mindi.log"); 919 asprintf(&command, "grep 'Fatal error' /var/log/mindi.log"); 921 920 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); 922 921 paranoid_free(command); … … 1715 1714 log_to_screen("%s...OK", message_to_screen); 1716 1715 if (!run_program_and_log_output 1717 ("tail -n10 /var/log/mondo-archive.log | fgrep \":-(\"",1716 ("tail -n10 /var/log/mondo-archive.log | fgrep ':-('", 1718 1717 1)) { 1719 1718 log_to_screen … … 1724 1723 #ifdef DVDRWFORMAT 1725 1724 asprintf(&tmp, 1726 " cat %s | tail -n8 | grep \"blank=full.*dvd-compat.*DAO\"",1725 "tail -n8 %s | grep 'blank=full.*dvd-compat.*DAO'", 1727 1726 MONDO_LOGFILE); 1728 1727 if (g_backup_media_type == dvd … … 3105 3104 } else { 3106 3105 file_to_openin = biggie_filename; 3107 asprintf(&command, "md5sum \"%s\"", biggie_filename);3106 asprintf(&command, "md5sum '%s'", biggie_filename); 3108 3107 if (!(fin = popen(command, "r"))) { 3109 3108 log_OS_error("Unable to popen-in command"); … … 3508 3507 if (bkpinfo->verify_data && !res) { 3509 3508 log_to_screen 3510 ("Please reboot from the 1st CD in Compare Mode, as a precaution."); 3509 ("Please reboot from the 1st %s in Compare Mode, as a precaution.", 3510 media_descriptor_string(g_backup_media_type)); 3511 3511 chdir("/"); 3512 3512 iamhere("Before calling verify_cd_image()"); … … 3640 3640 */ 3641 3641 asprintf(&tmp, 3642 " cat %s | grep \"afio: \" | sed 's/afio: //' | grep -vx \"/dev/.*\">> /tmp/changed.files",3642 "sed -n -e 's/afio: //p' %s | grep -vx '/dev/.*' >> /tmp/changed.files", 3643 3643 MONDO_LOGFILE); 3644 3644 system(tmp); … … 3646 3646 3647 3647 asprintf(&tmp, 3648 " cat %s | grep \"star: \" | sed 's/star: //' | grep -vx \"/dev/.*\">> /tmp/changed.files",3648 "sed -n -e 's/star: //p' %s | grep -vx '/dev/.*' >> /tmp/changed.files", 3649 3649 MONDO_LOGFILE); 3650 3650 system(tmp); -
trunk/mondo/mondo/common/libmondo-devices.c
r122 r127 1 1 /* libmondo-devices.c Subroutines for handling devices 2 2 $Id$ 3 .4 5 6 01/07/20057 - sensibly_set_tmpdir_and_scratchdir() --- exclude smb and smbfs and (new) cifs8 9 10/2310 - if root mounted at '/dev/rd/' then say FALSE, not mounted on ramdisk11 just to please Fred Beondo :-p12 13 07/2514 - updated get_phys_size_of_drive() to support newer, larger drives15 16 07/1817 - better support of users who boot from LVM CD and nuke-restore non-LVM backups18 19 07/0820 - BLKGETSIZE64 instead of BLKGETIO..whatever (Joshua)21 - amended to use BLKGETSIZE if BLKGETSIZE64 missing (Hugo)22 - resort to HDIO_GETGEO if BLKGETSIZE and BLKGETSIZE63 fail23 24 25 06/2526 - added Mandrake 9.2 support to which_boot_loader()27 - cleaned up find_cdrom_device()28 29 06/2330 - rewrote resolve_softlinks_to_get_to_actual_device_file() in C31 32 06/1733 - don't use star automatically if SELINUX detected; let user do that34 35 05/0736 - usage of parted2fdisk instead of fdisk alone (ia32/ia64 compatibility)37 BCO38 39 04/1740 - replaced INTERNAL_TAPE_BLK_SIZE with bkpinfo->internal_tape_block_size41 42 04/1343 - if kernel >= 2.6 then ask for /dev entry, not SCSI node44 45 04/1246 - in mount_CDROM_...whatever, don't use bkpinfo_DONTUSETHIS to see if47 mounting a real CD device; look for /dev/ at start of $device instead48 49 04/0450 - when testing for tape drive, use INTERNAL_TAPE_BLK_SIZE, not TAPE_BLOCK_SIZE51 52 04/0353 - don't eject/retract drive if ISO54 55 02/23/200456 - changed strstr() to strncmp() in a few places57 58 12/11/200359 - if we can't find the DVD using dvdrecord then try it w/cdrecord60 61 11/1562 - changed a few []s to char*s63 - better support of multiple CD-ROM drives64 65 11/1466 - better find_cdrom_device(), to cope w/ multiple CD writers67 68 10/2669 - call 'mt -f %s offline' to eject tape drive in eject_device()70 71 10/2572 - ask user to confirm which NFS share to mount73 - improved which_boot_loader()74 75 10/2276 - tweaked find_cdrom_device() and find_cdrw_device()77 - created find_dvd_device()78 79 10/2180 - changed "/mnt/cdrom" to MNT_CDROM81 82 09/2883 - interactive gui no longer asks dvd's speed84 85 09/2686 - interactive gui now supports dvd87 88 09/2389 - malloc/free global strings in new subroutines - malloc_libmondo_global_strings()90 and free_libmondo_global_strings() - which are in libmondo-tools.c91 92 09/2193 - ask for CD size when backing up interactively94 - offer to exclude NFS shares if they're present95 96 09/2097 - exclude /dev/shm from sensibly_*()98 99 09/18100 - less verbose logging when insisting on CD #n101 102 09/09103 - added resolve_softlinks_to_get_to_actual_device_file()104 105 09/05106 - rewrote inisist_on_this_cd_number() and what_number_cd_is_this()107 108 09/02109 - is_this_a_valid_disk_format() -- treat ntfs (a.k.a. type 7) as recognized format110 just in case user's backup includes a partimagehack-imaged drive111 112 08/01 - 08/31113 - better boot-time tape detection114 - remove backup-time, erroneous, "remove floppy" msg115 - working on am_I_in_disaster_recovery_mode()116 - interactively_obtain_...() - pause & ask user to remove CD/floppy117 118 06/01 - 07/31119 - in which_boot_loader(), also search /dev/cciss for boot loader120 - fixed calls to popup_and_get_string()121 - fixed bug in get_phys_size_of_drive()122 - fixed bug in where_is_root_mounted()123 - commented out a spurious assert()124 125 05/01 - 05/31126 - superior get_phys_size_of_drive() (Joshua Oreman)127 - fixed call to inject_device() --- Andree L.128 - find_cdrom_device() now may, if asked to, mount drive if possible,129 to test that it has a CD in it; it then unmounts130 - mount_CDROM_here() now calls retract_cd_and_defeat_autorun() as well131 - fixed support for subdir-within-NFS-mount132 - cleaned up some FreeBSD-specific stuff133 - added Joshua Oreman's FreeBSD patches134 - mount_CDROM_here() --- mkdir -p mountpt135 - add older drive support to get_phys_size_of_drive()136 137 04/01 - 04/30138 - made which_boot_loader() more friendly towards Red Hat 9139 - find_and_mount_actual_cd() retracts all CD trays140 - added lots of log_OS_error()'s and assert()'s141 - fix ISO support in interactively_restore_...()142 - made find_cdrom_device() skip dmesg if second-stage string is empty143 - in find_cdrw_device(), find cdrecord before dvdrecord144 - fixed am_i_in_disaster_recovery_mode()145 - fixed insist_on_this_cd_number()146 147 03/01 - 03/31148 - more work on find_cdrom_device()149 - find_cdrom_device() --- if nonexistent/not found then150 make sure to return '' as dev str and 1 as res151 - cleaner find_cdrom_device(), to find DVD instead of CD-ROM152 as last resort153 - fix insist_on_this_cd_number()154 - add user the speed of CD writer, if writing155 - if root is /dev/root then assume not a ramdisk156 157 01/07 - 02/28158 - fixed find_cdrom_device (Stan Benoit)159 - if root is at /dev/root/root then LVM (not ramdisk)160 - fix am_I_in_disaster_recovery_mode() to recognize that /dev/rd/cp*161 entries are not ramdisks but RAID disks162 - find_cdrw_device() no longer complains to stderr if no cdrecord163 164 01/02/2003165 - sensibly_set_tmpdir_and_scratchdir() --- exclude smb and smbfs166 167 12/01/2002168 - don't ask for isodir path if in disaster recovery mode169 170 11/01 - 11/30171 - added g_restoring_live_from_cd;172 - handle_incoming_parameters() will sensibly set tmpdir and scratchdir173 - properly wipe spurious scratchdir and tmpdir174 - modified sensibly_...() to use tmp.mondo.* and mondo.scratch.*175 instead of mondo.tmpdir.* and mondo.scratchdir.*176 - line 861,912: set media_size[0] to 1999 as well as 1 thru N177 - chmod 700, not 770, in make_fifo()178 - sensibly_set_tmpdir_and_scratchdir() will now prefix a '/' to the179 strings if it is missing180 181 10/01 - 10/31182 - changed find_cdrom_device() to ignore DVD drives in the hd[a-d] search;183 consequently, the subroutine will try scd0, sr0, etc. afterwards184 - commented code185 - fixed obscure bug in find_and_mount_actual_cd()186 - code which sensibly configures tmpdir,scratchdir is now sep. sub.187 - changed sort -s to sort -n <-- sensibly...()188 189 09/01 - 09/30190 - added list_of_NFS_devices_and_mounts()191 - try /dev/st0 if no tape specified at all192 - change '64k' to TAPE_BLOCK_SIZE193 - improved find_cdrom_device()194 - if cdrecord not found then find_cdrom_device() returns 1195 - if disaster recovery mode then don't ask for CD-ROM's /dev entry;196 assume /dev/cdrom197 - if restoring data then ask for CD-ROM's /dev entry (not its SCSI node)198 - run_program_and_log_output() now takes boolean operator to specify199 whether it will log its activities in the event of _success_200 - changed sort -n +4 to sort -s +4 (Troff)201 - ask if user's kernel is sane; if 'no' then use FAILSAFE202 - ask user to confirm the tape/CD device name203 - if restoring (not archiving) then don't try to find CD-ROM's SCSI204 node; try to find its /dev entry instead205 - better detection of biggest partition206 207 08/01 - 08/31208 - fixed verify bug --- CD#1 was being verified again & again & ...209 - detect boot loader + device; if not detectible then _ask_210 - if run interactively, assume tape size is irrelevant & don't ask211 for it; Mondo should handle end-of-tape gracefully now212 - worked on handling unknowng media size213 - added interactively_obtain_media_parameters_from_user()214 - when trying to mount CD-ROM, find_and_mount_actual_cd() will215 now call find_cdrom_device() to try to find the /dev entry first216 - fixed serious bug in zero_out_a_device()217 - cleaned up some log_it() calls218 - fixed minor bug in find_cdrom_device()219 - better at distinguishing between live filesystem and ramdisk220 221 07/24/2002222 - created223 3 */ 224 4 … … 2189 1969 if (!popup_and_get_string 2190 1970 ("ISO size.", 2191 "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s you plan to backup to.",1971 "Please enter how big you want each ISO image to be (in megabytes). This should be less than or equal to the size of the CD-R[W]'s or DVD's you plan to backup to.", 2192 1972 sz_size, 16)) { 2193 1973 log_to_screen("User has chosen not to backup the PC"); -
trunk/mondo/mondo/common/libmondo-filelist.c
r120 r127 158 158 log_msg(1, "Sorting file %s", orig_fname); 159 159 asprintf(&tmp_fname, "/tmp/sort.%d.%d.%d", (int) (random() % 32768), 160 (int) (random() % 32768), (int) (random() % 32768));160 (int) (random() % 32768), (int) (random() % 32768)); 161 161 162 162 if (!does_file_exist(orig_fname)) { … … 165 165 166 166 asprintf(&command, "sort %s > %s 2>> %s", orig_fname, tmp_fname, 167 MONDO_LOGFILE);167 MONDO_LOGFILE); 168 168 retval = system(command); 169 169 paranoid_free(command); … … 254 254 if (!(fbig = fopen(biggie_fname, "w"))) { 255 255 log_OS_error("Cannot openout biggie_fname"); 256 return (0);256 return (0); 257 257 } 258 258 if (!(fout = fopen(outfname, "w"))) { 259 259 log_OS_error("Cannot openout outfname"); 260 return (0);260 return (0); 261 261 } 262 262 (void) fgets(&incoming, &n, fin); … … 268 268 } 269 269 /* BERLIOS: Useless with getline 270 if (i > MAX_STR_LEN - 1) {271 272 273 274 }275 */270 if (i > MAX_STR_LEN - 1) { 271 incoming[MAX_STR_LEN - 30] = '\0'; 272 log_msg(1, "Warning - truncating file %s's name", incoming); 273 err++; 274 } 275 */ 276 276 if (incoming[i] < 32) { 277 277 incoming[i] = '\0'; … … 298 298 curr_set_no++; 299 299 curr_set_size = 0; 300 asprintf(&outfname, "%s/filelist.%ld", outdir, curr_set_no); 300 asprintf(&outfname, "%s/filelist.%ld", outdir, 301 curr_set_no); 301 302 if (!(fout = fopen(outfname, "w"))) { 302 303 log_OS_error("Unable to openout outfname"); 303 return (0);304 return (0); 304 305 } 305 306 update_evalcall_form((int) (lino * 100 / noof_lines)); … … 327 328 log_OS_error 328 329 ("Unable to echo write one-liner to LAST-FILELIST-NUMBER"); 329 return (0);330 return (0); 330 331 } 331 332 paranoid_free(outfname); … … 423 424 return (2); 424 425 } 425 for (getline(&tmp, &n, pattr); !feof(pattr); 426 getline(&tmp, &n, pattr)) { 426 for (getline(&tmp, &n, pattr); !feof(pattr); getline(&tmp, &n, pattr)) { 427 427 fputs(tmp, pout); 428 428 } … … 490 490 // sort_file(filelist); // FIXME - filelist chopper sorts, so this isn't necessary 491 491 asprintf(&command, 492 "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s",493 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE);492 "cat %s | getfacl --all-effective -P - 2>> %s | gzip -c1 > %s 2>> %s", 493 filelist, MONDO_LOGFILE, facl_fname, MONDO_LOGFILE); 494 494 iamhere(command); 495 495 retval = system(command); … … 544 544 { 545 545 const int my_depth = 8; 546 char *command, *syscall_pin, *syscall_pout; 546 char *command, *syscall_pin, *syscall_pout; 547 547 char *incoming = NULL; 548 char *current_subset_file = NULL; 548 char *current_subset_file = NULL; 549 549 char *current_master_file, *masklist; 550 550 int retval = 0; … … 561 561 "No masklist provided. I shall therefore set ALL attributes."); 562 562 asprintf(&command, "cat %s | gzip -dc | %s --restore - 2>> %s", 563 original_exat_fname, executable, MONDO_LOGFILE);563 original_exat_fname, executable, MONDO_LOGFILE); 564 564 log_msg(1, "command = %s", command); 565 565 retval = system(command); … … 575 575 } 576 576 asprintf(&masklist, "/tmp/%d.%d.mask", (int) (random() % 32768), 577 (int) (random() % 32768));577 (int) (random() % 32768)); 578 578 asprintf(&command, "cp -f %s %s", orig_msklist, masklist); 579 579 run_program_and_log_output(command, 1); … … 583 583 asprintf(&syscall_pin, "cat %s | gzip -dc", original_exat_fname); 584 584 asprintf(&syscall_pout, "%s --restore - 2>> %s", executable, 585 MONDO_LOGFILE);585 MONDO_LOGFILE); 586 586 587 587 log_msg(1, "syscall_pin = %s", syscall_pin); … … 774 774 return (add_string_at_node(node->right, string_to_add)); 775 775 } 776 777 776 // walk down tree if appropriate 778 777 if (node->down != NULL && node->ch == char_to_add) { … … 788 787 return (1); 789 788 } 790 791 789 // add here 792 790 if (!(newnode = (struct s_node *) malloc(sizeof(struct s_node)))) { … … 904 902 905 903 open_evalcall_form("Loading filelist from disk"); 906 for (getline(&fname, &n, pin); !feof(pin); 907 getline(&fname, &n, pin)) { 904 for (getline(&fname, &n, pin); !feof(pin); getline(&fname, &n, pin)) { 908 905 if ((fname[strlen(fname) - 1] == 13 909 906 || fname[strlen(fname) - 1] == 10) && strlen(fname) > 0) { … … 1326 1323 */ 1327 1324 int open_and_list_dir(char *dir, char *sth, FILE * fout, 1328 time_t time_of_last_full_backup, char *skeleton_filelist) 1325 time_t time_of_last_full_backup, 1326 char *skeleton_filelist) 1329 1327 { 1330 1328 DIR *dip; … … 1359 1357 // 2.6 has /sys as a proc-type thing -- must be excluded 1360 1358 asprintf(&tmp, 1361 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null",1362 dir, MAX_SKEL_DEPTH, skeleton_filelist);1359 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -path /sys -prune -o -path /dev/shm -prune -o -path /media/floppy -prune -o -type d -a -print > %s 2> /dev/null", 1360 dir, MAX_SKEL_DEPTH, skeleton_filelist); 1363 1361 #else 1364 1362 // On BSD, for example, /sys is the kernel sources -- don't exclude 1365 1363 asprintf(&tmp, 1366 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -type d -a -print > %s 2> /dev/null",1367 dir, MAX_SKEL_DEPTH, skeleton_filelist);1364 "find %s -maxdepth %d -path /proc -prune -o -path /tmp -prune -o -type d -a -print > %s 2> /dev/null", 1365 dir, MAX_SKEL_DEPTH, skeleton_filelist); 1368 1366 #endif 1369 1367 system(tmp); … … 1436 1434 asprintf(&new_with_spaces, " %s ", new); 1437 1435 /* BERLIOS: Old code 1438 new_with_spaces[0] = ' ';1439 strcpy(new_with_spaces + 1, new);1440 strcat(new_with_spaces, " ");1441 */1436 new_with_spaces[0] = ' '; 1437 strcpy(new_with_spaces + 1, new); 1438 strcat(new_with_spaces, " "); 1439 */ 1442 1440 if (strstr(skip_these, new_with_spaces)) { 1443 1441 fprintf(fout, "%s\n", new); … … 1447 1445 && S_ISDIR(statbuf.st_mode)) { 1448 1446 open_and_list_dir(new, skip_these, fout, 1449 time_of_last_full_backup, skeleton_filelist); 1447 time_of_last_full_backup, 1448 skeleton_filelist); 1450 1449 } else { 1451 1450 if (time_of_last_full_backup == 0 … … 1457 1456 uberctr++; 1458 1457 asprintf(&tmp, " %c ", 1459 special_dot_char(uberctr));1458 special_dot_char(uberctr)); 1460 1459 #ifndef _XWIN 1461 1460 if (!g_text_mode) { … … 1547 1546 time_t time_of_last_full_backup = 0; 1548 1547 struct stat statbuf; 1549 char *skeleton_filelist; 1550 1548 char *skeleton_filelist; 1549 // The pathname to the skeleton filelist, used to give better progress reporting for mondo_makefilelist(). 1551 1550 1552 1551 asprintf(&sz_datefile, sz_datefile_wildcard, 0); … … 1565 1564 if (differential == 0) { 1566 1565 // restore last good datefile if it exists 1567 asprintf(&command, "cp -f %s.aborted %s", sz_datefile, sz_datefile); 1566 asprintf(&command, "cp -f %s.aborted %s", sz_datefile, 1567 sz_datefile); 1568 1568 run_program_and_log_output(command, 3); 1569 1569 paranoid_free(command); … … 1572 1572 if (does_file_exist(sz_datefile)) { 1573 1573 asprintf(&command, "mv -f %s %s.aborted", sz_datefile, 1574 sz_datefile);1574 sz_datefile); 1575 1575 paranoid_system(command); 1576 1576 paranoid_free(command); … … 1630 1630 log_msg(1, "Including %s in filelist %s", q, sz_filelist); 1631 1631 open_and_list_dir(q, exclude_paths, fout, 1632 time_of_last_full_backup, skeleton_filelist); 1632 time_of_last_full_backup, 1633 skeleton_filelist); 1633 1634 p += strlen(q); 1634 1635 while (*p == ' ') { … … 1819 1820 return (1); 1820 1821 } 1821 for (getline(&tmp, &n, fin); !feof(fin); 1822 getline(&tmp, &n, fin)) { 1822 for (getline(&tmp, &n, fin); !feof(fin); getline(&tmp, &n, fin)) { 1823 1823 if (!tmp[0]) { 1824 1824 continue; -
trunk/mondo/mondo/common/libmondo-files.c
r110 r127 569 569 return (output); 570 570 } 571 sprintf(command, " cat %s | tail -n1", filename);571 sprintf(command, "tail -n1 %s", filename); 572 572 fin = popen(command, "r"); 573 573 (void) fgets(output, MAX_STR_LEN, fin); … … 1313 1313 if (scratchLL <= 1) { 1314 1314 sprintf(tmp, 1315 "Your backup will probably occupy a single CD/tape/ISO. Maybe two."); 1315 "Your backup will probably occupy a single %s. Maybe two.", 1316 media_descriptor_string(bkpinfo->backup_media_type)); 1316 1317 } else { 1317 1318 sprintf(tmp, "Your backup will occupy approximately %s media.", -
trunk/mondo/mondo/common/libmondo-stream.c
r122 r127 227 227 } 228 228 asprintf(&command, "%s -scanbus 2> /dev/null | grep -i tape | wc -l", 229 cdr_exe);229 cdr_exe); 230 230 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); 231 231 paranoid_free(command); … … 240 240 241 241 asprintf(&command, 242 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1",243 cdr_exe);242 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f2 | head -n1", 243 cdr_exe); 244 244 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); 245 245 paranoid_free(command); … … 251 251 252 252 asprintf(&command, 253 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1",254 cdr_exe);253 "%s -scanbus 2> /dev/null | tr -s '\t' ' ' | grep \"[0-9]*,[0-9]*,[0-9]*\" | grep -v \"[0-9]*) \\*\" | grep -i TAPE | cut -d' ' -f3 | cut -d')' -f1 | head -n1", 254 cdr_exe); 255 255 paranoid_free(cdr_exe); 256 256 … … 292 292 log_it("Turning %s", dev); 293 293 paranoid_free(tmp); 294 asprintf(&tmp, (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev); 294 asprintf(&tmp, 295 (strrchr(dev, '/') != NULL) ? strrchr(dev, '/') : dev); 295 296 sprintf(dev, "/dev/os%s", tmp); 296 297 log_it("...into %s", dev); … … 327 328 int res = 0; 328 329 int retval = 0; 329 char *fname = &res; /* Should NOT be NULL */330 char *fname = &res; /* Should NOT be NULL */ 330 331 331 332 // xattr … … 411 412 // log_it("g_current_media_number = %d", g_current_media_number); 412 413 asprintf(&tmp, 413 "When the tape drive goes quiet, please insert volume %d in this series.",414 tapeno);414 "When the tape drive goes quiet, please insert volume %d in this series.", 415 tapeno); 415 416 popup_and_OK(tmp); 416 417 paranoid_free(tmp); … … 467 468 char *p; 468 469 /* BERLIOS: useless 469 char suffix[16];470 */470 char suffix[16]; 471 */ 471 472 472 473 bufsize_K = (long long) (1024LL * (1 + g_tape_buffer_size_MB)); 473 474 asprintf(&tmpdir, "%s/tmpfs/backcatalog", td); 474 475 /* BERLIOS: useless 475 if ((p = strrchr(latest_fname, '.'))) {476 477 } else {478 479 }480 */476 if ((p = strrchr(latest_fname, '.'))) { 477 strcpy(suffix, ++p); 478 } else { 479 suffix[0] = '\0'; 480 } 481 */ 481 482 if (strstr(latest_fname, ".afio.") || strstr(latest_fname, ".star.")) { 482 483 type = fileset; … … 556 557 return (0); 557 558 } 558 asprintf(&tmp, "mt -f %s setblk %ld", tapedev, internal_tape_block_size); 559 asprintf(&tmp, "mt -f %s setblk %ld", tapedev, 560 internal_tape_block_size); 559 561 res = run_program_and_log_output(tmp, 3); 560 562 paranoid_free(tmp); … … 669 671 chdir(bkpinfo->tmpdir); 670 672 asprintf(&tmp, "tar -zxf %s tmp/mondo-restore.cfg 2> /dev/null", 671 outfname);673 outfname); 672 674 paranoid_system(tmp); 673 675 paranoid_free(tmp); … … 696 698 /* add 'dummy' if testing */ 697 699 asprintf(&command, 698 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",699 cddev, speed, MONDO_LOGFILE, MONDO_LOGFILE);700 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", 701 cddev, speed, MONDO_LOGFILE, MONDO_LOGFILE); 700 702 /* initialise the catalog */ 701 703 g_current_media_number = 1; … … 817 819 char *tmp; 818 820 char *datablock; 819 char *temp_fname = bkpinfo; 820 char *temp_cksum = bkpinfo; 821 char *temp_fname = bkpinfo; /* Should NOT be NULL */ 822 char *temp_cksum = bkpinfo; /* Should NOT be NULL */ 821 823 char *actual_cksum; 822 824 … … 857 859 if (orig_size != temp_size && orig_size != -1) { 858 860 asprintf(&tmp, 859 "output file's size should be %ld K but is apparently %ld K",860 (long) size >> 10, (long) temp_size >> 10);861 "output file's size should be %ld K but is apparently %ld K", 862 (long) size >> 10, (long) temp_size >> 10); 861 863 log_to_screen(tmp); 862 864 paranoid_free(tmp); … … 867 869 } 868 870 asprintf(&tmp, "Reading file from tape; writing to '%s'; %ld KB", 869 outfname, (long) size >> 10);871 outfname, (long) size >> 10); 870 872 log_to_screen(tmp); 871 873 paranoid_free(tmp); … … 937 939 if (strcmp(temp_cksum, actual_cksum)) { 938 940 asprintf(&tmp, "actual cksum=%s; recorded cksum=%s", actual_cksum, 939 temp_cksum);941 temp_cksum); 940 942 log_to_screen(tmp); 941 943 paranoid_free(tmp); 942 944 943 945 asprintf(&tmp, "%s (%ld K) is corrupt on tape", temp_fname, 944 (long) orig_size >> 10);946 (long) orig_size >> 10); 945 947 log_to_screen(tmp); 946 948 paranoid_free(tmp); … … 1110 1112 int res; 1111 1113 int ctrl_chr; 1112 char *temp_fname = &res; 1114 char *temp_fname = &res; /* should NOT be NULL */ 1113 1115 char *datablock; 1114 1116 long long temp_size, size; … … 1175 1177 fread(datablock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream); 1176 1178 } 1177 1179 1178 1180 paranoid_free(temp_fname); 1179 1181 temp_fname = &res; 1180 res = 1181 read_header_block_from_stream(&temp_size, NULL, 1182 &ctrl_chr); 1182 res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr); 1183 1183 if (ctrl_chr != BLK_STOP_FILE) { 1184 1184 wrong_marker(BLK_STOP_FILE, ctrl_chr); 1185 1185 } 1186 res = 1187 read_header_block_from_stream(&temp_size, NULL, 1188 &ctrl_chr); 1186 res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr); 1189 1187 if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) { 1190 1188 wrong_marker(BLK_STOP_AN_AFIO_OR_SLICE, ctrl_chr); 1191 1189 } 1192 res = 1193 read_header_block_from_stream(&temp_size, NULL, 1194 &ctrl_chr); 1190 res = read_header_block_from_stream(&temp_size, NULL, &ctrl_chr); 1195 1191 if (ctrl_chr != BLK_START_AN_AFIO_OR_SLICE) { 1196 1192 wrong_marker(BLK_START_AN_AFIO_OR_SLICE, ctrl_chr); … … 1209 1205 } 1210 1206 /* BERLIOS: useless ? 1211 pB = strrchr(the_file_I_was_reading, '/');1212 if (pB) {1213 1214 } else {1215 1216 }1217 */1207 pB = strrchr(the_file_I_was_reading, '/'); 1208 if (pB) { 1209 pB++; 1210 } else { 1211 pB = the_file_I_was_reading; 1212 } 1213 */ 1218 1214 } 1219 1215 log_msg(2, "Reading %s (it matches %s)", temp_fname, … … 1291 1287 if (bkpinfo->backup_media_type == cdstream) { 1292 1288 asprintf(&command, 1293 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s",1294 bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE,1295 MONDO_LOGFILE);1289 "cdrecord -eject dev=%s speed=%d fs=24m -waiti - >> %s 2>> %s", 1290 bkpinfo->media_device, bkpinfo->cdrw_speed, MONDO_LOGFILE, 1291 MONDO_LOGFILE); 1296 1292 log_it("Opening OUT to next CD with the command"); 1297 1293 log_it(command); … … 1343 1339 for (i = 0; i <= last; i++) { 1344 1340 asprintf(&fname, "%s/tmpfs/backcatalog/%s", bkpinfo->tmpdir, 1345 g_tapecatalog->el[i].fname);1341 g_tapecatalog->el[i].fname); 1346 1342 if (!does_file_exist(fname)) { 1347 1343 log_msg(6, "Can't write %s - it doesn't exist.", fname); … … 1491 1487 } 1492 1488 asprintf(&tmp, "Writing file '%s' to tape (%ld KB)", p, 1493 (long) filesize >> 10);1489 (long) filesize >> 10); 1494 1490 log_it(tmp); 1495 1491 paranoid_free(tmp); … … 1594 1590 g_tape_stream) / 1024; 1595 1591 asprintf(&tmp, "%s (fname=%s, size=%ld K)", 1596 marker_to_string(control_char), p,1597 (long) length_of_incoming_file >> 10);1592 marker_to_string(control_char), p, 1593 (long) length_of_incoming_file >> 10); 1598 1594 log_msg(6, tmp); 1599 1595 paranoid_free(tmp); … … 1615 1611 /*@ end vars *************************************************** */ 1616 1612 asprintf(&tmp, "Wrong marker! (Should be %s, is actually %s)", 1617 marker_to_string(should_be), marker_to_string(it_is));1613 marker_to_string(should_be), marker_to_string(it_is)); 1618 1614 log_to_screen(tmp); 1619 1615 paranoid_free(tmp); -
trunk/mondo/mondo/common/libmondo-tools.c
r94 r127 168 168 169 169 asprintf(&tmp, 170 170 "for i in `find /root /home -type d -name Desktop -maxdepth 2`; do \ 171 171 file=$i/.directory; if [ -f \"$file\" ] ; then mv -f $file $file.old ; \ 172 172 cat $file.old | awk '{if (index($0, \"rootimagesmindi\")) { while (length($0)>2) { getline;} ; } \ … … 189 189 190 190 asprintf(&home_sz, 191 192 191 call_program_and_get_last_line_of_output 192 ("find /usr/lib/ /usr/local/ /usr/share/ /usr/local/share/ /opt/ /ramdisk/usr/share/ -type d -maxdepth 2 -name include -prune -o -type d -maxdepth 2 -path '*/mondo/restore-scripts' -printf '%h\n' 2> /dev/null")); 193 193 194 194 if (home_sz[0] == '\0') { 195 195 paranoid_free(home_sz); 196 196 asprintf(&home_sz, 197 198 197 call_program_and_get_last_line_of_output 198 ("find /usr -type d -path '*/mondo/restore-scripts' -follow -maxdepth 3 -printf '%h\n' 2> /dev/null")); 199 199 } 200 200 if (home_sz[0] == '\0') { … … 402 402 #ifdef __FreeBSD__ 403 403 asprintf(&tmp, 404 405 404 call_program_and_get_last_line_of_output 405 ("vmstat | tail -1 | tr -s ' ' | cut -d' ' -f6")); 406 406 avm += atol(tmp); 407 407 paranoid_free(tmp); 408 408 asprintf(&tmp, 409 410 409 call_program_and_get_last_line_of_output 410 ("swapinfo | grep -v Device | tr -s ' ' | cut -d' ' -f4 | tr '\n' '+' | sed 's/+$//' | bc")); 411 411 avm += atol(tmp); 412 412 paranoid_free(tmp); 413 413 asprintf(&command, "mdmfs -s %d%c md9 %s", rdsiz_MB, 'm', 414 g_tmpfs_mountpt);414 g_tmpfs_mountpt); 415 415 #else 416 416 asprintf(&tmp, 417 418 417 call_program_and_get_last_line_of_output 418 ("free | grep \":\" | tr -s ' ' '\t' | cut -f2 | head -n1")); 419 419 avm += atol(tmp); 420 420 paranoid_free(tmp); 421 421 asprintf(&command, "mount /dev/shm -t tmpfs %s -o size=%d%c", 422 g_tmpfs_mountpt, rdsiz_MB, 'm');422 g_tmpfs_mountpt, rdsiz_MB, 'm'); 423 423 run_program_and_log_output("cat /proc/cpuinfo", 5); 424 424 /* BERLIOS: rpm is not necessarily there ! */ … … 453 453 454 454 if (bkpinfo->backup_media_type == dvd) { 455 if (! 455 if (!(find_home_of_exe("growisofs"))) { 456 456 fatal_error("Please install growisofs."); 457 457 } … … 483 483 sprintf(bkpinfo->call_make_iso, 484 484 "%s %s -Z %s . 2>> _ERR_", 485 mondo_mkisofs_sz, 486 "", bkpinfo->media_device); 485 mondo_mkisofs_sz, "", bkpinfo->media_device); 487 486 } 488 487 paranoid_free(mondo_mkisofs_sz); … … 572 571 log_it("isodir = %s", bkpinfo->isodir); 573 572 asprintf(&command, "df %s | tail -n1 | cut -d' ' -f1", 574 bkpinfo->isodir);573 bkpinfo->isodir); 575 574 log_it("command = %s", command); 576 575 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); … … 582 581 583 582 asprintf(&command, "mount | grep -w %s | tail -n1 | cut -d' ' -f3", 584 tmp);583 tmp); 585 584 paranoid_free(tmp); 586 585 log_it("command = %s", command); … … 595 594 log_it("isomnt: %s, %d", tmp, strlen(tmp)); 596 595 if (strlen(bkpinfo->isodir) < strlen(tmp)) { 597 asprintf(&iso_path, "");596 asprintf(&iso_path, ""); 598 597 } else { 599 598 asprintf(&iso_path, "%s", bkpinfo->isodir + strlen(tmp)); … … 627 626 } else { 628 627 asprintf(&ip_address, "%s%s", inet_ntoa((struct in_addr) 629 *((struct in_addr *) hent-> 630 h_addr)), strchr(bkpinfo->nfs_mount, ':')); 628 *((struct in_addr 629 *) hent-> 630 h_addr)), 631 strchr(bkpinfo->nfs_mount, ':')); 631 632 strcpy(bkpinfo->nfs_mount, ip_address); 632 633 paranoid_free(ip_address); … … 789 790 790 791 asprintf(&command, "df -m %s | tail -n1 | tr -s ' ' '\t' | cut -f4", 791 partition);792 partition); 792 793 asprintf(&out_sz, call_program_and_get_last_line_of_output(command)); 793 794 paranoid_free(command); … … 836 837 } 837 838 asprintf(&tmp, 838 839 839 call_program_and_get_last_line_of_output 840 ("free | grep Mem | head -n1 | tr -s ' ' '\t' | cut -f2")); 840 841 if (atol(tmp) < 35000) { 841 842 retval++; … … 926 927 ("umount `mount | grep cdr | cut -d' ' -f3 | tr '\n' ' '`", 5); 927 928 asprintf(&tmp, 928 929 929 call_program_and_get_last_line_of_output 930 ("mount | grep -E \"cdr(om|w)\"")); 930 931 if (strcmp("", tmp)) { 931 932 if (strstr(tmp, "autofs")) { … … 1027 1028 if (!does_file_exist(config_file)) { 1028 1029 asprintf(&tmp, "(read_cfg_var) Cannot find %s config file", 1029 config_file);1030 config_file); 1030 1031 log_to_screen(tmp); 1031 1032 paranoid_free(tmp); … … 1039 1040 } else { 1040 1041 asprintf(&command, "cat %s | grep \"%s .*\" | cut -d' ' -f2,3,4,5", 1041 config_file, label);1042 config_file, label); 1042 1043 strcpy(value, call_program_and_get_last_line_of_output(command)); 1043 1044 paranoid_free(command); … … 1150 1151 log_it("Started autofs OK"); 1151 1152 } 1152 1153 paranoid_free(tmp); 1153 1154 } 1154 1155 … … 1168 1169 log_msg(4, "Done. Great. Seeting command to something"); 1169 1170 asprintf(&command, 1170 1171 "cat /etc/fstab | grep -v \":\" | grep -vx \"#.*\" | grep -w \"/boot\" | tr -s ' ' '\t' | cut -f1 | head -n1"); 1171 1172 log_msg(4, "Cool. Command = '%s'", command); 1172 1173 asprintf(&tmp, call_program_and_get_last_line_of_output(command)); … … 1191 1192 asprintf(&g_boot_mountpt, tmp); 1192 1193 asprintf(&tmp1, 1193 "%s (your /boot partition) is not mounted. I'll mount it before backing up",1194 g_boot_mountpt);1194 "%s (your /boot partition) is not mounted. I'll mount it before backing up", 1195 g_boot_mountpt); 1195 1196 log_it(tmp1); 1196 1197 paranoid_free(tmp1); … … 1263 1264 if (!does_file_exist(config_file)) { 1264 1265 asprintf(&tmp, "(write_cfg_file) Cannot find %s config file", 1265 config_file);1266 config_file); 1266 1267 log_to_screen(tmp); 1267 1268 paranoid_free(tmp); … … 1269 1270 } 1270 1271 asprintf(&tempfile, 1271 1272 1272 call_program_and_get_last_line_of_output 1273 ("mktemp -q /tmp/mojo-jojo.blah.XXXXXX")); 1273 1274 if (does_file_exist(config_file)) { 1274 1275 asprintf(&command, "cat %s | grep -vx \"%s .*\" > %s", config_file, 1275 label, tempfile);1276 label, tempfile); 1276 1277 paranoid_system(command); 1277 1278 paranoid_free(command); -
trunk/mondo/mondo/common/libmondo-verify.c
r122 r127 608 608 char *orig_cksum; 609 609 char *tmp; 610 char *slice_fnam = (char *) &res;610 char *slice_fnam = (char *) &res; 611 611 612 612 /*@ pointers ******************************************************** */ … … 627 627 asprintf(&test_file, "%s/temporary-%s", bkpinfo->tmpdir, p); 628 628 asprintf(&tmp, 629 "Temporarily copying biggiefile %s's slices from tape to '%s'",630 p, test_file);631 log_it(tmp); 629 "Temporarily copying biggiefile %s's slices from tape to '%s'", 630 p, test_file); 631 log_it(tmp); 632 632 paranoid_free(tmp); 633 633 for (res = … … 643 643 unlink(test_file); 644 644 paranoid_free(slice_fnam); 645 slice_fnam = (char *) &res;645 slice_fnam = (char *) &res; 646 646 res = 647 647 read_header_block_from_stream(&slice_siz, slice_fnam, … … 654 654 retval += res; 655 655 paranoid_free(slice_fnam); 656 slice_fnam = (char *) &res;656 slice_fnam = (char *) &res; 657 657 } 658 658 paranoid_free(test_file); … … 706 706 /*@ buffers ***************************************************** */ 707 707 char *tmp; 708 char *fname = (char *) &res;/* Should NOT be NULL */708 char *fname = (char *) &res; /* Should NOT be NULL */ 709 709 char *curr_xattr_list_fname; 710 710 char *curr_acl_list_fname; … … 744 744 for (res = read_header_block_from_stream(&size, fname, &ctrl_chr); 745 745 ctrl_chr != BLK_STOP_AFIOBALLS; 746 res = 747 read_header_block_from_stream(&size, fname, &ctrl_chr)) { 746 res = read_header_block_from_stream(&size, fname, &ctrl_chr)) { 748 747 asprintf(&curr_xattr_list_fname, XATTR_LIST_FNAME_RAW_SZ, 749 748 bkpinfo->tmpdir, current_afioball_number); … … 753 752 iamhere("Reading EXAT files from tape"); 754 753 paranoid_free(fname); 755 fname = (char *) &res;754 fname = (char *) &res; 756 755 res = 757 756 read_EXAT_files_from_tape(bkpinfo, &size, fname, &ctrl_chr, … … 781 780 g_current_progress++; 782 781 paranoid_free(fname); 783 fname = (char *) &res;782 fname = (char *) &res; 784 783 res = read_header_block_from_stream(&size, fname, &ctrl_chr); 785 784 if (ctrl_chr != BLK_STOP_AN_AFIO_OR_SLICE) { … … 787 786 } 788 787 paranoid_free(fname); 789 fname = (char *) &res;788 fname = (char *) &res; 790 789 } 791 790 log_msg(1, "All done with afioballs"); … … 817 816 818 817 /*@ buffers ******************************************************** */ 819 char *orig_fname = (char *) &ctrl_chr; /* Should NOT be NULL */818 char *orig_fname = (char *) &ctrl_chr; /* Should NOT be NULL */ 820 819 char *logical_fname; 821 820 char *comment; … … 841 840 iamhere("Grabbing the EXAT biggiefiles"); 842 841 paranoid_free(orig_fname); 843 orig_fname = (char *) &ctrl_chr;842 orig_fname = (char *) &ctrl_chr; 844 843 res = 845 844 read_EXAT_files_from_tape(bkpinfo, &size, orig_fname, … … 851 850 paranoid_free(curr_acl_list_fname); 852 851 paranoid_free(orig_fname); 853 orig_fname = (char *) &ctrl_chr;852 orig_fname = (char *) &ctrl_chr; 854 853 855 854 if (ctrl_chr != BLK_START_BIGGIEFILES) { … … 891 890 g_current_progress++; 892 891 paranoid_free(orig_fname); 893 orig_fname = (char *) &ctrl_chr;892 orig_fname = (char *) &ctrl_chr; 894 893 } 895 894 close_progress_form(); -
trunk/mondo/mondo/common/my-stuff.h
r122 r127 210 210 * @c growisofs command to generate a bootable DVD using isolinux, except for the directory to image. 211 211 */ 212 #define MONDO_GROWISOFS_REGULAR_SYSLINUX "growisofs - use-the-force-luke -J -no-emul-boot -boot-load-size 4 -b isolinux.bin --boot-info-table -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_ -v"212 #define MONDO_GROWISOFS_REGULAR_SYSLINUX "growisofs -speed=1 -use-the-force-luke -J -no-emul-boot -boot-load-size 4 -b isolinux.bin --boot-info-table -c boot.cat -boot-load-size 4 -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL_Version -V _CD#_ -v" 213 213 214 214 /** 215 215 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image. 216 */// -b images/mindi-boot.2880.img217 #define MONDO_GROWISOFS_REGULAR_ELILO "growisofs - use-the-force-luke -no-emul-boot -b images/mindi-boot.2880.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"216 */// -b images/mindi-boot.2880.img 217 #define MONDO_GROWISOFS_REGULAR_ELILO "growisofs -speed=1 -use-the-force-luke -no-emul-boot -b images/mindi-boot.2880.img -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v" 218 218 219 219 /** 220 220 * @c growisofs command to generate a bootable DVD using LILO, except for the directory to image. 221 */// -b images/mindi-boot.2880.img222 #define MONDO_GROWISOFS_REGULAR_LILO "growisofs - no-emul-boot -b isolinux.bin -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"221 */// -b images/mindi-boot.2880.img 222 #define MONDO_GROWISOFS_REGULAR_LILO "growisofs -speed=1 -no-emul-boot -b isolinux.bin -c boot.cat -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v" 223 223 224 224 /** 225 225 * @c growisofs command to generate a nonbootable DVD, except for the directory to image. 226 226 */ 227 #define MONDO_GROWISOFS_NONBOOT "growisofs - use-the-force-luke -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v"227 #define MONDO_GROWISOFS_NONBOOT "growisofs -speed=1 -use-the-force-luke -J -r -p MondoRescue -publisher www.mondorescue.org -A Mondo_Rescue_GPL -V _CD#_ -v" 228 228 229 229 /** -
trunk/mondo/mondo/common/newt-specific.c
r121 r127 313 313 314 314 system 315 (" cat /var/log/mondo-archive.log | gzip -9> /tmp/MA.log.gz 2> /dev/null");315 ("gzip -9c /var/log/mondo-archive.log > /tmp/MA.log.gz 2> /dev/null"); 316 316 if (!strstr(g_version, "cvs") && !strstr(g_version, "svn")) { 317 317 printf("Please try the latest SVN version "); … … 427 427 } 428 428 if (grep_for_me[0] != '\0') { 429 asprintf(&command, "cat %s | grep \"%s\" | tail -n%d", 430 filename, grep_for_me, g_noof_log_lines); 431 } else { 432 asprintf(&command, "cat %s | tail -n%d", filename, 433 g_noof_log_lines); 429 asprintf(&command, "grep '%s' %s | tail -n%d", 430 grep_for_me, filename, g_noof_log_lines); 431 } else { 432 asprintf(&command, "tail -n%d %s", g_noof_log_lines, filename); 434 433 } 435 434 fin = popen(command, "r"); -
trunk/mondo/mondo/mondorestore/mondo-prep.c
r115 r127 488 488 if (lvmversion == 2) { 489 489 strcpy(tmp, call_program_and_get_last_line_of_output 490 (" cat /var/log/mondo-archive.log | tail -n5| grep Insufficient | tail -n1"));490 ("tail -n5 /var/log/mondo-archive.log | grep Insufficient | tail -n1")); 491 491 } else { 492 492 strcpy(tmp, call_program_and_get_last_line_of_output 493 (" cat /var/log/mondo-archive.log | tail -n5| grep lvcreate | tail -n1"));493 ("tail -n5 /var/log/mondo-archive.log | grep lvcreate | tail -n1")); 494 494 } 495 495 for (p = tmp; *p != '\0' && !isdigit(*p); p++); -
trunk/mondo/mondo/mondorestore/mondo-rstr-newt.c
r59 r127 2312 2312 #else 2313 2313 2314 for (i = 0; 2315 strcmp(raidlist->el[i].raid_device, device) 2314 for (i = 0; strcmp(raidlist->el[i].raid_device, device) 2316 2315 && i < raidlist->entries; i++); 2317 2316 #endif … … 2625 2624 * @ingroup restoreUtilityGroup 2626 2625 */ 2627 int 2628 read_variableINT_and_remove_from_raidvars(struct 2629 OSSWAP (raid_device_record, 2630 vinum_volume) * raidrec, 2631 char *label) 2626 int read_variableINT_and_remove_from_raidvars(struct 2627 OSSWAP (raid_device_record, 2628 vinum_volume) * 2629 raidrec, char *label) 2632 2630 { 2633 2631 /** int ***************************************************************/ -
trunk/mondo/mondo/mondorestore/mondo-rstr-tools.c
r94 r127 745 745 #endif 746 746 747 } else 748 if (bkpinfo->backup_media_type == iso) { 747 } else if (bkpinfo->backup_media_type == iso) { 749 748 #ifdef __FreeBSD__ 750 749 sprintf(mount_cmd, "%s/%d.iso", bkpinfo->isodir, … … 1965 1964 int signals[] = 1966 1965 { SIGKILL, SIGPIPE, SIGTERM, SIGHUP, SIGTRAP, SIGABRT, SIGINT, 1967 SIGSTOP, 0 }; 1966 SIGSTOP, 0 1967 }; 1968 1968 int i; 1969 1969 for (i = 0; signals[i]; i++) { -
trunk/mondo/mondo/mondorestore/mr-externs.h
r59 r127 85 85 extern void resize_drive_proportionately_to_suit_new_drives(struct 86 86 mountlist_itself 87 *mountlist, 88 char 87 *mountlist, char 89 88 *drive_name); 90 89 extern void resize_mountlist_proportionately_to_suit_new_drives(struct -
trunk/mondo/mondo/xmondo/xmondo.h
r59 r127 56 56 Q_OBJECT public: 57 57 /** construtor */ 58 XMondo(QWidget * parent = 0, const char *name = 0);58 XMondo(QWidget * parent = 0, const char *name = 0); 59 59 /** destructor */ 60 60 virtual ~ XMondo(); -
trunk/mondo/mondo/xmondo/xmondobackup.h
r59 r127 30 30 class XMondoBackup:public QObject { 31 31 Q_OBJECT public: 32 XMondoBackup();32 XMondoBackup(); 33 33 ~XMondoBackup(); 34 34 int run(struct s_bkpinfo *bkpinfo); -
trunk/mondo/mondo/xmondo/xmondorestore.h
r59 r127 44 44 bool good() { 45 45 return ok; 46 } bool isSetupDone() { 46 } 47 bool isSetupDone() { 47 48 return doneSetup; 48 49 }
Note:
See TracChangeset
for help on using the changeset viewer.