Codebase list libburn / e1438d1
Import Upstream version 0.8.0.pl00 Dominique Dumont 6 years ago
67 changed file(s) with 1705 addition(s) and 447 deletion(s). Raw diff Collapse all Expand all
109109 test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
110110 test_structest_SOURCES = test/structest.c
111111
112 ## cdrskin construction site - ts A60816 - B00122
112 ## cdrskin construction site - ts A60816 - B00409
113113 cdrskin_cdrskin_CPPFLAGS = -Ilibburn
114 cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_6
114 cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_0
115115
116116 # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
117117 # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
381381 test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
382382 test_structest_SOURCES = test/structest.c
383383 cdrskin_cdrskin_CPPFLAGS = -Ilibburn
384 cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_6
384 cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_0
385385
386386 # cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
387387 # ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
10411041 || exit 1; \
10421042 fi; \
10431043 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 \
10451045 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
10461046 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
10471047 ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
1010 and Ben Jansens <xor@orodu.net>
1111 Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
1212
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
1414
1515 ------------------------------------------------------------------------------
1616
1818
1919 From tarball
2020
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
2525 ./configure --prefix=/usr
2626 make
2727
495495 fixes bugs about the generic X/Open system adapter, and allows to use
496496 libcdio >= 0.83 as SCSI transport facility.
497497
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
498516 ------------------------------------------------------------------------------
499517
500518 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
011 AC_DEFUN([TARGET_SHIZZLE],
112 [
213 ARCH=""
33 cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
44 Integrated sub project of libburnia-project.org but also published via:
55 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
77
88 Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later.
99 ------------------------------------------------------------------------------
2424
2525 Compilation, First Glimpse, Installation
2626
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
3131
3232 Within that directory execute:
3333
145145 cdrskin dev=0,1,0 -checkdrive
146146
147147 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
149149
150150 Prepare CD-RW or DVD-RW for re-use, DVD-RAM or BD-RE for first use
151151 cdrskin -v dev=/dev/sg1 blank=as_needed -eject
398398 Special compilation variations
399399
400400 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
402403
403404 In some situations Linux may deliver a better write performance to drives if
404405 the track input is read with O_DIRECT (see man 2 open). The API call
405406 burn_os_open_track_src() and the input readers of cdrskin and libburn fifo
406407 can be told to use this peculiar read mode by:
407 --enable-track-src-odirect
408 --enable-track-src-odirect
408409
409410 But often cdrskin option dvd_obs=64k will yield even better performance in
410411 such a situation. 64k can be made default at compile time by
202202 if(o->dest_fd!=-1)
203203 close(o->dest_fd);
204204 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++) {
206206 if(o->follow_up_fds[i][1]!=-1)
207207 close(o->follow_up_fds[i][1]);
208208 o->follow_up_fds[i][1]= -1;
209 }
209210 return(1);
210211 }
211212
11 .\" First parameter, NAME, should be all caps
22 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
33 .\" other parameters are allowed: see man(7), man(1)
4 .TH CDRSKIN 1 "Jan 19, 2010"
4 .TH CDRSKIN 1 "Feb 29, 2010"
55 .\" Please adjust this date whenever revising the manpage.
66 .\"
77 .\" Some roff macros, for reference:
8181 .br
8282 Each track is initiated by one track source address argument, which may either
8383 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
8585 of track sources and the state of the output media.
8686 .PP
8787 More than one track can be burned by a single run of cdrskin.
9292 be written to them in subsequent runs of cdrskin (see option -multi).
9393 Info about the addresses of burned tracks is kept in a table of
9494 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.
9696 .PP
9797 In general there are two types of tracks: data and audio. They differ in
9898 sector size, throughput and readability via the systems' CD-ROM drivers
9999 resp. by music CD players. With DVD and BD there is only type data.
100100 .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
102102 data, unless the track source is a file with suffix ".wav" or ".au" and has a
103103 header part which identifies it as MS-WAVE resp. SUN Audio with suitable
104104 parameters. Such files are burned as audio tracks by default.
137137 the capabilities of the drive and the state of the present media.
138138 .br
139139 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,
141141 but rather an illustration of what to expect with particular media types.
142142 .SS
143143 .B Recordable CD Media:
180180 Mode DAO has many restrictions. It does not work with
181181 appendable media, allows no -multi and only a single track. The size of the
182182 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
184184 .B tsize=
185185 or
186186 .B tao_to_sao_tsize= .
187187 .br
188188 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
190190 .B -sao .
191191 Program growisofs uses DAO on sequential DVD-R[W] media for maximum
192192 DVD-ROM/-Video compatibility.
193193 .br
194194 The other mode, Incremental Streaming, is the default write mode if
195195 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
197197 .B -tao
198198 as it resembles much CD TAO by allowing track sources of
199199 unpredicted length and to keep media appendable by option
224224 cdrskin.
225225 .br
226226 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.
228228 Therefore -multi is banned unless ISO-9660 images shall be expandable by help
229229 of option
230230 .B --grow_overwriteable_iso .
349349 Announces that the subsequent tracks are to be burned as audio.
350350 The source is supposed to be uncompressed headerless PCM, 44100 Hz, 16 bit,
351351 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
353353 ".wav" are examined wether they have a header in MS-WAVE format confirming
354354 those parameters and eventually raw audio data get extracted and burned as
355355 audio track. Same is done for suffix ".au" and SUN Audio.
526526 Set "driveropts=noburnfree" to disable the drive's eventual protection
527527 mechanism against temporary lack of source data (i.e. buffer underrun).
528528 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".
530530 .TP
531531 .BI \-dummy
532532 Try to perform the drive operations without actually affecting the inserted
596596 .br
597597 If not, then the burn run will be aborted.
598598 .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
600600 by further -isosize options, though. At least 15 blocks of padding will be
601601 added to each -isosize track. But be advised to rather use padsize=300k.
602602 .br
704704 only imposes restrictions without providing known advantages.
705705 .br
706706 -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
708708 option tsize= or by option tao_to_sao_tsize=.
709709 .br
710710 -sao cannot be used on appendable media.
821821 normal use:
822822 .TP
823823 .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
825825 drive for the loaded media. By default, such an adjustment is only made with
826826 pseudo-speeds 0 and -1 whereas speed settings > 0 are sent unchanged to the
827827 drive which will then choose an appropriate speed on its own.
915915 The natural commands to be given are cdrecord or wodim but one may well submit
916916 the address of an own program.
917917 .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
919919 the shell patterns --?* or *_*=* . This eventually suppresses path names of
920920 track sources which happen to match those patterns. The options from the
921921 startup files are not handed to the fallback program.
961961 With overwriteable media and no option blank=fast|all present it expands an
962962 eventual ISO-9660 filesystem on media. It is assumed that this image's inner
963963 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
965965 appendable rather than as blank. I.e. options -msinfo and -toc will work.
966966 -toc will always show a single session with its size increasing with
967967 every added mkisofs image.
968968 .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
970970 will be placed behind the end of the old one. One may use option
971971 assert_write_lba= to make sure that media state and mkisofs job do match.
972972 .br
10611061 the full burn session and add --tell_media_space. But if one has to expect
10621062 a cdrskin version prior to 0.3.3 no track source should be given in order
10631063 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.
10651065 .br
10661066 The result gets printed to standard output. It is 0 or empty if no writing
10671067 is possible with the given options.
11291129 Linux specific: Select a SCSI device file family to be scanned for by
11301130 options --devices and -scanbus.
11311131 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
11331133 in order to meet other programs at a common device file for each drive.
11341134 On kernel 2.4 families sr and scd will find no drives.
11351135 .br
00
11 /*
22 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.
44
55 A cdrecord compatible command line interface for libburn.
66
8787
8888 /** The official program version */
8989 #ifndef Cdrskin_prog_versioN
90 #define Cdrskin_prog_versioN "0.7.6"
90 #define Cdrskin_prog_versioN "0.8.0"
9191 #endif
9292
9393 /** The official libburn interface revision to use.
9797 #define Cdrskin_libburn_majoR 0
9898 #endif
9999 #ifndef Cdrskin_libburn_minoR
100 #define Cdrskin_libburn_minoR 7
100 #define Cdrskin_libburn_minoR 8
101101 #endif
102102 #ifndef Cdrskin_libburn_micrO
103 #define Cdrskin_libburn_micrO 6
103 #define Cdrskin_libburn_micrO 0
104104 #endif
105105
106106
134134 #endif /* Cdrskin_libburn_cvs_A60220_tS */
135135
136136
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"
139139 #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"
144144 #define Cdrskin_libburn_from_pykix_svN 1
145145
146146 /* Place novelty switch macros here.
147147 Move them down to Cdrskin_libburn_from_pykix_svN on version leap
148148 */
149149
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 */
152156
153157 #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"
156160 #define Cdrskin_libburn_from_pykix_svN 1
157161 #endif
158162
159 #ifdef Cdrskin_libburn_0_7_6
163 #ifdef Cdrskin_libburn_0_8_0
160164 #undef Cdrskin_libburn_majoR
161165 #undef Cdrskin_libburn_minoR
162166 #undef Cdrskin_libburn_micrO
163167 #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
168172 #undef Cdrskin_libburn_majoR
169173 #undef Cdrskin_libburn_minoR
170174 #undef Cdrskin_libburn_micrO
171175 #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
174178 #endif
175179
176180
367371 #define Cleanup_app_handler_T burn_abort_handler_t
368372 #else
369373 #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;
371402
372403
373404 /** The size of a string buffer for pathnames and similar texts */
17951826
17961827 Cdrskin_get_fifo_par(track->boss, &fifo_enabled, &fifo_size, &fifo_start_at,
17971828 0);
1798 fd_src= src;
17991829
18001830 if(track->track_type == BURN_AUDIO)
18011831 chunksize= 2352;
18051835 chunksize= 2048;
18061836 chunks= fifo_size / chunksize;
18071837 if(chunks > 1 && fifo_enabled) {
1838 fd_src= src;
18081839 src= burn_fifo_source_new(fd_src, chunksize, chunks,
18091840 (chunksize * chunks >= 128 * 1024));
18101841 if((flag & 1) || src == NULL)
36143645 o->write_type= BURN_WRITE_SAO;
36153646 o->block_type= BURN_BLOCK_SAO;
36163647 o->multi= 0;
3648 o->cdxa_conversion= 0;
36173649 o->modesty_on_drive= 0;
36183650 o->min_buffer_percent= 65;
36193651 o->max_buffer_percent= 95;
40854117 #ifdef Cdrskin_grab_abort_brokeN
40864118 if(restore_handler) {
40874119 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);
40894122 }
40904123 #endif /* Cdrskin_grab_abort_brokeN */
40914124
41184151 }
41194152
41204153
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
41214183 /** Clean up resources in abort situations. To be called by Cleanup subsystem
41224184 but hardly ever by the application. The program must exit afterwards.
41234185 */
41244186 int Cdrskin_abort_handler(struct CdrskiN *skin, int signum, int flag)
41254187 {
41264188
4127 #ifdef Cdrskin_libburn_has_burn_aborT
4128
4129 int ret;
4130
4131 #else
4189 #ifndef Cdrskin_libburn_has_burn_aborT
41324190
41334191 int wait_grain= 100000,first_status= 1;
41344192 double start_time,last_time,current_time;
41804238 fprintf(stderr,"cdrskin: ABORT : Usually it is done with 4x speed after about a MINUTE\n");
41814239 fprintf(stderr,"cdrskin: URGE : But wait at least the normal burning time before any kill -9\n");
41824240 }
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;
41914250
41924251 #else /* Cdrskin_libburn_has_burn_aborT */
41934252
52165275 /* If last two blocks not readable then assume TAO and subtract 2
52175276 from lra and size.
52185277 */;
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);
52215280 if(ret <= 0) {
52225281 lra-= 2;
52235282 size-= 2;
60326091 skin->drive_is_busy= 0;
60336092 if(skin->drive_is_grabbed)
60346093 Cdrskin_release_drive(skin,0);
6094 if(Cdrskin__is_aborting(0))
6095 Cdrskin_abort(skin, 0); /* Never comes back */
60356096 return(ret);
60366097 }
60376098
60846145
60856146 /* for debugging */
60866147 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 */
60876151
60886152 current_time= Sfile_microtime(0);
60896153 elapsed_total_time= current_time-start_time;
72937357 skin->drive_is_busy= 1;
72947358 burn_disc_write(o, disc);
72957359 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);
72977362 last_time= start_time= Sfile_microtime(0);
72987363
72997364 burn_write_opts_free(o);
73127377
73137378 /* >>> how do i learn about success or failure ? */
73147379
7315 if(loop_counter>0)
7380 if(loop_counter>0 || Cdrskin__is_aborting(0))
73167381 Cdrskin_burn_pacifier(skin,drive_status,&p,start_time,&last_time,
73177382 &total_count,&last_count,&min_buffer_fill,0);
73187383
73857450 skin->drive_is_busy= 0;
73867451 if(skin->verbosity>=Cdrskin_verbose_progresS)
73877452 printf("\n");
7453
7454 if(Cdrskin__is_aborting(0))
7455 Cdrskin_abort(skin, 0); /* Never comes back */
73887456
73897457 #ifdef Cdrskin_libburn_has_wrote_welL
73907458 wrote_well = burn_drive_wrote_well(drive);
88848952 *o= skin;
88858953 if(skin->preskin->abort_handler==1 || skin->preskin->abort_handler==3 ||
88868954 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);
88888957 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);
88908960
88918961 printf("cdrskin: scanning for devices ...\n");
88928962 fflush(stdout);
89629032 if(skin->do_devices) {
89639033 if(skin->n_drives<=0 && skin->preskin->scan_demands_drive)
89649034 {*exit_value= 4; goto no_drive;}
9035 if(Cdrskin__is_aborting(0))
9036 goto ex;
89659037 ret= Cdrskin_scanbus(skin,1);
89669038 if(ret<=0) {
89679039 fprintf(stderr,"cdrskin: FATAL : --devices failed.\n");
89689040 {*exit_value= 4; goto ex;}
89699041 }
89709042 }
9043
89719044 if(skin->do_scanbus) {
89729045 if(skin->n_drives<=0 && skin->preskin->scan_demands_drive)
89739046 {*exit_value= 5; goto no_drive;}
9047 if(Cdrskin__is_aborting(0))
9048 goto ex;
89749049 ret= Cdrskin_scanbus(skin,0);
89759050 if(ret<=0)
89769051 fprintf(stderr,"cdrskin: FATAL : -scanbus failed.\n");
89779052 {*exit_value= 5*(ret<=0); goto ex;}
89789053 }
89799054 if(skin->do_load) {
9055 if(Cdrskin__is_aborting(0))
9056 goto ex;
89809057 ret= Cdrskin_grab_drive(skin,8);
89819058 if(ret>0) {
89829059 if(skin->do_load==2 && !skin->do_eject) {
89929069 {*exit_value= 14*(ret<=0); goto ex;}
89939070 }
89949071 if(skin->do_checkdrive) {
9072 if(Cdrskin__is_aborting(0))
9073 goto ex;
89959074 ret= Cdrskin_checkdrive(skin,"",(skin->do_checkdrive==2)<<1);
89969075 {*exit_value= 6*(ret<=0); goto ex;}
89979076 }
89989077 if(skin->do_msinfo) {
89999078 if(skin->n_drives<=0)
90009079 {*exit_value= 12; goto no_drive;}
9080 if(Cdrskin__is_aborting(0))
9081 goto ex;
90019082 ret= Cdrskin_msinfo(skin,0);
90029083 if(ret<=0)
90039084 {*exit_value= 12; goto ex;}
90059086 if(skin->do_atip) {
90069087 if(skin->n_drives<=0)
90079088 {*exit_value= 7; goto no_drive;}
9089 if(Cdrskin__is_aborting(0))
9090 goto ex;
90089091 ret= Cdrskin_atip(skin, skin->do_atip == 4 ? 4 :
90099092 (skin->do_atip>1) | (2 * (skin->do_atip > 2)));
90109093 if(ret<=0)
90139096 if(skin->do_list_formats) {
90149097 if(skin->n_drives<=0)
90159098 {*exit_value= 14; goto no_drive;}
9099 if(Cdrskin__is_aborting(0))
9100 goto ex;
90169101 ret= Cdrskin_list_formats(skin, 0);
90179102 if(ret<=0)
90189103 {*exit_value= 14; goto ex;}
90209105 if(skin->do_blank) {
90219106 if(skin->n_drives<=0)
90229107 {*exit_value= 8; goto no_drive;}
9108 if(Cdrskin__is_aborting(0))
9109 goto ex;
90239110 ret= Cdrskin_blank(skin,0);
90249111 if(ret<=0)
90259112 {*exit_value= 8; goto ex;}
90289115 #ifdef Cdrskin_libburn_has_random_access_rW
90299116 if(skin->do_direct_write) {
90309117 skin->do_burn= 0;
9118 if(Cdrskin__is_aborting(0))
9119 goto ex;
90319120 ret= Cdrskin_direct_write(skin,0);
90329121 if(ret<=0)
90339122 {*exit_value= 13; goto ex;}
90379126 if(skin->do_burn || skin->tell_media_space) {
90389127 if(skin->n_drives<=0)
90399128 {*exit_value= 10; goto no_drive;}
9129 if(Cdrskin__is_aborting(0))
9130 goto ex;
90409131 ret= Cdrskin_burn(skin,0);
90419132 if(ret<=0)
90429133 {*exit_value= 10; goto ex;}
90439134 }
90449135 ex:;
9136 if(Cdrskin__is_aborting(0))
9137 Cdrskin_abort(skin, 0); /* Never comes back */
90459138 return((*exit_value)==0);
90469139 no_drive:;
90479140 fprintf(stderr,"cdrskin: FATAL : This run would need an accessible drive\n");
90899182 messaging need libburn running */
90909183 ret= Cdrpreskin_initialize_lib(preskin,0);
90919184 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");
90939186 {exit_value= 2; goto ex;}
90949187 }
90959188 lib_initialized= 1;
91299222 #endif
91309223 }
91319224
9132 Cdrskin_run(skin,&exit_value,0);
9225 if(!Cdrskin__is_aborting(0))
9226 Cdrskin_run(skin,&exit_value,0);
91339227
91349228 ex:;
9229 if(Cdrskin__is_aborting(0))
9230 Cdrskin_abort(skin, 0); /* Never comes back */
9231
91359232 if(preskin!=NULL)
91369233 h_preskin= preskin;
91379234 else if(skin!=NULL)
6161 GPL software included:<BR>
6262 </H2>
6363 <DL>
64 <DT>libburn-0.7.6</DT>
64 <DT>libburn-0.8.0</DT>
6565 <DD>(founded by Derek Foreman and Ben Jansens,
6666 developed and maintained since August 2006 by
6767 Thomas Schmitt from team of libburnia-project.org)
193193 <P>
194194 <DL>
195195 <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).
198198 </DD>
199199 <DD>
200200 The cdrskin tarballs are source code identical with libburn releases
243243 <HR>
244244
245245 <P>
246 Enhancements towards previous stable version cdrskin-0.7.4.pl00:
246 Enhancements towards previous stable version cdrskin-0.7.8.pl00:
247247 <UL>
248248 <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
250250 </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>
253251 <!--
254252 <LI>none</LI>
255253 -->
256254 </UL>
257255
258 Bug fixes towards cdrskin-0.7.4.pl00:
256 Bug fixes towards cdrskin-0.7.8.pl00:
259257 <UL>
260258 <LI>none</LI>
261259 <!--
260 <LI>none</LI>
262261 -->
263262 </UL>
264263
266265
267266 <P>
268267 <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:
271270 <UL>
272271 <LI>none yet</LI>
273272 <!--
276275 </UL>
277276 </DD>
278277
279 <DD>Bug fixes towards cdrskin-0.7.6.pl00:
278 <DD>Bug fixes towards cdrskin-0.8.0.pl00:
280279 <UL>
281280 <LI>none yet</LI>
282281 <!--
285284 </DD>
286285
287286 <DD>&nbsp;</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>
292291 <DD>&nbsp;</DD>
293292 <DT>Maintainers of cdrskin unstable packages please use SVN of
294293 <A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
308307 <A HREF="README_cdrskin_devel">upcoming README</A> ):
309308 </DD>
310309 <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).
313312 </DD>
314313
315314 <!-- This is not offered any more since spring 2008
0 #define Cdrskin_timestamP "2010.01.22.130001"
0 #define Cdrskin_timestamP "2010.04.09.100001"
79287928 + cdrskin/add_ts_changes_to_libburn_0_7_7
79297929 Updated cdrskin tarball generator
79307930
7931 22 Jan 2009 []
7931 22 Jan 2009 [3034]
79327932 cdrskin/changelog.txt
79337933 Documented changes and release timestamp
79347934
79397939 * Enabled FreeBSD system adapter for Debian kfreebsd
79407940 * Experimental SCSI transport adapter via GNU libcdio 0.83git
79417941
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 -
79458314
79468315
79478316 ===============================================================================
79488317 TODO
79498318 ===============================================================================
79508319
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() ?
80208323
80218324
80228325 --------------------------------- bugs -------------------------------------
80448347
80458348 ------------------------------ end of bugs ---------------------------------
80468349
8047 - xorriso -as tar (Rocky wants me to begin with -x)
8048
80498350 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)
80538351
80548352 ? Enable profile 0x42 BD-R random recording
80558353
66 debug_opts="-O2"
77 def_opts=
88 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"
1111
1212 # To be used if Makefile.am uses libburn_libburn_la_CFLAGS
1313 # burn="libburn/libburn_libburn_la-"
2525 compile_cdrfifo=0
2626 compile_dewav=0
2727
28 libcam=
29 os=$(uname -s)
30 case $os in
31 *FreeBSD)
32 libcam="-lcam"
33 esac
34
2835 for i in "$@"
2936 do
3037 if test "$i" = "-compile_cdrfifo"
3946 libdax_audioxtr_o=
4047 libdax_msgs_o="$burn"message.o
4148 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"
4552 libdax_audioxtr_o="$burn"libdax_audioxtr.o
4653 libdax_msgs_o="$burn"libdax_msgs.o
4754 cleanup_src_or_obj="$burn"cleanup.o
4855 elif test "$i" = "-libburn_svn"
4956 then
50 libvers="-DCdrskin_libburn_0_7_7"
57 libvers="-DCdrskin_libburn_0_8_1"
5158 libdax_audioxtr_o="$burn"libdax_audioxtr.o
5259 libdax_msgs_o="$burn"libdax_msgs.o
5360 cleanup_src_or_obj="$burn"cleanup.o
8592 then
8693 fifo_source=
8794 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"
8899 elif test "$i" = "-use_libcdio"
89100 then
90101 libcdio="-lcdio"
97108 echo "Options:"
98109 echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
99110 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"
101112 echo " -libburn_svn set macro to match current libburn-SVN."
102113 echo " -dvd_obs_64k 64 KB default size for DVD/BD writing."
103114 echo " -use_libcdio link with -lcdio because libburn uses it."
124135
125136 if test "$compile_cdrskin"
126137 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"
128139 cc -I. \
129140 $warn_opts \
130141 $static_opts \
170181 "$burn"ecma130ab.o \
171182 \
172183 $libcdio \
184 $libcam \
173185 -lpthread
174186
175187 ret=$?
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <http://libburnia-project.org>.
55 #
712712 # Identity of this package.
713713 PACKAGE_NAME='libburn'
714714 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'
717717 PACKAGE_BUGREPORT='http://libburnia-project.org'
718718
719719 ac_default_prefix=/usr/local
14011401 # Omit some internal or obsolete options to make the list less imposing.
14021402 # This message is too long to be a string in the A/UX 3.1 sh.
14031403 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.
14051405
14061406 Usage: $0 [OPTION]... [VAR=VALUE]...
14071407
14721472
14731473 if test -n "$ac_init_help"; then
14741474 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:";;
14761476 esac
14771477 cat <<\_ACEOF
14781478
15871587 test -n "$ac_init_help" && exit $ac_status
15881588 if $ac_init_version; then
15891589 cat <<\_ACEOF
1590 libburn configure 0.7.6
1590 libburn configure 0.8.0
15911591 generated by GNU Autoconf 2.60
15921592
15931593 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
16011601 This file contains any messages produced by compilers while
16021602 running configure, to aid debugging if configure makes a mistake.
16031603
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
16051605 generated by GNU Autoconf 2.60. Invocation command line was
16061606
16071607 $ $0 $@
21142114 NONENONEs,x,x, &&
21152115 program_prefix=${target_alias}-
21162116
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
21172126 am__api_version="1.9"
21182127 # Find a good install program. We prefer a C program (faster),
21192128 # so one script is as good as another. But avoid the broken or
24002409
24012410 # Define the identity of the package.
24022411 PACKAGE='libburn'
2403 VERSION='0.7.6'
2412 VERSION='0.8.0'
24042413
24052414
24062415 cat >>confdefs.h <<_ACEOF
25482557
25492558
25502559 BURN_MAJOR_VERSION=0
2551 BURN_MINOR_VERSION=7
2552 BURN_MICRO_VERSION=6
2560 BURN_MINOR_VERSION=8
2561 BURN_MICRO_VERSION=0
25532562 BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
25542563
25552564
25582567
25592568
25602569 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
25632572 LT_REVISION=0
25642573 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
25652574
64146423 ;;
64156424 *-*-irix6*)
64166425 # Find out which ABI we are using.
6417 echo '#line 6418 "configure"' > conftest.$ac_ext
6426 echo '#line 6427 "configure"' > conftest.$ac_ext
64186427 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
64196428 (eval $ac_compile) 2>&5
64206429 ac_status=$?
88428851 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
88438852 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
88448853 -e 's:$: $lt_compiler_flag:'`
8845 (eval echo "\"\$as_me:8846: $lt_compile\"" >&5)
8854 (eval echo "\"\$as_me:8855: $lt_compile\"" >&5)
88468855 (eval "$lt_compile" 2>conftest.err)
88478856 ac_status=$?
88488857 cat conftest.err >&5
8849 echo "$as_me:8850: \$? = $ac_status" >&5
8858 echo "$as_me:8859: \$? = $ac_status" >&5
88508859 if (exit $ac_status) && test -s "$ac_outfile"; then
88518860 # The compiler can only warn and ignore the option if not recognized
88528861 # So say no if there are warnings other than the usual output.
91109119 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
91119120 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
91129121 -e 's:$: $lt_compiler_flag:'`
9113 (eval echo "\"\$as_me:9114: $lt_compile\"" >&5)
9122 (eval echo "\"\$as_me:9123: $lt_compile\"" >&5)
91149123 (eval "$lt_compile" 2>conftest.err)
91159124 ac_status=$?
91169125 cat conftest.err >&5
9117 echo "$as_me:9118: \$? = $ac_status" >&5
9126 echo "$as_me:9127: \$? = $ac_status" >&5
91189127 if (exit $ac_status) && test -s "$ac_outfile"; then
91199128 # The compiler can only warn and ignore the option if not recognized
91209129 # So say no if there are warnings other than the usual output.
92149223 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
92159224 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
92169225 -e 's:$: $lt_compiler_flag:'`
9217 (eval echo "\"\$as_me:9218: $lt_compile\"" >&5)
9226 (eval echo "\"\$as_me:9227: $lt_compile\"" >&5)
92189227 (eval "$lt_compile" 2>out/conftest.err)
92199228 ac_status=$?
92209229 cat out/conftest.err >&5
9221 echo "$as_me:9222: \$? = $ac_status" >&5
9230 echo "$as_me:9231: \$? = $ac_status" >&5
92229231 if (exit $ac_status) && test -s out/conftest2.$ac_objext
92239232 then
92249233 # The compiler can only warn and ignore the option if not recognized
1166611675 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1166711676 lt_status=$lt_dlunknown
1166811677 cat > conftest.$ac_ext <<EOF
11669 #line 11670 "configure"
11678 #line 11679 "configure"
1167011679 #include "confdefs.h"
1167111680
1167211681 #if HAVE_DLFCN_H
1176611775 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1176711776 lt_status=$lt_dlunknown
1176811777 cat > conftest.$ac_ext <<EOF
11769 #line 11770 "configure"
11778 #line 11779 "configure"
1177011779 #include "confdefs.h"
1177111780
1177211781 #if HAVE_DLFCN_H
1413414143 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1413514144 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1413614145 -e 's:$: $lt_compiler_flag:'`
14137 (eval echo "\"\$as_me:14138: $lt_compile\"" >&5)
14146 (eval echo "\"\$as_me:14147: $lt_compile\"" >&5)
1413814147 (eval "$lt_compile" 2>conftest.err)
1413914148 ac_status=$?
1414014149 cat conftest.err >&5
14141 echo "$as_me:14142: \$? = $ac_status" >&5
14150 echo "$as_me:14151: \$? = $ac_status" >&5
1414214151 if (exit $ac_status) && test -s "$ac_outfile"; then
1414314152 # The compiler can only warn and ignore the option if not recognized
1414414153 # So say no if there are warnings other than the usual output.
1423814247 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1423914248 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1424014249 -e 's:$: $lt_compiler_flag:'`
14241 (eval echo "\"\$as_me:14242: $lt_compile\"" >&5)
14250 (eval echo "\"\$as_me:14251: $lt_compile\"" >&5)
1424214251 (eval "$lt_compile" 2>out/conftest.err)
1424314252 ac_status=$?
1424414253 cat out/conftest.err >&5
14245 echo "$as_me:14246: \$? = $ac_status" >&5
14254 echo "$as_me:14255: \$? = $ac_status" >&5
1424614255 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1424714256 then
1424814257 # The compiler can only warn and ignore the option if not recognized
1580815817 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1580915818 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1581015819 -e 's:$: $lt_compiler_flag:'`
15811 (eval echo "\"\$as_me:15812: $lt_compile\"" >&5)
15820 (eval echo "\"\$as_me:15821: $lt_compile\"" >&5)
1581215821 (eval "$lt_compile" 2>conftest.err)
1581315822 ac_status=$?
1581415823 cat conftest.err >&5
15815 echo "$as_me:15816: \$? = $ac_status" >&5
15824 echo "$as_me:15825: \$? = $ac_status" >&5
1581615825 if (exit $ac_status) && test -s "$ac_outfile"; then
1581715826 # The compiler can only warn and ignore the option if not recognized
1581815827 # So say no if there are warnings other than the usual output.
1591215921 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1591315922 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1591415923 -e 's:$: $lt_compiler_flag:'`
15915 (eval echo "\"\$as_me:15916: $lt_compile\"" >&5)
15924 (eval echo "\"\$as_me:15925: $lt_compile\"" >&5)
1591615925 (eval "$lt_compile" 2>out/conftest.err)
1591715926 ac_status=$?
1591815927 cat out/conftest.err >&5
15919 echo "$as_me:15920: \$? = $ac_status" >&5
15928 echo "$as_me:15929: \$? = $ac_status" >&5
1592015929 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1592115930 then
1592215931 # The compiler can only warn and ignore the option if not recognized
1814218151 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1814318152 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1814418153 -e 's:$: $lt_compiler_flag:'`
18145 (eval echo "\"\$as_me:18146: $lt_compile\"" >&5)
18154 (eval echo "\"\$as_me:18155: $lt_compile\"" >&5)
1814618155 (eval "$lt_compile" 2>conftest.err)
1814718156 ac_status=$?
1814818157 cat conftest.err >&5
18149 echo "$as_me:18150: \$? = $ac_status" >&5
18158 echo "$as_me:18159: \$? = $ac_status" >&5
1815018159 if (exit $ac_status) && test -s "$ac_outfile"; then
1815118160 # The compiler can only warn and ignore the option if not recognized
1815218161 # So say no if there are warnings other than the usual output.
1841018419 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1841118420 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1841218421 -e 's:$: $lt_compiler_flag:'`
18413 (eval echo "\"\$as_me:18414: $lt_compile\"" >&5)
18422 (eval echo "\"\$as_me:18423: $lt_compile\"" >&5)
1841418423 (eval "$lt_compile" 2>conftest.err)
1841518424 ac_status=$?
1841618425 cat conftest.err >&5
18417 echo "$as_me:18418: \$? = $ac_status" >&5
18426 echo "$as_me:18427: \$? = $ac_status" >&5
1841818427 if (exit $ac_status) && test -s "$ac_outfile"; then
1841918428 # The compiler can only warn and ignore the option if not recognized
1842018429 # So say no if there are warnings other than the usual output.
1851418523 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1851518524 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1851618525 -e 's:$: $lt_compiler_flag:'`
18517 (eval echo "\"\$as_me:18518: $lt_compile\"" >&5)
18526 (eval echo "\"\$as_me:18527: $lt_compile\"" >&5)
1851818527 (eval "$lt_compile" 2>out/conftest.err)
1851918528 ac_status=$?
1852018529 cat out/conftest.err >&5
18521 echo "$as_me:18522: \$? = $ac_status" >&5
18530 echo "$as_me:18531: \$? = $ac_status" >&5
1852218531 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1852318532 then
1852418533 # The compiler can only warn and ignore the option if not recognized
2178721796 if test "${enable_dvd_obs_64k+set}" = set; then
2178821797 enableval=$enable_dvd_obs_64k;
2178921798 else
21790 enable_fifo_odirect=no
21799 enable_dvd_obs_64k=no
2179121800 fi
2179221801
2179321802 if test x$enable_dvd_obs_64k = xyes; then
2282922838 # report actual input values of CONFIG_FILES etc. instead of their
2283022839 # values after options handling.
2283122840 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
2283322842 generated by GNU Autoconf 2.60. Invocation command line was
2283422843
2283522844 CONFIG_FILES = $CONFIG_FILES
2287622885 _ACEOF
2287722886 cat >>$CONFIG_STATUS <<_ACEOF
2287822887 ac_cs_version="\\
22879 libburn config.status 0.7.6
22888 libburn config.status 0.8.0
2288022889 configured by $0, generated by GNU Autoconf 2.60,
2288122890 with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2288222891
0 AC_INIT([libburn], [0.7.6], [http://libburnia-project.org])
0 AC_INIT([libburn], [0.8.0], [http://libburnia-project.org])
11 AC_PREREQ([2.50])
22 dnl AC_CONFIG_HEADER([config.h])
33
44 AC_CANONICAL_HOST
55 AC_CANONICAL_TARGET
66
7 LIBBURNIA_SET_FLAGS
8
79 AM_INIT_AUTOMAKE([subdir-objects])
810
9 dnl Notes by ts A71207 - B00122 :
11 dnl Notes by ts A71207 - B00310 :
1012 dnl
1113 dnl Regrettably the meaning of the various version types was misunderstood
1214 dnl before version 0.4.1.
7678 dnl 0.7.2 = libburn.so.4.37.0
7779 dnl 0.7.4 = libburn.so.4.39.0
7880 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
7983 dnl
8084 dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here.
8185 dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
100104 dnl
101105 dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
102106 BURN_MAJOR_VERSION=0
103 BURN_MINOR_VERSION=7
104 BURN_MICRO_VERSION=6
107 BURN_MINOR_VERSION=8
108 BURN_MICRO_VERSION=0
105109 BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
106110
107111 AC_SUBST(BURN_MAJOR_VERSION)
112116 dnl Libtool versioning
113117 LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
114118 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
117121 dnl ### This is the development version after above release version
118122 dnl LT_CURRENT++, LT_AGE++ has not yet happened.
119123 dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
120124 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
124128 LT_REVISION=0
125129 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
126130
198202 dnl ts A91116
199203 AC_ARG_ENABLE(dvd-obs-64k,
200204 [ --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)
202206 if test x$enable_dvd_obs_64k = xyes; then
203207 LIBBURN_DVD_OBS_64K="-DLibburn_dvd_obs_default_64K"
204208 echo "enabled write size default 64 KB on DVD and BD"
00 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
11
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 */
26
37 /* ts A71019 */
48
3539 #include <stdlib.h>
3640 #include <stdio.h>
3741 #include <string.h>
42 #include <signal.h>
3843
3944 /*
4045 #include <a ssert.h>
227232 return NULL;
228233 }
229234
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
230251 int burn_drive_scan(struct burn_drive_info *drives[], unsigned int *n_drives)
231252 {
232253 struct scan_opts o;
296317
297318 static void *erase_worker_func(struct w_list *w)
298319 {
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
299333 burn_disc_erase_sync(w->u.erase.drive, w->u.erase.fast);
300334 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
301341 return NULL;
302342 }
303343
309349 /* a ssert(drive); */
310350 /* a ssert(!SCAN_GOING()); */
311351 /* a ssert(!find_worker(drive)); */
352
312353 if((drive == NULL)) {
313354 libdax_msgs_submit(libdax_messenger, drive->global_index,
314355 0x00020104,
324365 0, 0);
325366 return;
326367 }
368
369 reset_progress(drive, 1, 1, 1, 0x10000, 0);
370
327371 /* A70103 : will be set to 0 by burn_disc_erase_sync() */
328372 drive->cancel = 1;
329373
364408 /* ts A61230 */
365409 static void *format_worker_func(struct w_list *w)
366410 {
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
367424 burn_disc_format_sync(w->u.format.drive, w->u.format.size,
368425 w->u.format.flag);
369426 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
370433 return NULL;
371434 }
372435
377440 struct format_opts o;
378441 int ok = 0, ret;
379442 char msg[160];
443
444 reset_progress(drive, 1, 1, 1, 0x10000, 0);
380445
381446 if ((SCAN_GOING()) || find_worker(drive) != NULL) {
382447 libdax_msgs_submit(libdax_messenger, drive->global_index,
507572 static void *write_disc_worker_func(struct w_list *w)
508573 {
509574 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 */
510588
511589 d->thread_pid = getpid();
590 d->thread_tid = pthread_self();
512591 d->thread_pid_valid= 1;
513592 burn_disc_write_sync(w->u.write.opts, w->u.write.disc);
514593 d->thread_pid_valid= 0;
518597 */
519598 burn_write_opts_free(w->u.write.opts);
520599
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
521605 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
522613 return NULL;
523614 }
524615
541632 0, 0);
542633 return;
543634 }
635
636 reset_progress(d, disc->sessions, disc->session[0]->tracks,
637 disc->session[0]->track[0]->indices, 0, 0);
544638
545639 /* For the next lines any return indicates failure */
546640 d->cancel = 1;
608702 {
609703 int old;
610704
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
611717 pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old);
612718 pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old);
613719 /* Note: Only burn_fifo_abort() shall cancel the fifo thread */
614720
615721 burn_fifo_source_shoveller(w->u.fifo.source, w->u.fifo.flag);
616722 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
617729 return NULL;
618730 }
619731
638750 add_worker(Burnworker_type_fifO, NULL,
639751 (WorkerFunc) fifo_worker_func, &o);
640752 fs->is_started = 1;
753
641754 return 1;
642755 }
643756
00 /**
1 Copyright (c) 2006 Thomas Schmitt <scdbackup@gmx.net>
2 Provided under GPL version 2 or later.
13
24 This file bundles variables which disable changes in libburn which are
35 not yet completely accepted.
22
33 A signal handler which cleans up an application and exits.
44
5 Provided under GPL license within GPL projects, BSD license elsewise.
5 Provided under GPLv2+ license within GPL projects, BSD license elsewise.
66 */
77
88 /*
3939 #else /* ! Cleanup_has_no_libburn_os_H */
4040
4141
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 */
4344
4445 /* Signals to be caught */
4546 static int signal_list[]= {
22
33 A signal handler which cleans up an application and exits.
44
5 Provided under GPL license within GPL projects, BSD license elsewise.
5 Provided under GPLv2+ within GPL projects, BSD license elsewise.
66 */
77
88 #ifndef Cleanup_includeD
22 #ifndef BURN__CRC_H
33 #define BURN__CRC_H
44
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
516 unsigned short crc_ccitt(unsigned char *, int len);
617 unsigned int crc_32(unsigned char *, int len);
718
19 #endif /* Libburn_no_crc_C */
20
21
822 #endif /* BURN__CRC_H */
00 /* -*- 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
16
27 #ifdef WIN32
38 #include <windows.h>
00 /* -*- 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
17
28 #include <sys/types.h>
39 #include <sys/stat.h>
410
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 */
612
713 #include <stdlib.h>
814 #include <unistd.h>
369375 d->busy = BURN_DRIVE_IDLE;
370376 d->thread_pid = 0;
371377 d->thread_pid_valid = 0;
378 memset(&(d->thread_tid), 0, sizeof(d->thread_tid));
372379 d->toc_entries = 0;
373380 d->toc_entry = NULL;
374381 d->disc = NULL;
614621 d->idata->product);
615622
616623 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 */
619627 /* reset the progress */
620628 d->progress.session = 0;
621629 d->progress.sessions = 1;
626634 d->progress.start_sector = 0;
627635 d->progress.sectors = 0x10000;
628636 d->progress.sector = 0;
637 #endif /* Libburn_reset_progress_asynC */
638
639 d->erase(d, fast);
640 d->busy = BURN_DRIVE_ERASING;
641
629642 /* read the initial 0 stage */
630643 while (!d->test_unit_ready(d) && d->get_erase_progress(d) == 0)
631644 sleep(1);
652665 char msg[80];
653666 struct buffer buf, *buf_mem = d->buffer;
654667
668 #ifdef Libburn_reset_progress_asynC
669 /* <<< This is now done in async.c */
655670 /* reset the progress */
656671 d->progress.session = 0;
657672 d->progress.sessions = 1;
662677 d->progress.start_sector = 0;
663678 d->progress.sectors = 0x10000;
664679 d->progress.sector = 0;
680 #endif /* Libburn_reset_progress_asynC */
681
665682 stages = 1 + ((flag & 1) && size > 1024 * 1024);
666683 d->cancel = 0;
667684 d->busy = BURN_DRIVE_FORMATTING;
798815 enum burn_drive_status burn_drive_get_status(struct burn_drive *d,
799816 struct burn_progress *p)
800817 {
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
801830 /* 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)
803832 burn_global_abort_level++;
804 if (burn_global_abort_level > 5) {
833 if (burn_builtin_triggered_action < 2 && burn_global_abort_level > 5) {
805834 if (burn_global_signal_handler == NULL)
806835 kill(getpid(), burn_global_abort_signum);
807836 else
811840 burn_global_abort_level = -1;
812841 }
813842
843 /* --- End of asynchronous signal handling --- */
844
845
814846 if (p != NULL) {
815847 memcpy(p, &(d->progress), sizeof(struct burn_progress));
816848 /* TODO: add mutex */
832864
833865 void burn_drive_cancel(struct burn_drive *d)
834866 {
867 /* ts B00225 : these mutexes are unnecessary because "= 1" is atomar.
835868 pthread_mutex_lock(&d->access_lock);
869 */
836870 d->cancel = 1;
871 /*
837872 pthread_mutex_unlock(&d->access_lock);
873 */
838874 }
839875
840876 /* ts A61007 : defunct because unused */
18511887 }
18521888
18531889
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
18541992 /** Abort any running drive operation and finish libburn.
18551993 @param patience Maximum number of seconds to wait for drives to finish
18561994 @param pacifier_func Function to produce appeasing messages. See
18632001 int (*pacifier_func)(void *handle, int patience, int elapsed),
18642002 void *handle)
18652003 {
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;
19472012 }
19482013
19492014
26802745 }
26812746
26822747
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)
26842750 {
26852751 int i;
26862752
26922758 */
26932759
26942760 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)) {
26962763 *d = &(drive_array[i]);
26972764 return 1;
26982765 }
00 /* -*- 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
17
28 #ifndef __DRIVE
39 #define __DRIVE
120126 int burn_drive__fd_from_special_adr(char *adr);
121127
122128
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);
125132
126133
127134 /* ts A51221 - A80731 : Whitelist inquiry functions */
134141 int burn_drive_is_listed(char *path, struct burn_drive **found, int flag);
135142
136143
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
137152 #endif /* __DRIVE */
33 /* ts A91016 : libburn/ecma130ab.c is the replacement for old libburn/lec.c
44
55 Copyright 2009, Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
6 Provided under GPL version 2 or later.
67
78 This code module implements the production of RSPC parity bytes (P- and Q-
89 parity) and the scrambling of raw CD-ROM sectors as specified in ECMA-130:
33 /* ts A91016 : libburn/ecma130ab.h is the replacement for old libburn/lec.h
44
55 Copyright 2009, Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
6 Provided under GPL version 2 or later.
67
78 This code module implements the computations prescribed in ECMA-130 Annex A
89 and B. For explanations of the underlying mathematics see ecma130ab.c .
00 /* -*- 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
17
28
39 #include <stdlib.h>
8288
8389 if (fs->fixed_size > 0)
8490 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)
8694 return (off_t) 0;
8795 return (off_t) buf.st_size;
8896 }
00 /* -*- 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 */
16
27 #ifndef BURN__FILE_H
38 #define BURN__FILE_H
00 /* -*- 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
17
28 #include <unistd.h>
39
814 #include <signal.h>
915 #include <string.h>
1016 #include <stdlib.h>
17 #include <pthread.h>
1118
1219 /* ts A70928 : init.h is for others, not for init .c
1320 #include "init.h"
3138
3239 int burn_running = 0;
3340
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 */
3544 int burn_sg_open_o_excl = 1;
3645
37 /* ts A70403 : Linux: wether to use fcntl(,F_SETLK,)
46 /* ts A70403 : GNU/Linux: wether to use fcntl(,F_SETLK,)
3847 after open() of device files */
3948 int burn_sg_fcntl_f_setlk = 1;
4049
41 /* ts A70314 : Linux: what device family to use :
50 /* ts A70314 : GNU/Linux: what device family to use :
4251 0= default family
4352 1= sr
4453 2= scd
7180 /* Parameters for builtin abort handler */
7281 static char abort_message_prefix[81] = {"libburn : "};
7382 static pid_t abort_control_pid= 0;
83 static pthread_t abort_control_thread;
7484 volatile int burn_global_abort_level= 0;
7585 int burn_global_abort_signum= 0;
7686 void *burn_global_signal_handle = NULL;
7787 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() */
7890
7991
8092 /* ts A70223 : wether implemented untested profiles are supported */
320332 return ret;
321333 }
322334
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 }
323349
324350 int burn_builtin_abort_handler(void *handle, int signum, int flag)
325351 {
328354 /*
329355 #define Libburn_signal_handler_verbouS 1
330356 */
357
331358 int ret;
332359 struct burn_drive *d;
333360
334361 #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 */
338378 #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 ---- */
339403
340404 /* ts A70928:
341405 Must be quick. Allowed to coincide with other thread and to share
349413
350414 #ifdef Libburn_new_thread_signal_handleR
351415
352 ret = burn_drive_find_by_thread_pid(&d, getpid());
416 ret = burn_drive_find_by_thread_pid(&d, getpid(),
417 pthread_self());
353418 if (ret > 0 && d->busy == BURN_DRIVE_WRITING) {
354419 /* This is an active writer thread */
355420
389454 }
390455 burn_global_abort_level = -1;
391456 Cleanup_set_handlers(NULL, NULL, 2);
457
392458 fprintf(stderr,"%sABORT : Trying to shut down drive and library\n",
393459 abort_message_prefix);
394460 fprintf(stderr,
395461 "%sABORT : Wait the normal burning time before any kill -9\n",
396462 abort_message_prefix);
397463 close(0); /* somehow stdin as input blocks abort until EOF */
398
399464 burn_abort(4440, burn_abort_pacifier, abort_message_prefix);
400465
401466 fprintf(stderr,
405470 return(1);
406471 }
407472
473
474 /* ts A61002 : API */
408475 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) {
412484 handler = burn_builtin_abort_handler;
413485 /*
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));
415488 */
416489
417490 }
418491 strcpy(abort_message_prefix, "libburn : ");
419 if(handle != NULL)
492 abort_message_prefix[0] = 0;
493 if(handle != NULL && handler == burn_builtin_abort_handler)
420494 strncpy(abort_message_prefix, (char *) handle,
421495 sizeof(abort_message_prefix)-1);
422496 abort_message_prefix[sizeof(abort_message_prefix)-1] = 0;
423497 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);
425508 burn_global_signal_handle = handle;
426509 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);
427535 }
428536
429537
1616 extern void *burn_global_signal_handle;
1717 extern burn_abort_handler_t burn_global_signal_handler;
1818
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
1929
2030 #endif /* BURN__INIT_H */
00 /* -*- 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
110
211 #ifndef LIBBURN_H
312 #define LIBBURN_H
726735
727736
728737 /* 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
731741 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:
733743 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.
737751 @param pacifier_func If not NULL: a function to produce appeasing messages.
738752 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
740754 @return 1 ok, all went well
741755 0 had to leave a drive in unclean state
742756 <0 severe error, do no use libburn again
764778 void burn_set_verbosity(int level);
765779
766780 /* 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).
768782 This call can be made at any time - even before burn_initialize().
769783 It is in effect for all active drives and currently not very thread
770784 safe for multiple drives.
781795 after burn_initialize() and before any bus scan. But not mandatory at all.
782796 Parameter value 1 enables a feature, 0 disables.
783797 Default is (1,0,0). Have a good reason before you change it.
784 @param exclusive Linux only:
798 @param exclusive
785799 0 = no attempt to make drive access exclusive.
786800 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.)
790803 2 = in case of a SCSI device, also try to open exclusively
791804 the matching /dev/sr, /dev/scd and /dev/st .
792805 One may select a device SCSI file family by adding
795808 8 = /dev/scd%d
796809 16 = /dev/sg%d
797810 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.
800813 @param blocking Try to wait for drives which do not open immediately but
801814 also do not return an error as well. (O_NONBLOCK)
802815 This might stall indefinitely with /dev/hdX hard disks.
10961109
10971110 /** Release a drive. This should not be done until the drive is no longer
10981111 busy (see burn_drive_get_status).
1099 Linux: The drive device file is not reserved afterwards. (O_EXCL, F_SETLK).
11001112 @param drive The drive to release.
11011113 @param eject Nonzero to make the drive eject the disc in it.
11021114 */
26142626
26152627 */
26162628 #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
26192631 /** Note:
26202632 Above version numbers are also recorded in configure.ac because libtool
26212633 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
26232635 are not decisive. Only the three numbers above do matter.
26242636 */
26252637 /** Usage discussion:
27762788
27772789 /* ts A61002 */
27782790 /* @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()
27802792 Such a function has to return -2 if it does not want the process to
27812793 exit with value 1.
27822794 */
27832795 typedef int (*burn_abort_handler_t)(void *handle, int signum, int flag);
27842796
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
27862818 @param handle Opaque handle eventually pointing to an application
27872819 provided memory object
27882820 @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.
27972849 @since 0.2.6
27982850 */
27992851 void burn_set_signal_handling(void *handle, burn_abort_handler_t handler,
28002852 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);
28012865
28022866
28032867 /* ts A70811 */
29473011 #define Libburn_dummy_probe_write_modeS 1
29483012
29493013
2950
29513014 #endif /*LIBBURN_H*/
00
11 /* libdax_audioxtr
22 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+
44 */
55
66 #include <stdio.h>
00
11 /* libdax_audioxtr
22 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+
44 */
55
66 #ifndef LIBDAX_AUDIOXTR_H_INCLUDED
11 /* libdax_msgs
22 Message handling facility of libdax.
33 Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>,
4 provided under GPL
4 provided under GPL version 2 or later.
55 */
66
77 #include <stdio.h>
1111 #include <stdlib.h>
1212 #include <errno.h>
1313 #include <sys/time.h>
14 #include <pthread.h>
1415
1516 /* Only this single source module is entitled to do this */
1617 #define LIBDAX_MSGS_H_INTERNAL 1
11 /* libdax_msgs
22 Message handling facility of libdax.
33 Copyright (C) 2006-2010 Thomas Schmitt <scdbackup@gmx.net>,
4 provided under GPL
4 provided under GPL version 2 or later.
55 */
66
77
553553 0x00020174 (SORRY,HIGH) = Fifo alignment does not allow desired read size
554554 0x00020175 (FATAL,HIGH) = Supporting library is too old
555555 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
556558
557559
558560 libdax_audioxtr:
00 /* -*- 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
17
28 /* ts A61009 */
39 /* #include <a ssert.h> */
417423 mmc_start_if_needed(d, 1);
418424 if (mmc_function_spy(d, "mmc_get_nwa") <= 0)
419425 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;
420430
421431 ret = mmc_read_track_info(d, trackno, &buf, alloc_len);
422432 if (ret <= 0)
40774087 desired payload bytes. The drive then returns 35
40784088 bytes as requested and the media id is "RITEKF1".
40794089 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
40814091 more bytes than the drive will deliver.
40824092
40834093 # define Libburn_enforce_structure_code_0x0E 1
00 /* -*- 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
17
28 #ifndef __MMC
39 #define __MMC
00 /* -*- 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
16
27 #include "null.h"
38 #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
06 #include "libburn.h"
17 #include "options.h"
28 #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
06 #ifndef BURN__OPTIONS_H
17 #define BURN__OPTIONS_H
28
44 Unknown POSIX like systems
55 with the dummy MMC transport adapter sg-dummy.c
66
7 Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL
7 Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
88 */
99
1010
33 by os.h in case of compilation for
44 FreeBSD with CAM
55
6 Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL
6 Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
77 */
88
99 /** List of all signals which shall be caught by signal handlers and trigger
5858 #define BURN_OS_TRANSPORT_DRIVE_ELEMENTS \
5959 struct cam_device* cam; \
6060 int lock_fd; \
61 int is_ahci; \
6162
6263
44 Unknown X/Open-like systems
55 with GNU libcdio MMC transport adapter sg-libcdio.c
66
7 Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL
7 Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
88 */
99
1010
4040 /* Important : MUST be at least 32768 ! */
4141 /* My Blu-ray burner LG GGW-H20 writes junk if stream recording is combined
4242 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.
4444 */
4545 #ifdef __linux
4646 #define BURN_OS_TRANSPORT_BUFFER_SIZE 65536
11 /* os-linux.h
22 Operating system specific libburn definitions and declarations. Included
33 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)
55
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.
78 */
89
910
22 Operating system specific libburn definitions and declarations.
33 The macros defined here are used by libburn modules in order to
44 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+
66 */
77
88 #ifndef BURN_OS_H_INCLUDED
4040 #ifdef __linux
4141
4242
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) ------ */
4444 #include "os-linux.h"
4545
4646
00 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
11
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 */
39
410 #include <stdlib.h>
511 #include <unistd.h>
9399 fakesub[20] = 2;
94100 fakesub[12] = (d->toc->toc_entry[0].control << 4) +
95101 d->toc->toc_entry[0].adr;
102
103 #ifdef Libburn_no_crc_C
104 crc = 0; /* dummy */
105 #else
96106 crc = crc_ccitt(fakesub + 12, 10);
107 #endif
108
97109 fakesub[22] = crc >> 8;
98110 fakesub[23] = crc & 0xFF;
99111 write(o->subfd, fakesub, 96);
240252 }
241253 }
242254 crc = (*(sub + 22) << 8) + *(sub + 23);
255
256 #ifndef Libburn_no_crc_C
243257 if (crc != crc_ccitt(sub + 12, 10)) {
244258 burn_print(1, "sending error on %s %s\n",
245259 d->idata->vendor, d->idata->product);
248262 */
249263 burn_print(1, "crc mismatch in Q\n");
250264 }
265 #endif
266
251267 /* else process_q(d, sub + 12); */
252268 /*
253269 if (o->subfd != -1) write(o->subfd, sub, 96); */
00 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
11
22 /* 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
39
410 #include <string.h>
511 #include <unistd.h>
00 /* -*- 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
17
28 #ifndef __SBC
39 #define __SBC
00 /* -*- 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
17
28 #include <stdio.h>
39
2430
2531
2632 #ifdef Libburn_log_in_and_out_streaM
27 /* <<< ts A61031 */
33 /* ts A61031 */
2834 #include <sys/types.h>
2935 #include <sys/stat.h>
3036 #include <fcntl.h>
95101 int valid, shortage, curr, i, tr;
96102
97103 #ifdef Libburn_log_in_and_out_streaM
98 /* <<< ts A61031 */
104 /* ts A61031 */
99105 static int tee_fd= -1;
100106 if(tee_fd==-1)
101107 tee_fd= open("/tmp/libburn_sg_readin",
141147 track->sourcecount += valid;
142148
143149 #ifdef Libburn_log_in_and_out_streaM
144 /* <<< ts A61031 */
150 /* ts A61031 */
145151 if(tee_fd!=-1 && valid>0) {
146152 write(tee_fd, data + curr, valid);
147153 }
404410 q[7] = dec_to_bcd(d->toc_entry[track].pmin);
405411 q[8] = dec_to_bcd(d->toc_entry[track].psec);
406412 q[9] = dec_to_bcd(d->toc_entry[track].pframe);
413
414 #ifdef Libburn_no_crc_C
415 crc = 0; /* dummy */
416 #else
407417 crc = crc_ccitt(q, 10);
418 #endif
419
408420 q[10] = crc >> 8;
409421 q[11] = crc & 0xFF;
410422 d->toc_temp++;
501513 q[7] = dec_to_bcd(min);
502514 q[8] = dec_to_bcd(sec);
503515 q[9] = dec_to_bcd(frame);
516
517 #ifdef Libburn_no_crc_C
518 crc = 0; /* dummy */
519 #else
504520 crc = crc_ccitt(q, 10);
521 #endif
522
505523 q[10] = crc >> 8;
506524 q[11] = crc & 0xFF;
507525 }
621639 }
622640 q[0] = (control << 4) + qmode;
623641
642
643 #ifdef Libburn_no_crc_C
644 crc = 0; /* dummy */
645 #else
624646 crc = crc_ccitt(q, 10);
647 #endif
648
625649 q[10] = crc >> 8;
626650 q[11] = crc & 0xff;
627651 }
653677 unsigned char *data;
654678
655679 data = get_sector(o, t, t->mode);
656 if (!data)
680 if (data == NULL)
657681 return 0;
658682 /* ts A61010 */
659683 if (convert_data(o, t, t->mode, data) <= 0)
767791 out[15] = modebyte;
768792 }
769793 if (mode & BURN_MODE1) {
794
795 #ifdef Libburn_no_crc_C
796 crc = 0; /* dummy */
797 #else
770798 crc = crc_32(out, 2064);
799 #endif
800
771801 out[2064] = crc & 0xFF;
772802 crc >>= 8;
773803 out[2065] = crc & 0xFF;
00 /* -*- 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 */
16
27 #ifndef __SECTOR
38 #define __SECTOR
00 /* -*- 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
17
28 /*
39
00 /* -*- 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 */
16
27 #include <errno.h>
38 #include <unistd.h>
2328 #include <sys/disk.h> /* DIOCGMEDIASIZE */
2429
2530
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
2643 #include "transport.h"
2744 #include "drive.h"
2845 #include "sg.h"
428445
429446 out.cam = NULL;
430447 out.lock_fd = -1;
448 out.is_ahci = 0;
431449
432450 out.start_lba= -2000000000;
433451 out.end_lba= -2000000000;
520538 /* Adapter specific handles and data */
521539 out.cam = NULL;
522540 out.lock_fd = -1;
541 out.is_ahci = 0;
523542
524543 /* Adapter specific functions */
525544 out.grab = sg_grab;
671690 int sg_grab(struct burn_drive *d)
672691 {
673692 struct cam_device *cam;
693 char path_string[80];
674694
675695 if (mmc_function_spy(d, "sg_grab") <= 0)
676696 return 0;
693713 if (sg_lock(d, 0) <= 0)
694714 return 0;
695715 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
696728 d->released = 0;
697729 return 1;
698730 }
722754
723755 int sg_issue_command(struct burn_drive *d, struct command *c)
724756 {
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;
726759 union ccb *ccb;
727760 char buf[161];
728761 static FILE *fp = NULL;
770803 break;
771804 }
772805
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
773823 ccb->csio.cdb_len = c->oplen;
774824 memcpy(&ccb->csio.cdb_io.cdb_bytes, &c->opcode, c->oplen);
775825
800850 }
801851
802852 do {
853 memset(c->sense, 0, sizeof(c->sense));
803854 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) {
805921 libdax_msgs_submit(libdax_messenger,
806922 d->global_index, 0x0002010c,
807923 LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
815931 }
816932 /* XXX */
817933
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);
824934 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) {
826948 c->error = 1;
827949 {ret = 1; goto ex;}
828950 }
829951 switch (scsi_error(d, c->sense, 0)) {
830952 case RETRY:
831953 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 }
832961 break;
833962 case FAIL:
834963 done = 1;
00 /* -*- 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
17
28 /*
39
546552 */
547553 int sg_issue_command(struct burn_drive *d, struct command *c)
548554 {
549 int sense_valid = 0, i, usleep_time, timeout_ms;
555 int sense_valid = 0, i, usleep_time, timeout_ms, no_retry = 0;
550556 time_t start_time;
551557 driver_return_code_t i_status;
552558 unsigned int dxfer_len;
561567 return 0;
562568 }
563569 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);
573579
574580 memcpy(cdb.field, c->opcode, c->oplen);
575581 if (c->dir == TO_DRIVE) {
621627 }
622628 */
623629
624 if (!sense_valid) {
630 if ((!sense_valid) ||
631 ((c->sense[2] & 0x0f) == 0 && c->sense[12] == 0 &&
632 c->sense[13] == 0)) {
625633 memset(c->sense, 0, sizeof(c->sense));
626634 if (i_status != 0) { /* set dummy sense */
627 /*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/
635 /*LOGICAL UNIT NOT READY,
636 CAUSE NOT REPORTABLE*/
628637 c->sense[2] = 0x02;
629638 c->sense[12] = 0x04;
639 no_retry = 1;
630640 }
631641 } else
632642 c->sense[2] &= 15;
633643
634644 if (i_status != 0 ||
635645 (c->sense[2] || c->sense[12] || c->sense[13])) {
636 if (!c->retry) {
646 if (no_retry || !c->retry) {
637647 c->error = 1;
638648 goto ex;
639649 }
640650 switch (scsi_error(d, c->sense, 18)) {
641651 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 }
642659 break;
643660 case FAIL:
644661 c->error = 1;
833850
834851 #ifdef __linux
835852
836 /* Linux specific determination of block device size */
853 /* GNU/Linux specific determination of block device size */
837854 } else if(S_ISBLK(stbuf.st_mode)) {
838855 int open_mode = O_RDONLY, fd, ret;
839856
00 /* -*- 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
17
28
39 /* <<< ts A91112 : experiments to get better speed with USB
1016 This is the main operating system dependent SCSI part of libburn. It implements
1117 the transport level aspects of SCSI control and command i/o.
1218
13 Present implementation: Linux SCSI Generic (sg)
19 Present implementation: GNU/Linux SCSI Generic (sg)
1420
1521
1622 PORTING:
892898 #endif /* Libburn_drive_new_deaL */
893899
894900
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
896902 then on used used via generic SCSI as is done with (emulated) SCSI drives */
897903 static void ata_enumerate(void)
898904 {
14011407
14021408 /* PORTING: ------------------- non portable part --------------- */
14031409
1404 /* Operating system adapter is Linux Generic SCSI (sg) */
1410 /* Operating system adapter is GNU/Linux Generic SCSI (sg) */
14051411 /* Adapter specific handles and data */
14061412 out.fd = -1337;
14071413 out.sibling_count = 0;
14381444 */
14391445 int sg_id_string(char msg[1024], int flag)
14401446 {
1441 strcpy(msg, "internal Linux SG_IO adapter sg-linux");
1447 strcpy(msg, "internal GNU/Linux SG_IO adapter sg-linux");
14421448 return 1;
14431449 }
14441450
14831489
14841490
14851491 /** PORTING:
1486 In this Linux implementation, this function mirrors the enumeration
1492 In this GNU/Linux implementation, this function mirrors the enumeration
14871493 done in sg_enumerate and ata_enumerate(). It would be better to base those
14881494 functions on this sg_give_next_adr() but the situation is not inviting.
14891495 */
15801586 libburn's list of drives.
15811587 */
15821588 /** 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
15841590 one would rather implement this by a loop calling sg_give_next_adr().
15851591 If needed with your sg_give_next_adr() results, do a test for existence
15861592 and accessability. If burn activities are prone to external interference
16441650 int sg_grab(struct burn_drive *d)
16451651 {
16461652 int fd, os_errno= 0, ret;
1653 int max_tries = 3, tries = 0;
16471654
16481655 /* ts A60813 */
16491656 int open_mode = O_RDWR;
16771684 value -1 of open(2) war used. */
16781685 if(! burn_drive_is_open(d)) {
16791686
1687 try_open:;
16801688 /* ts A60821
16811689 <<< debug: for tracing calls which might use open drive fds */
16821690 mmc_function_spy(NULL, "sg_grab ----------- opening");
17101718 fcntl(fd, F_SETOWN, getpid());
17111719 d->released = 0;
17121720 return 1;
1713 }
1721 } else if (errno == EBUSY)
1722 goto drive_is_in_use;
17141723 libdax_msgs_submit(libdax_messenger, d->global_index, 0x00020003,
17151724 LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
17161725 "Could not grab drive", os_errno, 0);
17171726 return 0;
17181727
17191728 drive_is_in_use:;
1729 tries++;
1730 if (tries < max_tries) {
1731 usleep(2000000);
1732 goto try_open;
1733 }
17201734 libdax_msgs_submit(libdax_messenger, d->global_index,
17211735 0x00020003,
17221736 LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
19131927 switch (scsi_error(d, s.sbp, s.sb_len_wr)) {
19141928 case RETRY:
19151929 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 }
19161935 break;
19171936 case FAIL:
19181937 done = 1;
00
11 /* sg.c
22 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+
44 */
55
66
3333 static int intentional_compiler_warning(void)
3434 {
3535 int INTENTIONAL_COMPILER_WARNING_;
36 int Cannot_recognize_Linux_nor_FreeBSD_;
36 int Cannot_recognize_GNU_Linux_nor_FreeBSD_;
3737 int Have_to_use_dummy_MMC_transport_adapter_;
3838 int This_libburn_will_not_be_able_to_operate_on_real_CD_drives;
3939 int Have_to_use_dummy_MMC_transport_adapter;
40 int Cannot_recognize_Linux_nor_FreeBSD;
40 int Cannot_recognize_GNU_Linux_nor_FreeBSD;
4141 int INTENTIONAL_COMPILER_WARNING;
4242
4343 return(0);
00 /* -*- 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 */
14
25 #ifndef __SG
36 #define __SG
00 /* -*- 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
17
28 #include <stdlib.h>
39 #include <string.h>
00 /* -*- 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
17
28 /* scsi primary commands */
39
106112 int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text,
107113 int flag)
108114 {
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;
110117 char msg[320];
111118 unsigned char sense[14];
112119 enum response resp;
136143 /* media change notice = try again */
137144 goto slumber;
138145
146 handle_error:;
139147 /* ts A90213 */
140148 sprintf(msg,
141149 "Asynchronous SCSI error on %s: ", cmd_text);
150158 msg, 0, 0);
151159 d->cancel = 1;
152160 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
154178 slumber:;
155179 usleep(100000);
156180 }
954978 *key= *asc= *ascq= -1;
955979
956980 if (senselen<=0 || senselen>2)
957 *key = sense[2];
981 *key = sense[2] & 0x0f;
958982 if (senselen<=0 || senselen>12)
959983 *asc = sense[12];
960984 if (senselen<=0 || senselen>13)
961985 *ascq = sense[13];
962986
963 sprintf(msg, "[%X %2.2X %2.2X] ", (*key) & 0xf, *asc, *ascq);
987 sprintf(msg, "[%X %2.2X %2.2X] ", *key, *asc, *ascq);
964988 msg= msg + strlen(msg);
965989
966990 burn_print(12, "CONDITION: 0x%x 0x%x 0x%x on %s %s\n",
975999 sprintf(msg, "Not ready");
9761000 return RETRY;
9771001 case 0x04:
978 sprintf(msg,
1002 if (*ascq == 1)
1003 sprintf(msg,
9791004 "Logical unit is in the process of becoming ready");
1005 else
1006 sprintf(msg, "Logical unit is not ready");
9801007 return RETRY;
9811008 case 0x08:
9821009 if (*key != 4)
00 /* -*- 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
17
28 #ifndef __SPC
39 #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 */
05
16 /* ts A61008 */
27 /* #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
06 #ifndef BURN__STRUCTURE_H
17 #define BURN__STRUCTURE_H
28
00 /* -*- 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
16
27 /* ts A61008 */
38 /* #include <a ssert.h> */
129134 } else {
130135
131136 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
133138 predict the exact dxfer_size without knowing the sector type.
134139 mem.sectors = 1;
135140 d->read_sectors(d, lba, mem.sectors, &o, &mem);
00 /* -*- 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
16
27 #ifndef __TOC_H
38 #define __TOC_H
00 /* -*- 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
17
28 #ifndef __TRANSPORT
39 #define __TRANSPORT
305311 /* ts A70929 */
306312 pid_t thread_pid;
307313 int thread_pid_valid;
314 /* ts B00225 */
315 pthread_t thread_tid;
308316
309317
310318 /* 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
06 #include <string.h>
17
28 /* ts A61008 */
00 /* -*- 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
17
28 #include <unistd.h>
39 #include <signal.h>
3238 #include "libburn.h"
3339 #include "drive.h"
3440 #include "transport.h"
35 #include "crc.h"
3641 #include "debug.h"
3742 #include "init.h"
3843 #include "toc.h"
936941
937942 d->cancel = 0;
938943
944 #ifdef Libburn_reset_progress_asynC
945 /* <<< This is now done in async.c */
939946 /* init progress before showing the state */
940947 d->progress.session = 0;
941948 d->progress.sessions = disc->sessions;
950957 d->progress.sectors = 0;
951958 d->progress.sector = 0;
952959 d->progress.track = 0;
960 #endif /* Libburn_reset_progress_asynC */
953961
954962 /* ts A61023 */
955963 d->progress.buffer_capacity = 0;
12621270
12631271 /* ts A91114 : EXPERIMENTAL, NOT COMPLETELY IMPLEMENTED
12641272
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.
12671275 With 64 KB chunks it is 20% faster than the competitors.
12681276 No heavy CPU load is visible but there might be subtle race conditions in
12691277 the USB driver which work better with shorter time gaps between WRITE
13031311 unsigned char *data = out->data;
13041312
13051313 #ifdef Libburn_log_in_and_out_streaM
1306 /* <<< ts A61031 */
1314 /* ts A61031 */
13071315 static int tee_fd= -1;
13081316 if(tee_fd==-1)
13091317 tee_fd= open("/tmp/libburn_sg_readin",
19932001 burn_drive_mark_unready(d);
19942002 burn_drive_inquire_media(d);
19952003
1996 d->busy = BURN_DRIVE_IDLE;
2004 /* <<< d->busy = BURN_DRIVE_IDLE; */
19972005 return ret;
19982006 early_failure:;
19992007 return 0;
22562264 prev_sync_sector = d->progress.sector;
22572265 if (!o->simulate)
22582266 burn_stdio_sync_cache(d->stdio_fd, d, 1);
2267 }
2268 if ((d->progress.sector % 512) == 0)
22592269 burn_stdio_slowdown(d, &prev_time, 512 * 2, 0);
2260 }
22612270 }
22622271
22632272 /* Pad up buffer to next full o->obs (usually 32 kB) */
23202329 /* update media state records */
23212330 burn_drive_mark_unready(d);
23222331
2323 d->busy = BURN_DRIVE_IDLE;
2332 /* <<< d->busy = BURN_DRIVE_IDLE; */
23242333 return ret;
23252334 }
23262335
23962405 goto ex;
23972406 }
23982407
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 */
24002409 /* ts A80414 : might need 64 kiB for BD-RE streaming */
24012410 /* buffer flush trigger for sector.c:get_sector() */
24022411 o->obs = Libburn_cd_obS;
25572566 burn_drive_inquire_media(d);
25582567
25592568 burn_print(1, "done\n");
2560 d->busy = BURN_DRIVE_IDLE;
2569 /* <<< d->busy = BURN_DRIVE_IDLE; */
25612570
25622571 /* ts A61012 : This return was traditionally missing. I suspect this
25632572 to have caused Cdrskin_eject() failures */
25722581 LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
25732582 "Burn run failed", 0, 0);
25742583 d->cancel = 1;
2575 d->busy = BURN_DRIVE_IDLE;
2584 /* <<< d->busy = BURN_DRIVE_IDLE; */
25762585 ex:;
25772586 d->do_stream_recording = 0;
25782587 if (d->buffer != NULL)
00 /* -*- 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
17
28 #ifndef BURN__WRITE_H
39 #define BURN__WRITE_H
2525 approaches are shown here in application functions:
2626 libburner_aquire_by_adr() demonstrates usage as of cdrecord traditions
2727 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
2929 libburner_blank_disc()
3030 or you can format a DVD-RW to profile "Restricted Overwrite" (needed once)
3131 or an unused BD to default size with spare blocks
3535 When everything is done, main() releases the drive and shuts down libburn:
3636 burn_drive_release();
3737 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()
3846
39 */
40 /*
4147 Applications must use 64 bit off_t. E.g. by defining
4248 #define _LARGEFILE_SOURCE
4349 #define _FILE_OFFSET_BITS 64
309315 "FATAL : Media is not of erasable type\n");
310316 return 0;
311317 }
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"));
314322 burn_disc_erase(drive, blank_fast);
323
315324 sleep(1);
316325 while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
317326 if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
320329 printf("Blanking ( %.1f%% done )\n", percent);
321330 sleep(1);
322331 }
332 if (burn_is_aborting(0) > 0)
333 return -1;
334 /* Back to synchronous handling */
335 burn_set_signal_handling("libburner : ", NULL, 0);
323336 printf("Done\n");
324337 return 1;
325338 }
372385 fprintf(stderr, "FATAL: Can only format DVD-RW or BD\n");
373386 return 0;
374387 }
388 burn_set_signal_handling("libburner : ", NULL, 0x30);
375389
376390 printf("Beginning to format media.\n");
377391 burn_disc_format(drive, size, format_flag);
384398 printf("Formatting ( %.1f%% done )\n", percent);
385399 sleep(1);
386400 }
401 if (burn_is_aborting(0) > 0)
402 return -1;
403 burn_set_signal_handling("libburner : ", NULL, 0);
387404 burn_disc_get_profile(drive_list[0].drive, &current_profile,
388405 current_profile_name);
389406 if (current_profile == 0x14 || current_profile == 0x13)
529546 fprintf(stderr, "Reasons given:\n%s\n", reasons);
530547 return 0;
531548 }
549 burn_set_signal_handling("libburner : ", NULL, 0x30);
532550
533551 printf("Burning starts. With e.g. 4x media expect up to a minute of zero progress.\n");
534552 start_time = time(0);
576594 }
577595 burn_session_free(session);
578596 burn_disc_free(target_disc);
597 if (burn_is_aborting(0) > 0)
598 return -1;
579599 if (multi && current_profile != 0x1a && current_profile != 0x13 &&
580600 current_profile != 0x12 && current_profile != 0x43)
581601 /* not with DVD+RW, formatted DVD-RW, DVD-RAM, BD-RE */
711731 {
712732 int ret;
713733
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
714741 ret = libburner_setup(argc, argv);
715742 if (ret)
716743 exit(ret);
727754 /* Print messages of severity SORRY or more directly to stderr */
728755 burn_msgs_set_severities("NEVER", "SORRY", "libburner : ");
729756
730 /* Activate the default signal handler which eventually will try to
757 /* Activate the synchronous signal handler which eventually will try to
731758 properly shutdown drive and library on aborting events. */
732759 burn_set_signal_handling("libburner : ", NULL, 0);
733760
761788 burn_drive_release(drive_list[driveno].drive, 0);
762789
763790 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 }
764796 /* This app does not bother to know about exact scan state.
765797 Better to accept a memory leak here. We are done anyway. */
766798 /* burn_drive_info_free(drive_list); */
767
768799 burn_finish();
769800 exit(ret);
770801 }
00 #define BURN_MAJOR_VERSION 0
1 #define BURN_MINOR_VERSION 7
2 #define BURN_MICRO_VERSION 6
1 #define BURN_MINOR_VERSION 8
2 #define BURN_MICRO_VERSION 0