|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
Patch adding support for bacula by Luigi Gangitano <luigi@debian.org>
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
* Allow session to cross 4GB boundary regardless of medium type
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
* Add a -F option (used instead of -M or -Z), which displays
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
next_session offset and capacity
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
diff -Naur dvd+rw-tools-7.0.orig/growisofs.c dvd+rw-tools-7.0/growisofs.c
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
--- dvd+rw-tools-7.0.orig/growisofs.c 2006-09-24 17:28:53.000000000 +0000
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+++ dvd+rw-tools-7.0/growisofs.c 2006-10-29 14:18:35.000000000 +0000
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -370,6 +370,11 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
* upon Layer Break command, therefore longer timeout is required;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
* - Linux: deploy BLKFLSBUF to avoid media reloads when possible;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
* - add unit buffer utilization indicator [by request from K3b];
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ * Additions by Nicolas Boichat, Bacula project
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ * - Allow session to cross 4GB boundary regardless of medium type
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ * (don't need to have a DL media)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ * - Add a -F option (used instead of -M or -Z), which displays next_session
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ * offset and capacity (free space = next_session - capacity).
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
*/
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
#define PRINT_VERSION(cmd) do { \
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
char *s=strrchr((cmd),'/'); \
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -2773,6 +2778,18 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
else in_device = argv[++i];
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
dev_found = 'Z';
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
}
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ else if (argv[i][1] == 'F')
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ { if (len > 2) in_device = argv[i]+2;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ else in_device = argv[++i];
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ dev_found = 'F';
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ dry_run = 1; /* NEVER write anything with -F */
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ else if (!strncmp(opt,"-free-space",11))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ { if (len > 11) in_device = opt+11;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ else in_device = argv[++i];
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ dev_found = 'F';
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ dry_run = 1; /* NEVER write anything with -F */
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
else if (!strcmp(opt,"-poor-man"))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
{ if (poor_man<0) poor_man = 1;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
continue;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -2993,7 +3010,9 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
fprintf (stderr," you most likely want to use -Z option.\n"),
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
exit (FATAL_START(errno));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
- if (dev_found == 'M')
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ if ((dev_found == 'M') ||
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ ((dev_found == 'F') && !(mmc_profile&0x10000)) && (saved_descriptors[0].type[0] || saved_descriptors[0].type[1] || saved_descriptors[0].type[2]))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ /* -F : The medium is not blank, there is a fs on it (the_buffer[0,1 or 2] != 0), so compute next_session. */
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
{ if (memcmp (saved_descriptors[0].type,"\1CD001",6))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
fprintf (stderr,":-( %s doesn't look like isofs...\n",
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
in_device), exit(FATAL_START(EMEDIUMTYPE));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -3016,8 +3035,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
exit(FATAL_START(EINVAL));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
}
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
else if (next_session > (0x200000-0x5000)) /* 4GB/2K-40MB/2K */
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
- if ((mmc_profile&0xFFFF)<0x20 ||
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
- ((mmc_profile&0xFFFF)<0x40 && !no_4gb_check))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ if (!no_4gb_check)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
fprintf (stderr,":-( next session would cross 4GB "
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
"boundary, aborting...\n"),
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
exit (FATAL_START(ENOSPC));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -3060,7 +3078,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
exit (FATAL_START(EINVAL));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
if (imgfd<0)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
- { if (mkisofs_argc==1)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ { if ((mkisofs_argc==1) && (dev_found != 'F'))
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
fprintf (stderr,"%s: no mkisofs options specified, "
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
"aborting...\n",argv[0]),
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
exit (FATAL_START(EINVAL));
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
@@ -3244,6 +3262,15 @@
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
}
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
}
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ if (dev_found == 'F') {
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ off64_t capacity = 0;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ printf("next_session=%lld\n", next_session*CD_BLOCK);
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ if (ioctl_handle!=INVALID_HANDLE)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ capacity = get_capacity (ioctl_handle);
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ printf("capacity=%lld\n", capacity);
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ exit(0);
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
+
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
if (imgfd>=0)
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
{ quiet--;
|
|
![](https://seccdn.libravatar.org/avatar/503f27460248131cc217f3650aaf911c2974465ee303e529d728ad653b4a6554?s=16&d=retro) |
fedf45c |
if (builtin_dd (imgfd,out_fd,next_session*CD_BLOCK) < 0)
|