Compare commits
54 Commits
ZeroSevenF
...
ZeroSevenS
Author | SHA1 | Date | |
---|---|---|---|
335b2b0ffc | |||
3505b761f4 | |||
cbb9125bd9 | |||
8385908bb3 | |||
e081477a8f | |||
da1d260753 | |||
95865ee34d | |||
eb8b8faa3b | |||
39fd8b922d | |||
7ead54c8b9 | |||
2a85fc7d91 | |||
1e42a76415 | |||
734759190a | |||
16ffa10831 | |||
cdfc357064 | |||
df612390d3 | |||
77971f3680 | |||
5c75d583d7 | |||
2ff03841d7 | |||
a88745c82e | |||
96167b3d8e | |||
1ca38962d4 | |||
80bcabfd57 | |||
d9239aeafc | |||
758a197d06 | |||
ed972271ec | |||
0544ac8cd3 | |||
12a2be8d86 | |||
509db68d82 | |||
00ed59f34e | |||
2b8e8c2521 | |||
e3ff0bb0f6 | |||
8efb24ca6d | |||
d53c5db98e | |||
0320b7bf2a | |||
cee271f9cb | |||
c2a3e3677d | |||
fc3445215b | |||
4ce8bd45cf | |||
08169d63bc | |||
e13b6369ba | |||
d3988dd74b | |||
ef42052900 | |||
240afa7c3a | |||
5b72e5d06e | |||
4aa08e32ff | |||
eb34561262 | |||
dd85e37ac8 | |||
e566340261 | |||
7e86db207c | |||
a30ecd1abb | |||
45b28b6c31 | |||
afedcdd72b | |||
b8a98e0728 |
@ -1,12 +1,12 @@
|
||||
Derek Foreman <derek@signalmarketing.com> and Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
Mario Danic <mario.danic@gmail.com>, Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2009 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 as
|
||||
published by the Free Software Foundation.
|
||||
it under the terms of the GNU General Public License version 2 or later
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
|
11
Makefile.am
11
Makefile.am
@ -70,9 +70,6 @@ libburn_libburn_la_SOURCES = \
|
||||
libburn/write.h \
|
||||
version.h
|
||||
|
||||
## libburn/lec.c \
|
||||
## libburn/lec.h \
|
||||
|
||||
## libburn/sg-@ARCH@.c \
|
||||
|
||||
libinclude_HEADERS = \
|
||||
@ -113,9 +110,9 @@ test_structest_CPPFLAGS = -Ilibburn
|
||||
test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
test_structest_SOURCES = test/structest.c
|
||||
|
||||
## cdrskin construction site - ts A60816 - A91012
|
||||
## cdrskin construction site - ts A60816 - B00122
|
||||
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_3
|
||||
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_6
|
||||
|
||||
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
|
||||
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
|
||||
@ -202,10 +199,14 @@ EXTRA_DIST = \
|
||||
cdrskin/wiki_plain.txt \
|
||||
cdrskin/cleanup.h \
|
||||
cdrskin/cleanup.c \
|
||||
libburn/os-dummy.h \
|
||||
libburn/os-freebsd.h \
|
||||
libburn/os-linux.h \
|
||||
libburn/os-libcdio.h \
|
||||
libburn/sg-dummy.c \
|
||||
libburn/sg-freebsd.c \
|
||||
libburn/sg-linux.c \
|
||||
libburn/sg-libcdio.c \
|
||||
COPYING \
|
||||
NEWS \
|
||||
ChangeLog \
|
||||
|
60
README
60
README
@ -6,12 +6,12 @@ This all is under GPL.
|
||||
------------------------------------------------------------------------------
|
||||
libburn-project.org
|
||||
By Mario Danic <mario.danic@gmail.com> and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2009 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
Still containing parts of Libburn. By Derek Foreman <derek@signalmarketing.com>
|
||||
and Ben Jansens <xor@orodu.net>
|
||||
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
||||
http://files.libburnia-project.org/releases/libburn-0.7.2.pl00.tar.gz
|
||||
http://files.libburnia-project.org/releases/libburn-0.7.6.pl00.tar.gz
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
@ -19,10 +19,10 @@ Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
|
||||
|
||||
From tarball
|
||||
|
||||
Obtain libburn-0.7.2.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain libburn-0.7.6.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf libburn-0.7.2.pl00.tar.gz
|
||||
cd libburn-0.7.2
|
||||
tar xzf libburn-0.7.6.pl00.tar.gz
|
||||
cd libburn-0.7.6
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
@ -72,6 +72,10 @@ configure time by:
|
||||
--enable-dvd-obs-64k
|
||||
This may be combined with above --enable-track-src-odirect .
|
||||
|
||||
Alternatively the transport of SCSI commands can be done via libcdio-0.83.
|
||||
You may install it and re-run libburn's ./configure with option
|
||||
--enable-libcdio
|
||||
|
||||
Make sure to re-compile all source files after running ./configure
|
||||
make clean ; make
|
||||
make install
|
||||
@ -185,8 +189,8 @@ Applications must use 64 bit off_t. E.g. by defining
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
or take special precautions to interface with the libraries by 64 bit integers
|
||||
where the .h files prescribe off_t. Not to use 64 bit file i/o will keep the
|
||||
application from producing and processing ISO images of more than 2 GB size.
|
||||
where the .h files prescribe off_t. To reduce libburn's off_t size to 32 bit
|
||||
will keep it from processing tracks of more than 2 GB size.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
@ -472,12 +476,31 @@ Project history as far as known to me:
|
||||
- 12 Nov 2009 libburn-0.7.2.pl01 works around problems with Pioneer DVR-216D.
|
||||
DVD-R runs made the drive stuck. Ejecting the tray did not work properly.
|
||||
|
||||
- 06 Dec 2009 libburn-0.7.4 works around problems with newer DVD burners,
|
||||
provides throughput enhancements with hampered busses on Linux, and new
|
||||
API calls to log SCSI commands and to control the libburn fifo.
|
||||
|
||||
- 09 Dec 2009 libisoburn-0.4.6 allows performance tuning of output to DVD
|
||||
drives or disk files.
|
||||
|
||||
- 26 Dec 2009 libburn-0.7.4.pl01 fixes the release tarball which was lacking
|
||||
the files of the generic system adapter for X/Open.
|
||||
|
||||
- 29 Dec 2009 Our project received a donation for purchasing a fine small
|
||||
computer which shall serve as OS farm for development and support.
|
||||
|
||||
- 20 Jan 2010 Version 0.6.26 of libisofs fixes minor bugs and shall enhance
|
||||
portability.
|
||||
|
||||
- 22 Jan 2010 libburn-0.7.6 has an improved system adapter for FreeBSD,
|
||||
fixes bugs about the generic X/Open system adapter, and allows to use
|
||||
libcdio >= 0.83 as SCSI transport facility.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation. To be exact: version 2 of that License.
|
||||
it under the terms of the GNU General Public License version 2 or later
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@ -495,16 +518,16 @@ other copyrighted code has been replaced by ours and by copyright-free
|
||||
contributions of our friends:
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
We, the copyright holders, agree on the interpretation that
|
||||
dynamical linking of our libraries constitutes "use of" and
|
||||
not "derivation from" our work in the sense of GPL, provided
|
||||
those libraries are compiled from our unaltered code.
|
||||
We, the copyright holders, agree on the interpretation that dynamical linking
|
||||
of our libraries constitutes "use of" and not "derivation from" our work in
|
||||
the sense of GPL, provided those libraries are compiled from our unaltered
|
||||
code or from altered code published under GPL.
|
||||
|
||||
Thus you may link our libraries dynamically with applications
|
||||
which are not under GPL. You may distribute our libraries and
|
||||
application tools in binary form, if you fulfill the usual
|
||||
condition of GPL to offer a copy of the source code -altered
|
||||
or unaltered- under GPL.
|
||||
So we will not raise legal protest if you link our libraries dynamically with
|
||||
applications which are not under GPL, or if you distribute our libraries
|
||||
and application tools in binary form, as long as you fulfill the usual
|
||||
condition of GPL to offer a copy of their source code -altered or unaltered-
|
||||
under GPL.
|
||||
|
||||
We ask you politely to use our work in open source spirit
|
||||
and with the due reference to the entire open source community.
|
||||
@ -521,4 +544,5 @@ means to qualify for GPL.
|
||||
For now we are firmly committed to maintain one single license: GPL.
|
||||
|
||||
signed: Mario Danic, Thomas Schmitt
|
||||
Agreement joined later by: Vreixo Formoso
|
||||
|
||||
|
10
acinclude.m4
10
acinclude.m4
@ -6,16 +6,20 @@ AC_DEFUN([TARGET_SHIZZLE],
|
||||
AC_MSG_CHECKING([target operating system])
|
||||
|
||||
|
||||
case $target in
|
||||
*-*-linux*)
|
||||
case $target_os in
|
||||
linux*)
|
||||
ARCH=linux
|
||||
LIBBURN_ARCH_LIBS=
|
||||
;;
|
||||
*-*-freebsd*)
|
||||
freebsd*)
|
||||
ARCH=freebsd
|
||||
LIBBURN_ARCH_LIBS=-lcam
|
||||
LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig
|
||||
;;
|
||||
kfreebsd*-gnu)
|
||||
ARCH=freebsd
|
||||
LIBBURN_ARCH_LIBS=-lcam
|
||||
;;
|
||||
*)
|
||||
ARCH=
|
||||
LIBBURN_ARCH_LIBS=
|
||||
|
@ -4,17 +4,18 @@
|
||||
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
|
||||
Integrated sub project of libburnia-project.org but also published via:
|
||||
http://scdbackup.sourceforge.net/cdrskin_eng.html
|
||||
http://scdbackup.sourceforge.net/cdrskin-0.7.3.tar.gz
|
||||
http://scdbackup.sourceforge.net/cdrskin-0.7.6.pl00.tar.gz
|
||||
|
||||
Copyright (C) 2006-2009 Thomas Schmitt, provided under GPL version 2.
|
||||
Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
cdrskin is a limited cdrecord compatibility wrapper which allows to use
|
||||
most of the libburn features from the command line.
|
||||
|
||||
Currently it is supported on Linux with kernels >= 2.4 and on FreeBSD versions
|
||||
with ATAPI/CAM support enabled in the kernel, see atapicam(4).
|
||||
Currently it is supported on Linux with kernels >= 2.4 and on FreeBSD.
|
||||
IDE drives under Linux 2.4. need kernel module ide-scsi.
|
||||
ATA and SATA drives under FreeBSD need kernel module atapicam.
|
||||
On other X/Open compliant systems there will only be emulated drives, but no
|
||||
direct MMC operation on real CD/DVD/BD drives.
|
||||
|
||||
@ -24,10 +25,10 @@ By using this software you agree to the disclaimer at the end of this text
|
||||
|
||||
Compilation, First Glimpse, Installation
|
||||
|
||||
Obtain cdrskin-0.7.3.tar.gz, take it to a directory of your choice and do:
|
||||
Obtain cdrskin-0.7.6.pl00.tar.gz, take it to a directory of your choice and do:
|
||||
|
||||
tar xzf cdrskin-0.7.3.tar.gz
|
||||
cd cdrskin-0.7.3
|
||||
tar xzf cdrskin-0.7.6.pl00.tar.gz
|
||||
cd cdrskin-0.7.6
|
||||
|
||||
Within that directory execute:
|
||||
|
||||
@ -412,6 +413,10 @@ such a situation. 64k can be made default at compile time by
|
||||
It can also be enabled at configure time by
|
||||
./configure ... --enable-dvd-obs-64k ...
|
||||
|
||||
Alternatively the transport of SCSI commands can be done via libcdio-0.83.
|
||||
You may install it and re-run libburn's ./configure with option
|
||||
--enable-libcdio
|
||||
|
||||
You may get a (super fat) statically linked binary by :
|
||||
cdrskin/compile_cdrskin.sh -static
|
||||
if your system supports static linking, at all. This will not help with kernels
|
||||
@ -455,7 +460,7 @@ contributions in a due way.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
it under the terms of the GNU General Public License version 2 or later
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@ -471,7 +476,7 @@ contributions in a due way.
|
||||
Based on and sub project of:
|
||||
libburnia-project.org
|
||||
By Mario Danic <mario.danic@gmail.com> and Thomas Schmitt <scdbackup@gmx.net>
|
||||
Copyright (C) 2006-2009 Mario Danic, Thomas Schmitt
|
||||
Copyright (C) 2006-2010 Mario Danic, Thomas Schmitt
|
||||
|
||||
libburnia-project.org is inspired by and in other components still containing
|
||||
parts of
|
||||
@ -482,34 +487,3 @@ See toplevel README for an overview of the current copyright situation in
|
||||
libburnia-project.org.
|
||||
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
cdrskin is currently copyright Thomas Schmitt only.
|
||||
It adopts the following commitment by the toplevel copyright holders:
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
We, the copyright holders, agree on the interpretation that
|
||||
dynamical linking of our libraries constitutes "use of" and
|
||||
not "derivation from" our work in the sense of GPL, provided
|
||||
those libraries are compiled from our unaltered code.
|
||||
|
||||
Thus you may link our libraries dynamically with applications
|
||||
which are not under GPL. You may distribute our libraries and
|
||||
application tools in binary form, if you fulfill the usual
|
||||
condition of GPL to offer a copy of the source code -altered
|
||||
or unaltered- under GPL.
|
||||
|
||||
We ask you politely to use our work in open source spirit
|
||||
and with the due reference to the entire open source community.
|
||||
|
||||
If there should really arise the case where above clarification
|
||||
does not suffice to fulfill a clear and neat request in open source
|
||||
spirit that would otherwise be declined for mere formal reasons,
|
||||
only in that case we will duely consider to issue a special license
|
||||
covering only that special case.
|
||||
It is the open source idea of responsible freedom which will be
|
||||
decisive and you will have to prove that you exhausted all own
|
||||
means to qualify for GPL.
|
||||
|
||||
For now we are firmly committed to maintain one single license: GPL.
|
||||
|
||||
signed for cdrskin: Thomas Schmitt
|
||||
|
@ -38,7 +38,7 @@ original="./libburn_svn_release.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-release"
|
||||
|
||||
skin_release="0.7.2"
|
||||
skin_release="0.7.6"
|
||||
patch_level=".pl00"
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
@ -38,7 +38,7 @@ original="./libburn_svn.tgz"
|
||||
# My changes are in $changes , mainly in $changes/cdrskin
|
||||
changes="./libburn-develop"
|
||||
|
||||
skin_release="0.7.3"
|
||||
skin_release="0.7.7"
|
||||
patch_level=""
|
||||
skin_rev="$skin_release""$patch_level"
|
||||
|
@ -2,7 +2,7 @@
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH CDRSKIN 1 "Nov 16, 2009"
|
||||
.TH CDRSKIN 1 "Jan 19, 2010"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -1242,7 +1242,7 @@ cdrskin dev=0,1,0 -checkdrive
|
||||
.br
|
||||
cdrskin dev=ATA:1,0,0 -v -atip
|
||||
.br
|
||||
cdrskin dev=/dev/hdc -toc
|
||||
cdrskin dev=/dev/hdc -minfo
|
||||
.SS
|
||||
.B Prepare CD-RW or DVD-RW for re-use, DVD-RAM or BD-RE for first use:
|
||||
.br
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/*
|
||||
cdrskin.c , Copyright 2006-2009 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2. See future commitment below.
|
||||
cdrskin.c , Copyright 2006-2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 or later. See future commitment below.
|
||||
|
||||
A cdrecord compatible command line interface for libburn.
|
||||
|
||||
@ -88,7 +88,7 @@ or
|
||||
|
||||
/** The official program version */
|
||||
#ifndef Cdrskin_prog_versioN
|
||||
#define Cdrskin_prog_versioN "0.7.3"
|
||||
#define Cdrskin_prog_versioN "0.7.6"
|
||||
#endif
|
||||
|
||||
/** The official libburn interface revision to use.
|
||||
@ -101,7 +101,7 @@ or
|
||||
#define Cdrskin_libburn_minoR 7
|
||||
#endif
|
||||
#ifndef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_micrO 3
|
||||
#define Cdrskin_libburn_micrO 6
|
||||
#endif
|
||||
|
||||
|
||||
@ -135,49 +135,43 @@ or
|
||||
#endif /* Cdrskin_libburn_cvs_A60220_tS */
|
||||
|
||||
|
||||
#ifdef Cdrskin_libburn_0_7_2
|
||||
#define Cdrskin_libburn_versioN "0.7.2"
|
||||
#ifdef Cdrskin_libburn_0_7_6
|
||||
#define Cdrskin_libburn_versioN "0.7.6"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
#endif /* Cdrskin_libburn_0_7_2 */
|
||||
#endif /* Cdrskin_libburn_0_7_6 */
|
||||
|
||||
#ifdef Cdrskin_libburn_0_7_3
|
||||
#define Cdrskin_libburn_versioN "0.7.3"
|
||||
#ifdef Cdrskin_libburn_0_7_7
|
||||
#define Cdrskin_libburn_versioN "0.7.7"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
|
||||
/* Place novelty switch macros here.
|
||||
Move them down to Cdrskin_libburn_from_pykix_svN on version leap
|
||||
*/
|
||||
|
||||
/* burn_write_opts_set_dvd_obs() and burn_write_opts_set_stdio_fsync()
|
||||
*/
|
||||
#define Cdrskin_libburn_has_fsync_obS 1
|
||||
|
||||
/* >>> do not forget to remove Libburn_has_open_trac_srC at release of 0.7.4 */
|
||||
|
||||
|
||||
#endif /* Cdrskin_libburn_0_7_3 */
|
||||
#endif /* Cdrskin_libburn_0_7_7 */
|
||||
|
||||
#ifndef Cdrskin_libburn_versioN
|
||||
#define Cdrskin_libburn_0_7_2
|
||||
#define Cdrskin_libburn_versioN "0.7.2"
|
||||
#define Cdrskin_libburn_0_7_6
|
||||
#define Cdrskin_libburn_versioN "0.7.6"
|
||||
#define Cdrskin_libburn_from_pykix_svN 1
|
||||
#endif
|
||||
|
||||
#ifdef Cdrskin_libburn_0_7_2
|
||||
#ifdef Cdrskin_libburn_0_7_6
|
||||
#undef Cdrskin_libburn_majoR
|
||||
#undef Cdrskin_libburn_minoR
|
||||
#undef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_majoR 0
|
||||
#define Cdrskin_libburn_minoR 7
|
||||
#define Cdrskin_libburn_micrO 2
|
||||
#define Cdrskin_libburn_micrO 6
|
||||
#endif
|
||||
#ifdef Cdrskin_libburn_0_7_3
|
||||
#ifdef Cdrskin_libburn_0_7_7
|
||||
#undef Cdrskin_libburn_majoR
|
||||
#undef Cdrskin_libburn_minoR
|
||||
#undef Cdrskin_libburn_micrO
|
||||
#define Cdrskin_libburn_majoR 0
|
||||
#define Cdrskin_libburn_minoR 7
|
||||
#define Cdrskin_libburn_micrO 3
|
||||
#define Cdrskin_libburn_micrO 7
|
||||
#endif
|
||||
|
||||
|
||||
@ -1463,14 +1457,12 @@ int Cdrtrack_open_source_path(struct CdrtracK *track, int *fd, int flag)
|
||||
if(is_wav==-3)
|
||||
return(0);
|
||||
if(is_wav==0) {
|
||||
#ifdef Libburn_has_open_trac_srC
|
||||
if(track->track_type != BURN_MODE1 ||
|
||||
(track->cdxa_conversion & 0x7fffffff))
|
||||
flag&= ~4; /* Better avoid O_DIRECT with odd sectors */
|
||||
if(flag & 4)
|
||||
*fd= burn_os_open_track_src(track->source_path, O_RDONLY, 0);
|
||||
else
|
||||
#endif
|
||||
*fd= open(track->source_path, O_RDONLY);
|
||||
}
|
||||
if(*fd==-1) {
|
||||
@ -2880,11 +2872,9 @@ set_dev:;
|
||||
printf(
|
||||
" --drive_scsi_exclusive try to exclusively reserve device files\n");
|
||||
printf(" /dev/srN, /dev/scdM, /dev/stK of drive.\n");
|
||||
#ifdef Cdrskin_libburn_has_fsync_obS
|
||||
printf(" dvd_obs=\"default\"|number\n");
|
||||
printf(
|
||||
" set number of bytes per DVD/BD write: 32k or 64k\n");
|
||||
#endif
|
||||
#ifdef Cdrskin_burn_drive_eject_brokeN
|
||||
printf(
|
||||
" eject_device=<path> set the device address for command eject\n");
|
||||
@ -2935,13 +2925,11 @@ set_dev:;
|
||||
printf(
|
||||
" byte addresses below that number.\n");
|
||||
#endif
|
||||
#ifdef Cdrskin_libburn_has_fsync_obS
|
||||
printf(" stdio_sync=\"default\"|\"off\"|number\n");
|
||||
printf(
|
||||
" set number of bytes after which to force output\n");
|
||||
printf(
|
||||
" to drives with prefix \"stdio:\".\n");
|
||||
#endif
|
||||
|
||||
#ifdef Cdrskin_allow_libburn_taO
|
||||
printf(
|
||||
@ -3155,7 +3143,17 @@ set_severities:;
|
||||
int major, minor, micro;
|
||||
|
||||
printf(
|
||||
"Cdrecord 2.01-Emulation Copyright (C) 2006-2009, see libburnia-project.org\n");
|
||||
"Cdrecord 2.01-Emulation Copyright (C) 2006-2010, see libburnia-project.org\n");
|
||||
if(o->fallback_program[0]) {
|
||||
char *hargv[2];
|
||||
|
||||
printf("Fallback program : %s\n",o->fallback_program);
|
||||
printf("Fallback version :\n");
|
||||
hargv[0]= argv[0];
|
||||
hargv[1]= "-version";
|
||||
Cdrpreskin_fallback(o,2,hargv,1); /* dirty never come back */
|
||||
}
|
||||
printf("System adapter : %s\n", burn_scsi_transport_id(0));
|
||||
printf("libburn interface : %d.%d.%d\n",
|
||||
burn_header_version_major, burn_header_version_minor,
|
||||
burn_header_version_micro);
|
||||
@ -3171,15 +3169,6 @@ set_severities:;
|
||||
|
||||
printf("Version timestamp : %s\n",Cdrskin_timestamP);
|
||||
printf("Build timestamp : %s\n",Cdrskin_build_timestamP);
|
||||
if(o->fallback_program[0]) {
|
||||
char *hargv[2];
|
||||
|
||||
printf("Fallback program : %s\n",o->fallback_program);
|
||||
printf("Fallback version :\n");
|
||||
hargv[0]= argv[0];
|
||||
hargv[1]= "-version";
|
||||
Cdrpreskin_fallback(o,2,hargv,1); /* dirty never come back */
|
||||
}
|
||||
{ret= 2; goto ex;}
|
||||
|
||||
} else if(strcmp(argv[i],"-waiti")==0) {
|
||||
@ -3196,7 +3185,9 @@ set_severities:;
|
||||
final_checks:;
|
||||
if(flag&1)
|
||||
goto ex;
|
||||
|
||||
if(o->verbosity >= Cdrskin_verbose_debuG)
|
||||
ClN(fprintf(stderr,
|
||||
"cdrskin: DEBUG : Using %s\n", burn_scsi_transport_id(0)));
|
||||
if(o->do_waiti) {
|
||||
fprintf(stderr,
|
||||
"cdrskin: Option -waiti pauses program until input appears at stdin\n");
|
||||
@ -7218,7 +7209,6 @@ burn_failed:;
|
||||
#ifdef Cdrskin_libburn_has_stream_recordinG
|
||||
burn_write_opts_set_stream_recording(o, skin->stream_recording_is_set);
|
||||
#endif
|
||||
#ifdef Cdrskin_libburn_has_fsync_obS
|
||||
#ifdef Cdrskin_dvd_obs_default_64K
|
||||
if(skin->dvd_obs == 0)
|
||||
burn_write_opts_set_dvd_obs(o, 64 * 1024);
|
||||
@ -7226,7 +7216,6 @@ burn_failed:;
|
||||
#endif
|
||||
burn_write_opts_set_dvd_obs(o, skin->dvd_obs);
|
||||
burn_write_opts_set_stdio_fsync(o, skin->stdio_sync);
|
||||
#endif /* Cdrskin_libburn_has_fsync_obS */
|
||||
|
||||
if(skin->dummy_mode) {
|
||||
fprintf(stderr,
|
||||
|
@ -50,7 +50,8 @@ via SCSI, PATA (aka IDE, ATA), USB, or SATA.
|
||||
<DD>With kernel 2.4 an ATA drive has to be under ide-scsi emulation.</DD>
|
||||
<DD>With kernel 2.6 the drive should not be under ide-scsi.</DD>
|
||||
<DT>or FreeBSD (with libc, of course) :</DT>
|
||||
<DD>ATAPI/CAM support has to be enabled in the kernel, see atapicam(4).</DD>
|
||||
<DD>ATA and SATA drives need atapicam running.</DD>
|
||||
<DD>libcam has to be installed.</DD>
|
||||
<DT>libpthread</DT>
|
||||
<DD>is supposed to be a standard system component.</DD>
|
||||
</DL>
|
||||
@ -61,7 +62,7 @@ via SCSI, PATA (aka IDE, ATA), USB, or SATA.
|
||||
GPL software included:<BR>
|
||||
</H2>
|
||||
<DL>
|
||||
<DT>libburn-0.7.2</DT>
|
||||
<DT>libburn-0.7.6</DT>
|
||||
<DD>(founded by Derek Foreman and Ben Jansens,
|
||||
developed and maintained since August 2006 by
|
||||
Thomas Schmitt from team of libburnia-project.org)
|
||||
@ -193,8 +194,8 @@ Standalone ISO 9660 multi-session CD/DVD/BD tool
|
||||
<P>
|
||||
<DL>
|
||||
<DT>Download as source code (see README):</DT>
|
||||
<DD><A HREF="cdrskin-0.7.2.pl01.tar.gz">cdrskin-0.7.2.pl01.tar.gz</A>
|
||||
(780 KB).
|
||||
<DD><A HREF="cdrskin-0.7.6.pl00.tar.gz">cdrskin-0.7.6.pl00.tar.gz</A>
|
||||
(810 KB).
|
||||
</DD>
|
||||
<DD>
|
||||
The cdrskin tarballs are source code identical with libburn releases
|
||||
@ -243,63 +244,52 @@ cdrskin_0.4.2.pl00-x86-suse9_0-static.tar.gz</A>, (310 KB), -static compiled,
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
Enhancements towards previous stable version cdrskin-0.7.0.pl00:
|
||||
Enhancements towards previous stable version cdrskin-0.7.4.pl00:
|
||||
<UL>
|
||||
<LI>Better interpretation of options -mode2, -xa, -xa1, -xa2</LI>
|
||||
<LI>New option --xa1-ignore</LI>
|
||||
<LI>New -atip report lines "Product Id:" and "Producer:"</LI>
|
||||
<LI>Emulation of some -minfo output</LI>
|
||||
<LI>
|
||||
Made FreeBSD system adapter safe from mutal burn spoiling and drive deadlock
|
||||
</LI>
|
||||
<LI>Experimental system adapter via GNU libcdio on X/Open systems</LI>
|
||||
<LI>Experimentally using FreeBSD system adapter for Debian kfreebsd</LI>
|
||||
<!--
|
||||
<LI>none</LI>
|
||||
-->
|
||||
</UL>
|
||||
|
||||
Bug fixes towards cdrskin-0.7.0.pl00:
|
||||
Bug fixes towards cdrskin-0.7.4.pl00:
|
||||
<UL>
|
||||
<LI>CD TAO sessions with multiple tracks did not work in -dummy mode</LI>
|
||||
<!--
|
||||
<LI>none</LI>
|
||||
<!--
|
||||
-->
|
||||
</UL>
|
||||
|
||||
Bug fixes towards cdrskin-0.7.2.pl00:
|
||||
<UL>
|
||||
<LI>Workaround for Pioneer DVR-216D which got stuck on DVD-R burns.</LI>
|
||||
<LI>Workaround for Pioneer DVR-216D which did not always eject the tray.</LI>
|
||||
</UL>
|
||||
|
||||
<HR>
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
<DT><H3>Development snapshot, version 0.7.3 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 0.7.2.pl00:
|
||||
<DT><H3>Development snapshot, version 0.7.7 :</H3></DT>
|
||||
<DD>Enhancements towards current stable version 0.7.6.pl00:
|
||||
<UL>
|
||||
<LI>Implemented option -V for logging of SCSI commands</LI>
|
||||
<LI>New options dvd_obs= and stdio_fsync=</LI>
|
||||
<LI>New compile_cdrskin.sh options -o_direct (Linux only), -dvd_obs_64k</LI>
|
||||
<!--
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
-->
|
||||
|
||||
</UL>
|
||||
</DD>
|
||||
|
||||
<DD>Bug fixes towards cdrskin-0.7.2.pl00:
|
||||
<DD>Bug fixes towards cdrskin-0.7.6.pl00:
|
||||
<UL>
|
||||
<LI>Workaround for Pioneer DVR-216D which got stuck on DVD-R burns.</LI>
|
||||
<LI>Workaround for Pioneer DVR-216D which did not always eject the tray.</LI>
|
||||
<!--
|
||||
<LI>none yet</LI>
|
||||
<!--
|
||||
-->
|
||||
</UL>
|
||||
</DD>
|
||||
|
||||
<DD> </DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 0.7.3</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin_0.7.3 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin_0.7.3 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.3)</A></DD>
|
||||
<DD><A HREF="README_cdrskin_devel">README 0.7.7</A>
|
||||
<DD><A HREF="cdrskin__help_devel">cdrskin_0.7.7 --help</A></DD>
|
||||
<DD><A HREF="cdrskin_help_devel">cdrskin_0.7.7 -help</A></DD>
|
||||
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.7)</A></DD>
|
||||
<DD> </DD>
|
||||
<DT>Maintainers of cdrskin unstable packages please use SVN of
|
||||
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
|
||||
@ -319,8 +309,8 @@ admins with full system souvereignty.</DT>
|
||||
<A HREF="README_cdrskin_devel">upcoming README</A> ):
|
||||
</DD>
|
||||
<DD>
|
||||
<A HREF="cdrskin-0.7.3.tar.gz">cdrskin-0.7.3.tar.gz</A>
|
||||
(800 KB).
|
||||
<A HREF="cdrskin-0.7.7.tar.gz">cdrskin-0.7.7.tar.gz</A>
|
||||
(810 KB).
|
||||
</DD>
|
||||
|
||||
<!-- This is not offered any more since spring 2008
|
||||
|
@ -1 +1 @@
|
||||
#define Cdrskin_timestamP "2009.12.06.093847"
|
||||
#define Cdrskin_timestamP "2010.01.22.130001"
|
||||
|
@ -7178,21 +7178,847 @@ Made number transition to 0.7.3
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_3
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
12 Oct 2009 []
|
||||
12 Oct 2009 [2860]
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
12 Oct 2009 [2861]
|
||||
svn move -m "libburn release 0.7.2 is ready" \
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwo \
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenTwo
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.10.12.105750
|
||||
|
||||
|
||||
2009.10.17.131852 [2865] [2864]
|
||||
Makefile.am
|
||||
libburn/libburn.h
|
||||
libburn/sector.c
|
||||
+ libburn/ecma130ab.h
|
||||
+ libburn/ecma130ab.c
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Re-implemented ECMA-130 P-parity, Q-parity and scrambling for BURN_WRITE_RAW
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 -
|
||||
------------------------------------ cycle - cdrskin-0.7.3 -
|
||||
* Re-implemented ECMA-130 P-parity, Q-parity and scrambling for BURN_WRITE_RAW
|
||||
|
||||
|
||||
2009.10.19.115722 [2867]
|
||||
libburn/ecma130ab.c
|
||||
Optimizations with parity computation, clarification about nature of logarithms
|
||||
|
||||
2009.10.20.160131 [2868]
|
||||
libburn/libburn.h
|
||||
libburn/ecma130ab.c
|
||||
More optimizations with parity computation
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.10.20.160131
|
||||
|
||||
|
||||
2009.10.27.100637 [2871]
|
||||
libburn/mmc.c
|
||||
Bug fix: burn_drive->disc_id or burn_drive->disc_app_code altered by stray 0. Thanks to George Danchev.
|
||||
|
||||
2009.10.27.101031 [2872]
|
||||
libburn/sg-freebsd.c
|
||||
Bug fix: Closed memory leak with failure to open device file under FreeBSD. Thanks to George Danchev.
|
||||
|
||||
2009.10.30.134640 [2880]
|
||||
libburn/libburn.h
|
||||
libburn/spc.c
|
||||
libburn/mmc.c
|
||||
libburn/sg-linux.c
|
||||
Test macros for finding reason of stall problem with Pioneer DVD-216D on DVD-R
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.10.30.134640
|
||||
|
||||
|
||||
2009.11.03.184626 [2881]
|
||||
libburn/libburn.h
|
||||
libburn/mmc.c
|
||||
Test macro for SL_V in mode page 05
|
||||
|
||||
2009.11.04.084506 [2882]
|
||||
libburn/libburn.h
|
||||
libburn/write.c
|
||||
Test macro for SEND OPC INFORMATION before DVD-R track
|
||||
|
||||
2009.11.05.170409 [2883]
|
||||
libburn/libburn.h
|
||||
libburn/transport.h
|
||||
libburn/write.c
|
||||
libburn/sbc.c
|
||||
libburn/mmc.c
|
||||
Test macros for double START UNIT and SET CD SPEED
|
||||
|
||||
2009.11.08.120917 [2884]
|
||||
libburn/mmc.c
|
||||
Corrected allocation length with GET CONFIGURATION
|
||||
|
||||
2009.11.08.121334 [2885]
|
||||
libburn/spc.h
|
||||
libburn/spc.c
|
||||
libburn/mmc.h
|
||||
libburn/sg-linux.c
|
||||
Made SCSI command log more complete and more readable
|
||||
|
||||
2009.11.10.132154 [2886]
|
||||
libburn/mmc.c
|
||||
Avoiding START UNIT before the drive gets released
|
||||
|
||||
2009.11.10.203412 [2887]
|
||||
libburn/libburn.h
|
||||
libburn/write.c
|
||||
libburn/spc.c
|
||||
libburn/sbc.c
|
||||
libburn/mmc.c
|
||||
libburn/sg-linux.c
|
||||
Hopefully solved the endless burn problem with Pioneer DVR-216D
|
||||
|
||||
2009.11.11.100714 [2888]
|
||||
libburn/write.c
|
||||
Increased stdio flush interval from 1 MB to 16 MB
|
||||
|
||||
2009.11.11.100822 [2889]
|
||||
cdrskin/cdrskin.c
|
||||
Reporting number of pending bytes while thanking for patience in -vvv mode
|
||||
|
||||
2009.11.11.105028 [2890]
|
||||
cdrskin/cdrskin.c
|
||||
Silenced a compiler warning about potentially uninitialized variable
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.11.105159
|
||||
* Workaround for Pioneer DVR-216D which got stuck on DVD-R burns
|
||||
|
||||
|
||||
11 Nov 2009 [2891]
|
||||
cdrskin/cdrskin_eng.html
|
||||
Updated cdrskin home page about DVR-216D workaround
|
||||
|
||||
2009.11.12.175514 [2892]
|
||||
libburn/libburn.h
|
||||
libburn/init.c
|
||||
libburn/write.c
|
||||
libburn/sg-linux.c
|
||||
Made SCSI logger permanent and controllable via API call
|
||||
|
||||
2009.11.12.175735 [2893]
|
||||
libburn/spc.c
|
||||
libburn/sbc.c
|
||||
libburn/mmc.c
|
||||
Workaround for Pioneer DVR-216D refusal to eject
|
||||
|
||||
2009.11.12.180048 [2894]
|
||||
libburn/drive.c
|
||||
Macro Libburn_pioneer_dvr_216d_dummy_probe_wM for omitting write mode probe
|
||||
|
||||
2009.11.12.180241 [2895]
|
||||
cdrskin/cdrskin.c
|
||||
Implemented option -V for logging of SCSI commands
|
||||
|
||||
2009.11.12.193617 [2896]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrskin.1
|
||||
Man page entry and help text for option -V
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.12.194644
|
||||
* Implemented option -V for logging of SCSI commands
|
||||
* Workaround for Pioneer DVR-216D refusal to eject
|
||||
|
||||
|
||||
13 Nov 2009 [2898]
|
||||
svn copy -m Branching for libburn bugfix release 0.7.2.pl01 \
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenTwo \
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwoPl01
|
||||
|
||||
2009.11.12.230001 [2899]
|
||||
README
|
||||
libburn/write.c
|
||||
libburn/sbc.c
|
||||
cdrskin/README
|
||||
cdrskin/cdrskin_eng.html
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
libburn-0.7.2.pl01 : Workarounds for Pioneer DVR-216D rev 1.09
|
||||
|
||||
13 Nov 2009 [2900]
|
||||
svn move -m libburn bugfix release 0.7.2.pl01 is ready \
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwoPl01 \
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenTwoPl01
|
||||
|
||||
-------------------------------- patch - cdrskin-0.7.2.pl01 - 2009.11.12.230001
|
||||
* Workaround for Pioneer DVR-216D which got stuck on DVD-R burns
|
||||
* Workaround for Pioneer DVR-216D refusal to eject
|
||||
|
||||
|
||||
2009.11.15.115923 [2901]
|
||||
libburn/file.c
|
||||
Corrected an outdated remark
|
||||
|
||||
2009.11.15.152541 [2902]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrfifo.c
|
||||
cdrskin/compile_cdrskin.sh
|
||||
New compile_cdrskin.sh option -o_direct (Linux only)
|
||||
|
||||
2009.11.15.153140 [2903]
|
||||
libburn/libburn.h
|
||||
libburn/options.h
|
||||
libburn/options.c
|
||||
libburn/write.c
|
||||
New API calls burn_write_opts_set_dvd_obs(), burn_write_opts_set_stdio_fsync()
|
||||
|
||||
2009.11.15.165016 [2904]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrskin.1
|
||||
New options dvd_obs= and stdio_fsync=
|
||||
|
||||
2009.11.16.165420 [2905]
|
||||
configure.ac
|
||||
Makefile.am
|
||||
libburn/write.c
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrfifo.h
|
||||
cdrskin/cdrfifo.c
|
||||
cdrskin/cdrskin.1
|
||||
Configure options --enable-cdrskin-fifo-odirect, --enable-dvd-obs-64k
|
||||
|
||||
16 Nov 2009 [2906]
|
||||
cdrskin/compile_cdrskin.sh
|
||||
New compile_cdrskin.sh option -dvd_obs_64k, adapted to new .o names of libburn
|
||||
|
||||
16 Nov 2009 [2907]
|
||||
README
|
||||
cdrskin/README
|
||||
cdrskin/cdrskin_eng.html
|
||||
Updated build instructions of libburn and cdrskin
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.16.180334
|
||||
* New API calls burn_write_opts_set_dvd_obs(), burn_write_opts_set_stdio_fsync()
|
||||
* New options dvd_obs= and stdio_fsync=
|
||||
* Configure option --enable-dvd-obs-64k
|
||||
* New compile_cdrskin.sh option -dvd_obs_64k
|
||||
|
||||
|
||||
2009.11.17.093602 [2908]
|
||||
configure.ac
|
||||
Makefile.am
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Revoked usage of libburn_libburn_la_CFLAGS in Makefile.am (ugly .o names)
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.17.100248
|
||||
|
||||
|
||||
17 Nov 2009 [2912]
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Corrected help text of cdrskin static compile script
|
||||
|
||||
2009.11.18.122713 [2913]
|
||||
libburn/drive.c
|
||||
libburn/spc.c
|
||||
libburn/mmc.h
|
||||
libburn/mmc.c
|
||||
Split automatic drive start function from mmc_function_spy()
|
||||
|
||||
2009.11.18.185733 [2914]
|
||||
libburn/write.c
|
||||
Reserving enough track space for 64 kB write chunks
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.18.190403
|
||||
|
||||
|
||||
2009.11.20.134952 [2915]
|
||||
libburn/libburn.h
|
||||
libburn/write.c
|
||||
libburn/sg-linux.c
|
||||
Experiment about SG_FLAG_DIRECT_IO
|
||||
|
||||
2009.11.20.175854 [2916]
|
||||
cdrskin/cdrfifo.c
|
||||
Avoided use of uninitialized variable
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.21.122202
|
||||
|
||||
|
||||
2009.11.21.191516 [2917]
|
||||
libburn/write.c
|
||||
Longer READ BUFFER CAPACITY interval with DVD/BD writing
|
||||
|
||||
2009.11.21.191717 [2918]
|
||||
cdrskin/cdrskin.c
|
||||
Enabled cdrskin O_DIRECT with fs=0
|
||||
|
||||
2009.11.22.115227 [2919]
|
||||
libburn/write.c
|
||||
Bug fix: DVD DAO track size was rounded up much too generously
|
||||
|
||||
2009.11.23.185725 [2920]
|
||||
configure.ac
|
||||
Makefile.am
|
||||
README
|
||||
libburn/libburn.h
|
||||
libburn/file.h
|
||||
libburn/file.c
|
||||
libburn/async.c
|
||||
libburn/write.c
|
||||
libburn/sg-linux.c
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-dummy.c
|
||||
New API calls burn_os_open_track_src() , burn_os_alloc_buffer()
|
||||
|
||||
2009.11.23.193252 [2921]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/cdrfifo.c
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/README
|
||||
Gave up cdrskin specific O_DIRECT compile option
|
||||
|
||||
2009.11.25.122233 [2920]
|
||||
libburn/libburn.h
|
||||
libburn/sg-linux.c
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-dummy.c
|
||||
Gave up call burn_os_close_track_src() introduced by rev 2920
|
||||
|
||||
2009.11.25.160153 [2923]
|
||||
libburn/libburn.h
|
||||
libburn/file.c
|
||||
libburn/libdax_msgs.h
|
||||
New API call burn_fifo_fill()
|
||||
|
||||
2009.11.26.144452 [2924]
|
||||
libburn/libburn.h
|
||||
libburn/file.h
|
||||
libburn/file.c
|
||||
New API calls burn_fifo_get_statistics(), burn_fifo_next_interval()
|
||||
|
||||
2009.11.26.211418 [2925]
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Compiler option -use_libburn_fifo to switch non-CD from cdrfifo to libburn fifo
|
||||
|
||||
2009.11.28.122436 [2926]
|
||||
libburn/sg-linux.c
|
||||
Using mmap() by default for allocating read buffers
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.11.28.165658
|
||||
* Bug fix: DVD DAO track size was rounded up much too generously
|
||||
* New API call burn_fifo_fill()
|
||||
* New API calls burn_fifo_get_statistics(), burn_fifo_next_interval()
|
||||
* Configure option --enable-track-src-odirect
|
||||
|
||||
|
||||
2009.11.30.100152 [2929]
|
||||
libburn/sbc.c
|
||||
Documented meaning of START/STOP UNIT bits
|
||||
|
||||
2009.12.02.103036 [2930]
|
||||
libburn/write.c
|
||||
Gave up CLOSE TRACK with CD TAO burn runs
|
||||
|
||||
2009.12.05.111822 [2931]
|
||||
libburn/mmc.c
|
||||
Bug fix: SIGSEGV with LG GH22LS30 when inquiring media product id
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.3 - 2009.12.05.112623
|
||||
* Bug fix: SIGSEGV from NULL pointer with media product id inquiry on LG GH22LS30
|
||||
|
||||
|
||||
2009.12.05.142309 [2932]
|
||||
libburn/libburn.h
|
||||
libburn/write.c
|
||||
Made effect of macro Libburn_pioneer_dvr_216d_read_buf_caP unconditional
|
||||
|
||||
2009.12.05.143707 [2933]
|
||||
libburn/mmc.c
|
||||
libburn/sg-linux.c
|
||||
Converted stderr experiment messages to DEBUG messages
|
||||
|
||||
2009.12.06.073404 [2934]
|
||||
libburn/mmc.c
|
||||
Some clarifications about the GH22LS30 problem
|
||||
|
||||
2009.12.06.074622 [2935]
|
||||
libburn/write.c
|
||||
Some clarifications about the Linux throughput problem
|
||||
|
||||
2009.12.06.093847 [2936]
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Now default in cdrskin: use of libburn fifo with DVD and BD single track
|
||||
|
||||
06 Dec 2009 [2937]
|
||||
svn copy -m Branching for libburn release 0.7.4
|
||||
http://svn.libburnia-project.org/libburn/trunk
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFour
|
||||
|
||||
2009.12.06.160001 [2938]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 0.7.4
|
||||
|
||||
06 Dec 2009 [2939]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_2
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_3
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_4
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_5
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
06 Dec 2009 [2940]
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-0.7.4.pl00 - 2009.12.06.160001
|
||||
* Configure options --enable-dvd-obs-64k, --enable-track-src-odirect
|
||||
* New API calls burn_write_opts_set_dvd_obs(), burn_write_opts_set_stdio_fsync()
|
||||
* New API call burn_set_scsi_logging()
|
||||
* New API calls burn_fifo_get_statistics(), burn_fifo_next_interval(), burn_fifo_fill()
|
||||
* Re-implemented ECMA-130 P-parity, Q-parity and scrambling for BURN_WRITE_RAW
|
||||
* Workaround for Pioneer DVR-216D which got stuck on DVD-R burns
|
||||
* Workaround for Pioneer DVR-216D refusal to eject
|
||||
* Bug fix: SIGSEGV from NULL pointer with media product id inquiry on LG GH22LS30
|
||||
* Bug fix: DVD DAO track size was rounded up much too generously
|
||||
* cdrskin option -V for logging of SCSI commands
|
||||
* New cdrskin options dvd_obs= and stdio_fsync=
|
||||
* New compile_cdrskin.sh option -dvd_obs_64k
|
||||
|
||||
|
||||
2009.12.07.070029 [2941]
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 0.7.5
|
||||
|
||||
07 Dec 2009 [2942]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_2
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_3
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_4
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_5
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
07 Dec 2009 [2943]
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
07 Dec 2009 [2946]
|
||||
svn move -m libburn release 0.7.4 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFour
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenFour
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.5 - 2009.12.07.083850
|
||||
|
||||
|
||||
16 Dec 2009 [2955]
|
||||
doc/cookbook.txt
|
||||
Mentioned in cookbook the change about TAO close track
|
||||
|
||||
2009.12.19.140015 [2957]
|
||||
libburn/spc.c
|
||||
Corrected CDB length of command 55h MODE SELECT from 12 to 10
|
||||
|
||||
2009.12.19.142456 [2958]
|
||||
libburn/spc.h
|
||||
libburn/sg-linux.c
|
||||
Moved sg_log_cmd() to spc.c scsi_log_cmd()
|
||||
|
||||
2009.12.19.142456 [2959]
|
||||
configure.ac
|
||||
Makefile.am
|
||||
libburn/os.h
|
||||
libburn/sg.c
|
||||
libburn/sg-freebsd-port.c
|
||||
+ libburn/os-libcdio.h
|
||||
+ libburn/sg-libcdio.c
|
||||
Experimental SCSI transport adapter via GNU libcdio
|
||||
|
||||
2009.12.24.170601 [2960]
|
||||
configure.ac
|
||||
libburn/spc.h
|
||||
libburn/spc.c
|
||||
libburn/sg-linux.c
|
||||
libburn/sg-libcdio.c
|
||||
Making use of libcdio function mmc_get_cmd_scsi_sense()
|
||||
|
||||
25 Dec 2009 [2961]
|
||||
cdrskin/compile_cdrskin.sh
|
||||
Option -use_libcdio for cdrskin development compile script
|
||||
|
||||
2009.12.25.101433 [2962]
|
||||
libburn/libdax_msgs.h
|
||||
Commited file forgotten with rev 2960
|
||||
|
||||
2009.12.25.143326 [2963]
|
||||
libburn/sg-libcdio.c
|
||||
Resolving symbolic links in libcdio drive list
|
||||
|
||||
2009.12.25.144122 [2964]
|
||||
configure.ac
|
||||
Added PKG_CHECK_MODULES for libcdio-0.82 (must become 0.83 when released)
|
||||
|
||||
2009.12.25.205704 [2965]
|
||||
configure.ac
|
||||
libburn/sg-libcdio.c
|
||||
Adapted to libcdio-0.83 and its runtime version telling
|
||||
|
||||
2009.12.25.223915 [2966]
|
||||
libburn/init.c
|
||||
libburn/sg.h
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-libcdio.c
|
||||
libburn/sg-linux.c
|
||||
New internal sg-API function sg_initialize()
|
||||
|
||||
2009.12.26.080301 [2967]
|
||||
libburn/init.c
|
||||
libburn/sg-dummy.c
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-libcdio.c
|
||||
libburn/sg-linux.c
|
||||
New API function burn_scsi_transport_id()
|
||||
|
||||
26 Dec 2009 [2968]
|
||||
Makefile.am
|
||||
Added os-dummy.h and sg-dummy.h to libburn tarball
|
||||
|
||||
26 Dec 2009 [2969]
|
||||
svn copy -m Branching for libburn bugfix release 0.7.4.pl01
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenTwo
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwoPl01
|
||||
|
||||
26 Dec 2009 [2970]
|
||||
svn mv -m Branching for libburn bugfix release 0.7.4.pl01
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenTwoPl01
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFourPl01
|
||||
|
||||
26 Dec 2009 [2971]
|
||||
svn rm -m Branching for libburn bugfix release 0.7.4.pl01
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFourPl01
|
||||
|
||||
26 Dec 2009 [2972]
|
||||
svn copy -m Branching for libburn bugfix release 0.7.4.pl01
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenFour
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFourPl01
|
||||
|
||||
2009.12.26.110001 [2973]
|
||||
README
|
||||
Makefile.am
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
Bug fix: Added missing system adapter for generic X/Open to libburn release tarball
|
||||
|
||||
26 Dec 2009 [2974]
|
||||
svn move -m libburn bugfix release 0.7.4.pl01 is ready
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenFourPl01
|
||||
http://svn.libburnia-project.org/libburn/tags/ZeroSevenFourPl01
|
||||
|
||||
2009.12.26.193707 [2975]
|
||||
cdrskin/cdrskin.c
|
||||
Reporting burn_scsi_transport_id() in cdrskin as debug message
|
||||
|
||||
2009.12.26.222656 [2976]
|
||||
libburn/libburn.h
|
||||
doc/comments
|
||||
Reacted on some doxygen warnings of Debian hurd build
|
||||
|
||||
2009.12.27.092057 [2979]
|
||||
libburn/os-libcdio.h
|
||||
libburn/sg-libcdio.c
|
||||
Showing libburn users drive name link targets, using in libcdio its own names
|
||||
|
||||
2009.12.27.102342 [2981]
|
||||
libburn/sg-libcdio.c
|
||||
Shorter sg_initialize message with sg-libcdio
|
||||
|
||||
2009.12.27.144620 [2982]
|
||||
libburn/init.c
|
||||
libburn/drive.c
|
||||
libburn/sg.h
|
||||
libburn/os-libcdio.h
|
||||
libburn/sg-dummy.c
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-libcdio.c
|
||||
libburn/sg-linux.c
|
||||
Extended sg-API by sg_shutdown(), sg_dispose_drive(), sg_id_string()
|
||||
|
||||
2009.12.27.144733 [2983]
|
||||
cdrskin/cdrskin.c
|
||||
Reporting system adapter id with cdrskin -version
|
||||
|
||||
2009.12.29.115717 [2984]
|
||||
configure.ac
|
||||
Incremented middle .so number
|
||||
|
||||
2009.12.29.115854 [2985]
|
||||
libburn/spc.c
|
||||
Corrected a mode page size computation error which for now had no bad effect
|
||||
|
||||
2009.12.29.132537 [2986]
|
||||
acinclude.m4
|
||||
libburn/os.h
|
||||
libburn/sg.c
|
||||
Experimentally enabled FreeBSD system adapter for Debian kfreebsd
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.5 - 2009.12.29.134637
|
||||
* Experimental SCSI transport adapter via GNU libcdio
|
||||
* Experimentally using FreeBSD system adapter for Debian kfreebsd
|
||||
* Bug fix: System adapter for generic X/Open was missing in libburn release tarball
|
||||
|
||||
|
||||
2009.12.29.224506 [2987]
|
||||
acinclude.m4
|
||||
Adaptions for Debian kfreebsd requested by Petr Salinger
|
||||
|
||||
2009.12.30.154140 [2988]
|
||||
libburn/drive.c
|
||||
libburn/sg-libcdio.c
|
||||
Making use of new libcdio capability to obtain SCSI address tuple on Linux
|
||||
|
||||
2009.12.30.201025 [2990]
|
||||
libburn/sg-libcdio.c
|
||||
Silenced libcdio warnings
|
||||
|
||||
2010.01.01.124042 [2994]
|
||||
libburn/drive.c
|
||||
Bug fix: with non-Linux adapters there were 0 readable bytes on block devices
|
||||
|
||||
2010.01.01.124415 [2995]
|
||||
libburn/sg-libcdio.c
|
||||
Enabled block device size recognition with sg-libcdio on Linux
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.5 - 2010.01.01.143104
|
||||
* Bug fix: with non-Linux adapters there were 0 readable bytes on block devices
|
||||
|
||||
|
||||
2010.01.04.134949 [3001]
|
||||
libburn/write.c
|
||||
libburn/libdax_msgs.h
|
||||
Avoiding stream recording on BD if not 64 kB buffer
|
||||
|
||||
2010.01.04.135427 [3002]
|
||||
libburn/os-libcdio.h
|
||||
Enlarged buffer size of libcdio adapter on Linux to 64k
|
||||
|
||||
2010.01.09.142027 [3004]
|
||||
libburn/sg-libcdio.c
|
||||
Forgot to forward sense reply to higher levels
|
||||
|
||||
2010.01.09.142642 [3005]
|
||||
libburn/spc.c
|
||||
Better error message with unknown SCSI error codes
|
||||
|
||||
2010.01.09.143428 [3006]
|
||||
libburn/spc.c
|
||||
libburn/sbc.c
|
||||
Revoked asynchronous eject, as we cannot distinguish out from unready
|
||||
|
||||
2010.01.12.165214 [3009]
|
||||
libburn/sg-dummy.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-libcdio.c
|
||||
libburn/sg-linux.c
|
||||
Corrected free capacity measurement of stdio: drives in regular files
|
||||
|
||||
12 Jan 2010 [3010]
|
||||
doc/cookbook.txt
|
||||
Fixed typos in MMC cookbook
|
||||
|
||||
2010.01.13.074028 [3011]
|
||||
libburn/drive.c
|
||||
Experimentally regard FreeBSD /dev/da[0-9] and /dev/cd[0-9] as block device
|
||||
|
||||
2010.01.13.074640 [3012]
|
||||
libburn/sg-freebsd.c
|
||||
Adaptions after encounter with FreeBSD 8.0
|
||||
|
||||
2010.01.13.171546 [3013]
|
||||
libburn/libburn.h
|
||||
Carified that apps must use 64 bit off_t or the lib must be tweaked.
|
||||
|
||||
14 Jan 2010 [3014]
|
||||
14 Jan 2010 [3015]
|
||||
test/libburner.c
|
||||
Carified in libburner.c that apps must use 64 bit off_t.
|
||||
|
||||
2010.01.14.160633 [3016]
|
||||
libburn/libburn.h
|
||||
libburn/drive.c
|
||||
Giving up drive probing by mode page sending
|
||||
|
||||
2010.01.14.160748 [3017]
|
||||
libburn/sg-libcdio.c
|
||||
Provisory rejection of FreeBSD ATAPI drives in sg-libcdio
|
||||
|
||||
2010.01.15.182615 [3018]
|
||||
libburn/os-freebsd.h
|
||||
libburn/sg-freebsd.c
|
||||
Implemented adivisory FreeBSD drive locking via flock(2)
|
||||
|
||||
2010.01.16.125258 [3019]
|
||||
libburn/drive.c
|
||||
libburn/sg.h
|
||||
libburn/sg-dummy.c
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-freebsd-port.c
|
||||
libburn/sg-libcdio.c
|
||||
libburn/sg-linux.c
|
||||
New OS adapter burn_os_is_2k_seekrw() replaces S_ISBLK() with pseudo-drives
|
||||
|
||||
2010.01.18.103410 [3023]
|
||||
libburn/sg-linux.c
|
||||
Changed a comment in sg-linux.c
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.5 - 2010.01.18.104011
|
||||
* Made FreeBSD system adapter safe from mutal burn spoiling and drive deadlock
|
||||
|
||||
|
||||
21 Jan 2010 [3028]
|
||||
cdrskin/cdrskin.1
|
||||
Changed man page example from -toc to -minfo
|
||||
|
||||
2010.01.21.104741 [3029]
|
||||
libburn/sg-freebsd.c
|
||||
libburn/sg-libcdio.c
|
||||
Learned how to inquire size of disk-like FreeBSD devices
|
||||
|
||||
22 Jan 2010 [3030]
|
||||
svn copy -m "Branching for libburn release 0.7.6" \
|
||||
http://svn.libburnia-project.org/libburn/trunk \
|
||||
http://svn.libburnia-project.org/libburn/branches/ZeroSevenSix
|
||||
|
||||
2010.01.22.130001 []
|
||||
Makefile.am
|
||||
configure.ac
|
||||
README
|
||||
libburn/libburn.h
|
||||
cdrskin/cdrskin.c
|
||||
cdrskin/README
|
||||
cdrskin/compile_cdrskin.sh
|
||||
cdrskin/cdrskin_timestamp.h
|
||||
cdrskin/cdrskin_eng.html
|
||||
Made number transition to 0.7.6
|
||||
|
||||
22 Jan 2010 [3032]
|
||||
COPYRIGHT
|
||||
cdrskin/cdrskin.c
|
||||
doc/cookbook.txt
|
||||
libburn/libdax_msgs.h
|
||||
libburn/libdax_msgs.c
|
||||
test/libburner.c
|
||||
test/telltoc.c
|
||||
Lifted ban to derive GPLv3, extended copyright range to 2010
|
||||
|
||||
22 Jan 2009 [3033]
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_4
|
||||
- cdrskin/add_ts_changes_to_libburn_0_7_5
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_6
|
||||
+ cdrskin/add_ts_changes_to_libburn_0_7_7
|
||||
Updated cdrskin tarball generator
|
||||
|
||||
22 Jan 2009 []
|
||||
cdrskin/changelog.txt
|
||||
Documented changes and release timestamp
|
||||
|
||||
------------------------------ release - cdrskin-0.7.6.pl00 - 2010.01.22.130001
|
||||
* Bug fix: System adapter for generic X/Open was missing in libburn release tarball
|
||||
* Bug fix: with non-Linux adapters there were 0 readable bytes on block devices
|
||||
* Made FreeBSD system adapter safe from mutal burn spoiling and drive deadlock
|
||||
* Enabled FreeBSD system adapter for Debian kfreebsd
|
||||
* Experimental SCSI transport adapter via GNU libcdio 0.83git
|
||||
|
||||
------------------------------------ cycle - cdrskin-0.7.7 -
|
||||
------------------------------------ cycle - cdrskin-0.7.7 -
|
||||
------------------------------------ cycle - cdrskin-0.7.7 -
|
||||
|
||||
|
||||
===============================================================================
|
||||
TODO
|
||||
===============================================================================
|
||||
|
||||
- After writing first session and reload:
|
||||
Drive current: -dev '/dev/cd0'
|
||||
Drive type : vendor 'TSSTcorp' product 'CDDVDW SH-S223C' revision 'SB02'
|
||||
Media current: DVD-RW sequential recording
|
||||
Media product: RITEKW01 , Ritek Corp
|
||||
Media status : is written , is appendable
|
||||
TOC layout : Idx , sbsector , Size , Volume Id
|
||||
ISO session : 1 , 0 , 232357s , ISOIMAGE
|
||||
Other session: 2 , 261200 , 2036688s ,
|
||||
Media summary: 2 sessions, 2269200 data blocks, 4432m data, 3978m free
|
||||
Media nwa : 261200s
|
||||
dvd+rw-mediainfo shows 3 sessions with 2 tracks.
|
||||
Firmware bug.
|
||||
|
||||
|
||||
|
||||
- USB stick and drive on FreeBSD
|
||||
- how to detect random-read-write device ?
|
||||
|
||||
|
||||
--- libcdio ---
|
||||
|
||||
24 Dec 2009 [29de1d8bcb614a8360b519c5843c5852f78101db]
|
||||
include/cdio/mmc.h
|
||||
lib/driver/generic.h
|
||||
lib/driver/mmc.c
|
||||
lib/driver/libcdio.sym ( - cdio_version)
|
||||
New API function mmc_last_cmd_sense()
|
||||
|
||||
24 Dec 2009 [890b5610a8ec01609df8997f8031324af5bb4219]
|
||||
lib/driver/gnu_linux.c
|
||||
Linux driver makes available the sense reply of the most recent MMC command
|
||||
(Is there a place to register access modes MMC_RDWR and MMC_RDWR_EXCL ?)
|
||||
|
||||
24 Dec 2009 [20f762c3c12c06b52a47b401eb913c69c72ddcf8]
|
||||
include/cdio/version.h.in
|
||||
lib/driver/util.c
|
||||
lib/driver/libcdio.sym ( + cdio_version)
|
||||
New API function cdio_version() tell libcdio version at runtime
|
||||
|
||||
24 Dec 2009 [7cc7484a0b93268260c02ec35c46e1456f0fb38a]
|
||||
lib/driver/gnu_linux.c
|
||||
lib/driver/util.c
|
||||
Small repairs to the previous two changees
|
||||
|
||||
30 Dec 2009 07_cdio_get_arg_scsi_tuple_linux.tgz [cf882cfd20912fed94d1a4a2e057bbcf68c496a1]
|
||||
lib/driver/generic.h
|
||||
lib/driver/_cdio_generic.c
|
||||
lib/driver/gnu_linux.c
|
||||
New cdio_get_arg() key "scsi-tuple-linux"
|
||||
|
||||
15 Jan 2010 10_add_mmc_rdwr_excl_on_freebsd.tgz [bd096b3eca0644044a872c1f0d31a75395d420a4]
|
||||
NEWS
|
||||
test/test_mmc_rdwr.c
|
||||
lib/driver/FreeBSD/freebsd.h
|
||||
lib/driver/FreeBSD/freebsd.c
|
||||
lib/driver/FreeBSD/freebsd_cam.c
|
||||
lib/driver/FreeBSD/freebsd_ioctl.c
|
||||
FreeBSD driver augmented by MMC_RDWR_EXCL
|
||||
|
||||
|
||||
Todo:
|
||||
|
||||
Driver-Todo:
|
||||
- implement MMC_RDWR and MMC_RDWR_EXCL
|
||||
- record SCSI sense reply in generic_img_private_t.scsi_mmc_sense
|
||||
- rectify return values to DRIVER_OP_*
|
||||
(- obtain SCSI address tuple)
|
||||
- test concurrent drive access attempts resp. exclusivity of drive access
|
||||
|
||||
|
||||
--------------------------------- bugs -------------------------------------
|
||||
|
||||
@ -7219,6 +8045,8 @@ READ TRACK INFORMATION[#5]:
|
||||
|
||||
------------------------------ end of bugs ---------------------------------
|
||||
|
||||
- xorriso -as tar (Rocky wants me to begin with -x)
|
||||
|
||||
Support for BD-R SRM+POW
|
||||
|
||||
? Provide an option to open track source file O_DIRECT ?
|
||||
|
@ -1,14 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# compile_cdrskin.sh
|
||||
# Copyright 2005 - 2009 Thomas Schmitt, scdbackup@gmx.net, GPL version 2
|
||||
# Copyright 2005 - 2010 Thomas Schmitt, scdbackup@gmx.net, GPL
|
||||
# to be executed within ./libburn-* resp ./cdrskin-*
|
||||
|
||||
debug_opts="-O2"
|
||||
def_opts=
|
||||
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
|
||||
fifo_opts="-DCdrskin_use_libburn_fifO"
|
||||
libvers="-DCdrskin_libburn_0_7_3"
|
||||
libvers="-DCdrskin_libburn_0_7_6"
|
||||
|
||||
# To be used if Makefile.am uses libburn_libburn_la_CFLAGS
|
||||
# burn="libburn/libburn_libburn_la-"
|
||||
@ -20,6 +20,7 @@ libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
do_strip=0
|
||||
static_opts=
|
||||
warn_opts="-Wall"
|
||||
libcdio=
|
||||
fifo_source="cdrskin/cdrfifo.c"
|
||||
compile_cdrskin=1
|
||||
compile_cdrfifo=0
|
||||
@ -39,15 +40,15 @@ do
|
||||
libdax_audioxtr_o=
|
||||
libdax_msgs_o="$burn"message.o
|
||||
cleanup_src_or_obj="-DCleanup_has_no_libburn_os_H cdrskin/cleanup.c"
|
||||
elif test "$i" = "-libburn_0_7_2"
|
||||
elif test "$i" = "-libburn_0_7_6"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_0_7_2"
|
||||
libvers="-DCdrskin_libburn_0_7_6"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
elif test "$i" = "-libburn_svn"
|
||||
then
|
||||
libvers="-DCdrskin_libburn_0_7_3"
|
||||
libvers="-DCdrskin_libburn_0_7_7"
|
||||
libdax_audioxtr_o="$burn"libdax_audioxtr.o
|
||||
libdax_msgs_o="$burn"libdax_msgs.o
|
||||
cleanup_src_or_obj="$burn"cleanup.o
|
||||
@ -85,6 +86,9 @@ do
|
||||
then
|
||||
fifo_source=
|
||||
fifo_opts="-DCdrskin_use_libburn_fifO -DCdrskin_no_cdrfifO"
|
||||
elif test "$i" = "-use_libcdio"
|
||||
then
|
||||
libcdio="-lcdio"
|
||||
elif test "$i" = "-g"
|
||||
then
|
||||
debug_opts="-g"
|
||||
@ -94,9 +98,10 @@ do
|
||||
echo "Options:"
|
||||
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
|
||||
echo " -compile_dewav compile program test/dewav without libburn."
|
||||
echo " -libburn_0_7_2 set macro to match libburn-0.7.2"
|
||||
echo " -libburn_0_7_6 set macro to match libburn-0.7.6"
|
||||
echo " -libburn_svn set macro to match current libburn-SVN."
|
||||
echo " -dvd_obs_64k 64 KB default size for DVD/BD writing."
|
||||
echo " -use_libcdio link with -lcdio because libburn uses it."
|
||||
echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin."
|
||||
echo " -use_no_libburn_fifo use cdrfifo even for single track non-CD"
|
||||
echo " -use_no_cdrfifo always use fifo of libburn and never cdrfifo"
|
||||
@ -120,7 +125,7 @@ echo "Build timestamp : $timestamp"
|
||||
|
||||
if test "$compile_cdrskin"
|
||||
then
|
||||
echo "compiling program cdrskin/cdrskin.c $fifo_source $static_opts $debug_opts $libvers $fifo_opts $def_opts $cleanup_src_or_obj"
|
||||
echo "compiling program cdrskin/cdrskin.c $fifo_source $static_opts $debug_opts $libvers $fifo_opts $def_opts $cleanup_src_or_obj $libcdio"
|
||||
cc -I. \
|
||||
$warn_opts \
|
||||
$static_opts \
|
||||
@ -165,6 +170,7 @@ then
|
||||
"$burn"crc.o \
|
||||
"$burn"ecma130ab.o \
|
||||
\
|
||||
$libcdio \
|
||||
-lpthread
|
||||
|
||||
ret=$?
|
||||
|
54
configure.ac
54
configure.ac
@ -1,4 +1,4 @@
|
||||
AC_INIT([libburn], [0.7.3], [http://libburnia-project.org])
|
||||
AC_INIT([libburn], [0.7.6], [http://libburnia-project.org])
|
||||
AC_PREREQ([2.50])
|
||||
dnl AC_CONFIG_HEADER([config.h])
|
||||
|
||||
@ -7,7 +7,7 @@ AC_CANONICAL_TARGET
|
||||
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
|
||||
dnl Notes by ts A71207 - A91012 :
|
||||
dnl Notes by ts A71207 - B00122 :
|
||||
dnl
|
||||
dnl Regrettably the meaning of the various version types was misunderstood
|
||||
dnl before version 0.4.1.
|
||||
@ -75,6 +75,8 @@ dnl 0.6.6 = libburn.so.4.31.0
|
||||
dnl 0.6.8 = libburn.so.4.33.0
|
||||
dnl 0.7.0 = libburn.so.4.35.0
|
||||
dnl 0.7.2 = libburn.so.4.37.0
|
||||
dnl 0.7.4 = libburn.so.4.39.0
|
||||
dnl 0.7.6 = libburn.so.4.41.0
|
||||
dnl
|
||||
dnl So LT_CURRENT, LT_REVISION and LT_AGE get set directly here.
|
||||
dnl SONAME of the emerging library is LT_CURRENT - LT_AGE.
|
||||
@ -100,7 +102,7 @@ dnl
|
||||
dnl As said: Only copies. Original in libburn/libburn.h : burn_header_version_*
|
||||
BURN_MAJOR_VERSION=0
|
||||
BURN_MINOR_VERSION=7
|
||||
BURN_MICRO_VERSION=3
|
||||
BURN_MICRO_VERSION=6
|
||||
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
|
||||
AC_SUBST(BURN_MAJOR_VERSION)
|
||||
@ -111,15 +113,15 @@ AC_SUBST(BURN_VERSION)
|
||||
dnl Libtool versioning
|
||||
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
|
||||
dnl
|
||||
dnl ts A91116
|
||||
dnl ### This is the release version libburn-0.7.2 = libburn.so.4.37.0
|
||||
dnl This is the development version after above release version
|
||||
dnl ### LT_CURRENT++, LT_AGE++ has not yet happened.
|
||||
dnl LT_CURRENT++, LT_AGE++ has happened meanwhile.
|
||||
dnl ts B00122
|
||||
dnl This is the release version libburn-0.7.6 = libburn.so.4.41.0
|
||||
dnl ### This is the development version after above release version
|
||||
dnl LT_CURRENT++, LT_AGE++ has not yet happened.
|
||||
dnl ### LT_CURRENT++, LT_AGE++ has happened meanwhile.
|
||||
dnl
|
||||
dnl SONAME = 42 - 38 = 4 . Linux library name = libburn.so.4.38.0
|
||||
LT_CURRENT=42
|
||||
LT_AGE=38
|
||||
dnl SONAME = 45 - 41 = 4 . Linux library name = libburn.so.4.41.0
|
||||
LT_CURRENT=45
|
||||
LT_AGE=41
|
||||
LT_REVISION=0
|
||||
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
||||
|
||||
@ -205,10 +207,36 @@ else
|
||||
LIBBURN_DVD_OBS_64K=
|
||||
echo "disabled write size default 64 KB on DVD and BD"
|
||||
fi
|
||||
dnl Avoid the need for libburn_libburn_la_CFLAGS in Makefile.am (ugly .o names)
|
||||
dnl ### AC_SUBST(LIBBURN_DVD_OBS_64K)
|
||||
CFLAGS="$CFLAGS $LIBBURN_DVD_OBS_64K"
|
||||
|
||||
dnl ts A91218
|
||||
AC_ARG_ENABLE(libcdio,
|
||||
[ --enable-libcdio Enable EXPERIMENTAL use of libcdio as system adapter, default=no],
|
||||
, enable_libcdio=no)
|
||||
if test x$enable_libcdio = xyes; then
|
||||
dnl Check whether there is libcdio-devel and libcdio-runtime.
|
||||
dnl If not, erase this macro
|
||||
LIBCDIO_DEF="-DLibburn_use_libcdiO"
|
||||
dnl The empty yes case obviously causes -lcdio to be linked
|
||||
AC_CHECK_HEADER(cdio/cdio.h, AC_CHECK_LIB(cdio, mmc_last_cmd_sense, , LIBCDIO_DEF= ), LIBCDIO_DEF= )
|
||||
else
|
||||
LIBCDIO_DEF=
|
||||
fi
|
||||
if test x$LIBCDIO_DEF = x
|
||||
then
|
||||
if test x$enable_libcdio = xyes
|
||||
then
|
||||
echo "WARNING: could not enable use of libcdio as system adapter"
|
||||
fi
|
||||
else
|
||||
echo "enabled EXPERIMENTAL use of libcdio as system adapter"
|
||||
CFLAGS="$CFLAGS $LIBCDIO_DEF"
|
||||
|
||||
LIBCDIO_REQUIRED=0.83
|
||||
PKG_CHECK_MODULES(LIBCDIO, libcdio >= $LIBCDIO_REQUIRED)
|
||||
|
||||
fi
|
||||
|
||||
|
||||
dnl Add compiler-specific flags
|
||||
|
||||
|
@ -73,9 +73,9 @@ compatible for a good while.
|
||||
@subsection libburner-help Libburner --help
|
||||
<pre>
|
||||
Usage: test/libburner
|
||||
[--drive <address>|<driveno>|"-"] [--audio]
|
||||
[--drive address|driveno|"-"] [--audio]
|
||||
[--blank_fast|--blank_full|--format] [--try_to_simulate]
|
||||
[--multi] [<one or more imagefiles>|"-"]
|
||||
[--multi] [one or more imagefiles|"-"]
|
||||
Examples
|
||||
A bus scan (needs rw-permissions to see a drive):
|
||||
test/libburner --drive -
|
||||
|
@ -1,4 +1,4 @@
|
||||
libburnia-project.org Optical Media Rotisserie Recipes as of January 2009
|
||||
libburnia-project.org Optical Media Rotisserie Recipes as of January 2010
|
||||
|
||||
Content:
|
||||
- TAO Multi-Session CD Cookbook (CD-R, CD-RW)
|
||||
@ -86,7 +86,7 @@ parameters:
|
||||
BUFE Buffer Underrun protection 0=off, 1=on
|
||||
Test Write -dummy mode for writing 0=off, 1=on
|
||||
Write Type Packet/TAO/SAO/RAW 01h = TAO
|
||||
Multi-session Wether to keep appendable 00b = finalize
|
||||
Multi-session Whether to keep appendable 00b = finalize
|
||||
11b = keep appendable
|
||||
Track Mode Describes frame type 4 for data , 0 for audio
|
||||
Data Block Type Layout of payload blocks 8 for 2048 byte data blocks
|
||||
@ -119,19 +119,22 @@ A track must at least contain 300 payload blocks: 4 seconds of audio or
|
||||
600 KiB of data.
|
||||
(mmc5r03c.pdf 6.3.3.1.2)
|
||||
|
||||
The track has to be closed by 5Bh CLOSE TRACK SESSION Close Function 001b.
|
||||
Older MMC specifies a valid Logical Track Number FFh to depict the open track.
|
||||
MMC-5 is quite silent about this. FFh works for my drives.
|
||||
Up to december 2009 the track was closed by 5Bh CLOSE TRACK SESSION Close
|
||||
Function 001b. Older MMC specifies a valid Logical Track Number FFh to depict
|
||||
the open track. MMC-5 is quite silent about this. FFh worked for my drives.
|
||||
(mmc5r03c.pdf 6.3.3.1.2)
|
||||
This is omitted since libburn-0.7.4, relying entirely on 35h SYNCHRONIZE CACHE.
|
||||
First appeared a drive where CLOSE TRACK fails in simulation mode, later
|
||||
another one produced error replies even with real burning.
|
||||
|
||||
After that, a new track may be written beginning with sending the mode page 05h
|
||||
again. It is not tested wether 05h can be omitted if Track Mode and Data Block
|
||||
again. It is not tested whether 05h can be omitted if Track Mode and Data Block
|
||||
Type are the same as with the previous track.
|
||||
The new track will be added to the session which was opened by the first track.
|
||||
|
||||
After the last track of a session, 5Bh CLOSE TRACK SESSION Close Function 010b
|
||||
with Logical Track Number 0 closes the session. It depends on the Multi-Session
|
||||
value in mode page 05h wether the disc is finalized or stays appendable.
|
||||
value in mode page 05h whether the disc is finalized or stays appendable.
|
||||
(mmc5r03c.pdf 6.3.3.1.3)
|
||||
|
||||
|
||||
@ -202,7 +205,7 @@ for finalized disc.
|
||||
In libburn the address of the first track in the last session is obtained from
|
||||
the last session's POINT = A0h and from the track descriptor with the POINT
|
||||
value matching the PMIN value of the A0h descriptor.
|
||||
Untested is wether POINT = B0h and 52h READ TRACK INFORMATION are always in
|
||||
Untested is whether POINT = B0h and 52h READ TRACK INFORMATION are always in
|
||||
sync. libburn uses the info provided by 52h READ TRACK INFORMATION.
|
||||
|
||||
|
||||
@ -308,7 +311,7 @@ A Write Parameters mode page 05h has to be composed and transmitted via
|
||||
BUFE Buffer Underrun protection 0=off, 1=on
|
||||
Test Write -dummy mode for writing 0=off, 1=on
|
||||
Write Type Packet/TAO/SAO/RAW 02h = SAO
|
||||
Multi-session Wether to keep appendable 00b = finalize
|
||||
Multi-session Whether to keep appendable 00b = finalize
|
||||
11b = keep appendable
|
||||
Track Mode Describes frame type 0 (is ignored)
|
||||
Data Block Type Layout of payload blocks 0 (is ignored)
|
||||
@ -349,7 +352,7 @@ There is no separator between the tracks of a pure mode SAO session.
|
||||
(If the session was mixed mode, there would be extended Pre-gaps and Post-gaps
|
||||
between data mode tracks and audio mode tracks.)
|
||||
(libburn sends its own buffer to the drive at the end of each track but does
|
||||
not sync the drive's chache. It is unclear wether this separation of tracks
|
||||
not sync the drive's chache. It is unclear whether this separation of tracks
|
||||
on the level of 2Ah WRITE is necessary with a pure mode session. It does not
|
||||
harm in any case and would probably be unavoidable if audio and data tracks
|
||||
were mixed.)
|
||||
@ -755,7 +758,8 @@ The only known way to get full speed from DVD-RAM or BD-RE with enabled defect
|
||||
management is the use of AAh WRITE12 with Streaming Bit set to 1.
|
||||
(mmc5r03c.pdf 6.45)
|
||||
With some DVD-RAM drives this fails if a write buffer is not full 32 kB.
|
||||
With the tested BD-RE one has to write full 64 kB buffers.
|
||||
With the tested BD-RE one must write full 64 kB buffers, or else writing
|
||||
might not get into effect at all.
|
||||
|
||||
Although it seems not optimal, this is specified not only to disable the
|
||||
cumbersome checkread but also to ignore known defects and to write data
|
||||
@ -769,7 +773,8 @@ MMC-5 does not guarantee AAh WRITE12 to work on DVD-RAM or BD-RE at all.
|
||||
None of the features of profiles 0012h and 0043h promises the existence of
|
||||
AAh WRITE12.
|
||||
(mmc5r03c.pdf 5.4.13, 6.45)
|
||||
Nevertheless it worked on all tested drives if proper alignment was observed.
|
||||
Nevertheless it worked on all tested drives if proper alignment and block
|
||||
size was observed.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
@ -841,6 +846,8 @@ This chain gives the start addresses of sessions. The sector count minus start
|
||||
address gives the size of a particular session. ECMA-119 explains how to
|
||||
retrieve more info from the PVD (e.g. the volume id).
|
||||
|
||||
See also the multi-session example in libisofs/doc/checksums.txt.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@ -933,7 +940,7 @@ Multi-Session by the application.
|
||||
LS_V Link size valid 1=true
|
||||
Test Write -dummy mode for writing 0=off, 1=on
|
||||
Write Type Packet/TAO/SAO/RAW 00h = Incremental (Packet)
|
||||
Multi-session Wether to keep appendable 00b = finalize
|
||||
Multi-session Whether to keep appendable 00b = finalize
|
||||
11b = keep appendable
|
||||
Track Mode Describes frame type 5 [*1]
|
||||
Data Block Type Layout of payload blocks 8 [*2]
|
||||
@ -980,7 +987,7 @@ from the reply of 51h READ DISC INFORMATION requesting Data Type 000b
|
||||
Multiple tracks are permissible in a single session. After all of them have
|
||||
been written, 5Bh CLOSE TRACK SESSION Close Function 010b with Logical Track
|
||||
Number 0 closes the session. It depends on the Multi-Session value in mode
|
||||
page 05h wether the disc is finalized or stays appendable.
|
||||
page 05h whether the disc is finalized or stays appendable.
|
||||
(mmc5r03c.pdf 6.3.3.2.3)
|
||||
|
||||
|
||||
@ -1005,7 +1012,7 @@ The mode page 05h to be sent :
|
||||
LS_V Link size valid 0=false [*3]
|
||||
Test Write -dummy mode for writing 0=off, 1=on
|
||||
Write Type Packet/TAO/SAO/RAW 02h = DAO (same code as SAO)
|
||||
Multi-session Wether to keep appendable 00b = finalize
|
||||
Multi-session Whether to keep appendable 00b = finalize
|
||||
Track Mode Describes frame type 5 [*1]
|
||||
Data Block Type Layout of payload blocks 8 [*2]
|
||||
Link Size ??? 0 [*3]
|
||||
@ -1222,7 +1229,7 @@ No mode page 05h is to be sent.
|
||||
growisofs sends a page but the specs clearly state that one shall not do.
|
||||
(mmc5r03c.pdf 7.5.3)
|
||||
|
||||
It is optional wether a track size is reserved in advance or not. Eventually
|
||||
It is optional whether a track size is reserved in advance or not. Eventually
|
||||
this is done by 53h RESERVE TRACK, RMZ=ARSV=0. Reservation size should better
|
||||
already be aligned to 32 KiB.
|
||||
(mmc5r03c.pdf 6.31)
|
||||
|
@ -90,6 +90,7 @@ void burn_drive_free_subs(struct burn_drive *d)
|
||||
if (d->stdio_fd >= 0)
|
||||
close (d->stdio_fd);
|
||||
d->stdio_fd = -1;
|
||||
sg_dispose_drive(d, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -907,20 +908,27 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out)
|
||||
out->c2_errors = !!d->mdata->c2_pointers;
|
||||
out->drive = d;
|
||||
|
||||
#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM
|
||||
#ifdef Libburn_dummy_probe_write_modeS
|
||||
|
||||
/* ts A91112 */
|
||||
/* Set default block types. The call d->probe_write_modes() is quite
|
||||
obtrusive. It may be performed explicitely by new API call
|
||||
burn_drive_probe_cd_write_modes().
|
||||
*/
|
||||
if (out->write_dvdram || out->write_dvdr ||
|
||||
out->write_cdrw || out->write_cdr) {
|
||||
out->tao_block_types = d->block_types[BURN_WRITE_TAO] =
|
||||
BURN_BLOCK_MODE1 | BURN_BLOCK_RAW0;
|
||||
out->sao_block_types = d->block_types[BURN_WRITE_SAO] = BURN_BLOCK_SAO;
|
||||
out->sao_block_types = d->block_types[BURN_WRITE_SAO] =
|
||||
BURN_BLOCK_SAO;
|
||||
} else {
|
||||
out->tao_block_types = d->block_types[BURN_WRITE_TAO] = 0;
|
||||
out->sao_block_types = d->block_types[BURN_WRITE_SAO] = 0;
|
||||
}
|
||||
out->raw_block_types = d->block_types[BURN_WRITE_RAW] = 0;
|
||||
out->packet_block_types = 0;
|
||||
|
||||
#else /* Libburn_pioneer_dvr_216d_dummy_probe_wM */
|
||||
#else /* Libburn_dummy_probe_write_modeS */
|
||||
|
||||
/* update available block types for burners */
|
||||
if (out->write_dvdram || out->write_dvdr ||
|
||||
@ -931,15 +939,14 @@ static int drive_getcaps(struct burn_drive *d, struct burn_drive_info *out)
|
||||
out->raw_block_types = d->block_types[BURN_WRITE_RAW];
|
||||
out->packet_block_types = d->block_types[BURN_WRITE_PACKET];
|
||||
|
||||
#endif /* ! Libburn_pioneer_dvr_216d_dummy_probe_wM */
|
||||
#endif /* ! Libburn_dummy_probe_write_modeS */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM
|
||||
|
||||
/* ts A91112 candidate for API */
|
||||
/* ts A91112 - B00114 API */
|
||||
/* Probe available CD write modes and block types.
|
||||
*/
|
||||
int burn_drive_probe_cd_write_modes(struct burn_drive_info *dinfo)
|
||||
@ -958,8 +965,6 @@ int burn_drive_probe_cd_write_modes(struct burn_drive_info *dinfo)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* Libburn_pioneer_dvr_216d_dummy_probe_wM */
|
||||
|
||||
|
||||
/* ts A70907 : added parameter flag */
|
||||
/* @param flag bit0= reset global drive list */
|
||||
@ -1317,6 +1322,7 @@ int burn_drive__fd_from_special_adr(char *adr)
|
||||
int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
{
|
||||
int ret = -1, fd = -1, role = 0;
|
||||
int is_block_dev = 0;
|
||||
/* divided by 512 it needs to fit into a signed long integer */
|
||||
off_t size = ((off_t) (512 * 1024 * 1024 - 1) * (off_t) 2048);
|
||||
off_t read_size = -1;
|
||||
@ -1333,17 +1339,18 @@ int burn_drive_grab_dummy(struct burn_drive_info *drive_infos[], char *fname)
|
||||
else
|
||||
ret = stat(fname, &stbuf);
|
||||
if (ret != -1) {
|
||||
is_block_dev = burn_os_is_2k_seekrw(fname, 0);
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
read_size = stbuf.st_size;
|
||||
else if (S_ISBLK(stbuf.st_mode)) {
|
||||
else if (is_block_dev) {
|
||||
ret = burn_os_stdio_capacity(fname,
|
||||
&read_size);
|
||||
if (ret <= 0)
|
||||
read_size = -1;
|
||||
read_size = (off_t) 0x7ffffff0 *
|
||||
(off_t) 2048;
|
||||
}
|
||||
}
|
||||
if (ret == -1 || S_ISBLK(stbuf.st_mode) ||
|
||||
S_ISREG(stbuf.st_mode)) {
|
||||
if (ret == -1 || is_block_dev || S_ISREG(stbuf.st_mode)) {
|
||||
ret = burn_os_stdio_capacity(fname, &size);
|
||||
if (ret == -1) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
@ -1559,13 +1566,22 @@ int burn_drive_is_enumerable_adr(char *adr)
|
||||
#define BURN_DRIVE_MAX_LINK_DEPTH 20
|
||||
|
||||
/* ts A60922 ticket 33 */
|
||||
int burn_drive_resolve_link(char *path, char adr[], int *recursion_count)
|
||||
/* @param flag bit0= no debug messages
|
||||
bit1= resolve only links,
|
||||
do not rely on drive list for resolving via st_rdev
|
||||
*/
|
||||
int burn_drive_resolve_link(char *path, char adr[], int *recursion_count,
|
||||
int flag)
|
||||
{
|
||||
int ret;
|
||||
char link_target[4096], msg[4096+100], link_adr[4096], *adrpt;
|
||||
struct stat stbuf;
|
||||
|
||||
burn_drive_adr_debug_msg("burn_drive_resolve_link( %s )", path);
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg("burn_drive_resolve_link( %s )",
|
||||
path);
|
||||
if (*recursion_count >= BURN_DRIVE_MAX_LINK_DEPTH) {
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg(
|
||||
"burn_drive_resolve_link aborts because link too deep",
|
||||
NULL);
|
||||
@ -1574,11 +1590,14 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count)
|
||||
(*recursion_count)++;
|
||||
ret = readlink(path, link_target, sizeof(link_target));
|
||||
if (ret == -1) {
|
||||
burn_drive_adr_debug_msg("readlink( %s ) returns -1", path);
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg("readlink( %s ) returns -1",
|
||||
path);
|
||||
return 0;
|
||||
}
|
||||
if (ret >= sizeof(link_target) - 1) {
|
||||
sprintf(msg,"readlink( %s ) returns %d (too much)", path, ret);
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
return -1;
|
||||
}
|
||||
@ -1592,9 +1611,24 @@ int burn_drive_resolve_link(char *path, char adr[], int *recursion_count)
|
||||
} else
|
||||
adrpt = link_target;
|
||||
}
|
||||
ret = burn_drive_convert_fs_adr_sub(adrpt, adr, recursion_count);
|
||||
if (flag & 2) {
|
||||
/* Link-only recursion */
|
||||
if (lstat(adrpt, &stbuf) == -1) {
|
||||
;
|
||||
} else if((stbuf.st_mode & S_IFMT) == S_IFLNK) {
|
||||
ret = burn_drive_resolve_link(adrpt, adr,
|
||||
recursion_count, flag);
|
||||
} else {
|
||||
strcpy(adr, adrpt);
|
||||
}
|
||||
} else {
|
||||
/* Link and device number recursion */
|
||||
ret = burn_drive_convert_fs_adr_sub(adrpt, adr,
|
||||
recursion_count);
|
||||
sprintf(msg,"burn_drive_convert_fs_adr( %s ) returns %d",
|
||||
link_target, ret);
|
||||
}
|
||||
if (flag & 1)
|
||||
burn_drive_adr_debug_msg(msg, NULL);
|
||||
return ret;
|
||||
}
|
||||
@ -1769,7 +1803,7 @@ int burn_drive_convert_fs_adr_sub(char *path, char adr[], int *rec_count)
|
||||
return 0;
|
||||
}
|
||||
if((stbuf.st_mode & S_IFMT) == S_IFLNK) {
|
||||
ret = burn_drive_resolve_link(path, adr, rec_count);
|
||||
ret = burn_drive_resolve_link(path, adr, rec_count, 0);
|
||||
if(ret > 0)
|
||||
return 1;
|
||||
burn_drive_adr_debug_msg("link fallback via stat( %s )", path);
|
||||
@ -2608,6 +2642,9 @@ int burn_drive_equals_adr(struct burn_drive *d1, char *adr2_in, int role2)
|
||||
if (S_ISBLK(stbuf1.st_mode) && S_ISBLK(stbuf2.st_mode) &&
|
||||
stbuf1.st_rdev == stbuf2.st_rdev)
|
||||
return 1; /* same major,minor device number */
|
||||
if (S_ISCHR(stbuf1.st_mode) && S_ISCHR(stbuf2.st_mode) &&
|
||||
stbuf1.st_rdev == stbuf2.st_rdev)
|
||||
return 1; /* same major,minor device number */
|
||||
|
||||
/* Are both filesystem objects related to the same MMC drive */
|
||||
if (conv_ret2 <= 0)
|
||||
|
@ -59,6 +59,12 @@ int burn_sg_open_o_nonblock = 1;
|
||||
to unconditional abort of the process */
|
||||
int burn_sg_open_abort_busy = 0;
|
||||
|
||||
|
||||
/* The message returned from sg_id_string() and/or sg_initialize()
|
||||
*/
|
||||
static char sg_initialize_msg[1024] = {""};
|
||||
|
||||
|
||||
/* ts A61002 */
|
||||
|
||||
#include "cleanup.h"
|
||||
@ -110,6 +116,14 @@ int burn_initialize(void)
|
||||
ret = burn_msgs_initialize();
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
ret = sg_initialize(sg_initialize_msg, 0);
|
||||
if (ret <= 0) {
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
0x00020175,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
sg_initialize_msg, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
burn_running = 1;
|
||||
return 1;
|
||||
}
|
||||
@ -137,10 +151,22 @@ void burn_finish(void)
|
||||
/* ts A60924 : ticket 74 */
|
||||
libdax_msgs_destroy(&libdax_messenger,0);
|
||||
|
||||
sg_shutdown(0);
|
||||
|
||||
burn_running = 0;
|
||||
}
|
||||
|
||||
|
||||
/* ts A91226 */
|
||||
/** API function. See libburn.h */
|
||||
char *burn_scsi_transport_id(int flag)
|
||||
{
|
||||
if (!burn_running)
|
||||
sg_id_string(sg_initialize_msg, 0);
|
||||
return sg_initialize_msg;
|
||||
}
|
||||
|
||||
|
||||
/* ts A60813 */
|
||||
/** API function. See libburn.h */
|
||||
void burn_preset_device_open(int exclusive, int blocking, int abort_on_busy)
|
||||
|
@ -9,8 +9,10 @@ Applications must use 64 bit off_t. E.g. by defining
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
or take special precautions to interface with the library by 64 bit integers
|
||||
where this .h files prescribe off_t. Not to use 64 bit file i/o will keep the
|
||||
application from producing and processing ISO images of more than 2 GB size.
|
||||
where this .h files prescribe off_t.
|
||||
|
||||
To prevent 64 bit file i/o in the library would keep the application from
|
||||
processing tracks of more than 2 GB size.
|
||||
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
@ -767,9 +769,6 @@ void burn_set_verbosity(int level);
|
||||
This call can be made at any time - even before burn_initialize().
|
||||
It is in effect for all active drives and currently not very thread
|
||||
safe for multiple drives.
|
||||
|
||||
>>> ??? Shouldn't the file path with bit1 be adjustable ?
|
||||
|
||||
@param flag Bitfield for control purposes. The default is 0.
|
||||
bit0= log to file /tmp/libburn_sg_command_log
|
||||
bit1= log to stderr
|
||||
@ -868,12 +867,12 @@ void burn_allow_untested_profiles(int yes);
|
||||
If the path leads to an existing file of any type other than directory,
|
||||
then the result is a sequential write-only stdio-drive = drive role 3.
|
||||
|
||||
The special address form "stdio:/dev/fd/<number>" is interpreted literally
|
||||
as reference to open file descriptor <number>. This address form coincides
|
||||
The special address form "stdio:/dev/fd/{number}" is interpreted literally
|
||||
as reference to open file descriptor {number}. This address form coincides
|
||||
with real files on some systems, but it is in fact hardcoded in libburn.
|
||||
Special address "stdio:-" means stdout = "stdio:/dev/fd/1".
|
||||
The role of such a drive is determined by the file type obtained via
|
||||
fstat(<number>).
|
||||
fstat({number}).
|
||||
|
||||
Roles 2 and 3 perform all their eventual data transfer activities on a file
|
||||
via standard i/o functions open(2), lseek(2), read(2), write(2), close(2).
|
||||
@ -1065,6 +1064,19 @@ int burn_drive_obtain_scsi_adr(char *path, int *bus_no, int *host_no,
|
||||
*/
|
||||
int burn_drive_grab(struct burn_drive *drive, int load);
|
||||
|
||||
/* ts B00114 */
|
||||
/* Probe available CD write modes and block types. In earlier versions this
|
||||
was done unconditionally on drive examination or aquiration. But it is
|
||||
lengthy and obtrusive, up to spoiling burn runs on the examined drives.
|
||||
So now this probing is omitted by default. All drives which announce to be
|
||||
capable of CD or DVD writing, get blindly attributed the capability for
|
||||
SAO and TAO. Applications which are interested in RAW modes or want to
|
||||
rely on the traditional write mode information, may use this call.
|
||||
@param drive_info drive object to be inquired
|
||||
@return >0 indicates success, <=0 means failure
|
||||
@since 0.7.6
|
||||
*/
|
||||
int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info);
|
||||
|
||||
/* ts A90824 */
|
||||
/** Calm down or alert a drive. Some drives stay alert after reading for
|
||||
@ -1073,7 +1085,7 @@ int burn_drive_grab(struct burn_drive *drive, int load);
|
||||
sense to calm down the drive if no read operation is expected for the
|
||||
next few seconds. The drive will get alert automatically if operations
|
||||
are required.
|
||||
@param drive The drive to influence.
|
||||
@param d The drive to influence.
|
||||
@param flag Bitfield for control purposes
|
||||
bit0= become alert (else start snoozing)
|
||||
This is not mandatory to allow further drive operations
|
||||
@ -1097,7 +1109,7 @@ void burn_drive_release(struct burn_drive *drive, int eject);
|
||||
eject button disabled. This physically locked drive state will last until
|
||||
the drive is grabbed again and released via burn_drive_release().
|
||||
Programs like eject, cdrecord, growisofs will break that ban too.
|
||||
@param drive The drive to release and leave locked.
|
||||
@param d The drive to release and leave locked.
|
||||
@param flag Bitfield for control purposes (unused yet, submit 0)
|
||||
@return 1 means success, <=0 means failure
|
||||
@since 0.4.0
|
||||
@ -1190,7 +1202,7 @@ char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
|
||||
/* ts A90909 */
|
||||
/** Retrieve some media information which is mainly specific to CD. For other
|
||||
media only the bits in reply parameter valid are supposed to be meaningful.
|
||||
@param drive The drive to query.
|
||||
@param d The drive to query.
|
||||
@param disc_type A string saying either "CD-DA or CD-ROM", or "CD-I",
|
||||
or ""CD-ROM XA", or "undefined".
|
||||
@param disc_id A 32 bit number read from the media. (Meaning unclear yet)
|
||||
@ -1796,10 +1808,6 @@ struct burn_source *burn_file_source_new(const char *path,
|
||||
|
||||
/* ts A91122 : An interface to open(O_DIRECT) or similar OS tricks. */
|
||||
|
||||
/* <<< temporary indicator until release 0.7.4
|
||||
*/
|
||||
#define Libburn_has_open_trac_srC 1
|
||||
|
||||
/** Opens a file with eventual acceleration preparations which may depend
|
||||
on the operating system and on compile time options of libburn.
|
||||
You may use this call instead of open(2) for opening file descriptors
|
||||
@ -1945,7 +1953,7 @@ int burn_fifo_inquire_status(struct burn_source *fifo, int *size,
|
||||
@param full_counter The number of times the fifo was full.
|
||||
@since 0.7.4
|
||||
*/
|
||||
void burn_fifo_get_statistics(struct burn_source *source,
|
||||
void burn_fifo_get_statistics(struct burn_source *fifo,
|
||||
int *total_min_fill, int *interval_min_fill,
|
||||
int *put_counter, int *get_counter,
|
||||
int *empty_counter, int *full_counter);
|
||||
@ -1959,8 +1967,7 @@ void burn_fifo_get_statistics(struct burn_source *source,
|
||||
burn_fifo_next_interval() was called.
|
||||
@since 0.7.4
|
||||
*/
|
||||
void burn_fifo_next_interval(struct burn_source *source,
|
||||
int *interval_min_fill);
|
||||
void burn_fifo_next_interval(struct burn_source *fifo, int *interval_min_fill);
|
||||
|
||||
/* ts A80713 */
|
||||
/** Obtain a preview of the first input data of a fifo which was created
|
||||
@ -1982,7 +1989,7 @@ void burn_fifo_next_interval(struct burn_source *source,
|
||||
@return <0 on severe error, 0 if not enough data, 1 if bufsize bytes read
|
||||
@since 0.5.0
|
||||
*/
|
||||
int burn_fifo_peek_data(struct burn_source *source, char *buf, int bufsize,
|
||||
int burn_fifo_peek_data(struct burn_source *fifo, char *buf, int bufsize,
|
||||
int flag);
|
||||
|
||||
/* ts A91125 */
|
||||
@ -1999,7 +2006,7 @@ int burn_fifo_peek_data(struct burn_source *source, char *buf, int bufsize,
|
||||
1 if desired amount or fifo full
|
||||
@since 0.7.4
|
||||
*/
|
||||
int burn_fifo_fill(struct burn_source *source, int bufsize, int flag);
|
||||
int burn_fifo_fill(struct burn_source *fifo, int fill, int flag);
|
||||
|
||||
|
||||
/* ts A70328 */
|
||||
@ -2609,7 +2616,7 @@ void burn_version(int *major, int *minor, int *micro);
|
||||
*/
|
||||
#define burn_header_version_major 0
|
||||
#define burn_header_version_minor 7
|
||||
#define burn_header_version_micro 3
|
||||
#define burn_header_version_micro 6
|
||||
/** Note:
|
||||
Above version numbers are also recorded in configure.ac because libtool
|
||||
wants them as parameters at build time.
|
||||
@ -2659,6 +2666,15 @@ These two advises are mutually exclusive.
|
||||
|
||||
*/
|
||||
|
||||
/* ts A91226 */
|
||||
/** Obtain the id string of the SCSI transport interface.
|
||||
This interface may be a system specific adapter module of libburn or
|
||||
an adapter to a supporting library like libcdio.
|
||||
@flag Bitfield for control puposes, submit 0 for now
|
||||
@return A pointer to the id string. Do not alter the string content.
|
||||
@since 0.7.6
|
||||
*/
|
||||
char *burn_scsi_transport_id(int flag);
|
||||
|
||||
/* ts A60924 : ticket 74 */
|
||||
/** Control queueing and stderr printing of messages from libburn.
|
||||
@ -2928,16 +2944,9 @@ BURN_END_DECLS
|
||||
For other modes resp. real probing one has to call
|
||||
burn_drive_probe_cd_write_modes().
|
||||
|
||||
# define Libburn_pioneer_dvr_216d_dummy_probe_wM 1
|
||||
*/
|
||||
#ifdef Libburn_pioneer_dvr_216d_dummy_probe_wM
|
||||
#define Libburn_dummy_probe_write_modeS 1
|
||||
|
||||
/* Probe available CD write modes and block types.
|
||||
@param drive_info drive object to be inquired
|
||||
*/
|
||||
int burn_drive_probe_cd_write_modes(struct burn_drive_info *drive_info)
|
||||
|
||||
#endif /* Libburn_pioneer_dvr_216d_dummy_probe_wM */
|
||||
|
||||
|
||||
#endif /*LIBBURN_H*/
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
/* libdax_msgs
|
||||
Message handling facility of libdax.
|
||||
Copyright (C) 2006 - 2009 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL version 2
|
||||
Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
/* libdax_msgs
|
||||
Message handling facility of libdax.
|
||||
Copyright (C) 2006-2009 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL version 2
|
||||
Copyright (C) 2006-2010 Thomas Schmitt <scdbackup@gmx.net>,
|
||||
provided under GPL
|
||||
*/
|
||||
|
||||
|
||||
@ -552,6 +552,8 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
|
||||
0x00020172 (SORRY,HIGH) = Read start address larger than number of readable blocks
|
||||
0x00020173 (FAILURE,HIGH) = Drive tells NWA smaller than last written address
|
||||
0x00020174 (SORRY,HIGH) = Fifo alignment does not allow desired read size
|
||||
0x00020175 (FATAL,HIGH) = Supporting library is too old
|
||||
0x00020176 (NOTE,HIGH) = Stream recording disabled because of small OS buffer
|
||||
|
||||
|
||||
libdax_audioxtr:
|
||||
|
@ -57,5 +57,7 @@ typedef struct burn_drive_enumeration_state *burn_drive_enumerator_t;
|
||||
To be initialized and used within sg-*.c .
|
||||
*/
|
||||
#define BURN_OS_TRANSPORT_DRIVE_ELEMENTS \
|
||||
struct cam_device* cam;
|
||||
struct cam_device* cam; \
|
||||
int lock_fd; \
|
||||
|
||||
|
||||
|
72
libburn/os-libcdio.h
Normal file
72
libburn/os-libcdio.h
Normal file
@ -0,0 +1,72 @@
|
||||
|
||||
/* os-libcdio.h
|
||||
Operating system specific libburn definitions and declarations. Included
|
||||
by os.h in case of compilation for
|
||||
Unknown X/Open-like systems
|
||||
with GNU libcdio MMC transport adapter sg-libcdio.c
|
||||
|
||||
Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPL
|
||||
*/
|
||||
|
||||
|
||||
/** List of all signals which shall be caught by signal handlers and trigger
|
||||
a graceful abort of libburn. (See man 7 signal.)
|
||||
*/
|
||||
/* Once as system defined macros */
|
||||
#define BURN_OS_SIGNAL_MACRO_LIST \
|
||||
SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, \
|
||||
SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, \
|
||||
SIGUSR1, SIGUSR2, SIGXCPU, SIGTSTP, SIGTTIN, \
|
||||
SIGTTOU
|
||||
|
||||
/* Once as text 1:1 list of strings for messages and interpreters */
|
||||
#define BURN_OS_SIGNAL_NAME_LIST \
|
||||
"SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGABRT", \
|
||||
"SIGFPE", "SIGSEGV", "SIGPIPE", "SIGALRM", "SIGTERM", \
|
||||
"SIGUSR1", "SIGUSR2", "SIGXCPU", "SIGTSTP", "SIGTTIN", \
|
||||
"SIGTTOU"
|
||||
|
||||
/* The number of above list items */
|
||||
#define BURN_OS_SIGNAL_COUNT 16
|
||||
|
||||
/** To list all signals which shall surely not be caught */
|
||||
#define BURN_OS_NON_SIGNAL_MACRO_LIST \
|
||||
SIGKILL, SIGCHLD, SIGSTOP
|
||||
|
||||
/* The number of above list items */
|
||||
#define BURN_OS_NON_SIGNAL_COUNT 3
|
||||
|
||||
|
||||
/* The maximum size for a (SCSI) i/o transaction */
|
||||
/* Important : MUST be at least 32768 ! */
|
||||
/* My Blu-ray burner LG GGW-H20 writes junk if stream recording is combined
|
||||
with buffer size 32 kB. So stream recording is allowed only with size 64k.
|
||||
This makes it worth to have a special case for Linux buffer size here.
|
||||
*/
|
||||
#ifdef __linux
|
||||
#define BURN_OS_TRANSPORT_BUFFER_SIZE 65536
|
||||
#else
|
||||
/* (It might be risky to use 64k. FreeBSD is said to can only 32k.) */
|
||||
#define BURN_OS_TRANSPORT_BUFFER_SIZE 32768
|
||||
#endif
|
||||
|
||||
|
||||
/* To hold the position of the most recently delivered address from
|
||||
device enumeration.
|
||||
*/
|
||||
struct burn_drive_enumerator_struct {
|
||||
char **ppsz_cd_drives;
|
||||
char **pos;
|
||||
};
|
||||
|
||||
#define BURN_OS_DEFINE_DRIVE_ENUMERATOR_T \
|
||||
typedef struct burn_drive_enumerator_struct burn_drive_enumerator_t;
|
||||
|
||||
|
||||
/* The list of operating system dependent elements in struct burn_drive.
|
||||
Usually they are initialized in sg-*.c:enumerate_common().
|
||||
*/
|
||||
#define BURN_OS_TRANSPORT_DRIVE_ELEMENTS \
|
||||
void *p_cdio; /* actually a pointer to CdIo_t */ \
|
||||
char libcdio_name[4096]; /* The drive path as used by libcdio */ \
|
||||
|
19
libburn/os.h
19
libburn/os.h
@ -13,6 +13,15 @@
|
||||
Operating system case distinction
|
||||
*/
|
||||
|
||||
|
||||
#ifdef Libburn_use_libcdiO
|
||||
|
||||
|
||||
/* -------------------------- X/Open with GNU libcdio ---------------------- */
|
||||
#include "os-libcdio.h"
|
||||
|
||||
|
||||
#else
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
|
||||
@ -20,6 +29,14 @@
|
||||
#include "os-freebsd.h"
|
||||
|
||||
|
||||
#else
|
||||
#ifdef __FreeBSD_kernel__
|
||||
|
||||
|
||||
/* ----------------------- FreeBSD with CAM under Debian ------------------- */
|
||||
#include "os-freebsd.h"
|
||||
|
||||
|
||||
#else
|
||||
#ifdef __linux
|
||||
|
||||
@ -36,7 +53,9 @@
|
||||
|
||||
|
||||
#endif /* ! __linux */
|
||||
#endif /* ! __FreeBSD__kernel__ */
|
||||
#endif /* ! __FreeBSD__ */
|
||||
#endif /* ! Libburn_use_libcdiO */
|
||||
|
||||
|
||||
#endif /* ! BURN_OS_H_INCLUDED */
|
||||
|
@ -74,14 +74,17 @@ void sbc_eject(struct burn_drive *d)
|
||||
return;
|
||||
|
||||
scsi_init_command(&c, SBC_UNLOAD, sizeof(SBC_UNLOAD));
|
||||
c.opcode[1] |= 1; /* ts A70918 : Immed */
|
||||
/* c.opcode[1] |= 1; / * ts A70918 : Immed , ts B00109 : revoked */
|
||||
c.page = NULL;
|
||||
c.dir = NO_TRANSFER;
|
||||
d->issue_command(d, &c);
|
||||
/* ts A70918 : Wait long. A late eject could surprise or hurt user.
|
||||
ts B00109 : Asynchronous eject revoked, as one cannot reliably
|
||||
distinguish out from unready.
|
||||
if (c.error)
|
||||
return;
|
||||
/* ts A70918 : Wait long. A late eject could surprise or hurt user. */
|
||||
spc_wait_unit_attention(d, 1800, "STOP UNIT (+ EJECT)", 0);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,8 +7,8 @@ the transport level aspects of SCSI control and command i/o.
|
||||
|
||||
Present implementation: default dummy which enables libburn only to work
|
||||
with stdio: pseudo drive addresses.
|
||||
For real implementations see sg-linux.c or sg-freebsd.c
|
||||
|
||||
For real implementations see sg-linux.c, sg-freebsd.c,
|
||||
sg-libcdio.c
|
||||
*/
|
||||
|
||||
|
||||
@ -39,6 +39,59 @@ Present implementation: default dummy which enables libburn only to work
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
|
||||
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag)
|
||||
{
|
||||
strcpy(msg, "internal X/Open adapter sg-dummy");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag)
|
||||
{
|
||||
return sg_id_string(msg, 0);
|
||||
}
|
||||
|
||||
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Returns the next index number and the next enumerated drive address.
|
||||
The enumeration has to cover all available and accessible drives. It is
|
||||
allowed to return addresses of drives which are not available but under
|
||||
@ -153,6 +206,23 @@ int sg_is_enumerable_adr(char *adr)
|
||||
}
|
||||
|
||||
|
||||
/* Return 1 if the given path leads to a regular file or a device that can be
|
||||
seeked, read, and possibly written with 2 kB granularity.
|
||||
*/
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (S_ISBLK(stbuf.st_mode))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** Estimate the potential payload capacity of a file address.
|
||||
@param path The address of the file to be examined. If it does not
|
||||
exist yet, then the directory will be inquired.
|
||||
@ -215,7 +285,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_bsize) *
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
@ -29,12 +29,28 @@ and of deriving the following system specific files from existing examples:
|
||||
Said sg-*.c operations are defined by a public function interface, which has
|
||||
to be implemented in a way that provides libburn with the desired services:
|
||||
|
||||
sg_id_string() returns an id string of the SCSI transport adapter.
|
||||
It may be called before initialization but then may
|
||||
return only a preliminary id.
|
||||
|
||||
sg_initialize() performs global initialization of the SCSI transport
|
||||
adapter and eventually needed operating system
|
||||
facilities. Checks for compatibility of supporting
|
||||
software components.
|
||||
|
||||
sg_shutdown() performs global finalizations and releases golbally
|
||||
aquired resources.
|
||||
|
||||
sg_give_next_adr() iterates over the set of potentially useful drive
|
||||
address strings.
|
||||
|
||||
scsi_enumerate_drives() brings all available, not-whitelist-banned, and
|
||||
accessible drives into libburn's list of drives.
|
||||
|
||||
sg_dispose_drive() finalizes adapter specifics of struct burn_drive
|
||||
on destruction. Releases resources which were aquired
|
||||
underneath scsi_enumerate_drives().
|
||||
|
||||
sg_drive_is_open() tells wether libburn has the given drive in use.
|
||||
|
||||
sg_grab() opens the drive for SCSI commands and ensures
|
||||
@ -48,8 +64,25 @@ sg_issue_command() sends a SCSI command to the drive, receives reply,
|
||||
|
||||
sg_obtain_scsi_adr() tries to obtain SCSI address parameters.
|
||||
|
||||
|
||||
burn_os_is_2k_seekrw() tells whether the given path leads to a file object
|
||||
that can be used in 2 kB granularity by lseek(2),
|
||||
read(2), and possibly write(2) if not read-only.
|
||||
E.g. a USB stick or a hard disk.
|
||||
|
||||
burn_os_stdio_capacity() estimates the emulated media space of stdio-drives.
|
||||
|
||||
burn_os_open_track_src() opens a disk file in a way that allows best
|
||||
throughput with file reading and/or SCSI write command
|
||||
transmission.
|
||||
|
||||
burn_os_alloc_buffer() allocates a memory area that is suitable for file
|
||||
descriptors issued by burn_os_open_track_src().
|
||||
The buffer size may be rounded up for alignment
|
||||
reasons.
|
||||
|
||||
burn_os_free_buffer() delete a buffer obtained by burn_os_alloc_buffer().
|
||||
|
||||
|
||||
Porting hints are marked by the text "PORTING:".
|
||||
Send feedback to libburn-hackers@pykix.org .
|
||||
@ -230,6 +263,61 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag)
|
||||
{
|
||||
strcpy(msg, "internal FreeBSD CAM adapter sg-freebsd-port");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag)
|
||||
{
|
||||
return sg_id_string(msg, 0);
|
||||
}
|
||||
|
||||
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
The eventual initialization of those components was made underneath
|
||||
scsi_enumerate_drives().
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Returns the next index number and the next enumerated drive address.
|
||||
The enumeration has to cover all available and accessible drives. It is
|
||||
allowed to return addresses of drives which are not available but under
|
||||
@ -299,7 +387,7 @@ try_item:; /* This spaghetti loop keeps the number of tabs small */
|
||||
break;
|
||||
snprintf(buf, sizeof (buf), "/dev/%s%d",
|
||||
result->periph_name, result->unit_number);
|
||||
if(adr_size <= strlen(buf)
|
||||
if(adr_size <= strlen(buf))
|
||||
return -1;
|
||||
strcpy(adr, buf);
|
||||
|
||||
@ -323,7 +411,7 @@ try_item:; /* This spaghetti loop keeps the number of tabs small */
|
||||
int scsi_enumerate_drives(void)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1;
|
||||
int initialize = 1, ret;
|
||||
char buf[64];
|
||||
|
||||
while(1) {
|
||||
@ -338,6 +426,7 @@ int scsi_enumerate_drives(void)
|
||||
idx.result->target_lun);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -360,11 +449,12 @@ int sg_drive_is_open(struct burn_drive * d)
|
||||
*/
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
int count;
|
||||
struct cam_device *cam;
|
||||
|
||||
if(d->cam != NULL)
|
||||
return 0;
|
||||
if(d->cam != NULL) {
|
||||
d->released = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
cam = cam_open_device(d->devname, O_RDWR);
|
||||
if (cam == NULL) {
|
||||
@ -515,7 +605,7 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||
int *target_no, int *lun_no)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1;
|
||||
int initialize = 1, ret;
|
||||
char buf[64];
|
||||
struct periph_match_result* result;
|
||||
|
||||
@ -524,7 +614,7 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
if (strcmp(adr, buf) != 0)
|
||||
if (strcmp(path, buf) != 0)
|
||||
continue;
|
||||
result = &(idx->ccb.cdm.matches[i].result.periph_result);
|
||||
*bus_no = result->path_id;
|
||||
@ -546,7 +636,7 @@ int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||
int sg_is_enumerable_adr(char* adr)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1;
|
||||
int initialize = 1, ret;
|
||||
char buf[64];
|
||||
|
||||
while(1) {
|
||||
@ -564,6 +654,47 @@ int sg_is_enumerable_adr(char* adr)
|
||||
}
|
||||
|
||||
|
||||
/* ts B00115 */
|
||||
/* Return 1 if the given path leads to a regular file or a device that can be
|
||||
seeked, written, and read with 2 kB granularity.
|
||||
*/
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
char *spt;
|
||||
int i, e;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (!S_ISCHR(stbuf.st_mode))
|
||||
return 0;
|
||||
spt = strrchr(path, '/');
|
||||
if (spt == NULL)
|
||||
spt = path;
|
||||
else
|
||||
spt++;
|
||||
e = strlen(spt);
|
||||
for (i = strlen(spt) - 1; i > 0; i--)
|
||||
if (spt[i] >= '0' && spt[i] <= '9')
|
||||
e = i;
|
||||
if (strncmp(spt, "da", e) == 0) /* SCSI disk. E.g. USB stick. */
|
||||
return 1;
|
||||
if (strncmp(spt, "cd", e) == 0) /* SCSI CD drive might be writeable. */
|
||||
return 1;
|
||||
if (strncmp(spt, "ad", e) == 0) /* IDE hard drive */
|
||||
return 1;
|
||||
if (strncmp(spt, "acd", e) == 0) /* IDE CD drive might be writeable */
|
||||
return 1;
|
||||
if (strncmp(spt, "fd", e) == 0) /* Floppy disk */
|
||||
return 1;
|
||||
if (strncmp(spt, "fla", e) == 0) /* Flash drive */
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ts A70909 */
|
||||
/** Estimate the potential payload capacity of a file address.
|
||||
@param path The address of the file to be examined. If it does not
|
||||
@ -623,7 +754,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_bsize) *
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/file.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/poll.h>
|
||||
@ -16,10 +17,12 @@
|
||||
|
||||
#include <err.h> /* XXX */
|
||||
|
||||
|
||||
/* ts A70909 */
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
/* ts B00121 */
|
||||
#include <sys/disk.h> /* DIOCGMEDIASIZE */
|
||||
|
||||
|
||||
#include "transport.h"
|
||||
#include "drive.h"
|
||||
@ -54,6 +57,79 @@ int burn_drive_is_banned(char *device_address);
|
||||
int mmc_function_spy(struct burn_drive *d, char * text);
|
||||
|
||||
|
||||
/* ts B00113
|
||||
Whether to log SCSI commands:
|
||||
bit0= log in /tmp/libburn_sg_command_log
|
||||
bit1= log to stderr
|
||||
bit2= flush every line
|
||||
*/
|
||||
extern int burn_sg_log_scsi;
|
||||
|
||||
/* ts B00114 */
|
||||
/* Storage object is in libburn/init.c
|
||||
whether to strive for exclusive access to the drive
|
||||
*/
|
||||
extern int burn_sg_open_o_excl;
|
||||
|
||||
|
||||
/* ts A91227 */
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag)
|
||||
{
|
||||
strcpy(msg, "internal FreeBSD CAM adapter sg-freebsd");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A91227 */
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag)
|
||||
{
|
||||
return sg_id_string(msg, 0);
|
||||
}
|
||||
|
||||
|
||||
/* ts A91227 */
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
The eventual initialization of those components was made underneath
|
||||
scsi_enumerate_drives().
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A61021 : Moved most code from scsi_enumerate_drives under
|
||||
sg_give_next_adr() */
|
||||
/* Some helper functions for scsi_give_next_adr() */
|
||||
@ -145,7 +221,7 @@ static int sg_next_enumeration_buffer(burn_drive_enumerator_t *idx_)
|
||||
}
|
||||
|
||||
|
||||
/** Returns the next index number and the next enumerated drive address.
|
||||
/** Returns the next index object state and the next enumerated drive address.
|
||||
@param idx An opaque handle. Make no own theories about it.
|
||||
@param adr Takes the reply
|
||||
@param adr_size Gives maximum size of reply including final 0
|
||||
@ -199,9 +275,15 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx_,
|
||||
struct periph_match_result* result;
|
||||
|
||||
result = &(idx->ccb.cdm.matches[idx->i].result.periph_result);
|
||||
/* ts B00112 : we really want only "cd" devices.
|
||||
|
||||
if (idx->skip_device ||
|
||||
strcmp(result->periph_name, "pass") == 0)
|
||||
break;
|
||||
*/
|
||||
if (idx->skip_device ||
|
||||
strcmp(result->periph_name, "cd") != 0)
|
||||
break;
|
||||
ret = snprintf(adr, adr_size, "/dev/%s%d",
|
||||
result->periph_name, result->unit_number);
|
||||
if(ret >= adr_size)
|
||||
@ -212,7 +294,7 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx_,
|
||||
|
||||
}
|
||||
default:
|
||||
/* printf(stderr, "unknown match type\n"); */
|
||||
/* fprintf(stderr, "unknown match type\n"); */
|
||||
break;
|
||||
}
|
||||
(idx->i)++;
|
||||
@ -287,6 +369,10 @@ int sg_close_drive(struct burn_drive * d)
|
||||
cam_close_device(d->cam);
|
||||
d->cam = NULL;
|
||||
}
|
||||
if (d->lock_fd > 0) {
|
||||
close(d->lock_fd);
|
||||
d->lock_fd = -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -340,7 +426,9 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
out.lun = lun_no;
|
||||
|
||||
out.devname = burn_strdup(fname);
|
||||
|
||||
out.cam = NULL;
|
||||
out.lock_fd = -1;
|
||||
|
||||
out.start_lba= -2000000000;
|
||||
out.end_lba= -2000000000;
|
||||
@ -432,6 +520,8 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
/* Operating system adapter is CAM */
|
||||
/* Adapter specific handles and data */
|
||||
out.cam = NULL;
|
||||
out.lock_fd = -1;
|
||||
|
||||
/* Adapter specific functions */
|
||||
out.grab = sg_grab;
|
||||
out.release = sg_release;
|
||||
@ -444,14 +534,143 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
|
||||
#endif /* ! Scsi_freebsd_make_own_enumeratE */
|
||||
|
||||
/* ts A61021: do not believe this:
|
||||
we use the sg reference count to decide whether we can use the
|
||||
drive or not.
|
||||
if refcount is not one, drive is open somewhere else.
|
||||
|
||||
/* Lock the inode associated to dev_fd and the inode associated to devname.
|
||||
Return OS errno, number of pass device of dev_fd, locked fd to devname,
|
||||
error message.
|
||||
A return value of > 0 means success, <= 0 means failure.
|
||||
*/
|
||||
static int freebsd_dev_lock(int dev_fd, char *devname,
|
||||
int *os_errno, int *pass_dev_no, int *lock_fd, char msg[4096],
|
||||
int flag)
|
||||
{
|
||||
int lock_denied = 0, fd_stbuf_valid, name_stbuf_valid, i, pass_l = 100;
|
||||
int max_retry = 3, tries = 0;
|
||||
struct stat fd_stbuf, name_stbuf;
|
||||
char pass_name[16], *lock_name;
|
||||
|
||||
*os_errno = 0;
|
||||
*pass_dev_no = -1;
|
||||
*lock_fd = -1;
|
||||
msg[0] = 0;
|
||||
|
||||
fd_stbuf_valid = !fstat(dev_fd, &fd_stbuf);
|
||||
|
||||
/* Try to find name of pass device by inode number */
|
||||
lock_name = (char *) "effective device";
|
||||
if(fd_stbuf_valid) {
|
||||
for (i = 0; i < pass_l; i++) {
|
||||
sprintf(pass_name, "/dev/pass%d", i);
|
||||
if (stat(pass_name, &name_stbuf) != -1)
|
||||
if(fd_stbuf.st_ino == name_stbuf.st_ino &&
|
||||
fd_stbuf.st_dev == name_stbuf.st_dev)
|
||||
break;
|
||||
}
|
||||
if (i < pass_l) {
|
||||
lock_name = pass_name;
|
||||
*pass_dev_no = i;
|
||||
}
|
||||
}
|
||||
|
||||
name_stbuf_valid = !stat(devname, &name_stbuf);
|
||||
for (tries= 0; tries <= max_retry; tries++) {
|
||||
lock_denied = flock(dev_fd, LOCK_EX | LOCK_NB);
|
||||
*os_errno = errno;
|
||||
if (lock_denied) {
|
||||
if (errno == EAGAIN && tries < max_retry) {
|
||||
/* <<< debugging
|
||||
fprintf(stderr,
|
||||
"\nlibcdio_DEBUG: EAGAIN pass, tries= %d\n",
|
||||
tries);
|
||||
*/
|
||||
usleep(2000000);
|
||||
continue;
|
||||
}
|
||||
sprintf(msg,
|
||||
"Device busy. flock(LOCK_EX) failed on %s of %s",
|
||||
strlen(lock_name) > 2000 || *pass_dev_no < 0 ?
|
||||
"pass device" : lock_name,
|
||||
strlen(devname) > 2000 ? "drive" : devname);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
fprintf(stderr, "libburn_DEBUG: flock obtained on %s of %s\n",
|
||||
lock_name, devname);
|
||||
*/
|
||||
|
||||
/* Eventually lock the official device node too */
|
||||
if (fd_stbuf_valid && name_stbuf_valid &&
|
||||
(fd_stbuf.st_ino != name_stbuf.st_ino ||
|
||||
fd_stbuf.st_dev != name_stbuf.st_dev)) {
|
||||
|
||||
*lock_fd = open(devname, O_RDONLY);
|
||||
if (*lock_fd == 0) {
|
||||
close(*lock_fd);
|
||||
*lock_fd = -1;
|
||||
} if (*lock_fd > 0) {
|
||||
for (tries = 0; tries <= max_retry; tries++) {
|
||||
lock_denied =
|
||||
flock(*lock_fd, LOCK_EX | LOCK_NB);
|
||||
if (lock_denied) {
|
||||
if (errno == EAGAIN &&
|
||||
tries < max_retry) {
|
||||
/* <<< debugging
|
||||
fprintf(stderr,
|
||||
"\nlibcdio_DEBUG: EAGAIN dev, tries= %d\n",
|
||||
tries);
|
||||
*/
|
||||
|
||||
usleep(2000000);
|
||||
continue;
|
||||
}
|
||||
close(*lock_fd);
|
||||
*lock_fd = -1;
|
||||
sprintf(msg,
|
||||
"Device busy. flock(LOCK_EX) failed on %s",
|
||||
strlen(devname) > 4000 ? "drive" : devname);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
fprintf(stderr, "libburn_DEBUG: flock obtained on %s\n",
|
||||
devname);
|
||||
*/
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static int sg_lock(struct burn_drive *d, int flag)
|
||||
{
|
||||
int ret, os_errno, pass_dev_no = -1, flock_fd = -1;
|
||||
char msg[4096];
|
||||
|
||||
ret = freebsd_dev_lock(d->cam->fd, d->devname,
|
||||
&os_errno, &pass_dev_no, &flock_fd, msg, 0);
|
||||
if (ret <= 0) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020008,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
if (d->lock_fd > 0)
|
||||
close(d->lock_fd);
|
||||
d->lock_fd = flock_fd;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
int count;
|
||||
struct cam_device *cam;
|
||||
|
||||
if (mmc_function_spy(d, "sg_grab") <= 0)
|
||||
@ -464,22 +683,19 @@ int sg_grab(struct burn_drive *d)
|
||||
|
||||
cam = cam_open_device(d->devname, O_RDWR);
|
||||
if (cam == NULL) {
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00020003,
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Could not grab drive", 0/*os_errno*/, 0);
|
||||
"Could not grab drive", errno, 0);
|
||||
return 0;
|
||||
}
|
||||
/* er = ioctl(fd, SG_GET_ACCESS_COUNT, &count);*/
|
||||
count = 1;
|
||||
if (1 == count) {
|
||||
d->cam = cam;
|
||||
if (burn_sg_open_o_excl & 63)
|
||||
if (sg_lock(d, 0) <= 0)
|
||||
return 0;
|
||||
fcntl(cam->fd, F_SETOWN, getpid());
|
||||
d->released = 0;
|
||||
return 1;
|
||||
}
|
||||
burn_print(1, "could not acquire drive - already open\n");
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -507,11 +723,11 @@ int sg_release(struct burn_drive *d)
|
||||
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int done = 0;
|
||||
int err;
|
||||
int done = 0, err, sense_len, ret;
|
||||
union ccb *ccb;
|
||||
|
||||
char buf[161];
|
||||
static FILE *fp = NULL;
|
||||
|
||||
snprintf(buf, sizeof (buf), "sg_issue_command d->cam=%p d->released=%d",
|
||||
(void*)d->cam, d->released);
|
||||
mmc_function_spy(NULL, buf);
|
||||
@ -520,6 +736,15 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
c->error = 0;
|
||||
return 0;
|
||||
}
|
||||
if (burn_sg_log_scsi & 1) {
|
||||
if (fp == NULL) {
|
||||
fp= fopen("/tmp/libburn_sg_command_log", "a");
|
||||
fprintf(fp,
|
||||
"\n-----------------------------------------\n");
|
||||
}
|
||||
}
|
||||
if (burn_sg_log_scsi & 3)
|
||||
scsi_log_cmd(c,fp,0);
|
||||
|
||||
c->error = 0;
|
||||
|
||||
@ -568,12 +793,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
/* touch page so we can use valgrind */
|
||||
memset(c->page->data, 0, BUFFER_SIZE);
|
||||
} else {
|
||||
/* ts A90430 */
|
||||
/* a ssert(c->page->bytes > 0); */
|
||||
if (c->page->bytes <= 0) {
|
||||
c->error = 1;
|
||||
return 0;
|
||||
}
|
||||
ccb->csio.dxfer_len = c->page->bytes;
|
||||
}
|
||||
} else {
|
||||
@ -589,20 +808,24 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to transfer command to drive",
|
||||
errno, 0);
|
||||
cam_freeccb(ccb);
|
||||
sg_close_drive(d);
|
||||
d->released = 1;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
c->error = 1;
|
||||
return -1;
|
||||
{ret = -1; goto ex;}
|
||||
}
|
||||
/* XXX */
|
||||
|
||||
/* ts B00110 */
|
||||
/* Better curb sense_len */
|
||||
sense_len = ccb->csio.sense_len;
|
||||
if (sense_len > sizeof(c->sense))
|
||||
sense_len = sizeof(c->sense);
|
||||
memcpy(c->sense, &ccb->csio.sense_data, ccb->csio.sense_len);
|
||||
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
|
||||
if (!c->retry) {
|
||||
c->error = 1;
|
||||
cam_freeccb(ccb);
|
||||
return 1;
|
||||
{ret = 1; goto ex;}
|
||||
}
|
||||
switch (scsi_error(d, c->sense, 0)) {
|
||||
case RETRY:
|
||||
@ -617,8 +840,58 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
done = 1;
|
||||
}
|
||||
} while (!done);
|
||||
ret = 1;
|
||||
ex:;
|
||||
if (c->error)
|
||||
scsi_notify_error(d, c, c->sense, 18, 0);
|
||||
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 0, (c->error != 0) | 2);
|
||||
|
||||
cam_freeccb(ccb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/* ts B00115 */
|
||||
/* Return 1 if the given path leads to a regular file or a device that can be
|
||||
seeked, read and eventually written with 2 kB granularity.
|
||||
*/
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
char *spt;
|
||||
int i, e;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (!S_ISCHR(stbuf.st_mode))
|
||||
return 0;
|
||||
spt = strrchr(path, '/');
|
||||
if (spt == NULL)
|
||||
spt = path;
|
||||
else
|
||||
spt++;
|
||||
e = strlen(spt);
|
||||
for (i = strlen(spt) - 1; i > 0; i--)
|
||||
if (spt[i] >= '0' && spt[i] <= '9')
|
||||
e = i;
|
||||
if (strncmp(spt, "da", e) == 0) /* SCSI disk. E.g. USB stick. */
|
||||
return 1;
|
||||
if (strncmp(spt, "cd", e) == 0) /* SCSI CD drive might be writeable. */
|
||||
return 1;
|
||||
if (strncmp(spt, "ad", e) == 0) /* IDE hard drive */
|
||||
return 1;
|
||||
if (strncmp(spt, "acd", e) == 0) /* IDE CD drive might be writeable */
|
||||
return 1;
|
||||
if (strncmp(spt, "fd", e) == 0) /* Floppy disk */
|
||||
return 1;
|
||||
if (strncmp(spt, "fla", e) == 0) /* Flash drive */
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -639,6 +912,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
int fd, ret;
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
@ -673,6 +947,15 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
#endif /* Libburn_if_this_was_linuX */
|
||||
|
||||
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
*bytes = add_size;
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
@ -682,7 +965,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_bsize) *
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
|
928
libburn/sg-libcdio.c
Normal file
928
libburn/sg-libcdio.c
Normal file
@ -0,0 +1,928 @@
|
||||
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
||||
|
||||
/*
|
||||
|
||||
This is the main operating system dependent SCSI part of libburn. It implements
|
||||
the transport level aspects of SCSI control and command i/o.
|
||||
|
||||
Present implementation: GNU libcdio , for X/Open compliant operating systems
|
||||
|
||||
|
||||
PORTING:
|
||||
|
||||
Porting libburn typically will consist of adding a new operating system case
|
||||
to the following switcher files:
|
||||
os.h Operating system specific libburn definitions and declarations.
|
||||
sg.c Operating system dependent transport level modules.
|
||||
and of deriving the following system specific files from existing examples:
|
||||
os-*.h Included by os.h. You will need some general system knowledge
|
||||
about signals and knowledge about the storage object needs of your
|
||||
transport level module sg-*.c.
|
||||
|
||||
sg-*.c This source module. You will need special system knowledge about
|
||||
how to detect all potentially available drives, how to open them,
|
||||
eventually how to exclusively reserve them, how to perform
|
||||
SCSI transactions, how to inquire the (pseudo-)SCSI driver.
|
||||
You will not need to care about CD burning, MMC or other high-level
|
||||
SCSI aspects.
|
||||
|
||||
Said sg-*.c operations are defined by a public function interface, which has
|
||||
to be implemented in a way that provides libburn with the desired services:
|
||||
|
||||
sg_id_string() returns an id string of the SCSI transport adapter.
|
||||
It may be called before initialization but then may
|
||||
return only a preliminary id.
|
||||
|
||||
sg_initialize() performs global initialization of the SCSI transport
|
||||
adapter and eventually needed operating system
|
||||
facilities. Checks for compatibility of supporting
|
||||
software components.
|
||||
|
||||
sg_shutdown() performs global finalizations and releases golbally
|
||||
aquired resources.
|
||||
|
||||
sg_give_next_adr() iterates over the set of potentially useful drive
|
||||
address strings.
|
||||
|
||||
scsi_enumerate_drives() brings all available, not-whitelist-banned, and
|
||||
accessible drives into libburn's list of drives.
|
||||
|
||||
sg_dispose_drive() finalizes adapter specifics of struct burn_drive
|
||||
on destruction. Releases resources which were aquired
|
||||
underneath scsi_enumerate_drives().
|
||||
|
||||
sg_drive_is_open() tells wether libburn has the given drive in use.
|
||||
|
||||
sg_grab() opens the drive for SCSI commands and ensures
|
||||
undisturbed access.
|
||||
|
||||
sg_release() closes a drive opened by sg_grab()
|
||||
|
||||
sg_issue_command() sends a SCSI command to the drive, receives reply,
|
||||
and evaluates wether the command succeeded or shall
|
||||
be retried or finally failed.
|
||||
|
||||
sg_obtain_scsi_adr() tries to obtain SCSI address parameters.
|
||||
|
||||
|
||||
burn_os_is_2k_seekrw() tells whether the given path leads to a file object
|
||||
that can be used in 2 kB granularity by lseek(2),
|
||||
read(2), and possibly write(2) if not read-only..
|
||||
E.g. a USB stick or a hard disk.
|
||||
|
||||
burn_os_stdio_capacity() estimates the emulated media space of stdio-drives.
|
||||
|
||||
burn_os_open_track_src() opens a disk file in a way that allows best
|
||||
throughput with file reading and/or SCSI write command
|
||||
transmission.
|
||||
|
||||
burn_os_alloc_buffer() allocates a memory area that is suitable for file
|
||||
descriptors issued by burn_os_open_track_src().
|
||||
The buffer size may be rounded up for alignment
|
||||
reasons.
|
||||
|
||||
burn_os_free_buffer() delete a buffer obtained by burn_os_alloc_buffer().
|
||||
|
||||
Porting hints are marked by the text "PORTING:".
|
||||
Send feedback to libburn-hackers@pykix.org .
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/** PORTING : ------- OS dependent headers and definitions ------ */
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
#include <sys/statvfs.h>
|
||||
#endif /* Libburn_os_has_stavtfS */
|
||||
|
||||
#ifdef __linux
|
||||
/* for ioctl(BLKGETSIZE) */
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define Libburn_is_on_freebsD 1
|
||||
#endif
|
||||
#ifdef __FreeBSD_kernel__
|
||||
#define Libburn_is_on_freebsD 1
|
||||
#endif
|
||||
#ifdef Libburn_is_on_freebsD
|
||||
/* To avoid ATAPI devices */
|
||||
#define Libburn_guess_freebsd_atapi_devicE 1
|
||||
/* To obtain size of disk-like devices */
|
||||
#include <sys/disk.h> /* DIOCGMEDIASIZE */
|
||||
#endif /* Libburn_is_on_freebsD */
|
||||
|
||||
#define Libburn_guess_freebsd_atapi_devicE 1
|
||||
|
||||
#include <cdio/cdio.h>
|
||||
#include <cdio/logging.h>
|
||||
#include <cdio/mmc.h>
|
||||
|
||||
|
||||
/* The waiting time before eventually retrying a failed SCSI command.
|
||||
Before each retry wait Libburn_sg_linux_retry_incR longer than with
|
||||
the previous one.
|
||||
*/
|
||||
#define Libburn_sg_libcdio_retry_usleeP 100000
|
||||
#define Libburn_sg_libcdio_retry_incR 100000
|
||||
|
||||
|
||||
/** PORTING : ------ libburn portable headers and definitions ----- */
|
||||
|
||||
#include "transport.h"
|
||||
#include "drive.h"
|
||||
#include "sg.h"
|
||||
#include "spc.h"
|
||||
/* collides with symbols of <cdio/mmc.h>
|
||||
#include "mmc.h"
|
||||
*/
|
||||
#include "sbc.h"
|
||||
#include "debug.h"
|
||||
#include "toc.h"
|
||||
#include "util.h"
|
||||
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
|
||||
|
||||
/* is in portable part of libburn */
|
||||
int burn_drive_is_banned(char *device_address);
|
||||
int burn_drive_resolve_link(char *path, char adr[],
|
||||
int *recursion_count, int flag); /* drive.c */
|
||||
|
||||
/* Whether to log SCSI commands:
|
||||
bit0= log in /tmp/libburn_sg_command_log
|
||||
bit1= log to stderr
|
||||
bit2= flush every line
|
||||
*/
|
||||
extern int burn_sg_log_scsi;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* PORTING: Private definitions. Port only if needed by public functions. */
|
||||
/* (Public functions are listed below) */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
/* Storage object is in libburn/init.c
|
||||
whether to strive for exclusive access to the drive
|
||||
*/
|
||||
extern int burn_sg_open_o_excl;
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* PORTING: Private functions. Port only if needed by public functions */
|
||||
/* (Public functions are listed below) */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
static int sg_close_drive(struct burn_drive * d)
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
|
||||
if (d->p_cdio != NULL) {
|
||||
p_cdio = (CdIo_t *) d->p_cdio;
|
||||
cdio_destroy(p_cdio);
|
||||
d->p_cdio = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int sg_give_next_adr_raw(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int initialize)
|
||||
{
|
||||
char **pos;
|
||||
int count = 0;
|
||||
|
||||
if (initialize == 1) {
|
||||
idx->pos = idx->ppsz_cd_drives =
|
||||
cdio_get_devices(DRIVER_DEVICE);
|
||||
if (idx->ppsz_cd_drives == NULL)
|
||||
return 0;
|
||||
|
||||
for (pos = idx->ppsz_cd_drives ; pos != NULL; pos++) {
|
||||
if (*pos == NULL)
|
||||
break;
|
||||
count++;
|
||||
}
|
||||
|
||||
} else if (initialize == -1) {
|
||||
if (*(idx->ppsz_cd_drives) != NULL)
|
||||
cdio_free_device_list(idx->ppsz_cd_drives);
|
||||
idx->ppsz_cd_drives = NULL;
|
||||
}
|
||||
|
||||
#ifdef Libburn_guess_freebsd_atapi_devicE
|
||||
try_next:;
|
||||
#endif
|
||||
|
||||
if (idx->pos == NULL)
|
||||
return 0;
|
||||
if (*(idx->pos) == NULL)
|
||||
return 0;
|
||||
|
||||
#ifdef Libburn_guess_freebsd_atapi_devicE
|
||||
if (strncmp(*(idx->pos), "/dev/acd", 8) == 0) {
|
||||
(idx->pos)++;
|
||||
goto try_next;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strlen(*(idx->pos)) >= adr_size)
|
||||
return -1;
|
||||
strcpy(adr, *(idx->pos));
|
||||
(idx->pos)++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* PORTING: Private functions which contain publicly needed functionality. */
|
||||
/* Their portable part must be performed. So it is probably best */
|
||||
/* to replace the non-portable part and to call these functions */
|
||||
/* in your port, too. */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
|
||||
/** Wraps a detected drive into libburn structures and hands it over to
|
||||
libburn drive list.
|
||||
*/
|
||||
static void enumerate_common(char *fname, char *cdio_name,
|
||||
int bus_no, int host_no,
|
||||
int channel_no, int target_no, int lun_no)
|
||||
{
|
||||
int ret;
|
||||
struct burn_drive out;
|
||||
|
||||
/* General libburn drive setup */
|
||||
burn_setup_drive(&out, fname);
|
||||
|
||||
/* This transport adapter uses SCSI-family commands and models
|
||||
(seems the adapter would know better than its boss, if ever) */
|
||||
ret = burn_scsi_setup_drive(&out, bus_no, host_no, channel_no,
|
||||
target_no, lun_no, 0);
|
||||
if (ret <= 0)
|
||||
return;
|
||||
|
||||
/* PORTING: ------------------- non portable part --------------- */
|
||||
|
||||
/* Transport adapter is libcdio */
|
||||
/* Adapter specific handles and data */
|
||||
out.p_cdio = NULL;
|
||||
strcpy(out.libcdio_name, fname);
|
||||
if (strlen(cdio_name) < sizeof(out.libcdio_name))
|
||||
strcpy(out.libcdio_name, cdio_name);
|
||||
|
||||
/* PORTING: ---------------- end of non portable part ------------ */
|
||||
|
||||
/* Adapter specific functions with standardized names */
|
||||
out.grab = sg_grab;
|
||||
out.release = sg_release;
|
||||
out.drive_is_open = sg_drive_is_open;
|
||||
out.issue_command = sg_issue_command;
|
||||
/* Finally register drive and inquire drive information */
|
||||
burn_drive_finish_enum(&out);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* PORTING: Public functions. These MUST be ported. */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag)
|
||||
{
|
||||
char *version_text;
|
||||
|
||||
sprintf(msg, "sg-libcdio h%d with libcdio ", LIBCDIO_VERSION_NUM);
|
||||
|
||||
#if LIBCDIO_VERSION_NUM < 83
|
||||
|
||||
LIBBURN_MISCONFIGURATION = 0;
|
||||
INTENTIONAL_ABORT_OF_COMPILATION__HEADERFILE_cdio_version_dot_h_TOO_OLD__NEED_libcdio_VERSION_NUM_83 = 0;
|
||||
LIBBURN_MISCONFIGURATION_ = 0;
|
||||
|
||||
#endif /* LIBCDIO_VERSION_NUM < 83 */
|
||||
|
||||
version_text = (char *) cdio_version_string;
|
||||
strncat(msg, version_text, 800);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility of supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag)
|
||||
{
|
||||
int cdio_ver;
|
||||
char *msg_pt;
|
||||
|
||||
cdio_loglevel_default = CDIO_LOG_ASSERT;
|
||||
|
||||
msg[0] = 0;
|
||||
sg_id_string(msg, 0);
|
||||
cdio_ver = libcdio_version_num;
|
||||
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg , 0, 0);
|
||||
if (cdio_ver < LIBCDIO_VERSION_NUM) {
|
||||
strcat(msg, " ---> ");
|
||||
msg_pt = msg + strlen(msg);
|
||||
sprintf(msg_pt,
|
||||
"libcdio TOO OLD: numeric version %d , need at least %d",
|
||||
cdio_ver, LIBCDIO_VERSION_NUM);
|
||||
libdax_msgs_submit(libdax_messenger, -1,
|
||||
0x00000002,
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg_pt, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
The eventual initialization of those components was made underneath
|
||||
scsi_enumerate_drives().
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Returns the next index number and the next enumerated drive address.
|
||||
The enumeration has to cover all available and accessible drives. It is
|
||||
allowed to return addresses of drives which are not available but under
|
||||
some (even exotic) circumstances could be available. It is on the other
|
||||
hand allowed, only to hand out addresses which can really be used right
|
||||
in the moment of this call. (This implementation chooses the latter.)
|
||||
@param idx An opaque handle. Make no own theories about it.
|
||||
@param adr Takes the reply
|
||||
@param adr_size Gives maximum size of reply including final 0
|
||||
@param initialize 1 = start new,
|
||||
0 = continue, use no other values for now
|
||||
-1 = finish
|
||||
@return 1 = reply is a valid address , 0 = no further address available
|
||||
-1 = severe error (e.g. adr_size too small)
|
||||
*/
|
||||
int sg_give_next_adr(burn_drive_enumerator_t *idx,
|
||||
char adr[], int adr_size, int initialize)
|
||||
{
|
||||
int ret, recursion_count = 0;
|
||||
char path[4096];
|
||||
|
||||
ret = sg_give_next_adr_raw(idx, adr, adr_size, initialize);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
if (strlen(adr) >= sizeof(path))
|
||||
return ret;
|
||||
strcpy(path, adr);
|
||||
ret = burn_drive_resolve_link(path, adr, &recursion_count, 2);
|
||||
return (ret >= 0);
|
||||
}
|
||||
|
||||
|
||||
/** Brings all available, not-whitelist-banned, and accessible drives into
|
||||
libburn's list of drives.
|
||||
*/
|
||||
int scsi_enumerate_drives(void)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret, i_bus_no = -1, recursion_count = 0;
|
||||
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
|
||||
char buf[4096], target[4096];
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr_raw(&idx, buf, sizeof(buf), initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
ret = burn_drive_resolve_link(buf, target, &recursion_count,2);
|
||||
if (ret <= 0)
|
||||
strcpy(target, buf);
|
||||
if (burn_drive_is_banned(target))
|
||||
continue;
|
||||
sg_obtain_scsi_adr(buf, &i_bus_no, &i_host_no,
|
||||
&i_channel_no, &i_target_no, &i_lun_no);
|
||||
enumerate_common(target, buf,
|
||||
i_bus_no, i_host_no, i_channel_no,
|
||||
i_target_no, i_lun_no);
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Tells whether libburn has the given drive in use or exclusively reserved.
|
||||
If it is "open" then libburn will eventually call sg_release() on it when
|
||||
it is time to give up usage resp. reservation.
|
||||
*/
|
||||
/** Published as burn_drive.drive_is_open() */
|
||||
int sg_drive_is_open(struct burn_drive * d)
|
||||
{
|
||||
return (d->p_cdio != NULL);
|
||||
}
|
||||
|
||||
|
||||
/** Opens the drive for SCSI commands and - if burn activities are prone
|
||||
to external interference on your system - obtains an exclusive access lock
|
||||
on the drive. (Note: this is not physical tray locking.)
|
||||
A drive that has been opened with sg_grab() will eventually be handed
|
||||
over to sg_release() for closing and unreserving.
|
||||
*/
|
||||
int sg_grab(struct burn_drive *d)
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
char *am_eff, msg[4096], *am_wanted;
|
||||
int os_errno, second_try = 0;
|
||||
|
||||
if (d->p_cdio != NULL) {
|
||||
d->released = 0;
|
||||
return 1;
|
||||
}
|
||||
if (d->libcdio_name[0] == 0) /* just to be sure it is initialized */
|
||||
strcpy(d->libcdio_name, d->devname);
|
||||
am_wanted = (burn_sg_open_o_excl & 63) ? "MMC_RDWR_EXCL" : "MMC_RDWR";
|
||||
try_to_open:;
|
||||
p_cdio = cdio_open_am(d->libcdio_name, DRIVER_DEVICE, am_wanted);
|
||||
if (p_cdio == NULL) {
|
||||
os_errno = errno;
|
||||
sprintf(msg, "Could not grab drive '%s'", d->devname);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, os_errno, 0);
|
||||
return 0;
|
||||
}
|
||||
am_eff = (char *) cdio_get_arg(p_cdio, "access-mode");
|
||||
if (strncmp(am_eff, "MMC_RDWR", 8) != 0) {
|
||||
cdio_destroy(p_cdio);
|
||||
if (!second_try) {
|
||||
am_wanted = (burn_sg_open_o_excl & 63) ?
|
||||
"MMC_RDWR" : "MMC_RDWR_EXCL";
|
||||
second_try = 1;
|
||||
goto try_to_open;
|
||||
}
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020003,
|
||||
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"libcdio provides no MMC_RDWR access mode", 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
d->p_cdio = p_cdio;
|
||||
d->released = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** PORTING: Is mainly about the call to sg_close_drive() and whether it
|
||||
implements the demanded functionality.
|
||||
*/
|
||||
/** Gives up the drive for SCSI commands and releases eventual access locks.
|
||||
(Note: this is not physical tray locking.)
|
||||
*/
|
||||
int sg_release(struct burn_drive *d)
|
||||
{
|
||||
if (d->p_cdio == NULL) {
|
||||
burn_print(1, "release an ungrabbed drive. die\n");
|
||||
return 0;
|
||||
}
|
||||
sg_close_drive(d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/** Sends a SCSI command to the drive, receives reply and evaluates wether
|
||||
the command succeeded or shall be retried or finally failed.
|
||||
Returned SCSI errors shall not lead to a return value indicating failure.
|
||||
The callers get notified by c->error. An SCSI failure which leads not to
|
||||
a retry shall be notified via scsi_notify_error().
|
||||
The Libburn_log_sg_commandS facility might be of help when problems with
|
||||
a drive have to be examined. It shall stay disabled for normal use.
|
||||
@return: 1 success , <=0 failure
|
||||
*/
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
{
|
||||
int sense_valid = 0, i, usleep_time, timeout_ms;
|
||||
time_t start_time;
|
||||
driver_return_code_t i_status;
|
||||
unsigned int dxfer_len;
|
||||
static FILE *fp = NULL;
|
||||
mmc_cdb_t cdb = {{0, }};
|
||||
cdio_mmc_direction_t e_direction;
|
||||
CdIo_t *p_cdio;
|
||||
unsigned char *sense_pt = NULL;
|
||||
|
||||
c->error = 0;
|
||||
if (d->p_cdio == NULL) {
|
||||
return 0;
|
||||
}
|
||||
p_cdio = (CdIo_t *) d->p_cdio;
|
||||
if (burn_sg_log_scsi & 1) {
|
||||
if (fp == NULL) {
|
||||
fp= fopen("/tmp/libburn_sg_command_log", "a");
|
||||
fprintf(fp,
|
||||
"\n-----------------------------------------\n");
|
||||
}
|
||||
}
|
||||
if (burn_sg_log_scsi & 3)
|
||||
scsi_log_cmd(c,fp,0);
|
||||
|
||||
memcpy(cdb.field, c->opcode, c->oplen);
|
||||
if (c->dir == TO_DRIVE) {
|
||||
dxfer_len = c->page->bytes;
|
||||
e_direction = SCSI_MMC_DATA_WRITE;
|
||||
} else if (c->dir == FROM_DRIVE) {
|
||||
if (c->dxfer_len >= 0)
|
||||
dxfer_len = c->dxfer_len;
|
||||
else
|
||||
dxfer_len = BUFFER_SIZE;
|
||||
e_direction = SCSI_MMC_DATA_READ;
|
||||
/* touch page so we can use valgrind */
|
||||
memset(c->page->data, 0, BUFFER_SIZE);
|
||||
} else {
|
||||
dxfer_len = 0;
|
||||
e_direction = SCSI_MMC_DATA_NONE;
|
||||
}
|
||||
|
||||
/* retry-loop */
|
||||
start_time = time(NULL);
|
||||
timeout_ms = 200000;
|
||||
for(i = 0; ; i++) {
|
||||
|
||||
i_status = mmc_run_cmd(p_cdio, timeout_ms, &cdb, e_direction,
|
||||
dxfer_len, c->page->data);
|
||||
sense_valid = mmc_last_cmd_sense(p_cdio, &sense_pt);
|
||||
if (sense_valid >= 18)
|
||||
memcpy(c->sense, sense_pt,
|
||||
sense_valid >= sizeof(c->sense) ?
|
||||
sizeof(c->sense) : sense_valid );
|
||||
if (sense_pt != NULL)
|
||||
free(sense_pt);
|
||||
|
||||
/* Regrettably mmc_run_cmd() does not clearly distinguish between transport
|
||||
failure and SCSI error reply.
|
||||
This reaction here would be for transport failure:
|
||||
|
||||
if (i_status != 0 && i_status != DRIVER_OP_ERROR) {
|
||||
libdax_msgs_submit(libdax_messenger,
|
||||
d->global_index, 0x0002010c,
|
||||
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
|
||||
"Failed to transfer command to drive",
|
||||
errno, 0);
|
||||
sg_close_drive(d);
|
||||
d->released = 1;
|
||||
d->busy = BURN_DRIVE_IDLE;
|
||||
c->error = 1;
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
if (!sense_valid) {
|
||||
memset(c->sense, 0, sizeof(c->sense));
|
||||
if (i_status != 0) { /* set dummy sense */
|
||||
/*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/
|
||||
c->sense[2] = 0x02;
|
||||
c->sense[12] = 0x04;
|
||||
}
|
||||
} else
|
||||
c->sense[2] &= 15;
|
||||
|
||||
if (i_status != 0 ||
|
||||
(c->sense[2] || c->sense[12] || c->sense[13])) {
|
||||
if (!c->retry) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
switch (scsi_error(d, c->sense, 18)) {
|
||||
case RETRY:
|
||||
break;
|
||||
case FAIL:
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
/*
|
||||
Calming down retries and breaking up endless cycle
|
||||
*/
|
||||
usleep_time = Libburn_sg_libcdio_retry_usleeP +
|
||||
i * Libburn_sg_libcdio_retry_incR;
|
||||
if (time(NULL) + usleep_time / 1000000 - start_time >
|
||||
timeout_ms / 1000 + 1) {
|
||||
c->error = 1;
|
||||
goto ex;
|
||||
}
|
||||
usleep(usleep_time);
|
||||
} else
|
||||
break; /* retry-loop */
|
||||
} /* end of retry-loop */
|
||||
|
||||
ex:;
|
||||
if (c->error)
|
||||
scsi_notify_error(d, c, c->sense, 18, 0);
|
||||
|
||||
if (burn_sg_log_scsi & 3)
|
||||
/* >>> Need own duration time measurement. Then remove bit1 */
|
||||
scsi_log_err(c, fp, c->sense, 0, (c->error != 0) | 2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Tries to obtain SCSI address parameters.
|
||||
@return 1 is success , 0 is failure
|
||||
*/
|
||||
int sg_obtain_scsi_adr(char *path, int *bus_no, int *host_no, int *channel_no,
|
||||
int *target_no, int *lun_no)
|
||||
{
|
||||
CdIo_t *p_cdio;
|
||||
char *tuple;
|
||||
|
||||
*bus_no = *host_no = *channel_no = *target_no = *lun_no = -1;
|
||||
|
||||
p_cdio = cdio_open(path, DRIVER_DEVICE);
|
||||
if (p_cdio == NULL)
|
||||
return 0;
|
||||
|
||||
/* Try whether a bus,host,channel,target,lun address tuple is
|
||||
available */
|
||||
tuple = (char *) cdio_get_arg(p_cdio, "scsi-tuple");
|
||||
if (tuple != NULL) if (tuple[0]) {
|
||||
sscanf(tuple, "%d,%d,%d,%d,%d",
|
||||
bus_no, host_no, channel_no, target_no, lun_no);
|
||||
}
|
||||
|
||||
cdio_destroy(p_cdio);
|
||||
return (*bus_no >= 0);
|
||||
}
|
||||
|
||||
|
||||
/** Tells wether a text is a persistent address as listed by the enumeration
|
||||
functions.
|
||||
*/
|
||||
int sg_is_enumerable_adr(char* adr)
|
||||
{
|
||||
burn_drive_enumerator_t idx;
|
||||
int initialize = 1, ret;
|
||||
char buf[64];
|
||||
|
||||
while(1) {
|
||||
ret = sg_give_next_adr(&idx, buf, sizeof(buf), initialize);
|
||||
initialize = 0;
|
||||
if (ret <= 0)
|
||||
break;
|
||||
if (strcmp(adr, buf) == 0) {
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
sg_give_next_adr(&idx, buf, sizeof(buf), -1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define Libburn_guess_block_devicE 1
|
||||
#endif
|
||||
#ifdef __FreeBSD_kernel__
|
||||
#define Libburn_guess_block_devicE 1
|
||||
#endif
|
||||
|
||||
#ifdef Libburn_guess_block_devicE
|
||||
|
||||
/* ts B00115 */
|
||||
/* The FreeBSD implementation of burn_os_is_2k_seekrw().
|
||||
On FreeBSD there are no block devices.
|
||||
*/
|
||||
static int freebsd_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
char *spt;
|
||||
int i, e;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (!S_ISCHR(stbuf.st_mode))
|
||||
return 0;
|
||||
spt = strrchr(path, '/');
|
||||
if (spt == NULL)
|
||||
spt = path;
|
||||
else
|
||||
spt++;
|
||||
e = strlen(spt);
|
||||
for (i = strlen(spt) - 1; i > 0; i--)
|
||||
if (spt[i] >= '0' && spt[i] <= '9')
|
||||
e = i;
|
||||
if (strncmp(spt, "da", e) == 0) /* SCSI disk. E.g. USB stick. */
|
||||
return 1;
|
||||
if (strncmp(spt, "cd", e) == 0) /* SCSI CD drive might be writeable. */
|
||||
return 1;
|
||||
if (strncmp(spt, "ad", e) == 0) /* IDE hard drive */
|
||||
return 1;
|
||||
if (strncmp(spt, "acd", e) == 0) /* IDE CD drive might be writeable */
|
||||
return 1;
|
||||
if (strncmp(spt, "fd", e) == 0) /* Floppy disk */
|
||||
return 1;
|
||||
if (strncmp(spt, "fla", e) == 0) /* Flash drive */
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* Libburn_guess_block_devicE */
|
||||
|
||||
|
||||
/* Return 1 if the given path leads to a regular file or a device that can be
|
||||
seeked, read, and possibly written with 2 kB granularity.
|
||||
*/
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
#ifdef Libburn_guess_block_devicE
|
||||
return freebsd_is_2k_seekrw(path, flag);
|
||||
#else
|
||||
struct stat stbuf;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (S_ISBLK(stbuf.st_mode))
|
||||
return 1;
|
||||
return 0;
|
||||
#endif /* ! Libburn_guess_block_devicE */
|
||||
}
|
||||
|
||||
|
||||
/** Estimate the potential payload capacity of a file address.
|
||||
@param path The address of the file to be examined. If it does not
|
||||
exist yet, then the directory will be inquired.
|
||||
@param bytes The pointed value gets modified, but only if an estimation is
|
||||
possible.
|
||||
@return -2 = cannot perform necessary operations on file object
|
||||
-1 = neither path nor dirname of path exist
|
||||
0 = could not estimate size capacity of file object
|
||||
1 = estimation has been made, bytes was set
|
||||
*/
|
||||
int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
{
|
||||
struct stat stbuf;
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
struct statvfs vfsbuf;
|
||||
#endif
|
||||
|
||||
char testpath[4096], *cpt;
|
||||
long blocks;
|
||||
off_t add_size = 0;
|
||||
|
||||
testpath[0] = 0;
|
||||
blocks = *bytes / 512;
|
||||
if (stat(path, &stbuf) == -1) {
|
||||
strcpy(testpath, path);
|
||||
cpt = strrchr(testpath, '/');
|
||||
if(cpt == NULL)
|
||||
strcpy(testpath, ".");
|
||||
else if(cpt == testpath)
|
||||
testpath[1] = 0;
|
||||
else
|
||||
*cpt = 0;
|
||||
if (stat(testpath, &stbuf) == -1)
|
||||
return -1;
|
||||
|
||||
#ifdef __linux
|
||||
|
||||
/* Linux specific determination of block device size */
|
||||
} else if(S_ISBLK(stbuf.st_mode)) {
|
||||
int open_mode = O_RDONLY, fd, ret;
|
||||
|
||||
fd = open(path, open_mode);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
ret = ioctl(fd, BLKGETSIZE, &blocks);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
*bytes = ((off_t) blocks) * (off_t) 512;
|
||||
|
||||
#endif /* __linux */
|
||||
|
||||
#ifdef Libburn_is_on_freebsD
|
||||
|
||||
} else if(S_ISCHR(stbuf.st_mode)) {
|
||||
int fd, ret;
|
||||
|
||||
fd = open(path, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return -2;
|
||||
ret = ioctl(fd, DIOCGMEDIASIZE, &add_size);
|
||||
close(fd);
|
||||
if (ret == -1)
|
||||
return -2;
|
||||
*bytes = add_size;
|
||||
|
||||
#endif/* Libburn_is_on_freebsD */
|
||||
|
||||
} else if(S_ISREG(stbuf.st_mode)) {
|
||||
add_size = stbuf.st_blocks * (off_t) 512;
|
||||
strcpy(testpath, path);
|
||||
} else
|
||||
return 0;
|
||||
|
||||
if (testpath[0]) {
|
||||
|
||||
#ifdef Libburn_os_has_statvfS
|
||||
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
|
||||
#else /* Libburn_os_has_statvfS */
|
||||
|
||||
return 0;
|
||||
|
||||
#endif /* ! Libburn_os_has_stavtfS */
|
||||
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A91122 : an interface to open(O_DIRECT) or similar OS tricks. */
|
||||
|
||||
#ifdef Libburn_read_o_direcT
|
||||
|
||||
/* No special O_DIRECT-like precautions are implemented here */
|
||||
|
||||
#endif /* Libburn_read_o_direcT */
|
||||
|
||||
|
||||
int burn_os_open_track_src(char *path, int open_flags, int flag)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open(path, open_flags);
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
||||
void *burn_os_alloc_buffer(size_t amount, int flag)
|
||||
{
|
||||
void *buf = NULL;
|
||||
|
||||
buf = calloc(1, amount);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
int burn_os_free_buffer(void *buffer, size_t amount, int flag)
|
||||
{
|
||||
if (buffer == NULL)
|
||||
return 0;
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
|
@ -35,12 +35,28 @@ and of deriving the following system specific files from existing examples:
|
||||
Said sg-*.c operations are defined by a public function interface, which has
|
||||
to be implemented in a way that provides libburn with the desired services:
|
||||
|
||||
sg_id_string() returns an id string of the SCSI transport adapter.
|
||||
It may be called before initialization but then may
|
||||
return only a preliminary id.
|
||||
|
||||
sg_initialize() performs global initialization of the SCSI transport
|
||||
adapter and eventually needed operating system
|
||||
facilities. Checks for compatibility of supporting
|
||||
software components.
|
||||
|
||||
sg_shutdown() performs global finalizations and releases golbally
|
||||
aquired resources.
|
||||
|
||||
sg_give_next_adr() iterates over the set of potentially useful drive
|
||||
address strings.
|
||||
|
||||
scsi_enumerate_drives() brings all available, not-whitelist-banned, and
|
||||
accessible drives into libburn's list of drives.
|
||||
|
||||
sg_dispose_drive() finalizes adapter specifics of struct burn_drive
|
||||
on destruction. Releases resources which were aquired
|
||||
underneath scsi_enumerate_drives().
|
||||
|
||||
sg_drive_is_open() tells wether libburn has the given drive in use.
|
||||
|
||||
sg_grab() opens the drive for SCSI commands and ensures
|
||||
@ -55,15 +71,17 @@ sg_issue_command() sends a SCSI command to the drive, receives reply,
|
||||
sg_obtain_scsi_adr() tries to obtain SCSI address parameters.
|
||||
|
||||
|
||||
burn_os_is_2k_seekrw() tells whether the given path leads to a file object
|
||||
that can be used in 2 kB granularity by lseek(2) and
|
||||
read(2), and possibly write(2) if not read-only.
|
||||
E.g. a USB stick or a hard disk.
|
||||
|
||||
burn_os_stdio_capacity() estimates the emulated media space of stdio-drives.
|
||||
|
||||
burn_os_open_track_src() opens a disk file in a way that allows best
|
||||
throughput with file reading and/or SCSI write command
|
||||
transmission.
|
||||
|
||||
burn_os_close_track_src() closes a filedescriptor obtained by
|
||||
burn_os_open_track_src().
|
||||
|
||||
burn_os_alloc_buffer() allocates a memory area that is suitable for file
|
||||
descriptors issued by burn_os_open_track_src().
|
||||
The buffer size may be rounded up for alignment
|
||||
@ -1410,6 +1428,61 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag)
|
||||
{
|
||||
strcpy(msg, "internal Linux SG_IO adapter sg-linux");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag)
|
||||
{
|
||||
return sg_id_string(msg, 0);
|
||||
}
|
||||
|
||||
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
The eventual initialization of those components was made underneath
|
||||
scsi_enumerate_drives().
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/** PORTING:
|
||||
In this Linux implementation, this function mirrors the enumeration
|
||||
done in sg_enumerate and ata_enumerate(). It would be better to base those
|
||||
@ -1682,43 +1755,8 @@ int sg_release(struct burn_drive *d)
|
||||
}
|
||||
|
||||
|
||||
/* <<< ts A91111: on its way out */
|
||||
/** ts A70518:
|
||||
Debugging log facility. Controlled by existence of macros:
|
||||
Libburn_log_sg_commandS enables logging to file
|
||||
/tmp/libburn_sg_command_log
|
||||
Libburn_fflush_log_sg_commandS enables fflush after each output line
|
||||
Libburn_log_sg_command_stderR enables additional log to stderr
|
||||
*/
|
||||
/*
|
||||
ts A91111: now enabled by default and controlled burn_sg_log_scsi
|
||||
*/
|
||||
#define Libburn_log_sg_commandS 1
|
||||
#define Libburn_fflush_log_sg_commandS 1
|
||||
#define Libburn_log_sg_command_stderR 1
|
||||
|
||||
|
||||
#ifdef Libburn_log_sg_commandS
|
||||
|
||||
/** Logs command (before execution) */
|
||||
static int sg_log_cmd(struct command *c, FILE *fp, int flag)
|
||||
{
|
||||
if (fp != NULL && (fp == stderr || (burn_sg_log_scsi & 1))) {
|
||||
scsi_show_cmd_text(c, fp, 0);
|
||||
|
||||
#ifdef Libburn_fflush_log_sg_commandS
|
||||
if (burn_sg_log_scsi & 4)
|
||||
fflush(fp);
|
||||
#endif
|
||||
}
|
||||
#ifdef Libburn_log_sg_command_stderR
|
||||
if (fp == stderr || !(burn_sg_log_scsi & 2))
|
||||
return 1;
|
||||
sg_log_cmd(c, stderr, flag);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef NIX
|
||||
/* <<< now in spc.c as scsi_log_err */
|
||||
|
||||
/** logs outcome of a sg command. flag&1 causes an error message */
|
||||
static int sg_log_err(struct command *c, FILE *fp,
|
||||
@ -1734,21 +1772,17 @@ static int sg_log_err(struct command *c, FILE *fp,
|
||||
scsi_show_cmd_reply(c, fp, 0);
|
||||
fprintf(fp,"%6d ms\n", s->duration);
|
||||
}
|
||||
#ifdef Libburn_fflush_log_sg_commandS
|
||||
if (burn_sg_log_scsi & 4)
|
||||
fflush(fp);
|
||||
#endif
|
||||
}
|
||||
#ifdef Libburn_log_sg_command_stderR
|
||||
if (fp == stderr || !(burn_sg_log_scsi & 2))
|
||||
return 1;
|
||||
|
||||
sg_log_err(c, stderr, s, flag);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
#endif /* Libburn_log_sg_commandS */
|
||||
#endif /* NIX */
|
||||
|
||||
|
||||
/** Sends a SCSI command to the drive, receives reply and evaluates wether
|
||||
@ -1756,8 +1790,6 @@ static int sg_log_err(struct command *c, FILE *fp,
|
||||
Returned SCSI errors shall not lead to a return value indicating failure.
|
||||
The callers get notified by c->error. An SCSI failure which leads not to
|
||||
a retry shall be notified via scsi_notify_error().
|
||||
The Libburn_log_sg_commandS facility might be of help when problems with
|
||||
a drive have to be examined. It shall stay disabled for normal use.
|
||||
@return: 1 success , <=0 failure
|
||||
*/
|
||||
int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
@ -1766,11 +1798,8 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
int err;
|
||||
time_t start_time;
|
||||
sg_io_hdr_t s;
|
||||
|
||||
#ifdef Libburn_log_sg_commandS
|
||||
/* ts A61030 */
|
||||
static FILE *fp= NULL;
|
||||
#endif /* Libburn_log_sg_commandS */
|
||||
|
||||
/* <<< ts A60821
|
||||
debug: for tracing calls which might use open drive fds */
|
||||
@ -1779,7 +1808,6 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
d->fd,d->released);
|
||||
mmc_function_spy(NULL, buf);
|
||||
|
||||
#ifdef Libburn_log_sg_commandS
|
||||
/* ts A61030 */
|
||||
if (burn_sg_log_scsi & 1) {
|
||||
if (fp == NULL) {
|
||||
@ -1789,9 +1817,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
|
||||
}
|
||||
}
|
||||
if (burn_sg_log_scsi & 3)
|
||||
sg_log_cmd(c,fp,0);
|
||||
#endif /* Libburn_log_sg_commandS */
|
||||
|
||||
scsi_log_cmd(c,fp,0);
|
||||
|
||||
/* ts A61010 : with no fd there is no chance to send an ioctl */
|
||||
if (d->fd < 0) {
|
||||
@ -1931,12 +1957,9 @@ ex:;
|
||||
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
|
||||
msg, 0, 0);
|
||||
}
|
||||
|
||||
#ifdef Libburn_log_sg_commandS
|
||||
if (burn_sg_log_scsi & 3)
|
||||
sg_log_err(c, fp, &s, c->error != 0);
|
||||
#endif /* Libburn_log_sg_commandS */
|
||||
|
||||
/* <<< sg_log_err(c, fp, &s, c->error != 0); */
|
||||
scsi_log_err(c, fp, s.sbp, s.duration, c->error != 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -2032,6 +2055,24 @@ int sg_is_enumerable_adr(char *adr)
|
||||
}
|
||||
|
||||
|
||||
/* ts B00115 */
|
||||
/* Return 1 if the given path leads to a regular file or a device that can be
|
||||
seeked, read, and possibly written with 2 kB granularity.
|
||||
*/
|
||||
int burn_os_is_2k_seekrw(char *path, int flag)
|
||||
{
|
||||
struct stat stbuf;
|
||||
|
||||
if (stat(path, &stbuf) == -1)
|
||||
return 0;
|
||||
if (S_ISREG(stbuf.st_mode))
|
||||
return 1;
|
||||
if (S_ISBLK(stbuf.st_mode))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* ts A70909 */
|
||||
/** Estimate the potential payload capacity of a file address.
|
||||
@param path The address of the file to be examined. If it does not
|
||||
@ -2083,7 +2124,7 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
|
||||
if (testpath[0]) {
|
||||
if (statvfs(testpath, &vfsbuf) == -1)
|
||||
return -2;
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_bsize) *
|
||||
*bytes = add_size + ((off_t) vfsbuf.f_frsize) *
|
||||
(off_t) vfsbuf.f_bavail;
|
||||
}
|
||||
return 1;
|
||||
|
12
libburn/sg.c
12
libburn/sg.c
@ -5,10 +5,20 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifdef Libburn_use_libcdiO
|
||||
|
||||
#include "sg-libcdio.c"
|
||||
|
||||
#else
|
||||
#ifdef __FreeBSD__
|
||||
|
||||
#include "sg-freebsd.c"
|
||||
|
||||
#else
|
||||
#ifdef __FreeBSD_kernel__
|
||||
|
||||
#include "sg-freebsd.c"
|
||||
|
||||
#else
|
||||
#ifdef __linux
|
||||
|
||||
@ -37,5 +47,7 @@ static int intentional_compiler_warning(void)
|
||||
#include "sg-dummy.c"
|
||||
|
||||
#endif /* ! __linux */
|
||||
#endif /* ! __FreeBSD_kernel__ */
|
||||
#endif /* ! __FreeBSD__ */
|
||||
#endif /* ! Libburn_use_libcdiO */
|
||||
|
||||
|
45
libburn/sg.h
45
libburn/sg.h
@ -31,6 +31,51 @@ int scsi_enumerate_drives(void);
|
||||
|
||||
int sg_drive_is_open(struct burn_drive * d);
|
||||
|
||||
int burn_os_is_2k_seekrw(char *path, int flag);
|
||||
|
||||
int burn_os_stdio_capacity(char *path, off_t *bytes);
|
||||
|
||||
/* ts A91227 */
|
||||
/** Returns the id string of the SCSI transport adapter and eventually
|
||||
needed operating system facilities.
|
||||
This call is usable even if sg_initialize() was not called yet. In that
|
||||
case a preliminary constant message might be issued if detailed info is
|
||||
not available yet.
|
||||
@param msg returns id string
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_id_string(char msg[1024], int flag);
|
||||
|
||||
/* ts A91225 */
|
||||
/** Performs global initialization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Checks for compatibility supporting
|
||||
software components.
|
||||
@param msg returns ids and/or error messages of eventual helpers
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_initialize(char msg[1024], int flag);
|
||||
|
||||
/* ts A91227 */
|
||||
/** Performs global finalization of the SCSI transport adapter and eventually
|
||||
needed operating system facilities. Releases globally aquired resources.
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_shutdown(int flag);
|
||||
|
||||
/* ts A91227 */
|
||||
/** Finalizes BURN_OS_TRANSPORT_DRIVE_ELEMENTS, the components of
|
||||
struct burn_drive which are defined in os-*.h.
|
||||
The eventual initialization of those components was made underneath
|
||||
scsi_enumerate_drives().
|
||||
This will be called when a burn_drive gets disposed.
|
||||
@param d the drive to be finalized
|
||||
@param flag unused yet, submit 0
|
||||
@return 1 = success, <=0 = failure
|
||||
*/
|
||||
int sg_dispose_drive(struct burn_drive *d, int flag);
|
||||
|
||||
|
||||
#endif /* __SG */
|
||||
|
@ -27,6 +27,14 @@
|
||||
#include "libdax_msgs.h"
|
||||
extern struct libdax_msgs *libdax_messenger;
|
||||
|
||||
/* ts A91111 :
|
||||
whether to log SCSI commands:
|
||||
bit0= log in /tmp/libburn_sg_command_log
|
||||
bit1= log to stderr
|
||||
bit2= flush every line
|
||||
*/
|
||||
extern int burn_sg_log_scsi;
|
||||
|
||||
|
||||
/* spc command set */
|
||||
/* ts A70519 : allocation length byte 3+4 was 0,255 */
|
||||
@ -36,8 +44,7 @@ static unsigned char SPC_INQUIRY[] = { 0x12, 0, 0, 0, 36, 0 };
|
||||
static unsigned char SPC_PREVENT[] = { 0x1e, 0, 0, 0, 1, 0 };
|
||||
static unsigned char SPC_ALLOW[] = { 0x1e, 0, 0, 0, 0, 0 };
|
||||
static unsigned char SPC_MODE_SENSE[] = { 0x5a, 0, 0, 0, 0, 0, 0, 16, 0, 0 };
|
||||
static unsigned char SPC_MODE_SELECT[] =
|
||||
{ 0x55, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
static unsigned char SPC_MODE_SELECT[] = { 0x55, 16, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
static unsigned char SPC_REQUEST_SENSE[] = { 0x03, 0, 0, 0, 18, 0 };
|
||||
static unsigned char SPC_TEST_UNIT_READY[] = { 0x00, 0, 0, 0, 0, 0 };
|
||||
|
||||
@ -321,7 +328,7 @@ static int spc_sense_caps_al(struct burn_drive *d, int *alloc_len, int flag)
|
||||
was_error = 1;
|
||||
}
|
||||
|
||||
size = c.page->data[0] * 256 + c.page->data[1];
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
page = c.page->data + 8;
|
||||
|
||||
/* ts A61225 :
|
||||
@ -517,7 +524,7 @@ void spc_sense_error_params(struct burn_drive *d)
|
||||
c.dir = FROM_DRIVE;
|
||||
d->issue_command(d, &c);
|
||||
|
||||
size = c.page->data[0] * 256 + c.page->data[1];
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
m = d->mdata;
|
||||
page = c.page->data + 8;
|
||||
d->params.retries = page[3];
|
||||
@ -600,7 +607,7 @@ void spc_sense_write_params(struct burn_drive *d)
|
||||
/* ts A71128 : do not interpret reply if error */
|
||||
m = d->mdata;
|
||||
if (!c.error) {
|
||||
size = c.page->data[0] * 256 + c.page->data[1];
|
||||
size = c.page->data[0] * 256 + c.page->data[1] + 2;
|
||||
page = c.page->data + 8;
|
||||
burn_print(1, "write page length 0x%x\n", page[1]);
|
||||
m->write_page_length = page[1];
|
||||
@ -925,6 +932,24 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
|
||||
int *key, int *asc, int *ascq)
|
||||
{
|
||||
char *msg;
|
||||
static char key_def[16][40] = {
|
||||
"(no specific error)",
|
||||
"Recovered error",
|
||||
"Drive not ready",
|
||||
"Medium error",
|
||||
"Drive error",
|
||||
"Illegal request",
|
||||
"Drive event",
|
||||
"Data protected",
|
||||
"Blank/Nonblank",
|
||||
"Vendor specific code",
|
||||
"Copy aborted",
|
||||
"Command aborted",
|
||||
"(obsolete error code)",
|
||||
"Volume overflow",
|
||||
"Miscompare",
|
||||
"(reserved error code)",
|
||||
};
|
||||
|
||||
msg= msg_data;
|
||||
*key= *asc= *ascq= -1;
|
||||
@ -936,7 +961,7 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
|
||||
if (senselen<=0 || senselen>13)
|
||||
*ascq = sense[13];
|
||||
|
||||
sprintf(msg, "[%X %2.2X %2.2X] ", *key, *asc, *ascq);
|
||||
sprintf(msg, "[%X %2.2X %2.2X] ", (*key) & 0xf, *asc, *ascq);
|
||||
msg= msg + strlen(msg);
|
||||
|
||||
burn_print(12, "CONDITION: 0x%x 0x%x 0x%x on %s %s\n",
|
||||
@ -1205,8 +1230,8 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
|
||||
return FAIL;
|
||||
}
|
||||
sprintf(msg_data,
|
||||
"Failure. See mmc3r10g.pdf: Sense Key %X ASC %2.2X ASCQ %2.2X",
|
||||
*key, *asc, *ascq);
|
||||
"See MMC specs: Sense Key %X \"%s\", ASC %2.2X ASCQ %2.2X",
|
||||
*key & 0xf, key_def[(*key) & 0xf], *asc, *ascq);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@ -1412,3 +1437,56 @@ int scsi_show_cmd_reply(struct command *c, void *fp_in, int flag)
|
||||
fprintf(fp, "\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A91218 (former sg_log_cmd ts A70518) */
|
||||
/** Logs command (before execution) */
|
||||
int scsi_log_cmd(struct command *c, void *fp_in, int flag)
|
||||
{
|
||||
FILE *fp = fp_in;
|
||||
|
||||
if (fp != NULL && (fp == stderr || (burn_sg_log_scsi & 1))) {
|
||||
scsi_show_cmd_text(c, fp, 0);
|
||||
if (burn_sg_log_scsi & 4)
|
||||
fflush(fp);
|
||||
}
|
||||
if (fp == stderr || !(burn_sg_log_scsi & 2))
|
||||
return 1;
|
||||
scsi_log_cmd(c, stderr, flag);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* ts A91221 (former sg_log_err ts A91108) */
|
||||
/** Logs outcome of a sg command.
|
||||
@param flag bit0 causes an error message
|
||||
bit1 do not print duration
|
||||
*/
|
||||
int scsi_log_err(struct command *c, void *fp_in, unsigned char sense[18],
|
||||
int duration, int flag)
|
||||
{
|
||||
char durtxt[20];
|
||||
FILE *fp = fp_in;
|
||||
|
||||
if(fp != NULL && (fp == stderr || (burn_sg_log_scsi & 1))) {
|
||||
if(flag & 1) {
|
||||
durtxt[0] = 0;
|
||||
if (!(flag & 2))
|
||||
sprintf(durtxt, " (%6d ms)\n",duration);
|
||||
fprintf(fp, "+++ key=%X asc=%2.2Xh ascq=%2.2Xh%s\n",
|
||||
sense[2], sense[12], sense[13], durtxt);
|
||||
|
||||
} else {
|
||||
scsi_show_cmd_reply(c, fp, 0);
|
||||
if (!(flag & 2))
|
||||
fprintf(fp,"%6d ms\n", duration);
|
||||
}
|
||||
if (burn_sg_log_scsi & 4)
|
||||
fflush(fp);
|
||||
}
|
||||
if (fp == stderr || !(burn_sg_log_scsi & 2))
|
||||
return 1;
|
||||
scsi_log_err(c, stderr, sense, duration, flag);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -65,5 +65,14 @@ int scsi_show_cmd_text(struct command *c, void *fp, int flag);
|
||||
/* ts A91106 */
|
||||
int scsi_show_cmd_reply(struct command *c, void *fp, int flag);
|
||||
|
||||
/* ts A91218 (former sg_log_cmd ts A70518) */
|
||||
/** Logs command (before execution) */
|
||||
int scsi_log_cmd(struct command *c, void *fp, int flag);
|
||||
|
||||
/* ts A91221 (former sg_log_err ts A91108) */
|
||||
/** Logs outcome of a sg command. */
|
||||
int scsi_log_err(struct command *c, void *fp, unsigned char sense[18],
|
||||
int duration, int flag);
|
||||
|
||||
|
||||
#endif /*__SPC*/
|
||||
|
@ -1923,6 +1923,10 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
}
|
||||
/* ??? padding needed ??? cowardly doing it for now */
|
||||
o->obs_pad = 1; /* fill-up track's last 32k buffer */
|
||||
if (d->do_stream_recording) {
|
||||
if (d->current_profile == 0x41) /* BD-R */
|
||||
o->obs = Libburn_bd_re_streamed_obS;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Libburn_dvd_obs_default_64K
|
||||
@ -1949,6 +1953,18 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
|
||||
o->obs = 32 * 1024; /* This size is required to work */
|
||||
}
|
||||
|
||||
if (d->do_stream_recording &&
|
||||
(d->current_profile == 0x43 || d->current_profile == 0x41) &&
|
||||
o->obs < Libburn_bd_re_streamed_obS) {
|
||||
/* LG GGW-H20 writes junk with stream recording and obs=32k */
|
||||
sprintf(msg,
|
||||
"Stream recording disabled because of small OS buffer");
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index,
|
||||
0x00020176, LIBDAX_MSGS_SEV_NOTE,
|
||||
LIBDAX_MSGS_PRIO_HIGH, msg, 0, 0);
|
||||
d->do_stream_recording = 0;
|
||||
}
|
||||
|
||||
sprintf(msg, "dvd/bd Profile= %2.2Xh , obs= %d , obs_pad= %d",
|
||||
d->current_profile, o->obs, o->obs_pad);
|
||||
libdax_msgs_submit(libdax_messenger, d->global_index, 0x00000002,
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* test/libburner.c , API illustration of burning data or audio tracks to CD */
|
||||
/* Copyright (C) 2005 - 2009 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Provided under GPLv2,see also "License and copyright aspects" at file end */
|
||||
/* Copyright (C) 2005 - 2010 Thomas Schmitt <scdbackup@gmx.net> */
|
||||
/* Provided under GPL, see also "License and copyright aspects" at file end */
|
||||
|
||||
|
||||
/** Overview
|
||||
@ -38,6 +38,16 @@
|
||||
burn_finish()
|
||||
|
||||
*/
|
||||
/*
|
||||
Applications must use 64 bit off_t. E.g. by defining
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
or take special precautions to interface with the library by 64 bit integers
|
||||
where libburn/libburn.h prescribes off_t.
|
||||
This program gets fed with appropriate settings externally by libburn's
|
||||
autotools generated build system.
|
||||
*/
|
||||
|
||||
|
||||
/** See this for the decisive API specs . libburn.h is The Original */
|
||||
/* For using the installed header file : #include <libburn/libburn.h> */
|
||||
@ -768,37 +778,6 @@ Read. Try. Think. Play. Write yourself some code. Be free of my copyright.
|
||||
|
||||
Be also invited to study the code of cdrskin/cdrskin.c et al.
|
||||
|
||||
|
||||
Clarification in my name and in the name of Mario Danic, copyright holder
|
||||
on toplevel of libburnia. To be fully in effect after the remaining other
|
||||
copyrighted code has been replaced by ours and by copyright-free contributions
|
||||
of our friends:
|
||||
|
||||
We, the copyright holders, agree on the interpretation that
|
||||
dynamical linking of our libraries constitutes "use of" and
|
||||
not "derivation from" our work in the sense of GPL, provided
|
||||
those libraries are compiled from our unaltered code.
|
||||
|
||||
Thus you may link our libraries dynamically with applications
|
||||
which are not under GPL. You may distribute our libraries and
|
||||
application tools in binary form, if you fulfill the usual
|
||||
condition of GPL to offer a copy of the source code -altered
|
||||
or unaltered- under GPL.
|
||||
|
||||
We ask you politely to use our work in open source spirit
|
||||
and with the due reference to the entire open source community.
|
||||
|
||||
If there should really arise the case where above clarification
|
||||
does not suffice to fulfill a clear and neat request in open source
|
||||
spirit that would otherwise be declined for mere formal reasons,
|
||||
only in that case we will duely consider to issue a special license
|
||||
covering only that special case.
|
||||
It is the open source idea of responsible freedom which will be
|
||||
decisive and you will have to prove that you exhausted all own
|
||||
means to qualify for GPL.
|
||||
|
||||
For now we are firmly committed to maintain one single license: GPL.
|
||||
|
||||
History:
|
||||
libburner is a compilation of my own contributions to test/burniso.c and
|
||||
fresh code which replaced the remaining parts under copyright of
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* test/telltoc.c , API illustration of obtaining media status info */
|
||||
/* Copyright (C) 2006 - 2007 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL version 2 */
|
||||
/* Copyright (C) 2006 - 2010 Thomas Schmitt <scdbackup@gmx.net>
|
||||
Provided under GPL */
|
||||
|
||||
/** Overview
|
||||
|
||||
|
Reference in New Issue
Block a user