Import Upstream version 0.8.0.pl00
Dominique Dumont
6 years ago
109 | 109 | test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
110 | 110 | test_structest_SOURCES = test/structest.c |
111 | 111 | |
112 | ## cdrskin construction site - ts A60816 - B00122 | |
112 | ## cdrskin construction site - ts A60816 - B00409 | |
113 | 113 | cdrskin_cdrskin_CPPFLAGS = -Ilibburn |
114 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_6 | |
114 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_0 | |
115 | 115 | |
116 | 116 | # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
117 | 117 | # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking |
381 | 381 | test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
382 | 382 | test_structest_SOURCES = test/structest.c |
383 | 383 | cdrskin_cdrskin_CPPFLAGS = -Ilibburn |
384 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_6 | |
384 | cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_0 | |
385 | 385 | |
386 | 386 | # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS) |
387 | 387 | # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking |
1041 | 1041 | || exit 1; \ |
1042 | 1042 | fi; \ |
1043 | 1043 | done |
1044 | -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ | |
1044 | -find $(distdir) -type d ! -perm -755 -exec chmod u+rwx,go+rx {} \; -o \ | |
1045 | 1045 | ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ |
1046 | 1046 | ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ |
1047 | 1047 | ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ |
10 | 10 | and Ben Jansens <xor@orodu.net> |
11 | 11 | Copyright (C) 2002-2006 Derek Foreman and Ben Jansens |
12 | 12 | |
13 | http://files.libburnia-project.org/releases/libburn-0.7.6.pl00.tar.gz | |
13 | http://files.libburnia-project.org/releases/libburn-0.8.0.pl00.tar.gz | |
14 | 14 | |
15 | 15 | ------------------------------------------------------------------------------ |
16 | 16 | |
18 | 18 | |
19 | 19 | From tarball |
20 | 20 | |
21 | Obtain libburn-0.7.6.pl00.tar.gz, take it to a directory of your choice and do: | |
22 | ||
23 | tar xzf libburn-0.7.6.pl00.tar.gz | |
24 | cd libburn-0.7.6 | |
21 | Obtain libburn-0.8.0.pl00.tar.gz, take it to a directory of your choice and do: | |
22 | ||
23 | tar xzf libburn-0.8.0.pl00.tar.gz | |
24 | cd libburn-0.8.0 | |
25 | 25 | ./configure --prefix=/usr |
26 | 26 | make |
27 | 27 | |
495 | 495 | fixes bugs about the generic X/Open system adapter, and allows to use |
496 | 496 | libcdio >= 0.83 as SCSI transport facility. |
497 | 497 | |
498 | - 10 Feb 2010 libisofs-0.6.28 fixes a regression about bootable images which | |
499 | was introduced by version 0.6.22 in August 2009. | |
500 | ||
501 | - 23 Feb 2010 libisoburn-0.5.0 marks the transition of the xorriso standalone | |
502 | version to an official GNU project. The name changed to "GNU xorriso" and its | |
503 | license is now GPLv3+. | |
504 | The licenses of libburnia libraries and applications are not affected by | |
505 | this change. | |
506 | ||
507 | - 10 Mar 2010 libburn-0.7.8 fixes bugs and improves the built-in abort handler | |
508 | on FreeBSD. | |
509 | ||
510 | - 30 Mar 2010 Release 0.5.2 of libisoburn provides xorriso documentation in | |
511 | GNU Texinfo format with embedded extra data to derive a full man page. | |
512 | ||
513 | - 09 Apr 2010 libburn-0.8.0 now works with ahci driver on FreeBSD 8-STABLE. | |
514 | ||
515 | ||
498 | 516 | ------------------------------------------------------------------------------ |
499 | 517 | |
500 | 518 | This program is free software; you can redistribute it and/or modify |
0 | AC_DEFUN([LIBBURNIA_SET_FLAGS], | |
1 | [ | |
2 | case $target_os in | |
3 | freebsd*) | |
4 | LDFLAGS="$LDFLAGS -L/usr/local/lib" | |
5 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" | |
6 | ;; | |
7 | esac | |
8 | ]) | |
9 | ||
10 | ||
0 | 11 | AC_DEFUN([TARGET_SHIZZLE], |
1 | 12 | [ |
2 | 13 | ARCH="" |
3 | 3 | cdrskin. By Thomas Schmitt <scdbackup@gmx.net> |
4 | 4 | Integrated sub project of libburnia-project.org but also published via: |
5 | 5 | http://scdbackup.sourceforge.net/cdrskin_eng.html |
6 | http://scdbackup.sourceforge.net/cdrskin-0.7.6.pl00.tar.gz | |
6 | http://scdbackup.sourceforge.net/cdrskin-0.8.0.pl00.tar.gz | |
7 | 7 | |
8 | 8 | Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later. |
9 | 9 | ------------------------------------------------------------------------------ |
24 | 24 | |
25 | 25 | Compilation, First Glimpse, Installation |
26 | 26 | |
27 | Obtain cdrskin-0.7.6.pl00.tar.gz, take it to a directory of your choice and do: | |
28 | ||
29 | tar xzf cdrskin-0.7.6.pl00.tar.gz | |
30 | cd cdrskin-0.7.6 | |
27 | Obtain cdrskin-0.8.0.pl00.tar.gz, take it to a directory of your choice and do: | |
28 | ||
29 | tar xzf cdrskin-0.8.0.pl00.tar.gz | |
30 | cd cdrskin-0.8.0 | |
31 | 31 | |
32 | 32 | Within that directory execute: |
33 | 33 | |
145 | 145 | cdrskin dev=0,1,0 -checkdrive |
146 | 146 | |
147 | 147 | Obtain some info about the drive and the inserted media |
148 | cdrskin dev=0,1,0 -atip -v | |
148 | cdrskin dev=0,1,0 -atip -v -minfo | |
149 | 149 | |
150 | 150 | Prepare CD-RW or DVD-RW for re-use, DVD-RAM or BD-RE for first use |
151 | 151 | cdrskin -v dev=/dev/sg1 blank=as_needed -eject |
398 | 398 | Special compilation variations |
399 | 399 | |
400 | 400 | All following options of ./configure and cdrskin/compile_cdrskin.sh are |
401 | combinable. | |
401 | combinable. After runs of ./configure do as next: | |
402 | make clean ; make | |
402 | 403 | |
403 | 404 | In some situations Linux may deliver a better write performance to drives if |
404 | 405 | the track input is read with O_DIRECT (see man 2 open). The API call |
405 | 406 | burn_os_open_track_src() and the input readers of cdrskin and libburn fifo |
406 | 407 | can be told to use this peculiar read mode by: |
407 | --enable-track-src-odirect | |
408 | --enable-track-src-odirect | |
408 | 409 | |
409 | 410 | But often cdrskin option dvd_obs=64k will yield even better performance in |
410 | 411 | such a situation. 64k can be made default at compile time by |
202 | 202 | if(o->dest_fd!=-1) |
203 | 203 | close(o->dest_fd); |
204 | 204 | o->dest_fd= -1; |
205 | for(i=0; i<o->follow_up_fd_counter; i++) | |
205 | for(i=0; i<o->follow_up_fd_counter; i++) { | |
206 | 206 | if(o->follow_up_fds[i][1]!=-1) |
207 | 207 | close(o->follow_up_fds[i][1]); |
208 | 208 | o->follow_up_fds[i][1]= -1; |
209 | } | |
209 | 210 | return(1); |
210 | 211 | } |
211 | 212 |
1 | 1 | .\" First parameter, NAME, should be all caps |
2 | 2 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection |
3 | 3 | .\" other parameters are allowed: see man(7), man(1) |
4 | .TH CDRSKIN 1 "Jan 19, 2010" | |
4 | .TH CDRSKIN 1 "Feb 29, 2010" | |
5 | 5 | .\" Please adjust this date whenever revising the manpage. |
6 | 6 | .\" |
7 | 7 | .\" Some roff macros, for reference: |
81 | 81 | .br |
82 | 82 | Each track is initiated by one track source address argument, which may either |
83 | 83 | be "-" for standard input or the address of a readable file. If no write mode |
84 | is given explicitely then one will be chosen which matches the peculiarities | |
84 | is given explicitly then one will be chosen which matches the peculiarities | |
85 | 85 | of track sources and the state of the output media. |
86 | 86 | .PP |
87 | 87 | More than one track can be burned by a single run of cdrskin. |
92 | 92 | be written to them in subsequent runs of cdrskin (see option -multi). |
93 | 93 | Info about the addresses of burned tracks is kept in a table of |
94 | 94 | content (TOC) on media and can be retrieved via cdrskin option -toc. |
95 | These informations are also used by the operating systems' CD-ROM read drivers. | |
95 | This information is also used by the operating systems' CD-ROM read drivers. | |
96 | 96 | .PP |
97 | 97 | In general there are two types of tracks: data and audio. They differ in |
98 | 98 | sector size, throughput and readability via the systems' CD-ROM drivers |
99 | 99 | resp. by music CD players. With DVD and BD there is only type data. |
100 | 100 | .br |
101 | If not explicitely option -audio is given, then any track is burned as type | |
101 | If not explicitly option -audio is given, then any track is burned as type | |
102 | 102 | data, unless the track source is a file with suffix ".wav" or ".au" and has a |
103 | 103 | header part which identifies it as MS-WAVE resp. SUN Audio with suitable |
104 | 104 | parameters. Such files are burned as audio tracks by default. |
137 | 137 | the capabilities of the drive and the state of the present media. |
138 | 138 | .br |
139 | 139 | So the mentioning of write modes in the following paragraphs and in the |
140 | examples is not so much a demand that the user shall choose one explicitely, | |
140 | examples is not so much a demand that the user shall choose one explicitly, | |
141 | 141 | but rather an illustration of what to expect with particular media types. |
142 | 142 | .SS |
143 | 143 | .B Recordable CD Media: |
180 | 180 | Mode DAO has many restrictions. It does not work with |
181 | 181 | appendable media, allows no -multi and only a single track. The size of the |
182 | 182 | track needs to be known in advance. So either its source has to be a disk file |
183 | of recognizable size or the size has to be announced explicitely by options | |
183 | of recognizable size or the size has to be announced explicitly by options | |
184 | 184 | .B tsize= |
185 | 185 | or |
186 | 186 | .B tao_to_sao_tsize= . |
187 | 187 | .br |
188 | 188 | DAO is the only mode for media which do not offer feature 21h Incremental |
189 | Streaming. DAO may also be selected explicitely by option | |
189 | Streaming. DAO may also be selected explicitly by option | |
190 | 190 | .B -sao . |
191 | 191 | Program growisofs uses DAO on sequential DVD-R[W] media for maximum |
192 | 192 | DVD-ROM/-Video compatibility. |
193 | 193 | .br |
194 | 194 | The other mode, Incremental Streaming, is the default write mode if |
195 | 195 | it is available and if the restrictions of DAO would prevent the job. |
196 | Incremental Streaming may be selected explicitely by option | |
196 | Incremental Streaming may be selected explicitly by option | |
197 | 197 | .B -tao |
198 | 198 | as it resembles much CD TAO by allowing track sources of |
199 | 199 | unpredicted length and to keep media appendable by option |
224 | 224 | cdrskin. |
225 | 225 | .br |
226 | 226 | Option -audio is not allowed. Only one track is allowed. |
227 | Option -multi cannot mark a recognizeable end of overwriteable media. | |
227 | Option -multi cannot mark a recognizable end of overwriteable media. | |
228 | 228 | Therefore -multi is banned unless ISO-9660 images shall be expandable by help |
229 | 229 | of option |
230 | 230 | .B --grow_overwriteable_iso . |
349 | 349 | Announces that the subsequent tracks are to be burned as audio. |
350 | 350 | The source is supposed to be uncompressed headerless PCM, 44100 Hz, 16 bit, |
351 | 351 | stereo. For little-endian byte order (which is usual on PCs) use option |
352 | -swab. Unless marked explicitely by option -data, input files with suffix | |
352 | -swab. Unless marked explicitly by option -data, input files with suffix | |
353 | 353 | ".wav" are examined wether they have a header in MS-WAVE format confirming |
354 | 354 | those parameters and eventually raw audio data get extracted and burned as |
355 | 355 | audio track. Same is done for suffix ".au" and SUN Audio. |
526 | 526 | Set "driveropts=noburnfree" to disable the drive's eventual protection |
527 | 527 | mechanism against temporary lack of source data (i.e. buffer underrun). |
528 | 528 | A drive that announces no such capabilities will not get them enabled anyway, |
529 | even if attempted explicitely via "driveropts=burnfree". | |
529 | even if attempted explicitly via "driveropts=burnfree". | |
530 | 530 | .TP |
531 | 531 | .BI \-dummy |
532 | 532 | Try to perform the drive operations without actually affecting the inserted |
596 | 596 | .br |
597 | 597 | If not, then the burn run will be aborted. |
598 | 598 | .br |
599 | The range of -isosize is exactly one track. Further tracks may be preceeded | |
599 | The range of -isosize is exactly one track. Further tracks may be preceded | |
600 | 600 | by further -isosize options, though. At least 15 blocks of padding will be |
601 | 601 | added to each -isosize track. But be advised to rather use padsize=300k. |
602 | 602 | .br |
704 | 704 | only imposes restrictions without providing known advantages. |
705 | 705 | .br |
706 | 706 | -sao can only be used for tracks of fixely predicted size. This implies that |
707 | track arguments which depict stdin or named pipes need to be preceeded by | |
707 | track arguments which depict stdin or named pipes need to be preceded by | |
708 | 708 | option tsize= or by option tao_to_sao_tsize=. |
709 | 709 | .br |
710 | 710 | -sao cannot be used on appendable media. |
821 | 821 | normal use: |
822 | 822 | .TP |
823 | 823 | .BI \--adjust_speed_to_drive |
824 | Curb explicitely given speed= values to the maximum which is announced by the | |
824 | Curb explicitly given speed= values to the maximum which is announced by the | |
825 | 825 | drive for the loaded media. By default, such an adjustment is only made with |
826 | 826 | pseudo-speeds 0 and -1 whereas speed settings > 0 are sent unchanged to the |
827 | 827 | drive which will then choose an appropriate speed on its own. |
915 | 915 | The natural commands to be given are cdrecord or wodim but one may well submit |
916 | 916 | the address of an own program. |
917 | 917 | .br |
918 | The fallback programm will get all arguments of cdrskin which do not match | |
918 | The fallback program will get all arguments of cdrskin which do not match | |
919 | 919 | the shell patterns --?* or *_*=* . This eventually suppresses path names of |
920 | 920 | track sources which happen to match those patterns. The options from the |
921 | 921 | startup files are not handed to the fallback program. |
961 | 961 | With overwriteable media and no option blank=fast|all present it expands an |
962 | 962 | eventual ISO-9660 filesystem on media. It is assumed that this image's inner |
963 | 963 | size description points to the end of the valuable data. |
964 | Overwriteable media with a recognizeable ISO-9660 size will be regarded as | |
964 | Overwriteable media with a recognizable ISO-9660 size will be regarded as | |
965 | 965 | appendable rather than as blank. I.e. options -msinfo and -toc will work. |
966 | 966 | -toc will always show a single session with its size increasing with |
967 | 967 | every added mkisofs image. |
968 | 968 | .br |
969 | If not overriden by option write_start_address=, the track with the new image | |
969 | If not overridden by option write_start_address=, the track with the new image | |
970 | 970 | will be placed behind the end of the old one. One may use option |
971 | 971 | assert_write_lba= to make sure that media state and mkisofs job do match. |
972 | 972 | .br |
1061 | 1061 | the full burn session and add --tell_media_space. But if one has to expect |
1062 | 1062 | a cdrskin version prior to 0.3.3 no track source should be given in order |
1063 | 1063 | not to start an involuntary burn session. |
1064 | In this case set at least -sao or -tao explicitely. | |
1064 | In this case set at least -sao or -tao explicitly. | |
1065 | 1065 | .br |
1066 | 1066 | The result gets printed to standard output. It is 0 or empty if no writing |
1067 | 1067 | is possible with the given options. |
1129 | 1129 | Linux specific: Select a SCSI device file family to be scanned for by |
1130 | 1130 | options --devices and -scanbus. |
1131 | 1131 | Normally this is /dev/sgN on kernel versions < 2.6 and /dev/srN |
1132 | on kernels >= 2.6 . This option allows to explicitely override that default | |
1132 | on kernels >= 2.6 . This option allows to explicitly override that default | |
1133 | 1133 | in order to meet other programs at a common device file for each drive. |
1134 | 1134 | On kernel 2.4 families sr and scd will find no drives. |
1135 | 1135 | .br |
0 | 0 | |
1 | 1 | /* |
2 | 2 | cdrskin.c , Copyright 2006-2010 Thomas Schmitt <scdbackup@gmx.net> |
3 | Provided under GPL version 2 or later. See future commitment below. | |
3 | Provided under GPL version 2 or later. | |
4 | 4 | |
5 | 5 | A cdrecord compatible command line interface for libburn. |
6 | 6 | |
87 | 87 | |
88 | 88 | /** The official program version */ |
89 | 89 | #ifndef Cdrskin_prog_versioN |
90 | #define Cdrskin_prog_versioN "0.7.6" | |
90 | #define Cdrskin_prog_versioN "0.8.0" | |
91 | 91 | #endif |
92 | 92 | |
93 | 93 | /** The official libburn interface revision to use. |
97 | 97 | #define Cdrskin_libburn_majoR 0 |
98 | 98 | #endif |
99 | 99 | #ifndef Cdrskin_libburn_minoR |
100 | #define Cdrskin_libburn_minoR 7 | |
100 | #define Cdrskin_libburn_minoR 8 | |
101 | 101 | #endif |
102 | 102 | #ifndef Cdrskin_libburn_micrO |
103 | #define Cdrskin_libburn_micrO 6 | |
103 | #define Cdrskin_libburn_micrO 0 | |
104 | 104 | #endif |
105 | 105 | |
106 | 106 | |
134 | 134 | #endif /* Cdrskin_libburn_cvs_A60220_tS */ |
135 | 135 | |
136 | 136 | |
137 | #ifdef Cdrskin_libburn_0_7_6 | |
138 | #define Cdrskin_libburn_versioN "0.7.6" | |
137 | #ifdef Cdrskin_libburn_0_8_0 | |
138 | #define Cdrskin_libburn_versioN "0.8.0" | |
139 | 139 | #define Cdrskin_libburn_from_pykix_svN 1 |
140 | #endif /* Cdrskin_libburn_0_7_6 */ | |
141 | ||
142 | #ifdef Cdrskin_libburn_0_7_7 | |
143 | #define Cdrskin_libburn_versioN "0.7.7" | |
140 | #endif /* Cdrskin_libburn_0_8_0 */ | |
141 | ||
142 | #ifdef Cdrskin_libburn_0_8_1 | |
143 | #define Cdrskin_libburn_versioN "0.8.1" | |
144 | 144 | #define Cdrskin_libburn_from_pykix_svN 1 |
145 | 145 | |
146 | 146 | /* Place novelty switch macros here. |
147 | 147 | Move them down to Cdrskin_libburn_from_pykix_svN on version leap |
148 | 148 | */ |
149 | 149 | |
150 | ||
151 | #endif /* Cdrskin_libburn_0_7_7 */ | |
150 | /* Do not stay in signal handler but only cancel and set Cdrskin_abort_leveL. | |
151 | Make use of burn_is_aborting() to detect pending libburn aborts. | |
152 | */ | |
153 | ||
154 | ||
155 | #endif /* Cdrskin_libburn_0_8_1 */ | |
152 | 156 | |
153 | 157 | #ifndef Cdrskin_libburn_versioN |
154 | #define Cdrskin_libburn_0_7_6 | |
155 | #define Cdrskin_libburn_versioN "0.7.6" | |
158 | #define Cdrskin_libburn_0_8_0 | |
159 | #define Cdrskin_libburn_versioN "0.8.0" | |
156 | 160 | #define Cdrskin_libburn_from_pykix_svN 1 |
157 | 161 | #endif |
158 | 162 | |
159 | #ifdef Cdrskin_libburn_0_7_6 | |
163 | #ifdef Cdrskin_libburn_0_8_0 | |
160 | 164 | #undef Cdrskin_libburn_majoR |
161 | 165 | #undef Cdrskin_libburn_minoR |
162 | 166 | #undef Cdrskin_libburn_micrO |
163 | 167 | #define Cdrskin_libburn_majoR 0 |
164 | #define Cdrskin_libburn_minoR 7 | |
165 | #define Cdrskin_libburn_micrO 6 | |
166 | #endif | |
167 | #ifdef Cdrskin_libburn_0_7_7 | |
168 | #define Cdrskin_libburn_minoR 8 | |
169 | #define Cdrskin_libburn_micrO 0 | |
170 | #endif | |
171 | #ifdef Cdrskin_libburn_0_8_1 | |
168 | 172 | #undef Cdrskin_libburn_majoR |
169 | 173 | #undef Cdrskin_libburn_minoR |
170 | 174 | #undef Cdrskin_libburn_micrO |
171 | 175 | #define Cdrskin_libburn_majoR 0 |
172 | #define Cdrskin_libburn_minoR 7 | |
173 | #define Cdrskin_libburn_micrO 7 | |
176 | #define Cdrskin_libburn_minoR 8 | |
177 | #define Cdrskin_libburn_micrO 1 | |
174 | 178 | #endif |
175 | 179 | |
176 | 180 | |
367 | 371 | #define Cleanup_app_handler_T burn_abort_handler_t |
368 | 372 | #else |
369 | 373 | #include "cleanup.h" |
370 | #endif | |
374 | #ifdef Cdrskin_use_libburn_cleanuP | |
375 | #undef Cdrskin_use_libburn_cleanuP | |
376 | #endif | |
377 | #endif | |
378 | ||
379 | /* | |
380 | # define Cdrskin_use_libburn_cleanuP 1 | |
381 | */ | |
382 | /* May not use libburn cleanup with cdrskin fifo */ | |
383 | #ifndef Cdrskin_use_libburn_fifO | |
384 | #ifdef Cdrskin_use_libburn_cleanuP | |
385 | #undef Cdrskin_use_libburn_cleanuP | |
386 | #endif | |
387 | #endif | |
388 | ||
389 | #ifdef Cdrskin_use_libburn_cleanuP | |
390 | #define Cleanup_handler_funC NULL | |
391 | #define Cleanup_handler_handlE "cdrskin: " | |
392 | #define Cleanup_handler_flaG 48 | |
393 | #else | |
394 | #define Cleanup_handler_funC (Cleanup_app_handler_T) Cdrskin_abort_handler | |
395 | #define Cleanup_handler_handlE skin | |
396 | #define Cleanup_handler_flaG 4 | |
397 | #endif /* ! Cdrskin_use_libburn_cleanuP */ | |
398 | ||
399 | /* 0= no abort going on, -1= Cdrskin_abort_handler was called | |
400 | */ | |
401 | static int Cdrskin_abort_leveL= 0; | |
371 | 402 | |
372 | 403 | |
373 | 404 | /** The size of a string buffer for pathnames and similar texts */ |
1795 | 1826 | |
1796 | 1827 | Cdrskin_get_fifo_par(track->boss, &fifo_enabled, &fifo_size, &fifo_start_at, |
1797 | 1828 | 0); |
1798 | fd_src= src; | |
1799 | 1829 | |
1800 | 1830 | if(track->track_type == BURN_AUDIO) |
1801 | 1831 | chunksize= 2352; |
1805 | 1835 | chunksize= 2048; |
1806 | 1836 | chunks= fifo_size / chunksize; |
1807 | 1837 | if(chunks > 1 && fifo_enabled) { |
1838 | fd_src= src; | |
1808 | 1839 | src= burn_fifo_source_new(fd_src, chunksize, chunks, |
1809 | 1840 | (chunksize * chunks >= 128 * 1024)); |
1810 | 1841 | if((flag & 1) || src == NULL) |
3614 | 3645 | o->write_type= BURN_WRITE_SAO; |
3615 | 3646 | o->block_type= BURN_BLOCK_SAO; |
3616 | 3647 | o->multi= 0; |
3648 | o->cdxa_conversion= 0; | |
3617 | 3649 | o->modesty_on_drive= 0; |
3618 | 3650 | o->min_buffer_percent= 65; |
3619 | 3651 | o->max_buffer_percent= 95; |
4085 | 4117 | #ifdef Cdrskin_grab_abort_brokeN |
4086 | 4118 | if(restore_handler) { |
4087 | 4119 | int Cdrskin_abort_handler(struct CdrskiN *, int, int); |
4088 | Cleanup_set_handlers(skin,(Cleanup_app_handler_T) Cdrskin_abort_handler,4); | |
4120 | Cleanup_set_handlers(Cleanup_handler_handlE, Cleanup_handler_funC, | |
4121 | Cleanup_handler_flaG); | |
4089 | 4122 | } |
4090 | 4123 | #endif /* Cdrskin_grab_abort_brokeN */ |
4091 | 4124 | |
4118 | 4151 | } |
4119 | 4152 | |
4120 | 4153 | |
4154 | int Cdrskin__is_aborting(int flag) | |
4155 | { | |
4156 | if(Cdrskin_abort_leveL) | |
4157 | return(-1); | |
4158 | return(burn_is_aborting(0)); | |
4159 | } | |
4160 | ||
4161 | ||
4162 | int Cdrskin_abort(struct CdrskiN *skin, int flag) | |
4163 | { | |
4164 | int ret; | |
4165 | ||
4166 | Cdrskin_abort_leveL= 1; | |
4167 | ret= burn_abort(skin->abort_max_wait, burn_abort_pacifier, "cdrskin: "); | |
4168 | if(ret<=0) { | |
4169 | fprintf(stderr, | |
4170 | "\ncdrskin: ABORT : Cannot cancel burn session and release drive.\n"); | |
4171 | return(0); | |
4172 | } else { | |
4173 | fprintf(stderr, | |
4174 | "cdrskin: ABORT : Drive is released and library is shut down now.\n"); | |
4175 | } | |
4176 | fprintf(stderr, | |
4177 | "cdrskin: ABORT : Program done. Even if you do not see a shell prompt.\n"); | |
4178 | fprintf(stderr,"\n"); | |
4179 | exit(1); | |
4180 | } | |
4181 | ||
4182 | ||
4121 | 4183 | /** Clean up resources in abort situations. To be called by Cleanup subsystem |
4122 | 4184 | but hardly ever by the application. The program must exit afterwards. |
4123 | 4185 | */ |
4124 | 4186 | int Cdrskin_abort_handler(struct CdrskiN *skin, int signum, int flag) |
4125 | 4187 | { |
4126 | 4188 | |
4127 | #ifdef Cdrskin_libburn_has_burn_aborT | |
4128 | ||
4129 | int ret; | |
4130 | ||
4131 | #else | |
4189 | #ifndef Cdrskin_libburn_has_burn_aborT | |
4132 | 4190 | |
4133 | 4191 | int wait_grain= 100000,first_status= 1; |
4134 | 4192 | double start_time,last_time,current_time; |
4180 | 4238 | fprintf(stderr,"cdrskin: ABORT : Usually it is done with 4x speed after about a MINUTE\n"); |
4181 | 4239 | fprintf(stderr,"cdrskin: URGE : But wait at least the normal burning time before any kill -9\n"); |
4182 | 4240 | } |
4183 | ||
4184 | ret= burn_abort(skin->abort_max_wait, burn_abort_pacifier, "cdrskin: "); | |
4185 | if(ret<=0) { | |
4186 | fprintf(stderr, | |
4187 | "\ncdrskin: ABORT : Cannot cancel burn session and release drive.\n"); | |
4188 | return(0); | |
4189 | } | |
4190 | fprintf(stderr,"\n"); | |
4241 | if(skin->verbosity>=Cdrskin_verbose_debuG) | |
4242 | ClN(fprintf(stderr,"cdrskin_debug: ABORT : Calling burn_abort()\n")); | |
4243 | ||
4244 | Cdrskin_abort_leveL= -1; | |
4245 | if (!(flag & 1)) | |
4246 | burn_abort(-1, burn_abort_pacifier, "cdrskin: "); | |
4247 | fprintf(stderr, | |
4248 | "cdrskin: ABORT : Urged drive worker threads to do emergency halt.\n"); | |
4249 | return -2; | |
4191 | 4250 | |
4192 | 4251 | #else /* Cdrskin_libburn_has_burn_aborT */ |
4193 | 4252 | |
5216 | 5275 | /* If last two blocks not readable then assume TAO and subtract 2 |
5217 | 5276 | from lra and size. |
5218 | 5277 | */; |
5219 | ret= burn_read_data(drive, (off_t) lra * (off_t) 2048, buf, 2 * 2048, | |
5220 | &buf_count, 2 | 4); | |
5278 | ret= burn_read_data(drive, (off_t) (lra - 1) * (off_t) 2048, buf, | |
5279 | 2 * 2048, &buf_count, 2 | 4); | |
5221 | 5280 | if(ret <= 0) { |
5222 | 5281 | lra-= 2; |
5223 | 5282 | size-= 2; |
6032 | 6091 | skin->drive_is_busy= 0; |
6033 | 6092 | if(skin->drive_is_grabbed) |
6034 | 6093 | Cdrskin_release_drive(skin,0); |
6094 | if(Cdrskin__is_aborting(0)) | |
6095 | Cdrskin_abort(skin, 0); /* Never comes back */ | |
6035 | 6096 | return(ret); |
6036 | 6097 | } |
6037 | 6098 | |
6084 | 6145 | |
6085 | 6146 | /* for debugging */ |
6086 | 6147 | static double last_fifo_in= 0.0,last_fifo_out= 0.0,curr_fifo_in,curr_fifo_out; |
6148 | ||
6149 | if(Cdrskin__is_aborting(0)) | |
6150 | Cdrskin_abort(skin, 0); /* Never comes back */ | |
6087 | 6151 | |
6088 | 6152 | current_time= Sfile_microtime(0); |
6089 | 6153 | elapsed_total_time= current_time-start_time; |
7293 | 7357 | skin->drive_is_busy= 1; |
7294 | 7358 | burn_disc_write(o, disc); |
7295 | 7359 | if(skin->preskin->abort_handler==-1) |
7296 | Cleanup_set_handlers(skin,(Cleanup_app_handler_T) Cdrskin_abort_handler,4); | |
7360 | Cleanup_set_handlers(Cleanup_handler_handlE, Cleanup_handler_funC, | |
7361 | Cleanup_handler_flaG); | |
7297 | 7362 | last_time= start_time= Sfile_microtime(0); |
7298 | 7363 | |
7299 | 7364 | burn_write_opts_free(o); |
7312 | 7377 | |
7313 | 7378 | /* >>> how do i learn about success or failure ? */ |
7314 | 7379 | |
7315 | if(loop_counter>0) | |
7380 | if(loop_counter>0 || Cdrskin__is_aborting(0)) | |
7316 | 7381 | Cdrskin_burn_pacifier(skin,drive_status,&p,start_time,&last_time, |
7317 | 7382 | &total_count,&last_count,&min_buffer_fill,0); |
7318 | 7383 | |
7385 | 7450 | skin->drive_is_busy= 0; |
7386 | 7451 | if(skin->verbosity>=Cdrskin_verbose_progresS) |
7387 | 7452 | printf("\n"); |
7453 | ||
7454 | if(Cdrskin__is_aborting(0)) | |
7455 | Cdrskin_abort(skin, 0); /* Never comes back */ | |
7388 | 7456 | |
7389 | 7457 | #ifdef Cdrskin_libburn_has_wrote_welL |
7390 | 7458 | wrote_well = burn_drive_wrote_well(drive); |
8884 | 8952 | *o= skin; |
8885 | 8953 | if(skin->preskin->abort_handler==1 || skin->preskin->abort_handler==3 || |
8886 | 8954 | skin->preskin->abort_handler==4) |
8887 | Cleanup_set_handlers(skin,(Cleanup_app_handler_T) Cdrskin_abort_handler,4); | |
8955 | Cleanup_set_handlers(Cleanup_handler_handlE, Cleanup_handler_funC, | |
8956 | Cleanup_handler_flaG); | |
8888 | 8957 | else if(skin->preskin->abort_handler==2) |
8889 | Cleanup_set_handlers(skin,(Cleanup_app_handler_T) Cdrskin_abort_handler,2|8); | |
8958 | Cleanup_set_handlers(Cleanup_handler_handlE, Cleanup_handler_funC, | |
8959 | 2 | 8); | |
8890 | 8960 | |
8891 | 8961 | printf("cdrskin: scanning for devices ...\n"); |
8892 | 8962 | fflush(stdout); |
8962 | 9032 | if(skin->do_devices) { |
8963 | 9033 | if(skin->n_drives<=0 && skin->preskin->scan_demands_drive) |
8964 | 9034 | {*exit_value= 4; goto no_drive;} |
9035 | if(Cdrskin__is_aborting(0)) | |
9036 | goto ex; | |
8965 | 9037 | ret= Cdrskin_scanbus(skin,1); |
8966 | 9038 | if(ret<=0) { |
8967 | 9039 | fprintf(stderr,"cdrskin: FATAL : --devices failed.\n"); |
8968 | 9040 | {*exit_value= 4; goto ex;} |
8969 | 9041 | } |
8970 | 9042 | } |
9043 | ||
8971 | 9044 | if(skin->do_scanbus) { |
8972 | 9045 | if(skin->n_drives<=0 && skin->preskin->scan_demands_drive) |
8973 | 9046 | {*exit_value= 5; goto no_drive;} |
9047 | if(Cdrskin__is_aborting(0)) | |
9048 | goto ex; | |
8974 | 9049 | ret= Cdrskin_scanbus(skin,0); |
8975 | 9050 | if(ret<=0) |
8976 | 9051 | fprintf(stderr,"cdrskin: FATAL : -scanbus failed.\n"); |
8977 | 9052 | {*exit_value= 5*(ret<=0); goto ex;} |
8978 | 9053 | } |
8979 | 9054 | if(skin->do_load) { |
9055 | if(Cdrskin__is_aborting(0)) | |
9056 | goto ex; | |
8980 | 9057 | ret= Cdrskin_grab_drive(skin,8); |
8981 | 9058 | if(ret>0) { |
8982 | 9059 | if(skin->do_load==2 && !skin->do_eject) { |
8992 | 9069 | {*exit_value= 14*(ret<=0); goto ex;} |
8993 | 9070 | } |
8994 | 9071 | if(skin->do_checkdrive) { |
9072 | if(Cdrskin__is_aborting(0)) | |
9073 | goto ex; | |
8995 | 9074 | ret= Cdrskin_checkdrive(skin,"",(skin->do_checkdrive==2)<<1); |
8996 | 9075 | {*exit_value= 6*(ret<=0); goto ex;} |
8997 | 9076 | } |
8998 | 9077 | if(skin->do_msinfo) { |
8999 | 9078 | if(skin->n_drives<=0) |
9000 | 9079 | {*exit_value= 12; goto no_drive;} |
9080 | if(Cdrskin__is_aborting(0)) | |
9081 | goto ex; | |
9001 | 9082 | ret= Cdrskin_msinfo(skin,0); |
9002 | 9083 | if(ret<=0) |
9003 | 9084 | {*exit_value= 12; goto ex;} |
9005 | 9086 | if(skin->do_atip) { |
9006 | 9087 | if(skin->n_drives<=0) |
9007 | 9088 | {*exit_value= 7; goto no_drive;} |
9089 | if(Cdrskin__is_aborting(0)) | |
9090 | goto ex; | |
9008 | 9091 | ret= Cdrskin_atip(skin, skin->do_atip == 4 ? 4 : |
9009 | 9092 | (skin->do_atip>1) | (2 * (skin->do_atip > 2))); |
9010 | 9093 | if(ret<=0) |
9013 | 9096 | if(skin->do_list_formats) { |
9014 | 9097 | if(skin->n_drives<=0) |
9015 | 9098 | {*exit_value= 14; goto no_drive;} |
9099 | if(Cdrskin__is_aborting(0)) | |
9100 | goto ex; | |
9016 | 9101 | ret= Cdrskin_list_formats(skin, 0); |
9017 | 9102 | if(ret<=0) |
9018 | 9103 | {*exit_value= 14; goto ex;} |
9020 | 9105 | if(skin->do_blank) { |
9021 | 9106 | if(skin->n_drives<=0) |
9022 | 9107 | {*exit_value= 8; goto no_drive;} |
9108 | if(Cdrskin__is_aborting(0)) | |
9109 | goto ex; | |
9023 | 9110 | ret= Cdrskin_blank(skin,0); |
9024 | 9111 | if(ret<=0) |
9025 | 9112 | {*exit_value= 8; goto ex;} |
9028 | 9115 | #ifdef Cdrskin_libburn_has_random_access_rW |
9029 | 9116 | if(skin->do_direct_write) { |
9030 | 9117 | skin->do_burn= 0; |
9118 | if(Cdrskin__is_aborting(0)) | |
9119 | goto ex; | |
9031 | 9120 | ret= Cdrskin_direct_write(skin,0); |
9032 | 9121 | if(ret<=0) |
9033 | 9122 | {*exit_value= 13; goto ex;} |
9037 | 9126 | if(skin->do_burn || skin->tell_media_space) { |
9038 | 9127 | if(skin->n_drives<=0) |
9039 | 9128 | {*exit_value= 10; goto no_drive;} |
9129 | if(Cdrskin__is_aborting(0)) | |
9130 | goto ex; | |
9040 | 9131 | ret= Cdrskin_burn(skin,0); |
9041 | 9132 | if(ret<=0) |
9042 | 9133 | {*exit_value= 10; goto ex;} |
9043 | 9134 | } |
9044 | 9135 | ex:; |
9136 | if(Cdrskin__is_aborting(0)) | |
9137 | Cdrskin_abort(skin, 0); /* Never comes back */ | |
9045 | 9138 | return((*exit_value)==0); |
9046 | 9139 | no_drive:; |
9047 | 9140 | fprintf(stderr,"cdrskin: FATAL : This run would need an accessible drive\n"); |
9089 | 9182 | messaging need libburn running */ |
9090 | 9183 | ret= Cdrpreskin_initialize_lib(preskin,0); |
9091 | 9184 | if(ret<=0) { |
9092 | fprintf(stderr,"cdrskin: FATAL : Initializiation of burn library failed\n"); | |
9185 | fprintf(stderr,"cdrskin: FATAL : Initialization of burn library failed\n"); | |
9093 | 9186 | {exit_value= 2; goto ex;} |
9094 | 9187 | } |
9095 | 9188 | lib_initialized= 1; |
9129 | 9222 | #endif |
9130 | 9223 | } |
9131 | 9224 | |
9132 | Cdrskin_run(skin,&exit_value,0); | |
9225 | if(!Cdrskin__is_aborting(0)) | |
9226 | Cdrskin_run(skin,&exit_value,0); | |
9133 | 9227 | |
9134 | 9228 | ex:; |
9229 | if(Cdrskin__is_aborting(0)) | |
9230 | Cdrskin_abort(skin, 0); /* Never comes back */ | |
9231 | ||
9135 | 9232 | if(preskin!=NULL) |
9136 | 9233 | h_preskin= preskin; |
9137 | 9234 | else if(skin!=NULL) |
61 | 61 | GPL software included:<BR> |
62 | 62 | </H2> |
63 | 63 | <DL> |
64 | <DT>libburn-0.7.6</DT> | |
64 | <DT>libburn-0.8.0</DT> | |
65 | 65 | <DD>(founded by Derek Foreman and Ben Jansens, |
66 | 66 | developed and maintained since August 2006 by |
67 | 67 | Thomas Schmitt from team of libburnia-project.org) |
193 | 193 | <P> |
194 | 194 | <DL> |
195 | 195 | <DT>Download as source code (see README):</DT> |
196 | <DD><A HREF="cdrskin-0.7.6.pl00.tar.gz">cdrskin-0.7.6.pl00.tar.gz</A> | |
197 | (810 KB). | |
196 | <DD><A HREF="cdrskin-0.8.0.pl00.tar.gz">cdrskin-0.8.0.pl00.tar.gz</A> | |
197 | (835 KB). | |
198 | 198 | </DD> |
199 | 199 | <DD> |
200 | 200 | The cdrskin tarballs are source code identical with libburn releases |
243 | 243 | <HR> |
244 | 244 | |
245 | 245 | <P> |
246 | Enhancements towards previous stable version cdrskin-0.7.4.pl00: | |
246 | Enhancements towards previous stable version cdrskin-0.7.8.pl00: | |
247 | 247 | <UL> |
248 | 248 | <LI> |
249 | Made FreeBSD system adapter safe from mutal burn spoiling and drive deadlock | |
249 | Now able to work with ahci driver of FreeBSD 8-STABLE | |
250 | 250 | </LI> |
251 | <LI>Experimental system adapter via GNU libcdio on X/Open systems</LI> | |
252 | <LI>Experimentally using FreeBSD system adapter for Debian kfreebsd</LI> | |
253 | 251 | <!-- |
254 | 252 | <LI>none</LI> |
255 | 253 | --> |
256 | 254 | </UL> |
257 | 255 | |
258 | Bug fixes towards cdrskin-0.7.4.pl00: | |
256 | Bug fixes towards cdrskin-0.7.8.pl00: | |
259 | 257 | <UL> |
260 | 258 | <LI>none</LI> |
261 | 259 | <!-- |
260 | <LI>none</LI> | |
262 | 261 | --> |
263 | 262 | </UL> |
264 | 263 | |
266 | 265 | |
267 | 266 | <P> |
268 | 267 | <DL> |
269 | <DT><H3>Development snapshot, version 0.7.7 :</H3></DT> | |
270 | <DD>Enhancements towards current stable version 0.7.6.pl00: | |
268 | <DT><H3>Development snapshot, version 0.8.1 :</H3></DT> | |
269 | <DD>Enhancements towards current stable version 0.8.0.pl00: | |
271 | 270 | <UL> |
272 | 271 | <LI>none yet</LI> |
273 | 272 | <!-- |
276 | 275 | </UL> |
277 | 276 | </DD> |
278 | 277 | |
279 | <DD>Bug fixes towards cdrskin-0.7.6.pl00: | |
278 | <DD>Bug fixes towards cdrskin-0.8.0.pl00: | |
280 | 279 | <UL> |
281 | 280 | <LI>none yet</LI> |
282 | 281 | <!-- |
285 | 284 | </DD> |
286 | 285 | |
287 | 286 | <DD> </DD> |
288 | <DD><A HREF="README_cdrskin_devel">README 0.7.7</A> | |
289 | <DD><A HREF="cdrskin__help_devel">cdrskin_0.7.7 --help</A></DD> | |
290 | <DD><A HREF="cdrskin_help_devel">cdrskin_0.7.7 -help</A></DD> | |
291 | <DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.7)</A></DD> | |
287 | <DD><A HREF="README_cdrskin_devel">README 0.8.1</A> | |
288 | <DD><A HREF="cdrskin__help_devel">cdrskin_0.8.1 --help</A></DD> | |
289 | <DD><A HREF="cdrskin_help_devel">cdrskin_0.8.1 -help</A></DD> | |
290 | <DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.8.1)</A></DD> | |
292 | 291 | <DD> </DD> |
293 | 292 | <DT>Maintainers of cdrskin unstable packages please use SVN of |
294 | 293 | <A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT> |
308 | 307 | <A HREF="README_cdrskin_devel">upcoming README</A> ): |
309 | 308 | </DD> |
310 | 309 | <DD> |
311 | <A HREF="cdrskin-0.7.7.tar.gz">cdrskin-0.7.7.tar.gz</A> | |
312 | (810 KB). | |
310 | <A HREF="cdrskin-0.8.1.tar.gz">cdrskin-0.8.1.tar.gz</A> | |
311 | (840 KB). | |
313 | 312 | </DD> |
314 | 313 | |
315 | 314 | <!-- This is not offered any more since spring 2008 |
7928 | 7928 | + cdrskin/add_ts_changes_to_libburn_0_7_7 |
7929 | 7929 | Updated cdrskin tarball generator |
7930 | 7930 | |
7931 | 22 Jan 2009 [] | |
7931 | 22 Jan 2009 [3034] | |
7932 | 7932 | cdrskin/changelog.txt |
7933 | 7933 | Documented changes and release timestamp |
7934 | 7934 | |
7939 | 7939 | * Enabled FreeBSD system adapter for Debian kfreebsd |
7940 | 7940 | * Experimental SCSI transport adapter via GNU libcdio 0.83git |
7941 | 7941 | |
7942 | ------------------------------------ cycle - cdrskin-0.7.7 - | |
7943 | ------------------------------------ cycle - cdrskin-0.7.7 - | |
7944 | ------------------------------------ cycle - cdrskin-0.7.7 - | |
7942 | ||
7943 | 2010.01.23.103338 [3035] | |
7944 | Makefile.am | |
7945 | configure.ac | |
7946 | README | |
7947 | libburn/libburn.h | |
7948 | cdrskin/cdrskin.c | |
7949 | cdrskin/README | |
7950 | cdrskin/compile_cdrskin.sh | |
7951 | cdrskin/cdrskin_timestamp.h | |
7952 | cdrskin/cdrskin_eng.html | |
7953 | Made number transition to 0.7.7 | |
7954 | ||
7955 | 2010.01.23.104423 [3036] | |
7956 | COPYRIGHT | |
7957 | doc/cookbook.txt | |
7958 | libburn/libdax_msgs.h | |
7959 | libburn/libdax_msgs.c | |
7960 | test/libburner.c | |
7961 | test/telltoc.c | |
7962 | Lifted ban to derive GPLv3, extended copyright range to 2010 | |
7963 | ||
7964 | 23 Jan 2010 [3037] | |
7965 | - cdrskin/add_ts_changes_to_libburn_0_7_4 | |
7966 | - cdrskin/add_ts_changes_to_libburn_0_7_5 | |
7967 | + cdrskin/add_ts_changes_to_libburn_0_7_6 | |
7968 | + cdrskin/add_ts_changes_to_libburn_0_7_7 | |
7969 | Updated cdrskin tarball generator | |
7970 | ||
7971 | ------------------------------------ cycle - cdrskin-0.7.7 - 2010.01.23.104423 | |
7972 | ||
7973 | ||
7974 | 23 Jan 2010 [3038] | |
7975 | svn move -m 'libburn release 0.7.6 is ready' | |
7976 | http://svn.libburnia-project.org/libburn/branches/ZeroSevenSix | |
7977 | http://svn.libburnia-project.org/libburn/tags/ZeroSevenSix | |
7978 | ||
7979 | 2010.02.04.083315 [3054] | |
7980 | acinclude.m4 | |
7981 | configure.ac | |
7982 | Forcing use of /usr/local on FreeBSD by LDFLAGS and CPPFLAGS | |
7983 | ||
7984 | 2010.02.12.173236 [3063] | |
7985 | libburn/os-linux.h | |
7986 | libburn/sg-linux.c | |
7987 | Changed system adapter id and some remarks from "Linux" to "GNU/Linux" | |
7988 | ||
7989 | 2010.02.12.212818 [3064] | |
7990 | libburn/libburn.h | |
7991 | libburn/sg.c | |
7992 | libburn/mmc.c | |
7993 | libburn/drive.c | |
7994 | libburn/init.c | |
7995 | libburn/cleanup.c | |
7996 | libburn/os-linux.h | |
7997 | libburn/sg-linux.c | |
7998 | libburn/write.c | |
7999 | libburn/read.c | |
8000 | libburn/sg-libcdio.c | |
8001 | libburn/os-libcdio.h | |
8002 | libburn/os.h | |
8003 | libburn/toc.c | |
8004 | Changed docs and comments to "GNU/Linux" where appropriate | |
8005 | ||
8006 | 2010.02.14.084452 [3066] | |
8007 | libburn/sbc.c | |
8008 | libburn/file.h | |
8009 | libburn/os-libcdio.h | |
8010 | libburn/os-dummy.h | |
8011 | libburn/cleanup.h | |
8012 | libburn/sector.h | |
8013 | libburn/libiso_msgs.c | |
8014 | libburn/async.c | |
8015 | libburn/libdax_audioxtr.h | |
8016 | libburn/ecma130ab.c | |
8017 | libburn/back_hacks.h | |
8018 | libburn/libdax_msgs.h | |
8019 | libburn/drive.h | |
8020 | libburn/read.c | |
8021 | libburn/source.c | |
8022 | libburn/util.h | |
8023 | libburn/cleanup.c | |
8024 | libburn/sg.c | |
8025 | libburn/init.c | |
8026 | libburn/write.c | |
8027 | libburn/transport.h | |
8028 | libburn/write.h | |
8029 | libburn/libburn.h | |
8030 | libburn/options.c | |
8031 | libburn/mmc.h | |
8032 | libburn/sg.h | |
8033 | libburn/sbc.h | |
8034 | libburn/sg-dummy.c | |
8035 | libburn/ecma130ab.h | |
8036 | libburn/null.c | |
8037 | libburn/structure.c | |
8038 | libburn/mmc.c | |
8039 | libburn/spc.h | |
8040 | libburn/drive.c | |
8041 | libburn/sg-linux.c | |
8042 | libburn/options.h | |
8043 | libburn/os-linux.h | |
8044 | libburn/sg-libcdio.c | |
8045 | libburn/os-freebsd.h | |
8046 | libburn/sg-freebsd-port.c | |
8047 | libburn/sector.c | |
8048 | libburn/debug.c | |
8049 | libburn/util.c | |
8050 | libburn/toc.h | |
8051 | libburn/file.c | |
8052 | libburn/libdax_audioxtr.c | |
8053 | libburn/libdax_msgs.c | |
8054 | libburn/toc.c | |
8055 | libburn/sg-freebsd.c | |
8056 | libburn/spc.c | |
8057 | libburn/structure.h | |
8058 | Added or adjusted copyright and license statements in single files | |
8059 | ||
8060 | 2010.02.14.171833 [3069] | |
8061 | libburn/write.c | |
8062 | libburn/read.c | |
8063 | libburn/sector.c | |
8064 | libburn/crc.h | |
8065 | Created opportunity to omit source module libburn/crc.c | |
8066 | ||
8067 | 2010.02.15.125922 [3071] | |
8068 | libburn/crc.h | |
8069 | Changed a comment in libburn/crc.h | |
8070 | ||
8071 | 2010.02.16.194147 [3073] | |
8072 | libburn/file.c | |
8073 | Bug fix on FreeBSD: Piped input was falsely attributed a small fixed size | |
8074 | ||
8075 | 2010.02.17.141409 [3075] | |
8076 | libburn/async.c | |
8077 | libburn/drive.c | |
8078 | libburn/write.c | |
8079 | Avoided random percentage display at start of blanking | |
8080 | ||
8081 | 2010.02.22.134904 [3080] | |
8082 | libburn/init.c | |
8083 | Made burn_set_signal_handling() more suitable for cdrskin | |
8084 | ||
8085 | 2010.02.25.070635 [3090] | |
8086 | libburn/write.c | |
8087 | Corrected optional speed curb for stdio: drives. Was damaged by revision 2903. | |
8088 | ||
8089 | 2010.02.28.104003 [3091] | |
8090 | cdrskin/cdrskin.c | |
8091 | Added forgotten initialization of a variable | |
8092 | ||
8093 | 2010.02.28.110749 [3092] | |
8094 | cdrskin/cdrskin.c | |
8095 | Bug fix: cdrskin fs=0 lead to SIGSEGV. Regression introduced by revision 2936. | |
8096 | ||
8097 | 28 Feb 2010 [3093] | |
8098 | cdrskin/cdrskin.1 | |
8099 | Corrected spelling errors in cdrskin man page | |
8100 | ||
8101 | 2010.03.03.140639 [3096] | |
8102 | libburn/drive.c | |
8103 | Enabled patience 0 within burn_abort() | |
8104 | ||
8105 | 2010.03.03.141407 [3097] | |
8106 | cdrskin/cdrskin.c | |
8107 | cdrskin/cdrfifo.c | |
8108 | Adapted cdrskin abort handler to FreeBSD peculiarities | |
8109 | ||
8110 | 3 Mar 2010 [3098] [3099] | |
8111 | cdrskin/compile_cdrskin.sh | |
8112 | Enabled static compile script compile_cdrskin.sh for FreeBSD | |
8113 | ||
8114 | 2010.03.04.121441 [3100] | |
8115 | libburn/sg-linux.c | |
8116 | Showing more patience with temporarily busy drives on Linux | |
8117 | ||
8118 | 2010.03.04.180102 [3101] | |
8119 | cdrskin/cdrskin.c | |
8120 | Changed burn_abort(0) to burn_abort(-1) | |
8121 | ||
8122 | 2010.03.05.090948 [3102] | |
8123 | libburn/libburn.h | |
8124 | libburn/transport.h | |
8125 | libburn/drive.h | |
8126 | libburn/drive.c | |
8127 | libburn/init.h | |
8128 | libburn/init.c | |
8129 | libburn/async.c | |
8130 | libburn/write.c | |
8131 | libburn/sector.c | |
8132 | libburn/libdax_msgs.h | |
8133 | libburn/libdax_msgs.c | |
8134 | Introduced alternative signal handling actions | |
8135 | ||
8136 | 2010.03.05.091432 [3103] | |
8137 | cdrskin/cdrskin.c | |
8138 | Enabled optional use of new signal action 2 with libburn built-in handler | |
8139 | ||
8140 | 2010.03.05.111712 [3104] | |
8141 | libburn/init.c | |
8142 | libburn/drive.h | |
8143 | libburn/drive.c | |
8144 | Removed some debugging printing | |
8145 | ||
8146 | ------------------------------------ cycle - cdrskin-0.7.7 - 2010.03.05.111954 | |
8147 | Bug fix on FreeBSD: Piped input was falsely attributed a small fixed size | |
8148 | Bug fix: cdrskin fs=0 led to SIGSEGV. Regression introduced by revision 2936. | |
8149 | ||
8150 | ||
8151 | 2010.03.05.190110 [3105] | |
8152 | libburn/async.c | |
8153 | Protected blanker and formatter thread from signals | |
8154 | ||
8155 | 06 Mar 2010 [3106] | |
8156 | test/libburner.c | |
8157 | Adapted libburner to new advise about signal handling | |
8158 | ||
8159 | 07 Mar 2010 [3107] | |
8160 | libburn/libburn.h | |
8161 | test/libburner.c | |
8162 | Changed examples burn_set_signal_handling(...,48) to (...,0x30) | |
8163 | ||
8164 | 2010.03.08.092608 [3108] | |
8165 | libburn/libburn.h | |
8166 | libburn/init.c | |
8167 | Prevented potential memory fault with burn_set_signal_handling() | |
8168 | ||
8169 | 2010.03.09.140341 [3111] | |
8170 | libburn/libburn.h | |
8171 | Clarifications in API description of burn_set_signal_handling() | |
8172 | ||
8173 | 10 Mar 2010 [3112] | |
8174 | svn copy -m "Branching for libburn release 0.7.8" \ | |
8175 | http://svn.libburnia-project.org/libburn/trunk \ | |
8176 | http://svn.libburnia-project.org/libburn/branches/ZeroSevenEight | |
8177 | ||
8178 | 2010.03.10.120001 [3113] | |
8179 | Makefile.am | |
8180 | configure.ac | |
8181 | README | |
8182 | libburn/libburn.h | |
8183 | cdrskin/cdrskin.c | |
8184 | cdrskin/README | |
8185 | cdrskin/compile_cdrskin.sh | |
8186 | cdrskin/cdrskin_timestamp.h | |
8187 | cdrskin/cdrskin_eng.html | |
8188 | Made number transition to 0.7.8 | |
8189 | ||
8190 | 10 Mar 2010 [3114] | |
8191 | - cdrskin/add_ts_changes_to_libburn_0_7_6 | |
8192 | - cdrskin/add_ts_changes_to_libburn_0_7_7 | |
8193 | + cdrskin/add_ts_changes_to_libburn_0_7_8 | |
8194 | + cdrskin/add_ts_changes_to_libburn_0_7_9 | |
8195 | Updated cdrskin tarball generator | |
8196 | ||
8197 | 10 Mar 2010 [3115] | |
8198 | cdrskin/cdrskin.c | |
8199 | Removed unused variable | |
8200 | ||
8201 | 10 Mar 2010 [3116] | |
8202 | cdrskin/changelog.txt | |
8203 | Documented changes and release timestamp | |
8204 | ||
8205 | ------------------------------ release - cdrskin-0.7.8.pl00 - 2010.03.10.120001 | |
8206 | Bug fix on FreeBSD: Piped input was falsely attributed a small fixed size | |
8207 | Bug fix: cdrskin fs=0 led to SIGSEGV. Regression introduced by version 0.7.4. | |
8208 | ||
8209 | ||
8210 | 2010.03.10.134802 [3117] | |
8211 | Makefile.am | |
8212 | configure.ac | |
8213 | README | |
8214 | libburn/libburn.h | |
8215 | cdrskin/cdrskin.c | |
8216 | cdrskin/README | |
8217 | cdrskin/compile_cdrskin.sh | |
8218 | cdrskin/cdrskin_timestamp.h | |
8219 | cdrskin/cdrskin_eng.html | |
8220 | Made number transition to 0.7.9 | |
8221 | ||
8222 | 10 Mar 2010 [3118] | |
8223 | - cdrskin/add_ts_changes_to_libburn_0_7_6 | |
8224 | - cdrskin/add_ts_changes_to_libburn_0_7_7 | |
8225 | + cdrskin/add_ts_changes_to_libburn_0_7_8 | |
8226 | + cdrskin/add_ts_changes_to_libburn_0_7_9 | |
8227 | Updated cdrskin tarball generator | |
8228 | ||
8229 | 10 Mar 2010 [3119] | |
8230 | cdrskin/changelog.txt | |
8231 | Documented changes and release timestamp | |
8232 | ||
8233 | 10 Mar 2010 [3120] | |
8234 | svn move -m 'libburn release 0.7.8 is ready' | |
8235 | http://svn.libburnia-project.org/libburn/branches/ZeroSevenEight | |
8236 | http://svn.libburnia-project.org/libburn/tags/ZeroSevenEight | |
8237 | ||
8238 | ------------------------------------ cycle - cdrskin-0.7.9 - 2010.03.10.143607 | |
8239 | ||
8240 | 2010.03.17.185222 [3123] | |
8241 | cdrskin/cdrskin.c | |
8242 | Small bug fix about track size with cdrskin -minfo | |
8243 | ||
8244 | 17 Mar 2010 [3124] | |
8245 | configure.ac | |
8246 | Corrected initialization of configure option --enable-dvd-obs-64k | |
8247 | ||
8248 | 2010.03.25.113536 [3131] | |
8249 | libburn/spc.c | |
8250 | libburn/sg-freebsd.c | |
8251 | Changed sg-freebsd.c to work with ahci, advise by Alexander Motin | |
8252 | ||
8253 | 2010.03.26.083158 [3132] | |
8254 | libburn/sg-freebsd.c | |
8255 | Had to make ahci change conditional for now: -DLibburn_for_freebsd_ahcI | |
8256 | ||
8257 | 2010.03.27.155659 [3133] | |
8258 | libburn/mmc.c | |
8259 | Avoiding to inquire NWA of unwritable media or states | |
8260 | ||
8261 | 2010.03.27.172644 [3134] | |
8262 | libburn/os-freebsd.h | |
8263 | libburn/sg-freebsd.c | |
8264 | Trying to detect FreeBSD ahci devices and to handle others the old way | |
8265 | ||
8266 | ------------------------------------ cycle - cdrskin-0.7.9 - 2010.03.27.184614 | |
8267 | * Now able to work with ahci driver of FreeBSD 8-STABLE | |
8268 | ||
8269 | ||
8270 | 2010.03.29.103141 [3135] | |
8271 | libburn/spc.c | |
8272 | libburn/sg-linux.c | |
8273 | libburn/sg-freebsd.c | |
8274 | libburn/sg-libcdio.c | |
8275 | Adjusted libcdio system adapter to FreeBSD peculiarities | |
8276 | ||
8277 | 2010.04.04.181237 [3146] | |
8278 | test/libburner.c | |
8279 | Let libburner warn programmers if they forget to set 64 bit off_t | |
8280 | ||
8281 | 2010.04.09.090645 [3155] | |
8282 | libburn/sg-linux.c | |
8283 | Reporting eventual SCSI sense in sg-linux repeat loop | |
8284 | ||
8285 | 9 Apr 2010 [3156] | |
8286 | svn copy -m "Branching for libburn release 0.8.0" \ | |
8287 | http://svn.libburnia-project.org/libburn/trunk \ | |
8288 | http://svn.libburnia-project.org/libburn/branches/ZeroEightZero | |
8289 | ||
8290 | 2010.04.09.100001 [3157] | |
8291 | Makefile.am | |
8292 | configure.ac | |
8293 | README | |
8294 | libburn/libburn.h | |
8295 | cdrskin/cdrskin.c | |
8296 | cdrskin/README | |
8297 | cdrskin/compile_cdrskin.sh | |
8298 | cdrskin/cdrskin_timestamp.h | |
8299 | cdrskin/cdrskin_eng.html | |
8300 | Made number transition to 0.8.0 | |
8301 | ||
8302 | 09 Apr 2010 [3158] | |
8303 | - cdrskin/add_ts_changes_to_libburn_0_7_8 | |
8304 | - cdrskin/add_ts_changes_to_libburn_0_7_9 | |
8305 | + cdrskin/add_ts_changes_to_libburn_0_8_0 | |
8306 | + cdrskin/add_ts_changes_to_libburn_0_8_1 | |
8307 | Updated cdrskin tarball generator | |
8308 | ||
8309 | ------------------------------ release - cdrskin-0.8.0.pl00 - 2010.04.09.100001 | |
8310 | * Now able to work with ahci driver of FreeBSD 8-STABLE | |
8311 | ||
8312 | ------------------------------------ cycle - cdrskin-0.8.1 - | |
8313 | ------------------------------------ cycle - cdrskin-0.8.1 - | |
7945 | 8314 | |
7946 | 8315 | |
7947 | 8316 | =============================================================================== |
7948 | 8317 | TODO |
7949 | 8318 | =============================================================================== |
7950 | 8319 | |
7951 | - After writing first session and reload: | |
7952 | Drive current: -dev '/dev/cd0' | |
7953 | Drive type : vendor 'TSSTcorp' product 'CDDVDW SH-S223C' revision 'SB02' | |
7954 | Media current: DVD-RW sequential recording | |
7955 | Media product: RITEKW01 , Ritek Corp | |
7956 | Media status : is written , is appendable | |
7957 | TOC layout : Idx , sbsector , Size , Volume Id | |
7958 | ISO session : 1 , 0 , 232357s , ISOIMAGE | |
7959 | Other session: 2 , 261200 , 2036688s , | |
7960 | Media summary: 2 sessions, 2269200 data blocks, 4432m data, 3978m free | |
7961 | Media nwa : 261200s | |
7962 | dvd+rw-mediainfo shows 3 sessions with 2 tracks. | |
7963 | Firmware bug. | |
7964 | ||
7965 | ||
7966 | ||
7967 | - USB stick and drive on FreeBSD | |
7968 | - how to detect random-read-write device ? | |
7969 | ||
7970 | ||
7971 | --- libcdio --- | |
7972 | ||
7973 | 24 Dec 2009 [29de1d8bcb614a8360b519c5843c5852f78101db] | |
7974 | include/cdio/mmc.h | |
7975 | lib/driver/generic.h | |
7976 | lib/driver/mmc.c | |
7977 | lib/driver/libcdio.sym ( - cdio_version) | |
7978 | New API function mmc_last_cmd_sense() | |
7979 | ||
7980 | 24 Dec 2009 [890b5610a8ec01609df8997f8031324af5bb4219] | |
7981 | lib/driver/gnu_linux.c | |
7982 | Linux driver makes available the sense reply of the most recent MMC command | |
7983 | (Is there a place to register access modes MMC_RDWR and MMC_RDWR_EXCL ?) | |
7984 | ||
7985 | 24 Dec 2009 [20f762c3c12c06b52a47b401eb913c69c72ddcf8] | |
7986 | include/cdio/version.h.in | |
7987 | lib/driver/util.c | |
7988 | lib/driver/libcdio.sym ( + cdio_version) | |
7989 | New API function cdio_version() tell libcdio version at runtime | |
7990 | ||
7991 | 24 Dec 2009 [7cc7484a0b93268260c02ec35c46e1456f0fb38a] | |
7992 | lib/driver/gnu_linux.c | |
7993 | lib/driver/util.c | |
7994 | Small repairs to the previous two changees | |
7995 | ||
7996 | 30 Dec 2009 07_cdio_get_arg_scsi_tuple_linux.tgz [cf882cfd20912fed94d1a4a2e057bbcf68c496a1] | |
7997 | lib/driver/generic.h | |
7998 | lib/driver/_cdio_generic.c | |
7999 | lib/driver/gnu_linux.c | |
8000 | New cdio_get_arg() key "scsi-tuple-linux" | |
8001 | ||
8002 | 15 Jan 2010 10_add_mmc_rdwr_excl_on_freebsd.tgz [bd096b3eca0644044a872c1f0d31a75395d420a4] | |
8003 | NEWS | |
8004 | test/test_mmc_rdwr.c | |
8005 | lib/driver/FreeBSD/freebsd.h | |
8006 | lib/driver/FreeBSD/freebsd.c | |
8007 | lib/driver/FreeBSD/freebsd_cam.c | |
8008 | lib/driver/FreeBSD/freebsd_ioctl.c | |
8009 | FreeBSD driver augmented by MMC_RDWR_EXCL | |
8010 | ||
8011 | ||
8012 | Todo: | |
8013 | ||
8014 | Driver-Todo: | |
8015 | - implement MMC_RDWR and MMC_RDWR_EXCL | |
8016 | - record SCSI sense reply in generic_img_private_t.scsi_mmc_sense | |
8017 | - rectify return values to DRIVER_OP_* | |
8018 | (- obtain SCSI address tuple) | |
8019 | - test concurrent drive access attempts resp. exclusivity of drive access | |
8320 | - change all malloc() to calloc() | |
8321 | ||
8322 | - find out from where libburn/crc.c stems. What algorithm is crc_32() ? | |
8020 | 8323 | |
8021 | 8324 | |
8022 | 8325 | --------------------------------- bugs ------------------------------------- |
8044 | 8347 | |
8045 | 8348 | ------------------------------ end of bugs --------------------------------- |
8046 | 8349 | |
8047 | - xorriso -as tar (Rocky wants me to begin with -x) | |
8048 | ||
8049 | 8350 | Support for BD-R SRM+POW |
8050 | ||
8051 | ? Provide an option to open track source file O_DIRECT ? | |
8052 | (needs read chunks much larger than 2 kB) | |
8053 | 8351 | |
8054 | 8352 | ? Enable profile 0x42 BD-R random recording |
8055 | 8353 |
6 | 6 | debug_opts="-O2" |
7 | 7 | def_opts= |
8 | 8 | largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1" |
9 | fifo_opts="-DCdrskin_use_libburn_fifO" | |
10 | libvers="-DCdrskin_libburn_0_7_6" | |
9 | fifo_opts="" | |
10 | libvers="-DCdrskin_libburn_0_8_0" | |
11 | 11 | |
12 | 12 | # To be used if Makefile.am uses libburn_libburn_la_CFLAGS |
13 | 13 | # burn="libburn/libburn_libburn_la-" |
25 | 25 | compile_cdrfifo=0 |
26 | 26 | compile_dewav=0 |
27 | 27 | |
28 | libcam= | |
29 | os=$(uname -s) | |
30 | case $os in | |
31 | *FreeBSD) | |
32 | libcam="-lcam" | |
33 | esac | |
34 | ||
28 | 35 | for i in "$@" |
29 | 36 | do |
30 | 37 | if test "$i" = "-compile_cdrfifo" |
39 | 46 | libdax_audioxtr_o= |
40 | 47 | libdax_msgs_o="$burn"message.o |
41 | 48 | cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c" |
42 | elif test "$i" = "-libburn_0_7_6" | |
43 | then | |
44 | libvers="-DCdrskin_libburn_0_7_6" | |
49 | elif test "$i" = "-libburn_0_8_0" | |
50 | then | |
51 | libvers="-DCdrskin_libburn_0_8_0" | |
45 | 52 | libdax_audioxtr_o="$burn"libdax_audioxtr.o |
46 | 53 | libdax_msgs_o="$burn"libdax_msgs.o |
47 | 54 | cleanup_src_or_obj="$burn"cleanup.o |
48 | 55 | elif test "$i" = "-libburn_svn" |
49 | 56 | then |
50 | libvers="-DCdrskin_libburn_0_7_7" | |
57 | libvers="-DCdrskin_libburn_0_8_1" | |
51 | 58 | libdax_audioxtr_o="$burn"libdax_audioxtr.o |
52 | 59 | libdax_msgs_o="$burn"libdax_msgs.o |
53 | 60 | cleanup_src_or_obj="$burn"cleanup.o |
85 | 92 | then |
86 | 93 | fifo_source= |
87 | 94 | fifo_opts="-DCdrskin_use_libburn_fifO -DCdrskin_no_cdrfifO" |
95 | elif test "$i" = "-use_libburn_cleanup" | |
96 | then | |
97 | fifo_source= | |
98 | fifo_opts="-DCdrskin_use_libburn_cleanuP -DCdrskin_use_libburn_fifO -DCdrskin_no_cdrfifO" | |
88 | 99 | elif test "$i" = "-use_libcdio" |
89 | 100 | then |
90 | 101 | libcdio="-lcdio" |
97 | 108 | echo "Options:" |
98 | 109 | echo " -compile_cdrfifo compile program cdrskin/cdrfifo." |
99 | 110 | echo " -compile_dewav compile program test/dewav without libburn." |
100 | echo " -libburn_0_7_6 set macro to match libburn-0.7.6" | |
111 | echo " -libburn_0_8_0 set macro to match libburn-0.8.0" | |
101 | 112 | echo " -libburn_svn set macro to match current libburn-SVN." |
102 | 113 | echo " -dvd_obs_64k 64 KB default size for DVD/BD writing." |
103 | 114 | echo " -use_libcdio link with -lcdio because libburn uses it." |
124 | 135 | |
125 | 136 | if test "$compile_cdrskin" |
126 | 137 | then |
127 | echo "compiling program cdrskin/cdrskin.c $fifo_source $static_opts $debug_opts $libvers $fifo_opts $def_opts $cleanup_src_or_obj $libcdio" | |
138 | echo "compiling program cdrskin/cdrskin.c $fifo_source $static_opts $debug_opts $libvers $fifo_opts $def_opts $cleanup_src_or_obj $libcdio $libcam" | |
128 | 139 | cc -I. \ |
129 | 140 | $warn_opts \ |
130 | 141 | $static_opts \ |
170 | 181 | "$burn"ecma130ab.o \ |
171 | 182 | \ |
172 | 183 | $libcdio \ |
184 | $libcam \ | |
173 | 185 | -lpthread |
174 | 186 | |
175 | 187 | ret=$? |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.60 for libburn 0.7.6. | |
2 | # Generated by GNU Autoconf 2.60 for libburn 0.8.0. | |
3 | 3 | # |
4 | 4 | # Report bugs to <http://libburnia-project.org>. |
5 | 5 | # |
712 | 712 | # Identity of this package. |
713 | 713 | PACKAGE_NAME='libburn' |
714 | 714 | PACKAGE_TARNAME='libburn' |
715 | PACKAGE_VERSION='0.7.6' | |
716 | PACKAGE_STRING='libburn 0.7.6' | |
715 | PACKAGE_VERSION='0.8.0' | |
716 | PACKAGE_STRING='libburn 0.8.0' | |
717 | 717 | PACKAGE_BUGREPORT='http://libburnia-project.org' |
718 | 718 | |
719 | 719 | ac_default_prefix=/usr/local |
1401 | 1401 | # Omit some internal or obsolete options to make the list less imposing. |
1402 | 1402 | # This message is too long to be a string in the A/UX 3.1 sh. |
1403 | 1403 | cat <<_ACEOF |
1404 | \`configure' configures libburn 0.7.6 to adapt to many kinds of systems. | |
1404 | \`configure' configures libburn 0.8.0 to adapt to many kinds of systems. | |
1405 | 1405 | |
1406 | 1406 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1407 | 1407 | |
1472 | 1472 | |
1473 | 1473 | if test -n "$ac_init_help"; then |
1474 | 1474 | case $ac_init_help in |
1475 | short | recursive ) echo "Configuration of libburn 0.7.6:";; | |
1475 | short | recursive ) echo "Configuration of libburn 0.8.0:";; | |
1476 | 1476 | esac |
1477 | 1477 | cat <<\_ACEOF |
1478 | 1478 | |
1587 | 1587 | test -n "$ac_init_help" && exit $ac_status |
1588 | 1588 | if $ac_init_version; then |
1589 | 1589 | cat <<\_ACEOF |
1590 | libburn configure 0.7.6 | |
1590 | libburn configure 0.8.0 | |
1591 | 1591 | generated by GNU Autoconf 2.60 |
1592 | 1592 | |
1593 | 1593 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, |
1601 | 1601 | This file contains any messages produced by compilers while |
1602 | 1602 | running configure, to aid debugging if configure makes a mistake. |
1603 | 1603 | |
1604 | It was created by libburn $as_me 0.7.6, which was | |
1604 | It was created by libburn $as_me 0.8.0, which was | |
1605 | 1605 | generated by GNU Autoconf 2.60. Invocation command line was |
1606 | 1606 | |
1607 | 1607 | $ $0 $@ |
2114 | 2114 | NONENONEs,x,x, && |
2115 | 2115 | program_prefix=${target_alias}- |
2116 | 2116 | |
2117 | ||
2118 | case $target_os in | |
2119 | freebsd*) | |
2120 | LDFLAGS="$LDFLAGS -L/usr/local/lib" | |
2121 | CPPFLAGS="$CPPFLAGS -I/usr/local/include" | |
2122 | ;; | |
2123 | esac | |
2124 | ||
2125 | ||
2117 | 2126 | am__api_version="1.9" |
2118 | 2127 | # Find a good install program. We prefer a C program (faster), |
2119 | 2128 | # so one script is as good as another. But avoid the broken or |
2400 | 2409 | |
2401 | 2410 | # Define the identity of the package. |
2402 | 2411 | PACKAGE='libburn' |
2403 | VERSION='0.7.6' | |
2412 | VERSION='0.8.0' | |
2404 | 2413 | |
2405 | 2414 | |
2406 | 2415 | cat >>confdefs.h <<_ACEOF |
2548 | 2557 | |
2549 | 2558 | |
2550 | 2559 | BURN_MAJOR_VERSION=0 |
2551 | BURN_MINOR_VERSION=7 | |
2552 | BURN_MICRO_VERSION=6 | |
2560 | BURN_MINOR_VERSION=8 | |
2561 | BURN_MICRO_VERSION=0 | |
2553 | 2562 | BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
2554 | 2563 | |
2555 | 2564 | |
2558 | 2567 | |
2559 | 2568 | |
2560 | 2569 | LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
2561 | LT_CURRENT=45 | |
2562 | LT_AGE=41 | |
2570 | LT_CURRENT=49 | |
2571 | LT_AGE=45 | |
2563 | 2572 | LT_REVISION=0 |
2564 | 2573 | LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` |
2565 | 2574 | |
6414 | 6423 | ;; |
6415 | 6424 | *-*-irix6*) |
6416 | 6425 | # Find out which ABI we are using. |
6417 | echo '#line 6418 "configure"' > conftest.$ac_ext | |
6426 | echo '#line 6427 "configure"' > conftest.$ac_ext | |
6418 | 6427 | if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 |
6419 | 6428 | (eval $ac_compile) 2>&5 |
6420 | 6429 | ac_status=$? |
8842 | 8851 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
8843 | 8852 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
8844 | 8853 | -e 's:$: $lt_compiler_flag:'` |
8845 | (eval echo "\"\$as_me:8846: $lt_compile\"" >&5) | |
8854 | (eval echo "\"\$as_me:8855: $lt_compile\"" >&5) | |
8846 | 8855 | (eval "$lt_compile" 2>conftest.err) |
8847 | 8856 | ac_status=$? |
8848 | 8857 | cat conftest.err >&5 |
8849 | echo "$as_me:8850: \$? = $ac_status" >&5 | |
8858 | echo "$as_me:8859: \$? = $ac_status" >&5 | |
8850 | 8859 | if (exit $ac_status) && test -s "$ac_outfile"; then |
8851 | 8860 | # The compiler can only warn and ignore the option if not recognized |
8852 | 8861 | # So say no if there are warnings other than the usual output. |
9110 | 9119 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9111 | 9120 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9112 | 9121 | -e 's:$: $lt_compiler_flag:'` |
9113 | (eval echo "\"\$as_me:9114: $lt_compile\"" >&5) | |
9122 | (eval echo "\"\$as_me:9123: $lt_compile\"" >&5) | |
9114 | 9123 | (eval "$lt_compile" 2>conftest.err) |
9115 | 9124 | ac_status=$? |
9116 | 9125 | cat conftest.err >&5 |
9117 | echo "$as_me:9118: \$? = $ac_status" >&5 | |
9126 | echo "$as_me:9127: \$? = $ac_status" >&5 | |
9118 | 9127 | if (exit $ac_status) && test -s "$ac_outfile"; then |
9119 | 9128 | # The compiler can only warn and ignore the option if not recognized |
9120 | 9129 | # So say no if there are warnings other than the usual output. |
9214 | 9223 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
9215 | 9224 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
9216 | 9225 | -e 's:$: $lt_compiler_flag:'` |
9217 | (eval echo "\"\$as_me:9218: $lt_compile\"" >&5) | |
9226 | (eval echo "\"\$as_me:9227: $lt_compile\"" >&5) | |
9218 | 9227 | (eval "$lt_compile" 2>out/conftest.err) |
9219 | 9228 | ac_status=$? |
9220 | 9229 | cat out/conftest.err >&5 |
9221 | echo "$as_me:9222: \$? = $ac_status" >&5 | |
9230 | echo "$as_me:9231: \$? = $ac_status" >&5 | |
9222 | 9231 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
9223 | 9232 | then |
9224 | 9233 | # The compiler can only warn and ignore the option if not recognized |
11666 | 11675 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
11667 | 11676 | lt_status=$lt_dlunknown |
11668 | 11677 | cat > conftest.$ac_ext <<EOF |
11669 | #line 11670 "configure" | |
11678 | #line 11679 "configure" | |
11670 | 11679 | #include "confdefs.h" |
11671 | 11680 | |
11672 | 11681 | #if HAVE_DLFCN_H |
11766 | 11775 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 |
11767 | 11776 | lt_status=$lt_dlunknown |
11768 | 11777 | cat > conftest.$ac_ext <<EOF |
11769 | #line 11770 "configure" | |
11778 | #line 11779 "configure" | |
11770 | 11779 | #include "confdefs.h" |
11771 | 11780 | |
11772 | 11781 | #if HAVE_DLFCN_H |
14134 | 14143 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14135 | 14144 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14136 | 14145 | -e 's:$: $lt_compiler_flag:'` |
14137 | (eval echo "\"\$as_me:14138: $lt_compile\"" >&5) | |
14146 | (eval echo "\"\$as_me:14147: $lt_compile\"" >&5) | |
14138 | 14147 | (eval "$lt_compile" 2>conftest.err) |
14139 | 14148 | ac_status=$? |
14140 | 14149 | cat conftest.err >&5 |
14141 | echo "$as_me:14142: \$? = $ac_status" >&5 | |
14150 | echo "$as_me:14151: \$? = $ac_status" >&5 | |
14142 | 14151 | if (exit $ac_status) && test -s "$ac_outfile"; then |
14143 | 14152 | # The compiler can only warn and ignore the option if not recognized |
14144 | 14153 | # So say no if there are warnings other than the usual output. |
14238 | 14247 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
14239 | 14248 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
14240 | 14249 | -e 's:$: $lt_compiler_flag:'` |
14241 | (eval echo "\"\$as_me:14242: $lt_compile\"" >&5) | |
14250 | (eval echo "\"\$as_me:14251: $lt_compile\"" >&5) | |
14242 | 14251 | (eval "$lt_compile" 2>out/conftest.err) |
14243 | 14252 | ac_status=$? |
14244 | 14253 | cat out/conftest.err >&5 |
14245 | echo "$as_me:14246: \$? = $ac_status" >&5 | |
14254 | echo "$as_me:14255: \$? = $ac_status" >&5 | |
14246 | 14255 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
14247 | 14256 | then |
14248 | 14257 | # The compiler can only warn and ignore the option if not recognized |
15808 | 15817 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
15809 | 15818 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
15810 | 15819 | -e 's:$: $lt_compiler_flag:'` |
15811 | (eval echo "\"\$as_me:15812: $lt_compile\"" >&5) | |
15820 | (eval echo "\"\$as_me:15821: $lt_compile\"" >&5) | |
15812 | 15821 | (eval "$lt_compile" 2>conftest.err) |
15813 | 15822 | ac_status=$? |
15814 | 15823 | cat conftest.err >&5 |
15815 | echo "$as_me:15816: \$? = $ac_status" >&5 | |
15824 | echo "$as_me:15825: \$? = $ac_status" >&5 | |
15816 | 15825 | if (exit $ac_status) && test -s "$ac_outfile"; then |
15817 | 15826 | # The compiler can only warn and ignore the option if not recognized |
15818 | 15827 | # So say no if there are warnings other than the usual output. |
15912 | 15921 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
15913 | 15922 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
15914 | 15923 | -e 's:$: $lt_compiler_flag:'` |
15915 | (eval echo "\"\$as_me:15916: $lt_compile\"" >&5) | |
15924 | (eval echo "\"\$as_me:15925: $lt_compile\"" >&5) | |
15916 | 15925 | (eval "$lt_compile" 2>out/conftest.err) |
15917 | 15926 | ac_status=$? |
15918 | 15927 | cat out/conftest.err >&5 |
15919 | echo "$as_me:15920: \$? = $ac_status" >&5 | |
15928 | echo "$as_me:15929: \$? = $ac_status" >&5 | |
15920 | 15929 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
15921 | 15930 | then |
15922 | 15931 | # The compiler can only warn and ignore the option if not recognized |
18142 | 18151 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18143 | 18152 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18144 | 18153 | -e 's:$: $lt_compiler_flag:'` |
18145 | (eval echo "\"\$as_me:18146: $lt_compile\"" >&5) | |
18154 | (eval echo "\"\$as_me:18155: $lt_compile\"" >&5) | |
18146 | 18155 | (eval "$lt_compile" 2>conftest.err) |
18147 | 18156 | ac_status=$? |
18148 | 18157 | cat conftest.err >&5 |
18149 | echo "$as_me:18150: \$? = $ac_status" >&5 | |
18158 | echo "$as_me:18159: \$? = $ac_status" >&5 | |
18150 | 18159 | if (exit $ac_status) && test -s "$ac_outfile"; then |
18151 | 18160 | # The compiler can only warn and ignore the option if not recognized |
18152 | 18161 | # So say no if there are warnings other than the usual output. |
18410 | 18419 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18411 | 18420 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18412 | 18421 | -e 's:$: $lt_compiler_flag:'` |
18413 | (eval echo "\"\$as_me:18414: $lt_compile\"" >&5) | |
18422 | (eval echo "\"\$as_me:18423: $lt_compile\"" >&5) | |
18414 | 18423 | (eval "$lt_compile" 2>conftest.err) |
18415 | 18424 | ac_status=$? |
18416 | 18425 | cat conftest.err >&5 |
18417 | echo "$as_me:18418: \$? = $ac_status" >&5 | |
18426 | echo "$as_me:18427: \$? = $ac_status" >&5 | |
18418 | 18427 | if (exit $ac_status) && test -s "$ac_outfile"; then |
18419 | 18428 | # The compiler can only warn and ignore the option if not recognized |
18420 | 18429 | # So say no if there are warnings other than the usual output. |
18514 | 18523 | -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ |
18515 | 18524 | -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ |
18516 | 18525 | -e 's:$: $lt_compiler_flag:'` |
18517 | (eval echo "\"\$as_me:18518: $lt_compile\"" >&5) | |
18526 | (eval echo "\"\$as_me:18527: $lt_compile\"" >&5) | |
18518 | 18527 | (eval "$lt_compile" 2>out/conftest.err) |
18519 | 18528 | ac_status=$? |
18520 | 18529 | cat out/conftest.err >&5 |
18521 | echo "$as_me:18522: \$? = $ac_status" >&5 | |
18530 | echo "$as_me:18531: \$? = $ac_status" >&5 | |
18522 | 18531 | if (exit $ac_status) && test -s out/conftest2.$ac_objext |
18523 | 18532 | then |
18524 | 18533 | # The compiler can only warn and ignore the option if not recognized |
21787 | 21796 | if test "${enable_dvd_obs_64k+set}" = set; then |
21788 | 21797 | enableval=$enable_dvd_obs_64k; |
21789 | 21798 | else |
21790 | enable_fifo_odirect=no | |
21799 | enable_dvd_obs_64k=no | |
21791 | 21800 | fi |
21792 | 21801 | |
21793 | 21802 | if test x$enable_dvd_obs_64k = xyes; then |
22829 | 22838 | # report actual input values of CONFIG_FILES etc. instead of their |
22830 | 22839 | # values after options handling. |
22831 | 22840 | ac_log=" |
22832 | This file was extended by libburn $as_me 0.7.6, which was | |
22841 | This file was extended by libburn $as_me 0.8.0, which was | |
22833 | 22842 | generated by GNU Autoconf 2.60. Invocation command line was |
22834 | 22843 | |
22835 | 22844 | CONFIG_FILES = $CONFIG_FILES |
22876 | 22885 | _ACEOF |
22877 | 22886 | cat >>$CONFIG_STATUS <<_ACEOF |
22878 | 22887 | ac_cs_version="\\ |
22879 | libburn config.status 0.7.6 | |
22888 | libburn config.status 0.8.0 | |
22880 | 22889 | configured by $0, generated by GNU Autoconf 2.60, |
22881 | 22890 | with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" |
22882 | 22891 |
0 | AC_INIT([libburn], [0.7.6], [http://libburnia-project.org]) | |
0 | AC_INIT([libburn], [0.8.0], [http://libburnia-project.org]) | |
1 | 1 | AC_PREREQ([2.50]) |
2 | 2 | dnl AC_CONFIG_HEADER([config.h]) |
3 | 3 | |
4 | 4 | AC_CANONICAL_HOST |
5 | 5 | AC_CANONICAL_TARGET |
6 | 6 | |
7 | LIBBURNIA_SET_FLAGS | |
8 | ||
7 | 9 | AM_INIT_AUTOMAKE([subdir-objects]) |
8 | 10 | |
9 | dnl Notes by ts A71207 - B00122 : | |
11 | dnl Notes by ts A71207 - B00310 : | |
10 | 12 | dnl |
11 | 13 | dnl Regrettably the meaning of the various version types was misunderstood |
12 | 14 | dnl before version 0.4.1. |
76 | 78 | dnl 0.7.2 = libburn.so.4.37.0 |
77 | 79 | dnl 0.7.4 = libburn.so.4.39.0 |
78 | 80 | dnl 0.7.6 = libburn.so.4.41.0 |
81 | dnl 0.7.8 = libburn.so.4.43.0 | |
82 | dnl 0.8.0 = libburn.so.4.45.0 | |
79 | 83 | dnl |
80 | 84 | dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here. |
81 | 85 | dnl SONAME of the emerging library is LT_CURRENT - LT_AGE. |
100 | 104 | dnl |
101 | 105 | dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_* |
102 | 106 | BURN_MAJOR_VERSION=0 |
103 | BURN_MINOR_VERSION=7 | |
104 | BURN_MICRO_VERSION=6 | |
107 | BURN_MINOR_VERSION=8 | |
108 | BURN_MICRO_VERSION=0 | |
105 | 109 | BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
106 | 110 | |
107 | 111 | AC_SUBST(BURN_MAJOR_VERSION) |
112 | 116 | dnl Libtool versioning |
113 | 117 | LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION |
114 | 118 | dnl |
115 | dnl ts B00122 | |
116 | dnl This is the release version libburn-0.7.6 = libburn.so.4.41.0 | |
119 | dnl ts B00409 | |
120 | dnl This is the release version libburn-0.8.0 | |
117 | 121 | dnl ### This is the development version after above release version |
118 | 122 | dnl LT_CURRENT++, LT_AGE++ has not yet happened. |
119 | 123 | dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile. |
120 | 124 | dnl |
121 | dnl SONAME = 45 - 41 = 4 . Linux library name = libburn.so.4.41.0 | |
122 | LT_CURRENT=45 | |
123 | LT_AGE=41 | |
125 | dnl SONAME = 49 - 45 = 4 . Linux library name = libburn.so.4.45.0 | |
126 | LT_CURRENT=49 | |
127 | LT_AGE=45 | |
124 | 128 | LT_REVISION=0 |
125 | 129 | LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` |
126 | 130 | |
198 | 202 | dnl ts A91116 |
199 | 203 | AC_ARG_ENABLE(dvd-obs-64k, |
200 | 204 | [ --enable-dvd-obs-64k 64 KB default size for DVD/BD writing, default=no], |
201 | , enable_fifo_odirect=no) | |
205 | , enable_dvd_obs_64k=no) | |
202 | 206 | if test x$enable_dvd_obs_64k = xyes; then |
203 | 207 | LIBBURN_DVD_OBS_64K="-DLibburn_dvd_obs_default_64K" |
204 | 208 | echo "enabled write size default 64 KB on DVD and BD" |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | 1 | |
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
2 | 6 | |
3 | 7 | /* ts A71019 */ |
4 | 8 | |
35 | 39 | #include <stdlib.h> |
36 | 40 | #include <stdio.h> |
37 | 41 | #include <string.h> |
42 | #include <signal.h> | |
38 | 43 | |
39 | 44 | /* |
40 | 45 | #include <a ssert.h> |
227 | 232 | return NULL; |
228 | 233 | } |
229 | 234 | |
235 | static void reset_progress(struct burn_drive *d, int sessions, int tracks, | |
236 | int indices, int sectors, int flag) | |
237 | { | |
238 | /* reset the progress indicator */ | |
239 | d->progress.session = 0; | |
240 | d->progress.sessions = sessions; | |
241 | d->progress.track = 0; | |
242 | d->progress.tracks = tracks; | |
243 | d->progress.index = 0; | |
244 | d->progress.indices = indices; | |
245 | d->progress.start_sector = 0; | |
246 | d->progress.sectors = sectors; | |
247 | d->progress.sector = 0; | |
248 | } | |
249 | ||
250 | ||
230 | 251 | int burn_drive_scan(struct burn_drive_info *drives[], unsigned int *n_drives) |
231 | 252 | { |
232 | 253 | struct scan_opts o; |
296 | 317 | |
297 | 318 | static void *erase_worker_func(struct w_list *w) |
298 | 319 | { |
320 | ||
321 | #define Libburn_protect_erase_threaD 1 | |
322 | ||
323 | #ifdef Libburn_protect_erase_threaD | |
324 | sigset_t sigset, oldset; | |
325 | ||
326 | /* Protect blank thread from being interrupted by external signals */ | |
327 | sigfillset(&sigset); | |
328 | sigdelset(&sigset, SIGSEGV); | |
329 | sigdelset(&sigset, SIGILL); | |
330 | pthread_sigmask(SIG_SETMASK, &sigset, &oldset); | |
331 | #endif /* Libburn_protect_erase_threaD */ | |
332 | ||
299 | 333 | burn_disc_erase_sync(w->u.erase.drive, w->u.erase.fast); |
300 | 334 | remove_worker(pthread_self()); |
335 | ||
336 | #ifdef Libburn_protect_erase_threaD | |
337 | /* (just in case it would not end with all signals blocked) */ | |
338 | pthread_sigmask(SIG_SETMASK, &oldset, NULL); | |
339 | #endif /* Libburn_protect_erase_threaD */ | |
340 | ||
301 | 341 | return NULL; |
302 | 342 | } |
303 | 343 | |
309 | 349 | /* a ssert(drive); */ |
310 | 350 | /* a ssert(!SCAN_GOING()); */ |
311 | 351 | /* a ssert(!find_worker(drive)); */ |
352 | ||
312 | 353 | if((drive == NULL)) { |
313 | 354 | libdax_msgs_submit(libdax_messenger, drive->global_index, |
314 | 355 | 0x00020104, |
324 | 365 | 0, 0); |
325 | 366 | return; |
326 | 367 | } |
368 | ||
369 | reset_progress(drive, 1, 1, 1, 0x10000, 0); | |
370 | ||
327 | 371 | /* A70103 : will be set to 0 by burn_disc_erase_sync() */ |
328 | 372 | drive->cancel = 1; |
329 | 373 | |
364 | 408 | /* ts A61230 */ |
365 | 409 | static void *format_worker_func(struct w_list *w) |
366 | 410 | { |
411 | ||
412 | #define Libburn_protect_format_threaD 1 | |
413 | ||
414 | #ifdef Libburn_protect_format_threaD | |
415 | sigset_t sigset, oldset; | |
416 | ||
417 | /* Protect format thread from being interrupted by external signals */ | |
418 | sigfillset(&sigset); | |
419 | sigdelset(&sigset, SIGSEGV); | |
420 | sigdelset(&sigset, SIGILL); | |
421 | pthread_sigmask(SIG_SETMASK, &sigset, &oldset); | |
422 | #endif /* Libburn_protect_format_threaD */ | |
423 | ||
367 | 424 | burn_disc_format_sync(w->u.format.drive, w->u.format.size, |
368 | 425 | w->u.format.flag); |
369 | 426 | remove_worker(pthread_self()); |
427 | ||
428 | #ifdef Libburn_protect_format_threaD | |
429 | /* (just in case it would not end with all signals blocked) */ | |
430 | pthread_sigmask(SIG_SETMASK, &oldset, NULL); | |
431 | #endif /* Libburn_protect_format_threaD */ | |
432 | ||
370 | 433 | return NULL; |
371 | 434 | } |
372 | 435 | |
377 | 440 | struct format_opts o; |
378 | 441 | int ok = 0, ret; |
379 | 442 | char msg[160]; |
443 | ||
444 | reset_progress(drive, 1, 1, 1, 0x10000, 0); | |
380 | 445 | |
381 | 446 | if ((SCAN_GOING()) || find_worker(drive) != NULL) { |
382 | 447 | libdax_msgs_submit(libdax_messenger, drive->global_index, |
507 | 572 | static void *write_disc_worker_func(struct w_list *w) |
508 | 573 | { |
509 | 574 | struct burn_drive *d = w->u.write.drive; |
575 | char msg[80]; | |
576 | ||
577 | #define Libburn_protect_write_threaD 1 | |
578 | ||
579 | #ifdef Libburn_protect_write_threaD | |
580 | sigset_t sigset, oldset; | |
581 | ||
582 | /* Protect write thread from being interrupted by external signals */ | |
583 | sigfillset(&sigset); | |
584 | sigdelset(&sigset, SIGSEGV); | |
585 | sigdelset(&sigset, SIGILL); | |
586 | pthread_sigmask(SIG_SETMASK, &sigset, &oldset); | |
587 | #endif /* Libburn_protect_write_threaD */ | |
510 | 588 | |
511 | 589 | d->thread_pid = getpid(); |
590 | d->thread_tid = pthread_self(); | |
512 | 591 | d->thread_pid_valid= 1; |
513 | 592 | burn_disc_write_sync(w->u.write.opts, w->u.write.disc); |
514 | 593 | d->thread_pid_valid= 0; |
518 | 597 | */ |
519 | 598 | burn_write_opts_free(w->u.write.opts); |
520 | 599 | |
600 | sprintf(msg, "Write thread on drive %d ended", d->global_index); | |
601 | libdax_msgs_submit(libdax_messenger, d->global_index, 0x00020178, | |
602 | LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, | |
603 | msg, 0, 0); | |
604 | ||
521 | 605 | remove_worker(pthread_self()); |
606 | d->busy = BURN_DRIVE_IDLE; | |
607 | ||
608 | #ifdef Libburn_protect_write_threaD | |
609 | /* (just in case it would not end with all signals blocked) */ | |
610 | pthread_sigmask(SIG_SETMASK, &oldset, NULL); | |
611 | #endif /* Libburn_protect_write_threaD */ | |
612 | ||
522 | 613 | return NULL; |
523 | 614 | } |
524 | 615 | |
541 | 632 | 0, 0); |
542 | 633 | return; |
543 | 634 | } |
635 | ||
636 | reset_progress(d, disc->sessions, disc->session[0]->tracks, | |
637 | disc->session[0]->track[0]->indices, 0, 0); | |
544 | 638 | |
545 | 639 | /* For the next lines any return indicates failure */ |
546 | 640 | d->cancel = 1; |
608 | 702 | { |
609 | 703 | int old; |
610 | 704 | |
705 | #define Libburn_protect_fifo_threaD 1 | |
706 | ||
707 | #ifdef Libburn_protect_fifo_threaD | |
708 | sigset_t sigset, oldset; | |
709 | ||
710 | /* Protect fifo thread from being interrupted by external signals */ | |
711 | sigfillset(&sigset); | |
712 | sigdelset(&sigset, SIGSEGV); | |
713 | sigdelset(&sigset, SIGILL); | |
714 | pthread_sigmask(SIG_SETMASK, &sigset, &oldset); | |
715 | #endif /* Libburn_protect_fifo_threaD */ | |
716 | ||
611 | 717 | pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old); |
612 | 718 | pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); |
613 | 719 | /* Note: Only burn_fifo_abort() shall cancel the fifo thread */ |
614 | 720 | |
615 | 721 | burn_fifo_source_shoveller(w->u.fifo.source, w->u.fifo.flag); |
616 | 722 | remove_worker(pthread_self()); |
723 | ||
724 | #ifdef Libburn_protect_fifo_threaD | |
725 | /* (just in case it would not end with all signals blocked) */ | |
726 | pthread_sigmask(SIG_SETMASK, &oldset, NULL); | |
727 | #endif /* Libburn_protect_fifo_threaD */ | |
728 | ||
617 | 729 | return NULL; |
618 | 730 | } |
619 | 731 | |
638 | 750 | add_worker(Burnworker_type_fifO, NULL, |
639 | 751 | (WorkerFunc) fifo_worker_func, &o); |
640 | 752 | fs->is_started = 1; |
753 | ||
641 | 754 | return 1; |
642 | 755 | } |
643 | 756 |
0 | 0 | /** |
1 | Copyright (c) 2006 Thomas Schmitt <scdbackup@gmx.net> | |
2 | Provided under GPL version 2 or later. | |
1 | 3 | |
2 | 4 | This file bundles variables which disable changes in libburn which are |
3 | 5 | not yet completely accepted. |
2 | 2 | |
3 | 3 | A signal handler which cleans up an application and exits. |
4 | 4 | |
5 | Provided under GPL license within GPL projects, BSD license elsewise. | |
5 | Provided under GPLv2+ license within GPL projects, BSD license elsewise. | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | /* |
39 | 39 | #else /* ! Cleanup_has_no_libburn_os_H */ |
40 | 40 | |
41 | 41 | |
42 | /* Outdated. Linux only. For backward compatibility with pre-libburn-0.2.3 */ | |
42 | /* Outdated. GNU/Linux only. | |
43 | For backward compatibility with pre-libburn-0.2.3 */ | |
43 | 44 | |
44 | 45 | /* Signals to be caught */ |
45 | 46 | static int signal_list[]= { |
2 | 2 | |
3 | 3 | A signal handler which cleans up an application and exits. |
4 | 4 | |
5 | Provided under GPL license within GPL projects, BSD license elsewise. | |
5 | Provided under GPLv2+ within GPL projects, BSD license elsewise. | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #ifndef Cleanup_includeD |
2 | 2 | #ifndef BURN__CRC_H |
3 | 3 | #define BURN__CRC_H |
4 | 4 | |
5 | ||
6 | #ifdef Xorriso_standalonE | |
7 | /* Source module crc.c of yet unclear ancestry is excluded from GNU xorriso */ | |
8 | #ifndef Libburn_no_crc_C | |
9 | #define Libburn_no_crc_C 1 | |
10 | #endif | |
11 | #endif | |
12 | ||
13 | ||
14 | #ifndef Libburn_no_crc_C | |
15 | ||
5 | 16 | unsigned short crc_ccitt(unsigned char *, int len); |
6 | 17 | unsigned int crc_32(unsigned char *, int len); |
7 | 18 | |
19 | #endif /* Libburn_no_crc_C */ | |
20 | ||
21 | ||
8 | 22 | #endif /* BURN__CRC_H */ |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
1 | 6 | |
2 | 7 | #ifdef WIN32 |
3 | 8 | #include <windows.h> |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #include <sys/types.h> |
3 | 9 | #include <sys/stat.h> |
4 | 10 | |
5 | /* #include <m alloc.h> ts A61013 : not in Linux man 3 malloc */ | |
11 | /* #include <m alloc.h> ts A61013 : not in GNU/Linux man 3 malloc */ | |
6 | 12 | |
7 | 13 | #include <stdlib.h> |
8 | 14 | #include <unistd.h> |
369 | 375 | d->busy = BURN_DRIVE_IDLE; |
370 | 376 | d->thread_pid = 0; |
371 | 377 | d->thread_pid_valid = 0; |
378 | memset(&(d->thread_tid), 0, sizeof(d->thread_tid)); | |
372 | 379 | d->toc_entries = 0; |
373 | 380 | d->toc_entry = NULL; |
374 | 381 | d->disc = NULL; |
614 | 621 | d->idata->product); |
615 | 622 | |
616 | 623 | d->cancel = 0; |
617 | d->busy = BURN_DRIVE_ERASING; | |
618 | d->erase(d, fast); | |
624 | ||
625 | #ifdef Libburn_reset_progress_asynC | |
626 | /* <<< This is now done in async.c */ | |
619 | 627 | /* reset the progress */ |
620 | 628 | d->progress.session = 0; |
621 | 629 | d->progress.sessions = 1; |
626 | 634 | d->progress.start_sector = 0; |
627 | 635 | d->progress.sectors = 0x10000; |
628 | 636 | d->progress.sector = 0; |
637 | #endif /* Libburn_reset_progress_asynC */ | |
638 | ||
639 | d->erase(d, fast); | |
640 | d->busy = BURN_DRIVE_ERASING; | |
641 | ||
629 | 642 | /* read the initial 0 stage */ |
630 | 643 | while (!d->test_unit_ready(d) && d->get_erase_progress(d) == 0) |
631 | 644 | sleep(1); |
652 | 665 | char msg[80]; |
653 | 666 | struct buffer buf, *buf_mem = d->buffer; |
654 | 667 | |
668 | #ifdef Libburn_reset_progress_asynC | |
669 | /* <<< This is now done in async.c */ | |
655 | 670 | /* reset the progress */ |
656 | 671 | d->progress.session = 0; |
657 | 672 | d->progress.sessions = 1; |
662 | 677 | d->progress.start_sector = 0; |
663 | 678 | d->progress.sectors = 0x10000; |
664 | 679 | d->progress.sector = 0; |
680 | #endif /* Libburn_reset_progress_asynC */ | |
681 | ||
665 | 682 | stages = 1 + ((flag & 1) && size > 1024 * 1024); |
666 | 683 | d->cancel = 0; |
667 | 684 | d->busy = BURN_DRIVE_FORMATTING; |
798 | 815 | enum burn_drive_status burn_drive_get_status(struct burn_drive *d, |
799 | 816 | struct burn_progress *p) |
800 | 817 | { |
818 | /* --- Part of asynchronous signal handling --- */ | |
819 | /* This frequently used call may be used to react on messages from | |
820 | the libburn built-in signal handler. | |
821 | */ | |
822 | ||
823 | /* ts B00225 : | |
824 | If aborting with action 2: | |
825 | catch control thread after it returned from signal handler. | |
826 | Let it run burn_abort(4440,...) | |
827 | */ | |
828 | burn_init_catch_on_abort(0); | |
829 | ||
801 | 830 | /* ts A70928 : inform control thread of signal in sub-threads */ |
802 | if (burn_global_abort_level > 0) | |
831 | if (burn_builtin_triggered_action < 2 && burn_global_abort_level > 0) | |
803 | 832 | burn_global_abort_level++; |
804 | if (burn_global_abort_level > 5) { | |
833 | if (burn_builtin_triggered_action < 2 && burn_global_abort_level > 5) { | |
805 | 834 | if (burn_global_signal_handler == NULL) |
806 | 835 | kill(getpid(), burn_global_abort_signum); |
807 | 836 | else |
811 | 840 | burn_global_abort_level = -1; |
812 | 841 | } |
813 | 842 | |
843 | /* --- End of asynchronous signal handling --- */ | |
844 | ||
845 | ||
814 | 846 | if (p != NULL) { |
815 | 847 | memcpy(p, &(d->progress), sizeof(struct burn_progress)); |
816 | 848 | /* TODO: add mutex */ |
832 | 864 | |
833 | 865 | void burn_drive_cancel(struct burn_drive *d) |
834 | 866 | { |
867 | /* ts B00225 : these mutexes are unnecessary because "= 1" is atomar. | |
835 | 868 | pthread_mutex_lock(&d->access_lock); |
869 | */ | |
836 | 870 | d->cancel = 1; |
871 | /* | |
837 | 872 | pthread_mutex_unlock(&d->access_lock); |
873 | */ | |
838 | 874 | } |
839 | 875 | |
840 | 876 | /* ts A61007 : defunct because unused */ |
1851 | 1887 | } |
1852 | 1888 | |
1853 | 1889 | |
1890 | /* ts B00226 : Outsourced backend of burn_abort() | |
1891 | @param flag bit0= do not call burn_finish() | |
1892 | */ | |
1893 | int burn_abort_5(int patience, | |
1894 | int (*pacifier_func)(void *handle, int patience, int elapsed), | |
1895 | void *handle, int elapsed, int flag) | |
1896 | { | |
1897 | int ret, i, occup, still_not_done= 1, pacifier_off= 0, first_round= 1; | |
1898 | unsigned long wait_grain= 100000; | |
1899 | time_t start_time, current_time, pacifier_time, end_time; | |
1900 | ||
1901 | #ifndef NIX | |
1902 | time_t stdio_patience = 3; | |
1903 | #endif | |
1904 | ||
1905 | ||
1906 | /* | |
1907 | fprintf(stderr, | |
1908 | "libburn_EXPERIMENTAL: burn_abort_5(%d,%d)\n", patience, flag); | |
1909 | */ | |
1910 | ||
1911 | current_time = start_time = pacifier_time = time(0); | |
1912 | start_time -= elapsed; | |
1913 | end_time = start_time + patience; | |
1914 | ||
1915 | /* >>> ts A71002 : are there any threads at work ? | |
1916 | If not, then one can force abort because the drives will not | |
1917 | change status on their own. | |
1918 | */ | |
1919 | ||
1920 | while(current_time < end_time || (patience <= 0 && first_round)) { | |
1921 | still_not_done = 0; | |
1922 | ||
1923 | for(i = 0; i < drivetop + 1; i++) { | |
1924 | occup = burn_drive_is_occupied(&(drive_array[i])); | |
1925 | if(occup == -2) | |
1926 | continue; | |
1927 | ||
1928 | if(drive_array[i].drive_role != 1) { | |
1929 | ||
1930 | #ifdef NIX | |
1931 | ||
1932 | /* ts A90302 | |
1933 | <<< this causes a race condition with drive | |
1934 | usage and drive disposal. | |
1935 | */ | |
1936 | drive_array[i].busy = BURN_DRIVE_IDLE; | |
1937 | burn_drive_forget(&(drive_array[i]), 1); | |
1938 | continue; | |
1939 | ||
1940 | #else /* NIX */ | |
1941 | ||
1942 | /* ts A90318 | |
1943 | >>> but if a pipe breaks then the drive | |
1944 | never gets idle. | |
1945 | So for now with a short patience timespan | |
1946 | and eventually a deliberate memory leak. | |
1947 | */ | |
1948 | if (current_time - start_time > | |
1949 | stdio_patience) { | |
1950 | drive_array[i].global_index = -1; | |
1951 | continue; | |
1952 | } | |
1953 | ||
1954 | #endif /* ! NIX */ | |
1955 | ||
1956 | } | |
1957 | ||
1958 | if(occup <= 10) { | |
1959 | if (drive_array[i].drive_role != 1) | |
1960 | /* occup == -1 comes early */ | |
1961 | usleep(1000000); | |
1962 | burn_drive_forget(&(drive_array[i]), 1); | |
1963 | } else if(occup <= 100) { | |
1964 | if(first_round) | |
1965 | burn_drive_cancel(&(drive_array[i])); | |
1966 | still_not_done++; | |
1967 | } else if(occup <= 1000) { | |
1968 | still_not_done++; | |
1969 | } | |
1970 | } | |
1971 | first_round = 0; | |
1972 | ||
1973 | if(still_not_done == 0 || patience <= 0) | |
1974 | break; | |
1975 | usleep(wait_grain); | |
1976 | current_time = time(0); | |
1977 | if(current_time>pacifier_time) { | |
1978 | if(pacifier_func != NULL && !pacifier_off) { | |
1979 | ret = (*pacifier_func)(handle, patience, | |
1980 | current_time-start_time); | |
1981 | pacifier_off = (ret <= 0); | |
1982 | } | |
1983 | pacifier_time = current_time; | |
1984 | } | |
1985 | } | |
1986 | if (!(flag & 1)) | |
1987 | burn_finish(); | |
1988 | return(still_not_done == 0); | |
1989 | } | |
1990 | ||
1991 | ||
1854 | 1992 | /** Abort any running drive operation and finish libburn. |
1855 | 1993 | @param patience Maximum number of seconds to wait for drives to finish |
1856 | 1994 | @param pacifier_func Function to produce appeasing messages. See |
1863 | 2001 | int (*pacifier_func)(void *handle, int patience, int elapsed), |
1864 | 2002 | void *handle) |
1865 | 2003 | { |
1866 | int ret, i, occup, still_not_done= 1, pacifier_off= 0, first_round= 1; | |
1867 | unsigned long wait_grain= 100000; | |
1868 | time_t start_time, current_time, pacifier_time, end_time; | |
1869 | ||
1870 | #ifndef NIX | |
1871 | time_t stdio_patience = 3; | |
1872 | #endif | |
1873 | ||
1874 | current_time = start_time = pacifier_time = time(0); | |
1875 | end_time = start_time + patience; | |
1876 | ||
1877 | /* >>> ts A71002 : are there any threads at work ? | |
1878 | If not, then one can force abort because the drives will not | |
1879 | change status on their own. | |
1880 | */ | |
1881 | ||
1882 | while(current_time-end_time < patience) { | |
1883 | still_not_done = 0; | |
1884 | ||
1885 | for(i = 0; i < drivetop + 1; i++) { | |
1886 | occup = burn_drive_is_occupied(&(drive_array[i])); | |
1887 | if(occup == -2) | |
1888 | continue; | |
1889 | ||
1890 | if(drive_array[i].drive_role != 1) { | |
1891 | ||
1892 | #ifdef NIX | |
1893 | ||
1894 | /* ts A90302 | |
1895 | <<< this causes a race condition with drive | |
1896 | usage and drive disposal. | |
1897 | */ | |
1898 | drive_array[i].busy = BURN_DRIVE_IDLE; | |
1899 | burn_drive_forget(&(drive_array[i]), 1); | |
1900 | continue; | |
1901 | ||
1902 | #else /* NIX */ | |
1903 | ||
1904 | /* ts A90318 | |
1905 | >>> but if a pipe breaks then the drive | |
1906 | never gets idle. | |
1907 | So for now with a short patience timespan | |
1908 | and eventually a deliberate memory leak. | |
1909 | */ | |
1910 | if (current_time - start_time > | |
1911 | stdio_patience) { | |
1912 | drive_array[i].global_index = -1; | |
1913 | continue; | |
1914 | } | |
1915 | ||
1916 | #endif /* ! NIX */ | |
1917 | ||
1918 | } | |
1919 | ||
1920 | if(occup <= 10) { | |
1921 | burn_drive_forget(&(drive_array[i]), 1); | |
1922 | } else if(occup <= 100) { | |
1923 | if(first_round) | |
1924 | burn_drive_cancel(&(drive_array[i])); | |
1925 | still_not_done++; | |
1926 | } else if(occup <= 1000) { | |
1927 | still_not_done++; | |
1928 | } | |
1929 | } | |
1930 | first_round = 0; | |
1931 | ||
1932 | if(still_not_done == 0) | |
1933 | break; | |
1934 | usleep(wait_grain); | |
1935 | current_time = time(0); | |
1936 | if(current_time>pacifier_time) { | |
1937 | if(pacifier_func != NULL && !pacifier_off) { | |
1938 | ret = (*pacifier_func)(handle, patience, | |
1939 | current_time-start_time); | |
1940 | pacifier_off = (ret <= 0); | |
1941 | } | |
1942 | pacifier_time = current_time; | |
1943 | } | |
1944 | } | |
1945 | burn_finish(); | |
1946 | return(still_not_done == 0); | |
2004 | int ret, flg = 0; | |
2005 | ||
2006 | if (patience < 0) { | |
2007 | patience = 0; | |
2008 | flg |= 1; | |
2009 | } | |
2010 | ret = burn_abort_5(patience, pacifier_func, handle, 0, flg); | |
2011 | return ret; | |
1947 | 2012 | } |
1948 | 2013 | |
1949 | 2014 | |
2680 | 2745 | } |
2681 | 2746 | |
2682 | 2747 | |
2683 | int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid) | |
2748 | int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid, | |
2749 | pthread_t tid) | |
2684 | 2750 | { |
2685 | 2751 | int i; |
2686 | 2752 | |
2692 | 2758 | */ |
2693 | 2759 | |
2694 | 2760 | if (drive_array[i].thread_pid_valid && |
2695 | drive_array[i].thread_pid == pid) { | |
2761 | drive_array[i].thread_pid == pid && | |
2762 | pthread_equal(drive_array[i].thread_tid, tid)) { | |
2696 | 2763 | *d = &(drive_array[i]); |
2697 | 2764 | return 1; |
2698 | 2765 | } |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef __DRIVE |
3 | 9 | #define __DRIVE |
120 | 126 | int burn_drive__fd_from_special_adr(char *adr); |
121 | 127 | |
122 | 128 | |
123 | /* ts A70929 : Find the drive which is being worked on by pid */ | |
124 | int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid); | |
129 | /* ts A70929 : Find the drive which is being worked on by pid , tid */ | |
130 | int burn_drive_find_by_thread_pid(struct burn_drive **d, pid_t pid, | |
131 | pthread_t tid); | |
125 | 132 | |
126 | 133 | |
127 | 134 | /* ts A51221 - A80731 : Whitelist inquiry functions */ |
134 | 141 | int burn_drive_is_listed(char *path, struct burn_drive **found, int flag); |
135 | 142 | |
136 | 143 | |
144 | /* ts B00226 : Outsourced backend of burn_abort() | |
145 | @param elapsed to be subtracted from start time | |
146 | @param flag bit0= do not shutdown the library | |
147 | */ | |
148 | int burn_abort_5(int patience, | |
149 | int (*pacifier_func)(void *handle, int patience, int elapsed), | |
150 | void *handle, int elapsed, int flag); | |
151 | ||
137 | 152 | #endif /* __DRIVE */ |
3 | 3 | /* ts A91016 : libburn/ecma130ab.c is the replacement for old libburn/lec.c |
4 | 4 | |
5 | 5 | Copyright 2009, Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org |
6 | Provided under GPL version 2 or later. | |
6 | 7 | |
7 | 8 | This code module implements the production of RSPC parity bytes (P- and Q- |
8 | 9 | parity) and the scrambling of raw CD-ROM sectors as specified in ECMA-130: |
3 | 3 | /* ts A91016 : libburn/ecma130ab.h is the replacement for old libburn/lec.h |
4 | 4 | |
5 | 5 | Copyright 2009, Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org |
6 | Provided under GPL version 2 or later. | |
6 | 7 | |
7 | 8 | This code module implements the computations prescribed in ECMA-130 Annex A |
8 | 9 | and B. For explanations of the underlying mathematics see ecma130ab.c . |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | |
3 | 9 | #include <stdlib.h> |
82 | 88 | |
83 | 89 | if (fs->fixed_size > 0) |
84 | 90 | return fs->fixed_size; |
85 | if (fstat(fs->datafd, &buf) == -1) | |
91 | if (fstat(fs->datafd, &buf) != 0) | |
92 | return (off_t) 0; | |
93 | if ((buf.st_mode & S_IFMT) != S_IFREG) | |
86 | 94 | return (off_t) 0; |
87 | 95 | return (off_t) buf.st_size; |
88 | 96 | } |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
1 | 6 | |
2 | 7 | #ifndef BURN__FILE_H |
3 | 8 | #define BURN__FILE_H |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #include <unistd.h> |
3 | 9 | |
8 | 14 | #include <signal.h> |
9 | 15 | #include <string.h> |
10 | 16 | #include <stdlib.h> |
17 | #include <pthread.h> | |
11 | 18 | |
12 | 19 | /* ts A70928 : init.h is for others, not for init .c |
13 | 20 | #include "init.h" |
31 | 38 | |
32 | 39 | int burn_running = 0; |
33 | 40 | |
34 | /* ts A60813 : Linux: wether to use O_EXCL on open() of device files */ | |
41 | /* ts A60813 : GNU/Linux: whether to use O_EXCL on open() of device files | |
42 | ts B00212 : FreeBSD: whether to use flock(LOCK_EX) after open() | |
43 | */ | |
35 | 44 | int burn_sg_open_o_excl = 1; |
36 | 45 | |
37 | /* ts A70403 : Linux: wether to use fcntl(,F_SETLK,) | |
46 | /* ts A70403 : GNU/Linux: wether to use fcntl(,F_SETLK,) | |
38 | 47 | after open() of device files */ |
39 | 48 | int burn_sg_fcntl_f_setlk = 1; |
40 | 49 | |
41 | /* ts A70314 : Linux: what device family to use : | |
50 | /* ts A70314 : GNU/Linux: what device family to use : | |
42 | 51 | 0= default family |
43 | 52 | 1= sr |
44 | 53 | 2= scd |
71 | 80 | /* Parameters for builtin abort handler */ |
72 | 81 | static char abort_message_prefix[81] = {"libburn : "}; |
73 | 82 | static pid_t abort_control_pid= 0; |
83 | static pthread_t abort_control_thread; | |
74 | 84 | volatile int burn_global_abort_level= 0; |
75 | 85 | int burn_global_abort_signum= 0; |
76 | 86 | void *burn_global_signal_handle = NULL; |
77 | 87 | burn_abort_handler_t burn_global_signal_handler = NULL; |
88 | int burn_builtin_signal_action = 0; /* burn_set_signal_handling() */ | |
89 | volatile int burn_builtin_triggered_action = 0; /* burn_is_aborting() */ | |
78 | 90 | |
79 | 91 | |
80 | 92 | /* ts A70223 : wether implemented untested profiles are supported */ |
320 | 332 | return ret; |
321 | 333 | } |
322 | 334 | |
335 | /* ts B00224 */ | |
336 | char *burn_util_thread_id(pid_t pid, pthread_t tid, char text[80]) | |
337 | { | |
338 | int i, l; | |
339 | ||
340 | sprintf(text, "[%d,", getpid()); | |
341 | l= strlen(text); | |
342 | for(i= 0; i < sizeof(pthread_t) && 2 * i < 80 - l - 3; i++) | |
343 | sprintf(text + l + 2 * i, | |
344 | "%2.2X", ((unsigned char *) &tid)[i]); | |
345 | ||
346 | sprintf(text + l + 2 * i, "]"); | |
347 | return text; | |
348 | } | |
323 | 349 | |
324 | 350 | int burn_builtin_abort_handler(void *handle, int signum, int flag) |
325 | 351 | { |
328 | 354 | /* |
329 | 355 | #define Libburn_signal_handler_verbouS 1 |
330 | 356 | */ |
357 | ||
331 | 358 | int ret; |
332 | 359 | struct burn_drive *d; |
333 | 360 | |
334 | 361 | #ifdef Libburn_signal_handler_verbouS |
335 | fprintf(stderr, | |
336 | "libburn_ABORT: pid = %d , abort_control_pid = %d , sig= %d\n", | |
337 | getpid(), abort_control_pid, signum); | |
362 | char text[80]; | |
363 | ||
364 | fprintf(stderr, "libburn_ABORT: in = %s\n", | |
365 | burn_util_thread_id(getpid(), pthread_self(), text)); | |
366 | fprintf(stderr, "libburn_ABORT: ctrl = %s\n", | |
367 | burn_util_thread_id(abort_control_pid, abort_control_thread, | |
368 | text)); | |
369 | if (burn_global_signal_handler == burn_builtin_abort_handler) | |
370 | fprintf(stderr, "libburn_ABORT: signal action = %d\n", | |
371 | burn_builtin_signal_action); | |
372 | ||
373 | /* >>> find writing drives and report their tid | |
374 | fprintf(stderr, "libburn_ABORT: wrt = %s\n", | |
375 | burn_util_thread_id(0, burn_write_thread_id, text)); | |
376 | fprintf(stderr, "libburn_ABORT: sig= %d\n", signum); | |
377 | */ | |
338 | 378 | #endif |
379 | ||
380 | burn_builtin_triggered_action = burn_builtin_signal_action; | |
381 | burn_global_abort_level = -1; | |
382 | ||
383 | if (burn_builtin_signal_action > 1) { | |
384 | Cleanup_set_handlers(NULL, NULL, 2); | |
385 | if (burn_builtin_signal_action == 4) | |
386 | return -2; | |
387 | fprintf(stderr,"%sABORT : Trying to shut down busy drives\n", | |
388 | abort_message_prefix); | |
389 | fprintf(stderr, | |
390 | "%sABORT : Wait the normal burning time before any kill -9\n", | |
391 | abort_message_prefix); | |
392 | burn_abort_5(0, burn_abort_pacifier, abort_message_prefix, | |
393 | 0, 1); | |
394 | libdax_msgs_submit(libdax_messenger, -1, 0x00020177, | |
395 | LIBDAX_MSGS_SEV_ABORT, LIBDAX_MSGS_PRIO_HIGH, | |
396 | "Urged drive worker threads to do emergency halt", | |
397 | 0, 0); | |
398 | return -2; | |
399 | } | |
400 | ||
401 | ||
402 | /* ---- old deprecated stuck-in-abort-handler loop ---- */ | |
339 | 403 | |
340 | 404 | /* ts A70928: |
341 | 405 | Must be quick. Allowed to coincide with other thread and to share |
349 | 413 | |
350 | 414 | #ifdef Libburn_new_thread_signal_handleR |
351 | 415 | |
352 | ret = burn_drive_find_by_thread_pid(&d, getpid()); | |
416 | ret = burn_drive_find_by_thread_pid(&d, getpid(), | |
417 | pthread_self()); | |
353 | 418 | if (ret > 0 && d->busy == BURN_DRIVE_WRITING) { |
354 | 419 | /* This is an active writer thread */ |
355 | 420 | |
389 | 454 | } |
390 | 455 | burn_global_abort_level = -1; |
391 | 456 | Cleanup_set_handlers(NULL, NULL, 2); |
457 | ||
392 | 458 | fprintf(stderr,"%sABORT : Trying to shut down drive and library\n", |
393 | 459 | abort_message_prefix); |
394 | 460 | fprintf(stderr, |
395 | 461 | "%sABORT : Wait the normal burning time before any kill -9\n", |
396 | 462 | abort_message_prefix); |
397 | 463 | close(0); /* somehow stdin as input blocks abort until EOF */ |
398 | ||
399 | 464 | burn_abort(4440, burn_abort_pacifier, abort_message_prefix); |
400 | 465 | |
401 | 466 | fprintf(stderr, |
405 | 470 | return(1); |
406 | 471 | } |
407 | 472 | |
473 | ||
474 | /* ts A61002 : API */ | |
408 | 475 | void burn_set_signal_handling(void *handle, burn_abort_handler_t handler, |
409 | int mode) | |
410 | { | |
411 | if(handler == NULL && mode == 0) { | |
476 | int mode) | |
477 | { | |
478 | ||
479 | /* | |
480 | fprintf(stderr, "libburn_experimental: burn_set_signal_handling, handler==%lx mode=%d\n", (unsigned long) handler, mode); | |
481 | */ | |
482 | ||
483 | if(handler == NULL) { | |
412 | 484 | handler = burn_builtin_abort_handler; |
413 | 485 | /* |
414 | fprintf(stderr, "libburn_experimental: activated burn_builtin_abort_handler() with handle '%s'\n",(handle==NULL ? "libburn : " : (char *) handle)); | |
486 | if ((mode & ~4) == 0) | |
487 | fprintf(stderr, "libburn_experimental: activated burn_builtin_abort_handler() with handle '%s'\n",(handle==NULL ? "libburn : " : (char *) handle)); | |
415 | 488 | */ |
416 | 489 | |
417 | 490 | } |
418 | 491 | strcpy(abort_message_prefix, "libburn : "); |
419 | if(handle != NULL) | |
492 | abort_message_prefix[0] = 0; | |
493 | if(handle != NULL && handler == burn_builtin_abort_handler) | |
420 | 494 | strncpy(abort_message_prefix, (char *) handle, |
421 | 495 | sizeof(abort_message_prefix)-1); |
422 | 496 | abort_message_prefix[sizeof(abort_message_prefix)-1] = 0; |
423 | 497 | abort_control_pid = getpid(); |
424 | Cleanup_set_handlers(handle, (Cleanup_app_handler_T) handler, mode|4); | |
498 | abort_control_thread = pthread_self(); | |
499 | burn_builtin_signal_action = (mode >> 4) & 15; | |
500 | if((mode & 11) != 0) | |
501 | burn_builtin_signal_action = 0; | |
502 | if(burn_builtin_signal_action > 1) | |
503 | burn_builtin_triggered_action = 0; | |
504 | if(burn_builtin_signal_action == 0) | |
505 | burn_builtin_signal_action = 1; | |
506 | Cleanup_set_handlers(handle, (Cleanup_app_handler_T) handler, | |
507 | (mode & 15) | 4); | |
425 | 508 | burn_global_signal_handle = handle; |
426 | 509 | burn_global_signal_handler = handler; |
510 | } | |
511 | ||
512 | ||
513 | /* ts B00304 : API */ | |
514 | int burn_is_aborting(int flag) | |
515 | { | |
516 | return burn_builtin_triggered_action; | |
517 | } | |
518 | ||
519 | ||
520 | /* ts B00225 */ | |
521 | /* @return 0= no abort action 2 pending , 1= not control thread | |
522 | */ | |
523 | int burn_init_catch_on_abort(int flag) | |
524 | { | |
525 | if (burn_builtin_triggered_action != 2) | |
526 | return 0; | |
527 | if (abort_control_pid != getpid() || | |
528 | abort_control_thread != pthread_self()) | |
529 | return 1; | |
530 | burn_abort(4440, burn_abort_pacifier, abort_message_prefix); | |
531 | fprintf(stderr, | |
532 | "\n%sABORT : Program done. Even if you do not see a shell prompt.\n\n", | |
533 | abort_message_prefix); | |
534 | exit(1); | |
427 | 535 | } |
428 | 536 | |
429 | 537 |
16 | 16 | extern void *burn_global_signal_handle; |
17 | 17 | extern burn_abort_handler_t burn_global_signal_handler; |
18 | 18 | |
19 | extern int burn_builtin_signal_action; /* burn_set_signal_handling() */ | |
20 | extern volatile int burn_builtin_triggered_action; /* burn_is_aborting() */ | |
21 | ||
22 | ||
23 | /* ts B00225 */ | |
24 | /* @return 0= no abort pending , 1= not control thread , | |
25 | -1= surprisingly burn_abort returned | |
26 | */ | |
27 | int burn_init_catch_on_abort(int flag); | |
28 | ||
19 | 29 | |
20 | 30 | #endif /* BURN__INIT_H */ |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | ||
6 | This is the official API definition of libburn. | |
7 | ||
8 | */ | |
9 | ||
1 | 10 | |
2 | 11 | #ifndef LIBBURN_H |
3 | 12 | #define LIBBURN_H |
726 | 735 | |
727 | 736 | |
728 | 737 | /* ts A61002 */ |
729 | /** Abort any running drive operation and finally call burn_finish(). | |
730 | You MUST calm down the busy drive if an aborting event occurs during a | |
738 | /** Abort any running drive operation and eventually call burn_finish(). | |
739 | ||
740 | You MUST shut down the busy drives if an aborting event occurs during a | |
731 | 741 | burn run. For that you may call this function either from your own signal |
732 | handling code or indirectly by activating the builtin signal handling: | |
742 | handling code or indirectly by activating the built-in signal handling: | |
733 | 743 | burn_set_signal_handling("my_app_name : ", NULL, 0); |
734 | Else you may eventually call burn_drive_cancel() on the active drive and | |
735 | wait for it to assume state BURN_DRIVE_IDLE. | |
736 | @param patience Maximum number of seconds to wait for drives to finish | |
744 | Else you may eventually call burn_drive_cancel() on the active drives and | |
745 | wait for them to assume state BURN_DRIVE_IDLE. | |
746 | @param patience Maximum number of seconds to wait for drives to | |
747 | finish. | |
748 | @since 0.7.8 : | |
749 | If this is -1, then only the cancel operations will | |
750 | be performed and no burn_finish() will happen. | |
737 | 751 | @param pacifier_func If not NULL: a function to produce appeasing messages. |
738 | 752 | See burn_abort_pacifier() for an example. |
739 | @param handle Opaque handle to be used with pacifier_func | |
753 | @param handle Opaque handle to be used with pacifier_func | |
740 | 754 | @return 1 ok, all went well |
741 | 755 | 0 had to leave a drive in unclean state |
742 | 756 | <0 severe error, do no use libburn again |
764 | 778 | void burn_set_verbosity(int level); |
765 | 779 | |
766 | 780 | /* ts A91111 */ |
767 | /** Enable resp. disable logging of SCSI commands (currently Linux only). | |
781 | /** Enable resp. disable logging of SCSI commands (currently GNU/Linux only). | |
768 | 782 | This call can be made at any time - even before burn_initialize(). |
769 | 783 | It is in effect for all active drives and currently not very thread |
770 | 784 | safe for multiple drives. |
781 | 795 | after burn_initialize() and before any bus scan. But not mandatory at all. |
782 | 796 | Parameter value 1 enables a feature, 0 disables. |
783 | 797 | Default is (1,0,0). Have a good reason before you change it. |
784 | @param exclusive Linux only: | |
798 | @param exclusive | |
785 | 799 | 0 = no attempt to make drive access exclusive. |
786 | 800 | 1 = Try to open only devices which are not marked as busy |
787 | and try to mark them busy if opened sucessfully. (O_EXCL) | |
788 | There are kernels which simply don't care about O_EXCL. | |
789 | Some have it off, some have it on, some are switchable. | |
801 | and try to mark them busy if opened sucessfully. (O_EXCL | |
802 | on GNU/Linux , flock(LOCK_EX) on FreeBSD.) | |
790 | 803 | 2 = in case of a SCSI device, also try to open exclusively |
791 | 804 | the matching /dev/sr, /dev/scd and /dev/st . |
792 | 805 | One may select a device SCSI file family by adding |
795 | 808 | 8 = /dev/scd%d |
796 | 809 | 16 = /dev/sg%d |
797 | 810 | Do not use other values ! |
798 | Add 32 to demand an exclusive lock by fcntl(,F_SETLK,) | |
799 | after open() has succeeded. | |
811 | Add 32 to demand on GNU/Linux an exclusive lock by | |
812 | fcntl(,F_SETLK,) after open() has succeeded. | |
800 | 813 | @param blocking Try to wait for drives which do not open immediately but |
801 | 814 | also do not return an error as well. (O_NONBLOCK) |
802 | 815 | This might stall indefinitely with /dev/hdX hard disks. |
1096 | 1109 | |
1097 | 1110 | /** Release a drive. This should not be done until the drive is no longer |
1098 | 1111 | busy (see burn_drive_get_status). |
1099 | Linux: The drive device file is not reserved afterwards. (O_EXCL, F_SETLK). | |
1100 | 1112 | @param drive The drive to release. |
1101 | 1113 | @param eject Nonzero to make the drive eject the disc in it. |
1102 | 1114 | */ |
2614 | 2626 | |
2615 | 2627 | */ |
2616 | 2628 | #define burn_header_version_major 0 |
2617 | #define burn_header_version_minor 7 | |
2618 | #define burn_header_version_micro 6 | |
2629 | #define burn_header_version_minor 8 | |
2630 | #define burn_header_version_micro 0 | |
2619 | 2631 | /** Note: |
2620 | 2632 | Above version numbers are also recorded in configure.ac because libtool |
2621 | 2633 | wants them as parameters at build time. |
2622 | For the library compatibility check BURN_*_VERSION in configure.ac | |
2634 | For the library compatibility check, BURN_*_VERSION in configure.ac | |
2623 | 2635 | are not decisive. Only the three numbers above do matter. |
2624 | 2636 | */ |
2625 | 2637 | /** Usage discussion: |
2776 | 2788 | |
2777 | 2789 | /* ts A61002 */ |
2778 | 2790 | /* @since 0.2.6 */ |
2779 | /** The prototype of a handler function suitable for burn_set_abort_handling(). | |
2791 | /** The prototype of a handler function suitable for burn_set_signal_handling() | |
2780 | 2792 | Such a function has to return -2 if it does not want the process to |
2781 | 2793 | exit with value 1. |
2782 | 2794 | */ |
2783 | 2795 | typedef int (*burn_abort_handler_t)(void *handle, int signum, int flag); |
2784 | 2796 | |
2785 | /** Control builtin signal handling. See also burn_abort(). | |
2797 | /** Control built-in signal handling. Either by setting an own handler or | |
2798 | by activating the built-in signal handler. | |
2799 | ||
2800 | A function parameter handle of NULL activates the built-in abort handler. | |
2801 | Depending on mode it may cancel all drive operations, wait for all drives | |
2802 | to become idle, exit(1). It may also prepare function | |
2803 | burn_drive_get_status() for waiting and performing exit(1). | |
2804 | If parameter handle may be NULL or a text that shall be used as prefix for | |
2805 | pacifier messages of burn_abort_pacifier(). Other than with an application | |
2806 | provided handler, the prefix char array does not have to be kept existing | |
2807 | until the eventual signal event. | |
2808 | Before version 0.7.8 only action 0 was available. I.e. the built-in handler | |
2809 | waited for the drives to become idle and then performed exit(1) directly. | |
2810 | But during burn_disc_write() onto real CD or DVD, FreeBSD 8.0 pauses the | |
2811 | other threads until the signal handler returns. | |
2812 | The new actions try to avoid this deadlock. It is advised to use action 3 | |
2813 | at least during burn_disc_write(), burn_disc_rease(), burn_disc_format(): | |
2814 | burn_set_signal_handling(text, NULL, 0x30); | |
2815 | and to call burn_is_aborting(0) when the drive is BURN_DRIVE_IDLE. | |
2816 | If burn_is_aborting(0) returns 1, then call burn_abort() and exit(1). | |
2817 | ||
2786 | 2818 | @param handle Opaque handle eventually pointing to an application |
2787 | 2819 | provided memory object |
2788 | 2820 | @param handler A function to be called on signals. It will get handle as |
2789 | argument. It should finally call burn_abort(). See there. | |
2790 | @param mode : 0 call handler(handle, signum, 0) on nearly all signals | |
2791 | 1 enable system default reaction on all signals | |
2792 | 2 try to ignore nearly all signals | |
2793 | 10 like mode 2 but handle SIGABRT like with mode 0 | |
2794 | Arguments (text, NULL, 0) activate the builtin abort handler. It will | |
2795 | eventually call burn_abort() and then perform exit(1). If text is not NULL | |
2796 | then it is used as prefix for pacifier messages of burn_abort_pacifier(). | |
2821 | argument. flag will be 0. | |
2822 | It should finally call burn_abort(). See there. | |
2823 | @param mode : bit0 - bit3: | |
2824 | Receiving signals: | |
2825 | 0 Call handler(handle, signum, 0) on nearly all signals | |
2826 | 1 Enable system default reaction on all signals | |
2827 | 2 Try to ignore nearly all signals | |
2828 | 10 like mode 2 but handle SIGABRT like with mode 0 | |
2829 | bit4 - bit7: With handler == NULL : | |
2830 | Action of built-in handler. "control thread" is the one | |
2831 | which called burn_set_signal_handling(). | |
2832 | All actions activate receive mode 2 to ignore further | |
2833 | signals. | |
2834 | 0 Same as 1 (for pre-0.7.8 backward compatibility) | |
2835 | @since 0.7.8 | |
2836 | 1 Catch the control thread in abort handler, call | |
2837 | burn_abort(>0) and finally exit(1). | |
2838 | Does not always work with FreeBSD. | |
2839 | 2 Call burn_abort(-1) and return from handler. When the | |
2840 | control thread calls burn_drive_get_status(), then do | |
2841 | burn_abort(>0) instead, and finally exit(1). | |
2842 | Does not always work with FreeBSD. | |
2843 | 3 Call burn_abort(-1), return from handler. It is duty of | |
2844 | the application to detect a pending abort condition | |
2845 | by calling burn_is_aborting() and to wait for all | |
2846 | drives to become idle. E.g. by calling burn_abort(>0). | |
2847 | 4 Like 3, but without calling burn_abort(-1). Only the | |
2848 | indicator of burn_is_aborting() gets set. | |
2797 | 2849 | @since 0.2.6 |
2798 | 2850 | */ |
2799 | 2851 | void burn_set_signal_handling(void *handle, burn_abort_handler_t handler, |
2800 | 2852 | int mode); |
2853 | ||
2854 | ||
2855 | /* ts B00304 */ | |
2856 | /* Inquire whether the built-in abort handler was triggered by a signal. | |
2857 | This has to be done to detect pending abort handling if signal handling | |
2858 | was set to the built-in handler and action was set to 2 or 3. | |
2859 | @param flag Bitfield for control purposes (unused yet, submit 0) | |
2860 | @return 0 = no abort was triggered | |
2861 | >0 = action that was triggered (action 0 is reported as 1) | |
2862 | @since 0.7.8 | |
2863 | */ | |
2864 | int burn_is_aborting(int flag); | |
2801 | 2865 | |
2802 | 2866 | |
2803 | 2867 | /* ts A70811 */ |
2947 | 3011 | #define Libburn_dummy_probe_write_modeS 1 |
2948 | 3012 | |
2949 | 3013 | |
2950 | ||
2951 | 3014 | #endif /*LIBBURN_H*/ |
0 | 0 | |
1 | 1 | /* libdax_audioxtr |
2 | 2 | Audio track data extraction facility of libdax and libburn. |
3 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
3 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
4 | 4 | */ |
5 | 5 | |
6 | 6 | #include <stdio.h> |
0 | 0 | |
1 | 1 | /* libdax_audioxtr |
2 | 2 | Audio track data extraction facility of libdax and libburn. |
3 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
3 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
4 | 4 | */ |
5 | 5 | |
6 | 6 | #ifndef LIBDAX_AUDIOXTR_H_INCLUDED |
1 | 1 | /* libdax_msgs |
2 | 2 | Message handling facility of libdax. |
3 | 3 | Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>, |
4 | provided under GPL | |
4 | provided under GPL version 2 or later. | |
5 | 5 | */ |
6 | 6 | |
7 | 7 | #include <stdio.h> |
11 | 11 | #include <stdlib.h> |
12 | 12 | #include <errno.h> |
13 | 13 | #include <sys/time.h> |
14 | #include <pthread.h> | |
14 | 15 | |
15 | 16 | /* Only this single source module is entitled to do this */ |
16 | 17 | #define LIBDAX_MSGS_H_INTERNAL 1 |
1 | 1 | /* libdax_msgs |
2 | 2 | Message handling facility of libdax. |
3 | 3 | Copyright (C) 2006-2010 Thomas Schmitt <scdbackup@gmx.net>, |
4 | provided under GPL | |
4 | provided under GPL version 2 or later. | |
5 | 5 | */ |
6 | 6 | |
7 | 7 | |
553 | 553 | 0x00020174 (SORRY,HIGH) = Fifo alignment does not allow desired read size |
554 | 554 | 0x00020175 (FATAL,HIGH) = Supporting library is too old |
555 | 555 | 0x00020176 (NOTE,HIGH) = Stream recording disabled because of small OS buffer |
556 | 0x00020177 (ABORT,HIGH) = Urged drive worker threads to do emergency halt | |
557 | 0x00020178 (DEBUG,HIGH) = Write thread ended | |
556 | 558 | |
557 | 559 | |
558 | 560 | libdax_audioxtr: |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | /* ts A61009 */ |
3 | 9 | /* #include <a ssert.h> */ |
417 | 423 | mmc_start_if_needed(d, 1); |
418 | 424 | if (mmc_function_spy(d, "mmc_get_nwa") <= 0) |
419 | 425 | return -1; |
426 | ||
427 | /* ts B00327 : Avoid to inquire unsuitable media states */ | |
428 | if (d->status != BURN_DISC_BLANK && d->status != BURN_DISC_APPENDABLE) | |
429 | return 0; | |
420 | 430 | |
421 | 431 | ret = mmc_read_track_info(d, trackno, &buf, alloc_len); |
422 | 432 | if (ret <= 0) |
4077 | 4087 | desired payload bytes. The drive then returns 35 |
4078 | 4088 | bytes as requested and the media id is "RITEKF1". |
4079 | 4089 | Nevertheless this is not a generally usable gesture |
4080 | because older Linux USB dislikes requests to fetch | |
4090 | because older GNU/Linux USB dislikes requests to fetch | |
4081 | 4091 | more bytes than the drive will deliver. |
4082 | 4092 | |
4083 | 4093 | # define Libburn_enforce_structure_code_0x0E 1 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef __MMC |
3 | 9 | #define __MMC |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
1 | 6 | |
2 | 7 | #include "null.h" |
3 | 8 | #include "libburn.h" |
0 | ||
1 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
2 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
0 | 6 | #include "libburn.h" |
1 | 7 | #include "options.h" |
2 | 8 | #include "drive.h" |
0 | ||
1 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
2 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
0 | 6 | #ifndef BURN__OPTIONS_H |
1 | 7 | #define BURN__OPTIONS_H |
2 | 8 |
4 | 4 | Unknown POSIX like systems |
5 | 5 | with the dummy MMC transport adapter sg-dummy.c |
6 | 6 | |
7 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
7 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
8 | 8 | */ |
9 | 9 | |
10 | 10 |
3 | 3 | by os.h in case of compilation for |
4 | 4 | FreeBSD with CAM |
5 | 5 | |
6 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
6 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** List of all signals which shall be caught by signal handlers and trigger |
58 | 58 | #define BURN_OS_TRANSPORT_DRIVE_ELEMENTS \ |
59 | 59 | struct cam_device* cam; \ |
60 | 60 | int lock_fd; \ |
61 | int is_ahci; \ | |
61 | 62 | |
62 | 63 |
4 | 4 | Unknown X/Open-like systems |
5 | 5 | with GNU libcdio MMC transport adapter sg-libcdio.c |
6 | 6 | |
7 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
7 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
40 | 40 | /* Important : MUST be at least 32768 ! */ |
41 | 41 | /* My Blu-ray burner LG GGW-H20 writes junk if stream recording is combined |
42 | 42 | with buffer size 32 kB. So stream recording is allowed only with size 64k. |
43 | This makes it worth to have a special case for Linux buffer size here. | |
43 | This makes it worth to have a special case for GNU/Linux buffer size here. | |
44 | 44 | */ |
45 | 45 | #ifdef __linux |
46 | 46 | #define BURN_OS_TRANSPORT_BUFFER_SIZE 65536 |
1 | 1 | /* os-linux.h |
2 | 2 | Operating system specific libburn definitions and declarations. Included |
3 | 3 | by os.h in case of compilation for |
4 | Linux kernels 2.4 and 2.6 with Linux SCSI Generic (sg) | |
4 | Linux kernels 2.4 and 2.6, GNU/Linux SCSI Generic (sg) | |
5 | 5 | |
6 | Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
6 | Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
7 | Provided under GPL version 2 or later. | |
7 | 8 | */ |
8 | 9 | |
9 | 10 |
2 | 2 | Operating system specific libburn definitions and declarations. |
3 | 3 | The macros defined here are used by libburn modules in order to |
4 | 4 | avoid own system dependent case distinctions. |
5 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
5 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
6 | 6 | */ |
7 | 7 | |
8 | 8 | #ifndef BURN_OS_H_INCLUDED |
40 | 40 | #ifdef __linux |
41 | 41 | |
42 | 42 | |
43 | /* --------- Linux kernels 2.4 and 2.6 with Linux SCSI Generic (sg) -------- */ | |
43 | /* ------- Linux kernels 2.4 and 2.6 with GNU/Linux SCSI Generic (sg) ------ */ | |
44 | 44 | #include "os-linux.h" |
45 | 45 | |
46 | 46 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | 1 | |
2 | /* #include <m alloc.h> ts A61013 : not in Linux man 3 malloc */ | |
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
7 | ||
8 | /* #include <m alloc.h> ts A61013 : not in GNU/Linux man 3 malloc */ | |
3 | 9 | |
4 | 10 | #include <stdlib.h> |
5 | 11 | #include <unistd.h> |
93 | 99 | fakesub[20] = 2; |
94 | 100 | fakesub[12] = (d->toc->toc_entry[0].control << 4) + |
95 | 101 | d->toc->toc_entry[0].adr; |
102 | ||
103 | #ifdef Libburn_no_crc_C | |
104 | crc = 0; /* dummy */ | |
105 | #else | |
96 | 106 | crc = crc_ccitt(fakesub + 12, 10); |
107 | #endif | |
108 | ||
97 | 109 | fakesub[22] = crc >> 8; |
98 | 110 | fakesub[23] = crc & 0xFF; |
99 | 111 | write(o->subfd, fakesub, 96); |
240 | 252 | } |
241 | 253 | } |
242 | 254 | crc = (*(sub + 22) << 8) + *(sub + 23); |
255 | ||
256 | #ifndef Libburn_no_crc_C | |
243 | 257 | if (crc != crc_ccitt(sub + 12, 10)) { |
244 | 258 | burn_print(1, "sending error on %s %s\n", |
245 | 259 | d->idata->vendor, d->idata->product); |
248 | 262 | */ |
249 | 263 | burn_print(1, "crc mismatch in Q\n"); |
250 | 264 | } |
265 | #endif | |
266 | ||
251 | 267 | /* else process_q(d, sub + 12); */ |
252 | 268 | /* |
253 | 269 | if (o->subfd != -1) write(o->subfd, sub, 96); */ |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | 1 | |
2 | 2 | /* scsi block commands */ |
3 | ||
4 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
5 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
6 | Provided under GPL version 2 or later. | |
7 | */ | |
8 | ||
3 | 9 | |
4 | 10 | #include <string.h> |
5 | 11 | #include <unistd.h> |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef __SBC |
3 | 9 | #define __SBC |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #include <stdio.h> |
3 | 9 | |
24 | 30 | |
25 | 31 | |
26 | 32 | #ifdef Libburn_log_in_and_out_streaM |
27 | /* <<< ts A61031 */ | |
33 | /* ts A61031 */ | |
28 | 34 | #include <sys/types.h> |
29 | 35 | #include <sys/stat.h> |
30 | 36 | #include <fcntl.h> |
95 | 101 | int valid, shortage, curr, i, tr; |
96 | 102 | |
97 | 103 | #ifdef Libburn_log_in_and_out_streaM |
98 | /* <<< ts A61031 */ | |
104 | /* ts A61031 */ | |
99 | 105 | static int tee_fd= -1; |
100 | 106 | if(tee_fd==-1) |
101 | 107 | tee_fd= open("/tmp/libburn_sg_readin", |
141 | 147 | track->sourcecount += valid; |
142 | 148 | |
143 | 149 | #ifdef Libburn_log_in_and_out_streaM |
144 | /* <<< ts A61031 */ | |
150 | /* ts A61031 */ | |
145 | 151 | if(tee_fd!=-1 && valid>0) { |
146 | 152 | write(tee_fd, data + curr, valid); |
147 | 153 | } |
404 | 410 | q[7] = dec_to_bcd(d->toc_entry[track].pmin); |
405 | 411 | q[8] = dec_to_bcd(d->toc_entry[track].psec); |
406 | 412 | q[9] = dec_to_bcd(d->toc_entry[track].pframe); |
413 | ||
414 | #ifdef Libburn_no_crc_C | |
415 | crc = 0; /* dummy */ | |
416 | #else | |
407 | 417 | crc = crc_ccitt(q, 10); |
418 | #endif | |
419 | ||
408 | 420 | q[10] = crc >> 8; |
409 | 421 | q[11] = crc & 0xFF; |
410 | 422 | d->toc_temp++; |
501 | 513 | q[7] = dec_to_bcd(min); |
502 | 514 | q[8] = dec_to_bcd(sec); |
503 | 515 | q[9] = dec_to_bcd(frame); |
516 | ||
517 | #ifdef Libburn_no_crc_C | |
518 | crc = 0; /* dummy */ | |
519 | #else | |
504 | 520 | crc = crc_ccitt(q, 10); |
521 | #endif | |
522 | ||
505 | 523 | q[10] = crc >> 8; |
506 | 524 | q[11] = crc & 0xFF; |
507 | 525 | } |
621 | 639 | } |
622 | 640 | q[0] = (control << 4) + qmode; |
623 | 641 | |
642 | ||
643 | #ifdef Libburn_no_crc_C | |
644 | crc = 0; /* dummy */ | |
645 | #else | |
624 | 646 | crc = crc_ccitt(q, 10); |
647 | #endif | |
648 | ||
625 | 649 | q[10] = crc >> 8; |
626 | 650 | q[11] = crc & 0xff; |
627 | 651 | } |
653 | 677 | unsigned char *data; |
654 | 678 | |
655 | 679 | data = get_sector(o, t, t->mode); |
656 | if (!data) | |
680 | if (data == NULL) | |
657 | 681 | return 0; |
658 | 682 | /* ts A61010 */ |
659 | 683 | if (convert_data(o, t, t->mode, data) <= 0) |
767 | 791 | out[15] = modebyte; |
768 | 792 | } |
769 | 793 | if (mode & BURN_MODE1) { |
794 | ||
795 | #ifdef Libburn_no_crc_C | |
796 | crc = 0; /* dummy */ | |
797 | #else | |
770 | 798 | crc = crc_32(out, 2064); |
799 | #endif | |
800 | ||
771 | 801 | out[2064] = crc & 0xFF; |
772 | 802 | crc >>= 8; |
773 | 803 | out[2065] = crc & 0xFF; |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
1 | 6 | |
2 | 7 | #ifndef __SECTOR |
3 | 8 | #define __SECTOR |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* | |
3 | Copyright (c) 2009 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | /* |
3 | 9 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
1 | 6 | |
2 | 7 | #include <errno.h> |
3 | 8 | #include <unistd.h> |
23 | 28 | #include <sys/disk.h> /* DIOCGMEDIASIZE */ |
24 | 29 | |
25 | 30 | |
31 | /* ts B00326 : For use of CAM_PASS_ERR_RECOVER with ahci */ | |
32 | #define Libburn_for_freebsd_ahcI yes | |
33 | ||
34 | /* ts B00327 : for debugging of cam_send_cdb() failures | |
35 | # define Libburn_ahci_verbouS yes | |
36 | */ | |
37 | ||
38 | /* ts B00327 : Apply CAM_PASS_ERR_RECOVER to drives even if not ahci | |
39 | # define libburn_ahci_style_for_alL yes | |
40 | */ | |
41 | ||
42 | ||
26 | 43 | #include "transport.h" |
27 | 44 | #include "drive.h" |
28 | 45 | #include "sg.h" |
428 | 445 | |
429 | 446 | out.cam = NULL; |
430 | 447 | out.lock_fd = -1; |
448 | out.is_ahci = 0; | |
431 | 449 | |
432 | 450 | out.start_lba= -2000000000; |
433 | 451 | out.end_lba= -2000000000; |
520 | 538 | /* Adapter specific handles and data */ |
521 | 539 | out.cam = NULL; |
522 | 540 | out.lock_fd = -1; |
541 | out.is_ahci = 0; | |
523 | 542 | |
524 | 543 | /* Adapter specific functions */ |
525 | 544 | out.grab = sg_grab; |
671 | 690 | int sg_grab(struct burn_drive *d) |
672 | 691 | { |
673 | 692 | struct cam_device *cam; |
693 | char path_string[80]; | |
674 | 694 | |
675 | 695 | if (mmc_function_spy(d, "sg_grab") <= 0) |
676 | 696 | return 0; |
693 | 713 | if (sg_lock(d, 0) <= 0) |
694 | 714 | return 0; |
695 | 715 | fcntl(cam->fd, F_SETOWN, getpid()); |
716 | ||
717 | cam_path_string(d->cam, path_string, sizeof(path_string)); | |
718 | ||
719 | #ifdef Libburn_ahci_verbouS | |
720 | fprintf(stderr, "libburn_EXPERIMENTAL: CAM path = %s\n", path_string); | |
721 | #endif | |
722 | ||
723 | if (strstr(path_string, ":ahcich") != NULL) | |
724 | d->is_ahci = 1; | |
725 | else | |
726 | d->is_ahci = -1; | |
727 | ||
696 | 728 | d->released = 0; |
697 | 729 | return 1; |
698 | 730 | } |
722 | 754 | |
723 | 755 | int sg_issue_command(struct burn_drive *d, struct command *c) |
724 | 756 | { |
725 | int done = 0, err, sense_len, ret; | |
757 | int done = 0, err, sense_len = 0, ret, ignore_error, no_retry = 0; | |
758 | int cam_pass_err_recover = 0; | |
726 | 759 | union ccb *ccb; |
727 | 760 | char buf[161]; |
728 | 761 | static FILE *fp = NULL; |
770 | 803 | break; |
771 | 804 | } |
772 | 805 | |
806 | #ifdef Libburn_for_freebsd_ahcI | |
807 | /* ts B00325 : Advise by Alexander Motin */ | |
808 | /* Runs well on 8-STABLE (23 Mar 2003) | |
809 | But on 8-RELEASE cam_send_ccb() returns non-zero with errno 6 | |
810 | on eject. Long lasting TEST UNIT READY cycles break with | |
811 | errno 16. | |
812 | */ | |
813 | #ifdef Libburn_ahci_style_for_alL | |
814 | { | |
815 | #else | |
816 | if (d->is_ahci > 0) { | |
817 | #endif | |
818 | ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; | |
819 | cam_pass_err_recover = 1; | |
820 | } | |
821 | #endif /* Libburn_for_freebsd_ahcI */ | |
822 | ||
773 | 823 | ccb->csio.cdb_len = c->oplen; |
774 | 824 | memcpy(&ccb->csio.cdb_io.cdb_bytes, &c->opcode, c->oplen); |
775 | 825 | |
800 | 850 | } |
801 | 851 | |
802 | 852 | do { |
853 | memset(c->sense, 0, sizeof(c->sense)); | |
803 | 854 | err = cam_send_ccb(d->cam, ccb); |
804 | if (err == -1) { | |
855 | ||
856 | ignore_error = sense_len = 0; | |
857 | /* ts B00325 : CAM_AUTOSNS_VALID advised by Alexander Motin */ | |
858 | if (ccb->ccb_h.status & CAM_AUTOSNS_VALID) { | |
859 | /* ts B00110 */ | |
860 | /* Better curb sense_len */ | |
861 | sense_len = ccb->csio.sense_len; | |
862 | if (sense_len > sizeof(c->sense)) | |
863 | sense_len = sizeof(c->sense); | |
864 | memcpy(c->sense, &ccb->csio.sense_data, sense_len); | |
865 | if (sense_len >= 14 && cam_pass_err_recover && | |
866 | (c->sense[2] & 0x0f)) | |
867 | ignore_error = 1; | |
868 | } | |
869 | ||
870 | if (err == -1 && cam_pass_err_recover && ! ignore_error) { | |
871 | ||
872 | #ifdef Libburn_ahci_verbouS | |
873 | fprintf(stderr, "libburn_EXPERIMENTAL: errno = %d . cam_errbuf = '%s'\n", errno, cam_errbuf); | |
874 | #endif | |
875 | ||
876 | if (errno == ENXIO && c->opcode[0] != 0) { | |
877 | /* Operations on empty or ejected tray */ | |
878 | /* MEDIUM NOT PRESENT */ | |
879 | ||
880 | #ifdef Libburn_ahci_verbouS | |
881 | fprintf(stderr, "libburn_EXPERIMENTAL: Emulating [2,3A,00] MEDIUM NOT PRESENT\n"); | |
882 | #endif | |
883 | ||
884 | c->sense[2] = 0x02; | |
885 | c->sense[12] = 0x3A; | |
886 | c->sense[13] = 0x00; | |
887 | sense_len = 14; | |
888 | ignore_error = 1; | |
889 | } else if (c->opcode[0] == 0 && | |
890 | (errno == EBUSY || errno == ENXIO)) { | |
891 | /* Timeout of TEST UNIT READY loop */ | |
892 | /* Inquiries while tray is being loaded */ | |
893 | /*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/ | |
894 | ||
895 | #ifdef Libburn_ahci_verbouS | |
896 | fprintf(stderr, "libburn_EXPERIMENTAL: Emulating [2,04,00] LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE\n"); | |
897 | #endif | |
898 | ||
899 | c->sense[2] = 0x02; | |
900 | c->sense[12] = 0x04; | |
901 | c->sense[13] = 0x00; | |
902 | sense_len = 14; | |
903 | ignore_error = 1; | |
904 | } else if (errno == EINVAL) { | |
905 | /* Inappropriate MODE SENSE */ | |
906 | /* INVALID FIELD IN CDB */ | |
907 | ||
908 | #ifdef Libburn_ahci_verbouS | |
909 | fprintf(stderr, "libburn_EXPERIMENTAL: Emulating [5,24,00] INVALID FIELD IN CDB\n"); | |
910 | #endif | |
911 | ||
912 | c->sense[2] = 0x05; | |
913 | c->sense[12] = 0x24; | |
914 | c->sense[13] = 0x00; | |
915 | sense_len = 14; | |
916 | ignore_error = 1; | |
917 | } | |
918 | } | |
919 | ||
920 | if (err == -1 && !ignore_error) { | |
805 | 921 | libdax_msgs_submit(libdax_messenger, |
806 | 922 | d->global_index, 0x0002010c, |
807 | 923 | LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, |
815 | 931 | } |
816 | 932 | /* XXX */ |
817 | 933 | |
818 | /* ts B00110 */ | |
819 | /* Better curb sense_len */ | |
820 | sense_len = ccb->csio.sense_len; | |
821 | if (sense_len > sizeof(c->sense)) | |
822 | sense_len = sizeof(c->sense); | |
823 | memcpy(c->sense, &ccb->csio.sense_data, ccb->csio.sense_len); | |
824 | 934 | if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { |
825 | if (!c->retry) { | |
935 | if (sense_len < 14) { | |
936 | /*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/ | |
937 | ||
938 | #ifdef Libburn_ahci_verbouS | |
939 | fprintf(stderr, "libburn_EXPERIMENTAL: CAM_STATUS= %d .Emulating [2,04,00] LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE\n", (ccb->ccb_h.status & CAM_STATUS_MASK)); | |
940 | #endif | |
941 | ||
942 | c->sense[2] = 0x02; | |
943 | c->sense[12] = 0x04; | |
944 | c->sense[13] = 0x00; | |
945 | no_retry = 1; | |
946 | } | |
947 | if (no_retry || ignore_error || !c->retry) { | |
826 | 948 | c->error = 1; |
827 | 949 | {ret = 1; goto ex;} |
828 | 950 | } |
829 | 951 | switch (scsi_error(d, c->sense, 0)) { |
830 | 952 | case RETRY: |
831 | 953 | done = 0; |
954 | if (burn_sg_log_scsi & 3) { | |
955 | /* >>> Need own duration time | |
956 | measurement. Then remove bit1 */ | |
957 | scsi_log_err(c, fp, c->sense, 0, | |
958 | (c->error != 0) | 2); | |
959 | scsi_log_cmd(c,fp,0); | |
960 | } | |
832 | 961 | break; |
833 | 962 | case FAIL: |
834 | 963 | done = 1; |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* | |
3 | Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | /* |
3 | 9 | |
546 | 552 | */ |
547 | 553 | int sg_issue_command(struct burn_drive *d, struct command *c) |
548 | 554 | { |
549 | int sense_valid = 0, i, usleep_time, timeout_ms; | |
555 | int sense_valid = 0, i, usleep_time, timeout_ms, no_retry = 0; | |
550 | 556 | time_t start_time; |
551 | 557 | driver_return_code_t i_status; |
552 | 558 | unsigned int dxfer_len; |
561 | 567 | return 0; |
562 | 568 | } |
563 | 569 | p_cdio = (CdIo_t *) d->p_cdio; |
564 | if (burn_sg_log_scsi & 1) { | |
565 | if (fp == NULL) { | |
566 | fp= fopen("/tmp/libburn_sg_command_log", "a"); | |
567 | fprintf(fp, | |
568 | "\n-----------------------------------------\n"); | |
569 | } | |
570 | } | |
571 | if (burn_sg_log_scsi & 3) | |
572 | scsi_log_cmd(c,fp,0); | |
570 | if (burn_sg_log_scsi & 1) { | |
571 | if (fp == NULL) { | |
572 | fp= fopen("/tmp/libburn_sg_command_log", "a"); | |
573 | fprintf(fp, | |
574 | "\n-----------------------------------------\n"); | |
575 | } | |
576 | } | |
577 | if (burn_sg_log_scsi & 3) | |
578 | scsi_log_cmd(c,fp,0); | |
573 | 579 | |
574 | 580 | memcpy(cdb.field, c->opcode, c->oplen); |
575 | 581 | if (c->dir == TO_DRIVE) { |
621 | 627 | } |
622 | 628 | */ |
623 | 629 | |
624 | if (!sense_valid) { | |
630 | if ((!sense_valid) || | |
631 | ((c->sense[2] & 0x0f) == 0 && c->sense[12] == 0 && | |
632 | c->sense[13] == 0)) { | |
625 | 633 | memset(c->sense, 0, sizeof(c->sense)); |
626 | 634 | if (i_status != 0) { /* set dummy sense */ |
627 | /*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/ | |
635 | /*LOGICAL UNIT NOT READY, | |
636 | CAUSE NOT REPORTABLE*/ | |
628 | 637 | c->sense[2] = 0x02; |
629 | 638 | c->sense[12] = 0x04; |
639 | no_retry = 1; | |
630 | 640 | } |
631 | 641 | } else |
632 | 642 | c->sense[2] &= 15; |
633 | 643 | |
634 | 644 | if (i_status != 0 || |
635 | 645 | (c->sense[2] || c->sense[12] || c->sense[13])) { |
636 | if (!c->retry) { | |
646 | if (no_retry || !c->retry) { | |
637 | 647 | c->error = 1; |
638 | 648 | goto ex; |
639 | 649 | } |
640 | 650 | switch (scsi_error(d, c->sense, 18)) { |
641 | 651 | case RETRY: |
652 | if (burn_sg_log_scsi & 3) { | |
653 | /* >>> Need own duration time | |
654 | measurement. Then remove bit1 */ | |
655 | scsi_log_err(c, fp, c->sense, 0, | |
656 | (c->error != 0) | 2); | |
657 | scsi_log_cmd(c,fp,0); | |
658 | } | |
642 | 659 | break; |
643 | 660 | case FAIL: |
644 | 661 | c->error = 1; |
833 | 850 | |
834 | 851 | #ifdef __linux |
835 | 852 | |
836 | /* Linux specific determination of block device size */ | |
853 | /* GNU/Linux specific determination of block device size */ | |
837 | 854 | } else if(S_ISBLK(stbuf.st_mode)) { |
838 | 855 | int open_mode = O_RDONLY, fd, ret; |
839 | 856 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | |
3 | 9 | /* <<< ts A91112 : experiments to get better speed with USB |
10 | 16 | This is the main operating system dependent SCSI part of libburn. It implements |
11 | 17 | the transport level aspects of SCSI control and command i/o. |
12 | 18 | |
13 | Present implementation: Linux SCSI Generic (sg) | |
19 | Present implementation: GNU/Linux SCSI Generic (sg) | |
14 | 20 | |
15 | 21 | |
16 | 22 | PORTING: |
892 | 898 | #endif /* Libburn_drive_new_deaL */ |
893 | 899 | |
894 | 900 | |
895 | /** Speciality of Linux: detect non-SCSI ATAPI (EIDE) which will from | |
901 | /** Speciality of GNU/Linux: detect non-SCSI ATAPI (EIDE) which will from | |
896 | 902 | then on used used via generic SCSI as is done with (emulated) SCSI drives */ |
897 | 903 | static void ata_enumerate(void) |
898 | 904 | { |
1401 | 1407 | |
1402 | 1408 | /* PORTING: ------------------- non portable part --------------- */ |
1403 | 1409 | |
1404 | /* Operating system adapter is Linux Generic SCSI (sg) */ | |
1410 | /* Operating system adapter is GNU/Linux Generic SCSI (sg) */ | |
1405 | 1411 | /* Adapter specific handles and data */ |
1406 | 1412 | out.fd = -1337; |
1407 | 1413 | out.sibling_count = 0; |
1438 | 1444 | */ |
1439 | 1445 | int sg_id_string(char msg[1024], int flag) |
1440 | 1446 | { |
1441 | strcpy(msg, "internal Linux SG_IO adapter sg-linux"); | |
1447 | strcpy(msg, "internal GNU/Linux SG_IO adapter sg-linux"); | |
1442 | 1448 | return 1; |
1443 | 1449 | } |
1444 | 1450 | |
1483 | 1489 | |
1484 | 1490 | |
1485 | 1491 | /** PORTING: |
1486 | In this Linux implementation, this function mirrors the enumeration | |
1492 | In this GNU/Linux implementation, this function mirrors the enumeration | |
1487 | 1493 | done in sg_enumerate and ata_enumerate(). It would be better to base those |
1488 | 1494 | functions on this sg_give_next_adr() but the situation is not inviting. |
1489 | 1495 | */ |
1580 | 1586 | libburn's list of drives. |
1581 | 1587 | */ |
1582 | 1588 | /** PORTING: |
1583 | If not stricken with an incompletely unified situation like in Linux | |
1589 | If not stricken with an incompletely unified situation like in GNU/Linux | |
1584 | 1590 | one would rather implement this by a loop calling sg_give_next_adr(). |
1585 | 1591 | If needed with your sg_give_next_adr() results, do a test for existence |
1586 | 1592 | and accessability. If burn activities are prone to external interference |
1644 | 1650 | int sg_grab(struct burn_drive *d) |
1645 | 1651 | { |
1646 | 1652 | int fd, os_errno= 0, ret; |
1653 | int max_tries = 3, tries = 0; | |
1647 | 1654 | |
1648 | 1655 | /* ts A60813 */ |
1649 | 1656 | int open_mode = O_RDWR; |
1677 | 1684 | value -1 of open(2) war used. */ |
1678 | 1685 | if(! burn_drive_is_open(d)) { |
1679 | 1686 | |
1687 | try_open:; | |
1680 | 1688 | /* ts A60821 |
1681 | 1689 | <<< debug: for tracing calls which might use open drive fds */ |
1682 | 1690 | mmc_function_spy(NULL, "sg_grab ----------- opening"); |
1710 | 1718 | fcntl(fd, F_SETOWN, getpid()); |
1711 | 1719 | d->released = 0; |
1712 | 1720 | return 1; |
1713 | } | |
1721 | } else if (errno == EBUSY) | |
1722 | goto drive_is_in_use; | |
1714 | 1723 | libdax_msgs_submit(libdax_messenger, d->global_index, 0x00020003, |
1715 | 1724 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, |
1716 | 1725 | "Could not grab drive", os_errno, 0); |
1717 | 1726 | return 0; |
1718 | 1727 | |
1719 | 1728 | drive_is_in_use:; |
1729 | tries++; | |
1730 | if (tries < max_tries) { | |
1731 | usleep(2000000); | |
1732 | goto try_open; | |
1733 | } | |
1720 | 1734 | libdax_msgs_submit(libdax_messenger, d->global_index, |
1721 | 1735 | 0x00020003, |
1722 | 1736 | LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH, |
1913 | 1927 | switch (scsi_error(d, s.sbp, s.sb_len_wr)) { |
1914 | 1928 | case RETRY: |
1915 | 1929 | done = 0; |
1930 | if (burn_sg_log_scsi & 3) { | |
1931 | scsi_log_err(c, fp, s.sbp, s.duration, | |
1932 | c->error != 0); | |
1933 | scsi_log_cmd(c,fp,0); | |
1934 | } | |
1916 | 1935 | break; |
1917 | 1936 | case FAIL: |
1918 | 1937 | done = 1; |
0 | 0 | |
1 | 1 | /* sg.c |
2 | 2 | Switcher for operating system dependent transport level modules of libburn. |
3 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL | |
3 | Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
4 | 4 | */ |
5 | 5 | |
6 | 6 | |
33 | 33 | static int intentional_compiler_warning(void) |
34 | 34 | { |
35 | 35 | int INTENTIONAL_COMPILER_WARNING_; |
36 | int Cannot_recognize_Linux_nor_FreeBSD_; | |
36 | int Cannot_recognize_GNU_Linux_nor_FreeBSD_; | |
37 | 37 | int Have_to_use_dummy_MMC_transport_adapter_; |
38 | 38 | int This_libburn_will_not_be_able_to_operate_on_real_CD_drives; |
39 | 39 | int Have_to_use_dummy_MMC_transport_adapter; |
40 | int Cannot_recognize_Linux_nor_FreeBSD; | |
40 | int Cannot_recognize_GNU_Linux_nor_FreeBSD; | |
41 | 41 | int INTENTIONAL_COMPILER_WARNING; |
42 | 42 | |
43 | 43 | return(0); |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+ | |
3 | */ | |
1 | 4 | |
2 | 5 | #ifndef __SG |
3 | 6 | #define __SG |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #include <stdlib.h> |
3 | 9 | #include <string.h> |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | /* scsi primary commands */ |
3 | 9 | |
106 | 112 | int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text, |
107 | 113 | int flag) |
108 | 114 | { |
109 | int i, ret = 1, key = 0, asc = 0, ascq = 0; | |
115 | int i, ret = 1, key = 0, asc = 0, ascq = 0, clueless_start = 0; | |
116 | static int clueless_timeout = 5 * 10; | |
110 | 117 | char msg[320]; |
111 | 118 | unsigned char sense[14]; |
112 | 119 | enum response resp; |
136 | 143 | /* media change notice = try again */ |
137 | 144 | goto slumber; |
138 | 145 | |
146 | handle_error:; | |
139 | 147 | /* ts A90213 */ |
140 | 148 | sprintf(msg, |
141 | 149 | "Asynchronous SCSI error on %s: ", cmd_text); |
150 | 158 | msg, 0, 0); |
151 | 159 | d->cancel = 1; |
152 | 160 | break; |
153 | } | |
161 | } else if (ascq == 0x00) { /* CAUSE NOT REPORTABLE */ | |
162 | /* Might be a clueless system adapter */ | |
163 | if (clueless_start == 0) | |
164 | clueless_start = i; | |
165 | if (i - clueless_start > clueless_timeout) { | |
166 | libdax_msgs_submit(libdax_messenger, | |
167 | d->global_index, | |
168 | 0x00000002, | |
169 | LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, | |
170 | "Ended clueless NOT READY cycle", | |
171 | 0, 0); | |
172 | ret = 1; /* medium not present = ok */ | |
173 | break; | |
174 | } | |
175 | } else if (ascq == 0x02 || ascq == 0x03) | |
176 | goto handle_error; | |
177 | ||
154 | 178 | slumber:; |
155 | 179 | usleep(100000); |
156 | 180 | } |
954 | 978 | *key= *asc= *ascq= -1; |
955 | 979 | |
956 | 980 | if (senselen<=0 || senselen>2) |
957 | *key = sense[2]; | |
981 | *key = sense[2] & 0x0f; | |
958 | 982 | if (senselen<=0 || senselen>12) |
959 | 983 | *asc = sense[12]; |
960 | 984 | if (senselen<=0 || senselen>13) |
961 | 985 | *ascq = sense[13]; |
962 | 986 | |
963 | sprintf(msg, "[%X %2.2X %2.2X] ", (*key) & 0xf, *asc, *ascq); | |
987 | sprintf(msg, "[%X %2.2X %2.2X] ", *key, *asc, *ascq); | |
964 | 988 | msg= msg + strlen(msg); |
965 | 989 | |
966 | 990 | burn_print(12, "CONDITION: 0x%x 0x%x 0x%x on %s %s\n", |
975 | 999 | sprintf(msg, "Not ready"); |
976 | 1000 | return RETRY; |
977 | 1001 | case 0x04: |
978 | sprintf(msg, | |
1002 | if (*ascq == 1) | |
1003 | sprintf(msg, | |
979 | 1004 | "Logical unit is in the process of becoming ready"); |
1005 | else | |
1006 | sprintf(msg, "Logical unit is not ready"); | |
980 | 1007 | return RETRY; |
981 | 1008 | case 0x08: |
982 | 1009 | if (*key != 4) |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef __SPC |
3 | 9 | #define __SPC |
0 | ||
1 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
2 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
0 | 5 | |
1 | 6 | /* ts A61008 */ |
2 | 7 | /* #include <a ssert.h> */ |
0 | ||
1 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
2 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
0 | 6 | #ifndef BURN__STRUCTURE_H |
1 | 7 | #define BURN__STRUCTURE_H |
2 | 8 |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
1 | 6 | |
2 | 7 | /* ts A61008 */ |
3 | 8 | /* #include <a ssert.h> */ |
129 | 134 | } else { |
130 | 135 | |
131 | 136 | t->mode = BURN_MODE1; |
132 | /* ts A70519 : this does not work with Linux 2.4 USB because one cannot | |
137 | /* ts A70519 : this does not work with GNU/Linux 2.4 USB because one cannot | |
133 | 138 | predict the exact dxfer_size without knowing the sector type. |
134 | 139 | mem.sectors = 1; |
135 | 140 | d->read_sectors(d, lba, mem.sectors, &o, &mem); |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
1 | 6 | |
2 | 7 | #ifndef __TOC_H |
3 | 8 | #define __TOC_H |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef __TRANSPORT |
3 | 9 | #define __TRANSPORT |
305 | 311 | /* ts A70929 */ |
306 | 312 | pid_t thread_pid; |
307 | 313 | int thread_pid_valid; |
314 | /* ts B00225 */ | |
315 | pthread_t thread_tid; | |
308 | 316 | |
309 | 317 | |
310 | 318 | /* transport functions */ |
0 | ||
1 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
2 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
3 | Provided under GPL version 2 or later. | |
4 | */ | |
5 | ||
0 | 6 | #include <string.h> |
1 | 7 | |
2 | 8 | /* ts A61008 */ |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #include <unistd.h> |
3 | 9 | #include <signal.h> |
32 | 38 | #include "libburn.h" |
33 | 39 | #include "drive.h" |
34 | 40 | #include "transport.h" |
35 | #include "crc.h" | |
36 | 41 | #include "debug.h" |
37 | 42 | #include "init.h" |
38 | 43 | #include "toc.h" |
936 | 941 | |
937 | 942 | d->cancel = 0; |
938 | 943 | |
944 | #ifdef Libburn_reset_progress_asynC | |
945 | /* <<< This is now done in async.c */ | |
939 | 946 | /* init progress before showing the state */ |
940 | 947 | d->progress.session = 0; |
941 | 948 | d->progress.sessions = disc->sessions; |
950 | 957 | d->progress.sectors = 0; |
951 | 958 | d->progress.sector = 0; |
952 | 959 | d->progress.track = 0; |
960 | #endif /* Libburn_reset_progress_asynC */ | |
953 | 961 | |
954 | 962 | /* ts A61023 */ |
955 | 963 | d->progress.buffer_capacity = 0; |
1262 | 1270 | |
1263 | 1271 | /* ts A91114 : EXPERIMENTAL, NOT COMPLETELY IMPLEMENTED |
1264 | 1272 | |
1265 | Simplified data transmission for DVD. libburn via Linux USB is 30 % slower | |
1266 | than growisofs or cdrecord when transmitting 32 KB chunks. | |
1273 | Simplified data transmission for DVD. libburn via GNU/Linux USB is 30 % | |
1274 | slower than growisofs or cdrecord when transmitting 32 KB chunks. | |
1267 | 1275 | With 64 KB chunks it is 20% faster than the competitors. |
1268 | 1276 | No heavy CPU load is visible but there might be subtle race conditions in |
1269 | 1277 | the USB driver which work better with shorter time gaps between WRITE |
1303 | 1311 | unsigned char *data = out->data; |
1304 | 1312 | |
1305 | 1313 | #ifdef Libburn_log_in_and_out_streaM |
1306 | /* <<< ts A61031 */ | |
1314 | /* ts A61031 */ | |
1307 | 1315 | static int tee_fd= -1; |
1308 | 1316 | if(tee_fd==-1) |
1309 | 1317 | tee_fd= open("/tmp/libburn_sg_readin", |
1993 | 2001 | burn_drive_mark_unready(d); |
1994 | 2002 | burn_drive_inquire_media(d); |
1995 | 2003 | |
1996 | d->busy = BURN_DRIVE_IDLE; | |
2004 | /* <<< d->busy = BURN_DRIVE_IDLE; */ | |
1997 | 2005 | return ret; |
1998 | 2006 | early_failure:; |
1999 | 2007 | return 0; |
2256 | 2264 | prev_sync_sector = d->progress.sector; |
2257 | 2265 | if (!o->simulate) |
2258 | 2266 | burn_stdio_sync_cache(d->stdio_fd, d, 1); |
2267 | } | |
2268 | if ((d->progress.sector % 512) == 0) | |
2259 | 2269 | burn_stdio_slowdown(d, &prev_time, 512 * 2, 0); |
2260 | } | |
2261 | 2270 | } |
2262 | 2271 | |
2263 | 2272 | /* Pad up buffer to next full o->obs (usually 32 kB) */ |
2320 | 2329 | /* update media state records */ |
2321 | 2330 | burn_drive_mark_unready(d); |
2322 | 2331 | |
2323 | d->busy = BURN_DRIVE_IDLE; | |
2332 | /* <<< d->busy = BURN_DRIVE_IDLE; */ | |
2324 | 2333 | return ret; |
2325 | 2334 | } |
2326 | 2335 | |
2396 | 2405 | goto ex; |
2397 | 2406 | } |
2398 | 2407 | |
2399 | /* ts A70521 : Linux 2.4 USB audio fails with 64 kiB */ | |
2408 | /* ts A70521 : GNU/Linux 2.4 USB audio fails with 64 kiB */ | |
2400 | 2409 | /* ts A80414 : might need 64 kiB for BD-RE streaming */ |
2401 | 2410 | /* buffer flush trigger for sector.c:get_sector() */ |
2402 | 2411 | o->obs = Libburn_cd_obS; |
2557 | 2566 | burn_drive_inquire_media(d); |
2558 | 2567 | |
2559 | 2568 | burn_print(1, "done\n"); |
2560 | d->busy = BURN_DRIVE_IDLE; | |
2569 | /* <<< d->busy = BURN_DRIVE_IDLE; */ | |
2561 | 2570 | |
2562 | 2571 | /* ts A61012 : This return was traditionally missing. I suspect this |
2563 | 2572 | to have caused Cdrskin_eject() failures */ |
2572 | 2581 | LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, |
2573 | 2582 | "Burn run failed", 0, 0); |
2574 | 2583 | d->cancel = 1; |
2575 | d->busy = BURN_DRIVE_IDLE; | |
2584 | /* <<< d->busy = BURN_DRIVE_IDLE; */ | |
2576 | 2585 | ex:; |
2577 | 2586 | d->do_stream_recording = 0; |
2578 | 2587 | if (d->buffer != NULL) |
0 | 0 | /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ |
1 | ||
2 | /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens | |
3 | Copyright (c) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net> | |
4 | Provided under GPL version 2 or later. | |
5 | */ | |
6 | ||
1 | 7 | |
2 | 8 | #ifndef BURN__WRITE_H |
3 | 9 | #define BURN__WRITE_H |
25 | 25 | approaches are shown here in application functions: |
26 | 26 | libburner_aquire_by_adr() demonstrates usage as of cdrecord traditions |
27 | 27 | libburner_aquire_by_driveno() demonstrates a scan-and-choose approach |
28 | With that aquired drive you can blank a CD-RW | |
28 | With that aquired drive you can blank a CD-RW or DVD-RW | |
29 | 29 | libburner_blank_disc() |
30 | 30 | or you can format a DVD-RW to profile "Restricted Overwrite" (needed once) |
31 | 31 | or an unused BD to default size with spare blocks |
35 | 35 | When everything is done, main() releases the drive and shuts down libburn: |
36 | 36 | burn_drive_release(); |
37 | 37 | burn_finish() |
38 | ||
39 | FreeBSD does not work well with the convenient synchronous signal handler. So | |
40 | the waiting loops for blanking, formatting, and writing use the asynchronous | |
41 | mode of the libburn signal handler. It will not shutdown the library and | |
42 | abort the program, but rather tell the ongoing drive operation to stop as | |
43 | soon as possible. After the loops and at the end of the program there is a | |
44 | call to determine whether an abort happened: | |
45 | burn_is_aborting() | |
38 | 46 | |
39 | */ | |
40 | /* | |
41 | 47 | Applications must use 64 bit off_t. E.g. by defining |
42 | 48 | #define _LARGEFILE_SOURCE |
43 | 49 | #define _FILE_OFFSET_BITS 64 |
309 | 315 | "FATAL : Media is not of erasable type\n"); |
310 | 316 | return 0; |
311 | 317 | } |
312 | printf( | |
313 | "Beginning to %s-blank media.\n", (blank_fast?"fast":"full")); | |
318 | /* Switch to asynchronous signal handling for the time of waiting */ | |
319 | burn_set_signal_handling("libburner : ", NULL, 0x30); | |
320 | ||
321 | printf("Beginning to %s-blank media.\n", (blank_fast?"fast":"full")); | |
314 | 322 | burn_disc_erase(drive, blank_fast); |
323 | ||
315 | 324 | sleep(1); |
316 | 325 | while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) { |
317 | 326 | if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */ |
320 | 329 | printf("Blanking ( %.1f%% done )\n", percent); |
321 | 330 | sleep(1); |
322 | 331 | } |
332 | if (burn_is_aborting(0) > 0) | |
333 | return -1; | |
334 | /* Back to synchronous handling */ | |
335 | burn_set_signal_handling("libburner : ", NULL, 0); | |
323 | 336 | printf("Done\n"); |
324 | 337 | return 1; |
325 | 338 | } |
372 | 385 | fprintf(stderr, "FATAL: Can only format DVD-RW or BD\n"); |
373 | 386 | return 0; |
374 | 387 | } |
388 | burn_set_signal_handling("libburner : ", NULL, 0x30); | |
375 | 389 | |
376 | 390 | printf("Beginning to format media.\n"); |
377 | 391 | burn_disc_format(drive, size, format_flag); |
384 | 398 | printf("Formatting ( %.1f%% done )\n", percent); |
385 | 399 | sleep(1); |
386 | 400 | } |
401 | if (burn_is_aborting(0) > 0) | |
402 | return -1; | |
403 | burn_set_signal_handling("libburner : ", NULL, 0); | |
387 | 404 | burn_disc_get_profile(drive_list[0].drive, ¤t_profile, |
388 | 405 | current_profile_name); |
389 | 406 | if (current_profile == 0x14 || current_profile == 0x13) |
529 | 546 | fprintf(stderr, "Reasons given:\n%s\n", reasons); |
530 | 547 | return 0; |
531 | 548 | } |
549 | burn_set_signal_handling("libburner : ", NULL, 0x30); | |
532 | 550 | |
533 | 551 | printf("Burning starts. With e.g. 4x media expect up to a minute of zero progress.\n"); |
534 | 552 | start_time = time(0); |
576 | 594 | } |
577 | 595 | burn_session_free(session); |
578 | 596 | burn_disc_free(target_disc); |
597 | if (burn_is_aborting(0) > 0) | |
598 | return -1; | |
579 | 599 | if (multi && current_profile != 0x1a && current_profile != 0x13 && |
580 | 600 | current_profile != 0x12 && current_profile != 0x43) |
581 | 601 | /* not with DVD+RW, formatted DVD-RW, DVD-RAM, BD-RE */ |
711 | 731 | { |
712 | 732 | int ret; |
713 | 733 | |
734 | /* A warning to programmers who start their own projekt from here. */ | |
735 | if (sizeof(off_t) != 8) { | |
736 | fprintf(stderr, | |
737 | "\nFATAL: Compile time misconfiguration. off_t is not 64 bit.\n\n"); | |
738 | exit(39); | |
739 | } | |
740 | ||
714 | 741 | ret = libburner_setup(argc, argv); |
715 | 742 | if (ret) |
716 | 743 | exit(ret); |
727 | 754 | /* Print messages of severity SORRY or more directly to stderr */ |
728 | 755 | burn_msgs_set_severities("NEVER", "SORRY", "libburner : "); |
729 | 756 | |
730 | /* Activate the default signal handler which eventually will try to | |
757 | /* Activate the synchronous signal handler which eventually will try to | |
731 | 758 | properly shutdown drive and library on aborting events. */ |
732 | 759 | burn_set_signal_handling("libburner : ", NULL, 0); |
733 | 760 | |
761 | 788 | burn_drive_release(drive_list[driveno].drive, 0); |
762 | 789 | |
763 | 790 | finish_libburn:; |
791 | if (burn_is_aborting(0) > 0) { | |
792 | burn_abort(4400, burn_abort_pacifier, "libburner : "); | |
793 | fprintf(stderr,"\nlibburner run aborted\n"); | |
794 | exit(1); | |
795 | } | |
764 | 796 | /* This app does not bother to know about exact scan state. |
765 | 797 | Better to accept a memory leak here. We are done anyway. */ |
766 | 798 | /* burn_drive_info_free(drive_list); */ |
767 | ||
768 | 799 | burn_finish(); |
769 | 800 | exit(ret); |
770 | 801 | } |