Changeset 1638 in MondoRescue
- Timestamp:
- Sep 19, 2007, 9:32:00 AM (17 years ago)
- Location:
- branches/stable/mondo
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/configure.in
r1619 r1638 38 38 AC_ARG_ENABLE(debug, AS_HELP_STRING(--enable-debug,Add debugging flags), CFLAGS="$CFLAGS -g", ) 39 39 AC_ARG_WITH(max-noof-media, AS_HELP_STRING(--with-max-noof-media=NUM,Compile for a certain maximum number of media (default 50)), max_noof_media=$withval, max_noof_media=50) 40 AC_ARG_WITH(tape-block-size, AS_HELP_STRING(--with-tape-block-size=NUM,Set tape block size in kilobytes (default 131072)), exttape=${withval:=131072}, exttape=131072)41 40 if test x$do_static_mr = xyes; then 42 41 MONDORESTORE_STATIC=-static … … 45 44 fi 46 45 AC_SUBST(MONDORESTORE_STATIC) 47 AC_DEFINE_UNQUOTED(EXTTAPE, $exttape, [Tape blocksize])48 46 49 47 # ( which automake 2>/dev/null >/dev/null && ( automake --version 2>&1 | grep -q 1.5 || automake --version 2>&1 | grep -q 1.7 || AC_MSG_ERROR([Automake must be version 1.5 or 1.7, if you have it at all]) ) ) -
branches/stable/mondo/src/common/libmondo-archive.c
r1627 r1638 26 26 #include "mr_file.h" 27 27 #include "mr_gettext.h" 28 #include "mr_conf.h" 28 29 29 30 #include "libmondo-string-EXT.h" … … 56 57 #endif 57 58 #endif /* __FreeBSD__ */ 59 60 extern struct mr_conf *mr_conf; 58 61 59 62 /*@unused@*/ … … 367 370 368 371 mr_asprintf(&command, "afio -o -b %ld -M 16m %s %s < %s 2>> %s", 369 TAPE_BLOCK_SIZE, zipparams, fname, filelist, MONDO_LOGFILE);372 mr_conf->external_tape_blocksize, zipparams, fname, filelist, MONDO_LOGFILE); 370 373 mr_free(zipparams); 371 374 -
branches/stable/mondo/src/common/libmondo-devices.c
r1609 r1638 1794 1794 mr_free(command); 1795 1795 1796 mr_asprintf(&tmp, mr_conf->prefix); 1796 1797 if (!popup_and_get_string 1797 1798 ("Prefix.", 1798 1799 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 1799 bkpinfo->prefix, MAX_STR_LEN / 4)) {1800 tmp, MAX_STR_LEN / 4)) { 1800 1801 log_to_screen("User has chosen not to backup the PC"); 1801 1802 finish(1); 1802 1803 } 1804 mr_free(bkpinfo->prefix); 1805 bkpinfo->prefix = tmp; 1803 1806 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 1804 1807 … … 1851 1854 } 1852 1855 } 1856 mr_asprintf(&tmp, mr_conf->prefix); 1853 1857 if (!popup_and_get_string 1854 1858 ("Prefix.", 1855 1859 "Please enter the prefix that will be prepended to your ISO filename. Example: machine1 to obtain machine1-[1-9]*.iso files", 1856 bkpinfo->prefix, MAX_STR_LEN / 4)) {1860 tmp, MAX_STR_LEN / 4)) { 1857 1861 log_to_screen("User has chosen not to backup the PC"); 1858 1862 finish(1); 1859 1863 } 1864 mr_free(bkpinfo->prefix); 1865 bkpinfo->prefix = tmp; 1860 1866 mr_msg(3, "prefix set to %s", bkpinfo->prefix); 1861 1867 break; -
branches/stable/mondo/src/common/libmondo-stream.c
r1594 r1638 17 17 #include "mr_list.h" 18 18 #include "mr_gettext.h" 19 #include "mr_conf.h" 19 20 20 21 #include "mondostructures.h" … … 38 39 extern char *g_getfattr; 39 40 extern char *MONDO_LOGFILE; 41 42 extern struct mr_conf *mr_conf; 40 43 41 44 /** … … 864 867 malloc_string(temp_fname); 865 868 malloc_string(temp_cksum); 866 datablock = mr_malloc( TAPE_BLOCK_SIZE);869 datablock = mr_malloc(mr_conf->external_tape_blocksize); 867 870 crc16 = 0; 868 871 crctt = 0; … … 904 907 bytes_read) { 905 908 bytes_to_write = 906 (size < TAPE_BLOCK_SIZE) ? (long) size : TAPE_BLOCK_SIZE;907 bytes_to_read = TAPE_BLOCK_SIZE;909 (size < mr_conf->external_tape_blocksize) ? (long) size : mr_conf->external_tape_blocksize; 910 bytes_to_read = mr_conf->external_tape_blocksize; 908 911 bytes_read = fread(datablock, 1, bytes_to_read, g_tape_stream); 909 912 while (bytes_read < bytes_to_read) { // next tape! … … 995 998 /*@ end vars *************************************************** */ 996 999 997 tempblock = (char *) mr_malloc((size_t) TAPE_BLOCK_SIZE);998 999 for (i = 0; i < (int) TAPE_BLOCK_SIZE; i++) {1000 tempblock = (char *) mr_malloc((size_t) mr_conf->external_tape_blocksize); 1001 1002 for (i = 0; i < (int) mr_conf->external_tape_blocksize; i++) { 1000 1003 tempblock[i] = 0; 1001 1004 } 1002 1005 while (!(*pcontrol_char = tempblock[7000])) { 1003 1006 g_tape_posK += 1004 fread(tempblock, 1, (size_t) TAPE_BLOCK_SIZE,1007 fread(tempblock, 1, (size_t) mr_conf->external_tape_blocksize, 1005 1008 g_tape_stream) / 1024; 1006 1009 } … … 1131 1134 long bytes_to_write; 1132 1135 1133 datablock = mr_malloc( TAPE_BLOCK_SIZE);1136 datablock = mr_malloc(mr_conf->external_tape_blocksize); 1134 1137 malloc_string(temp_fname); 1135 1138 pB = strrchr(the_file_I_was_reading, '/'); … … 1181 1184 for (size = temp_size; size > 0; size -= bytes_to_write) { 1182 1185 bytes_to_write = 1183 (size < TAPE_BLOCK_SIZE) ? (long) size : TAPE_BLOCK_SIZE;1186 (size < mr_conf->external_tape_blocksize) ? (long) size : mr_conf->external_tape_blocksize; 1184 1187 // FIXME - needs error-checking and -catching 1185 fread(datablock, 1, (size_t) TAPE_BLOCK_SIZE, g_tape_stream);1188 fread(datablock, 1, (size_t) mr_conf->external_tape_blocksize, g_tape_stream); 1186 1189 } 1187 1190 res = … … 1444 1447 /*@ buffers **************************************************** */ 1445 1448 char *tmp = NULL; 1446 char datablock[TAPE_BLOCK_SIZE];1449 char *datablock = NULL; 1447 1450 char *checksum = NULL; 1448 1451 char *infile_basename = NULL; … … 1473 1476 crc16 = 0; 1474 1477 crctt = 0; 1478 datablock = mr_malloc(mr_conf->external_tape_blocksize); 1475 1479 1476 1480 /*@ end vars *************************************************** */ … … 1508 1512 for (noof_blocks = 0; filesize > 0; 1509 1513 noof_blocks++, filesize -= bytes_to_read) { 1510 if (filesize < TAPE_BLOCK_SIZE) {1514 if (filesize < mr_conf->external_tape_blocksize) { 1511 1515 bytes_to_read = (long) filesize; 1512 for (i = 0; i < TAPE_BLOCK_SIZE; i++) {1516 for (i = 0; i < mr_conf->external_tape_blocksize; i++) { 1513 1517 datablock[i] = '\0'; 1514 1518 } 1515 1519 } else { 1516 bytes_to_read = TAPE_BLOCK_SIZE;1520 bytes_to_read = mr_conf->external_tape_blocksize; 1517 1521 } 1518 1522 (void) fread(datablock, 1, (size_t) bytes_to_read, fin); 1519 1523 g_tape_posK += fwrite(datablock, 1, /*bytes_to_read */ 1520 (size_t) TAPE_BLOCK_SIZE,1524 (size_t) mr_conf->external_tape_blocksize, 1521 1525 g_tape_stream) / 1024; 1522 1526 if (g_sigpipe) { … … 1536 1540 #endif 1537 1541 } 1542 paranoid_free(datablock); 1538 1543 paranoid_fclose(fin); 1539 1544 mr_asprintf(&checksum, "%04x%04x", crc16, crctt); … … 1563 1568 { 1564 1569 /*@ buffers **************************************************** */ 1565 char tempblock[TAPE_BLOCK_SIZE];1570 char *tempblock; 1566 1571 char *p; 1567 1572 … … 1573 1578 /*@ end vars *************************************************** */ 1574 1579 1580 tempblock = mr_malloc(mr_conf->external_tape_blocksize); 1575 1581 1576 1582 olen = length_of_incoming_file; … … 1586 1592 return (1); 1587 1593 } 1588 for (i = 0; i < (int) TAPE_BLOCK_SIZE; i++) {1594 for (i = 0; i < (int) mr_conf->external_tape_blocksize; i++) { 1589 1595 tempblock[i] = 0; 1590 1596 } … … 1594 1600 strcpy(tempblock + 1000, filename); 1595 1601 g_tape_posK += 1596 fwrite(tempblock, 1, (size_t) TAPE_BLOCK_SIZE,1602 fwrite(tempblock, 1, (size_t) mr_conf->external_tape_blocksize, 1597 1603 g_tape_stream) / 1024; 1604 paranoid_free(tempblock); 1598 1605 mr_msg(6, "%s (fname=%s, size=%ld K)", 1599 1606 marker_to_string(control_char), p, -
branches/stable/mondo/src/common/libmondo-tools.c
r1628 r1638 696 696 697 697 bkpinfo->manual_tray = mr_conf->manual_tray; 698 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;698 bkpinfo->internal_tape_block_size = mr_conf->internal_tape_blocksize; 699 699 mr_asprintf(&tmp,mr_conf->media_device); 700 700 bkpinfo->media_device = tmp; -
branches/stable/mondo/src/include/my-stuff.h
r1629 r1638 147 147 #define BLK_ABORTED_BACKUP 102 ///< Marker block: backup was aborted. 148 148 149 /// The external tape blocksize.150 #ifdef EXTTAPE151 #define TAPE_BLOCK_SIZE (long)EXTTAPE152 #else153 #define TAPE_BLOCK_SIZE 131072L /* was 8192; 06/2002-->65536; 11/2002-->131072 */154 #endif155 156 #define DEFAULT_INTERNAL_TAPE_BLOCK_SIZE 32768 // Nov 2003?157 158 159 160 161 149 #define SLICE_SIZE 4096 ///< The size of a slice of a biggiefile. 162 163 164 165 166 167 150 168 151 /** -
branches/stable/mondo/src/mondoarchive/mondo-cli.c
r1628 r1638 207 207 assert(flag_set != NULL); 208 208 209 bkpinfo->internal_tape_block_size = DEFAULT_INTERNAL_TAPE_BLOCK_SIZE;209 bkpinfo->internal_tape_block_size = mr_conf->internal_tape_blocksize; 210 210 211 211 /* compulsory */ … … 429 429 } 430 430 } else if (flag_set['u'] || flag_set['t']) { 431 /* Force aut idetection */431 /* Force autodetection */ 432 432 bkpinfo->media_size = 0L; 433 433 } else { -
branches/stable/mondo/src/mondorestore/mondo-rstr-compare.c
r1633 r1638 230 230 char *archiver_exe = NULL; 231 231 char *compressor_exe = NULL; 232 #ifdef __FreeBSD__ 233 long BUFSIZE=512L; 234 #else 235 long BUFSIZE=(1024L*1024L)/mr_conf->external_tape_blexternal_tape_blocksize; 236 #endif 237 232 238 233 239 use_star = (strstr(tarball_fname, ".star")) ? TRUE : FALSE; … … 271 277 } 272 278 273 #ifdef __FreeBSD__274 #define BUFSIZE 512L275 #else276 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE277 #endif278 279 279 mr_asprintf(&logfile, "/tmp/afio.log.%d", current_tarball_number); 280 280 if (use_star) // doesn't use compressor_exe … … 287 287 "%s -r -b %ld -M 16m -c %ld %s %s >> %s 2>> %s", 288 288 archiver_exe, 289 TAPE_BLOCK_SIZE,289 mr_conf->external_tape_blocksize, 290 290 BUFSIZE, compressor_exe, tarball_fname, logfile, logfile); 291 291 } 292 #undef BUFSIZE293 292 mr_free(archiver_exe); 294 293 mr_free(compressor_exe); -
branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c
r1629 r1638 886 886 bkpinfo->internal_tape_block_size); 887 887 } else { 888 bkpinfo->internal_tape_block_size = 889 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE; 890 mr_msg(1, "Internal tape block size = default (%ld)", 891 DEFAULT_INTERNAL_TAPE_BLOCK_SIZE); 888 bkpinfo->internal_tape_block_size = mr_conf->internal_tape_blocksize; 889 mr_msg(1, "Internal tape block size = default (%ld)", mr_conf->internal_tape_blocksize); 892 890 } 893 891 -
branches/stable/mondo/src/mondorestore/mondorestore.c
r1628 r1638 438 438 read_cfg_file_into_bkpinfo(g_mondo_cfg_file, bkpinfo); 439 439 iamhere("Done loading config file; resizing ML"); 440 mr_asprintf(&tmp,bkpinfo->prefix); 440 441 if (popup_and_get_string 441 ("Prefix", "Prefix of your ISO images ?", bkpinfo->prefix, MAX_STR_LEN / 4)) { 442 ("Prefix", "Prefix of your ISO images ?", tmp, MAX_STR_LEN / 4)) { 443 mr_free(bkpinfo->prefix); 444 bkpinfo->prefix = tmp; 442 445 mr_msg(1, "Prefix set to %s",bkpinfo->prefix); 443 446 } … … 1038 1041 1039 1042 pathname_of_last_file_restored[0] = '\0'; 1040 bigblk = mr_malloc( TAPE_BLOCK_SIZE);1043 bigblk = mr_malloc(mr_conf->external_tape_blocksize); 1041 1044 1042 1045 if (!(fin = fopen(slice_fname(bigfileno, 0, ARCHIVES_PATH, ""), "r"))) { … … 1249 1252 1250 1253 while (!feof(fbzip2)) { 1251 siz = fread(bigblk, 1, TAPE_BLOCK_SIZE, fbzip2);1254 siz = fread(bigblk, 1, mr_conf->external_tape_blocksize, fbzip2); 1252 1255 if (siz > 0) { 1253 1256 siz = fwrite(bigblk, 1, siz, fout); … … 1567 1570 char *xattr_fname = NULL; 1568 1571 char *acl_fname = NULL; 1572 #ifdef __FreeBSD__ 1573 long BUFSIZE=512L; 1574 #else 1575 long BUFSIZE=(1024L*1024L)/mr_conf->external_tape_blocksize; 1576 #endif 1577 1569 1578 1570 1579 assert_string_is_neither_NULL_nor_zerolength(tarball_fname); … … 1651 1660 mr_free(tmp); 1652 1661 } 1653 #ifdef __FreeBSD__1654 #define BUFSIZE 5121655 #else1656 #define BUFSIZE (1024L*1024L)/TAPE_BLOCK_SIZE1657 #endif1658 1659 1662 if (use_star) { 1660 1663 mr_asprintf(&command, … … 1668 1671 mr_asprintf(&command, 1669 1672 "afio -i -M 8m -b %ld -c %ld %s -w '%s' %s", 1670 TAPE_BLOCK_SIZE,1673 mr_conf->external_tape_blocksize, 1671 1674 BUFSIZE, executable, filelist_subset_fname, 1672 1675 tarball_fname); … … 1674 1677 mr_asprintf(&command, 1675 1678 "afio -i -b %ld -c %ld -M 8m %s %s", 1676 TAPE_BLOCK_SIZE,1679 mr_conf->external_tape_blocksize, 1677 1680 BUFSIZE, executable, tarball_fname); 1678 1681 } … … 1680 1683 mr_free(executable); 1681 1684 1682 #undef BUFSIZE1683 1685 mr_asprintf(&temp_log, "/tmp/%d.%d", (int) (random() % 32768), 1684 1686 (int) (random() % 32768)); … … 1841 1843 } else { 1842 1844 use_star = FALSE; 1843 mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", TAPE_BLOCK_SIZE,1845 mr_asprintf(&command, "afio -t -M 8m -b %ld %s %s", mr_conf->external_tape_blocksize, 1844 1846 executable, afio_fname); 1845 1847 } … … 1883 1885 // afio 1884 1886 if (filelist) { 1885 mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE);1887 mr_asprintf(&command, "afio -i -M 8m -b %ld %s -w %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, filelist_subset_fname, afio_fname, MONDO_LOGFILE); 1886 1888 } else { 1887 mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", TAPE_BLOCK_SIZE, executable, afio_fname, MONDO_LOGFILE);1889 mr_asprintf(&command, "afio -i -M 8m -b %ld %s %s 2>> %s", mr_conf->external_tape_blocksize, executable, afio_fname, MONDO_LOGFILE); 1888 1890 } 1889 1891 }
Note:
See TracChangeset
for help on using the changeset viewer.