Compare commits

...

19 Commits

Author SHA1 Message Date
7e01bae7e6 Documented changes and release timestamp 2010-06-11 09:57:58 +00:00
7c0a33420a Updated cdrskin tarball generator 2010-06-11 08:34:07 +00:00
101a8813d5 Made number transition to 0.8.2 2010-06-11 08:32:24 +00:00
3a5acf9989 Branching for libburn release 0.8.2 2010-06-11 07:50:01 +00:00
e9828cddd0 Mentioned Solaris and system dependent drive permission settings 2010-06-10 17:23:23 +00:00
7f0358892a Removed obsolete development remark 2010-06-10 17:09:50 +00:00
bc40ce2876 Implemented block device capacity determination fo Solaris 2010-06-08 20:04:01 +00:00
6674667b7f Handled SCSI status "BUSY" on Solaris 2010-06-08 17:50:33 +00:00
cc4d72bf8b Corrected comment 2010-06-08 17:32:44 +00:00
1eee6ab8a0 New system adapter for Solaris uscsi (tested on snv134, kernel 5.11) 2010-06-07 17:30:54 +00:00
736d8b9019 Reacted on harmless compiler warnings on Solaris 2010-06-07 17:17:53 +00:00
8345eb8a71 Avoiding to resolve /dev/rdsk/cXtYdZs2 drive addresses on Solaris libcdio 2010-06-07 17:16:40 +00:00
cc7548f1c7 Bug fix: SIGSEGV of libcdio system adapter if drive list is empty 2010-05-29 07:44:41 +00:00
edca339338 Eventually including ../config.h generated by autotools 2010-05-16 09:07:42 +00:00
9323cceff1 Bug fix: CD-ROM media got attributed random lead-in and lead-out adresses 2010-05-01 08:29:28 +00:00
8b1b3f08c6 Avoided to create track without toc_entry from "hidden first track" on CD 2010-04-30 18:04:47 +00:00
e332f4a438 Documented changes and release timestamp 2010-04-09 11:13:19 +00:00
960fe6d188 Updated cdrskin tarball generator 2010-04-09 10:59:32 +00:00
92c5f6f998 Made number transition to 0.8.1 2010-04-09 10:57:38 +00:00
46 changed files with 1661 additions and 117 deletions

View File

@ -110,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 - B00122
## cdrskin construction site - ts A60816 - B00611
cdrskin_cdrskin_CPPFLAGS = -Ilibburn
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_7_9
cdrskin_cdrskin_CFLAGS = -DCdrskin_libburn_0_8_2
# cdrskin_cdrskin_LDADD = $(libburn_libburn_la_OBJECTS) $(LIBBURN_EXTRALIBS)
# ts A80123, change proposed by Simon Huggins to cause dynamic libburn linking
@ -203,10 +203,12 @@ EXTRA_DIST = \
libburn/os-freebsd.h \
libburn/os-linux.h \
libburn/os-libcdio.h \
libburn/os-solaris.h \
libburn/sg-dummy.c \
libburn/sg-freebsd.c \
libburn/sg-linux.c \
libburn/sg-libcdio.c \
libburn/sg-solaris.c \
COPYING \
NEWS \
ChangeLog \

32
README
View File

@ -11,7 +11,7 @@ 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.8.pl00.tar.gz
http://files.libburnia-project.org/releases/libburn-0.8.2.pl00.tar.gz
------------------------------------------------------------------------------
@ -19,10 +19,10 @@ Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
From tarball
Obtain libburn-0.7.8.pl00.tar.gz, take it to a directory of your choice and do:
Obtain libburn-0.8.2.pl00.tar.gz, take it to a directory of your choice and do:
tar xzf libburn-0.7.8.pl00.tar.gz
cd libburn-0.7.8
tar xzf libburn-0.8.2.pl00.tar.gz
cd libburn-0.8.2
./configure --prefix=/usr
make
@ -105,8 +105,9 @@ The project comprises of several more or less interdependent parts which
together strive to be a usable foundation for application development.
These are libraries, language bindings, and middleware binaries which emulate
classical (and valuable) Linux tools.
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 GNU/Linux with kernels >= 2.4,
on FreeBSD with ATAPI/CAM enabled in the kernel (see man atapicam),
and on OpenSolaris (tested with kernel 5.11).
On other X/Open compliant systems there will only be pseudo drives, but no
direct MMC operation on real CD/DVD/BD drives.
@ -144,6 +145,8 @@ The project components (list subject to growth, hopefully):
also allows to grow ISO-9660 filesystem images on multi-session
media as well as on overwriteable media via the same API.
All media peculiarities are handled automatically.
It also contains the methods of command oriented application
xorriso and offers them via a C language API.
- cdrskin is a limited cdrecord compatibility wrapper for libburn.
cdrecord is a powerful GPL'ed burn program included in Joerg
@ -163,6 +166,8 @@ The project components (list subject to growth, hopefully):
changing, incremental backups, activating boot images, and
extracting of files from ISO images to disk. An own ISO 9660
extension stores ACLs, xattr, and MD5 of file content.
All features of xorriso are also available via a C language API
of libisoburn.
See xorriso/README for more.
- "test" is a collection of application gestures and examples given by the
@ -508,6 +513,21 @@ Project history as far as known to me:
- 10 Mar 2010 libburn-0.7.8 fixes bugs and improves the built-in abort handler
on FreeBSD.
- 30 Mar 2010 Release 0.5.2 of libisoburn provides xorriso documentation in
GNU Texinfo format with embedded extra data to derive a full man page.
- 09 Apr 2010 libburn-0.8.0 now works with ahci driver on FreeBSD 8-STABLE.
- 03 May 2010 Version 0.6.32 of libisofs is able to create ISO images with
multiple boot images. All boot catalog parameters described in El-Torito
specs can be set and inquired. This allows to use GRUB boot images for EFI.
- 04 May 2010 Release 0.5.6.pl00 of libisoburn makes use of the new libisofs
capabilities about boot images.
- 11 Jun 2010 libburn-0.8.2 now works on Solaris.
------------------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify

View File

@ -4,7 +4,7 @@
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.9.tar.gz
http://scdbackup.sourceforge.net/cdrskin-0.8.2.pl00.tar.gz
Copyright (C) 2006-2010 Thomas Schmitt, provided under GPL version 2 or later.
------------------------------------------------------------------------------
@ -13,7 +13,8 @@ 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.
Currently it is supported on GNU/Linux with kernels >= 2.4,
on FreeBSD and on OpenSolaris.
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
@ -25,10 +26,10 @@ By using this software you agree to the disclaimer at the end of this text
Compilation, First Glimpse, Installation
Obtain cdrskin-0.7.9.tar.gz, take it to a directory of your choice and do:
Obtain cdrskin-0.8.2.pl00.tar.gz, take it to a directory of your choice and do:
tar xzf cdrskin-0.7.9.tar.gz
cd cdrskin-0.7.9
tar xzf cdrskin-0.8.2.pl00.tar.gz
cd cdrskin-0.8.2
Within that directory execute:
@ -103,17 +104,25 @@ The output of cdrskin --devices might look like
0 dev='/dev/sr0' rwrwr- : '_NEC' 'DVD_RW ND-4570A'
1 dev='/dev/sr1' rwrw-- : 'HL-DT-ST' 'DVDRAM GSA-4082B'
So full and insecure enabling of both for everybody would look like
chmod a+rw /dev/sr0 /dev/sr1
On Linux, full and insecure enabling of both for everybody would look like
chmod a+rw /dev/sr0 /dev/hda
This is equivalent to the traditional setup chmod a+x,u+s cdrecord.
On FreeBSD, device permissions are to be set in /etc/devfs.rules.
On Solaris, pfexec privileges may be restricted to "basic,sys_devices".
See below "System Dependend Drive Permission Examples".
I strongly discourage to run cdrskin with setuid root or via sudo !
It is not checked for the necessary degree of hacker safety.
Better consider to grant the necessary permissions to group "floppy"
and to add users to it.
A behavioral conflict is known between any burn software and demons like hald
which probe CD drives. This can spoil burn runs for CD-R or CD-RW.
You may have to keep your hald away from the drive. See for example
http://www.freebsd.org/gnome/docs/halfaq.html
Consider to put all authorized users into group "floppy", to chgrp the
device file to that group and to disallow w-access to others.
Helpful with Linux kernel 2.4 is a special SCSI feature:
It is possible to address a scsi(-emulated) drive via associated device files
@ -122,11 +131,6 @@ as listed device files. This addressing via e.g. /dev/sr0 or /dev/scd1 is
compatible with generic read programs like dd and with write program growisofs.
For finding /dev/sg1 from /dev/sr0, the program needs rw-access to both files.
A behavioral conflict is known between any burn software and demons like hald
which probe CD drives. This can spoil burn runs for CD-R or CD-RW.
You may have to keep your hald away from the drive. See for example
http://www.freebsd.org/gnome/docs/halfaq.html
Usage examples
@ -433,6 +437,84 @@ It will not read startup files, will abort on option dev_translation= ,
will not have a fifo buffer, and will not be able to put out help texts or
debugging messages.
------------------------------------------------------------------------------
System Dependend Drive Permission Examples
Accessing the optical drives requires privileges which usually are granted
only to the superuser. Linux, FreeBSD and Solaris offer quite different
approaches for avoiding the need for unrestricted privileges.
First check whether some friendly system setting already allows you to
access the drives as normal user:
cdrskin --devices
Those drives of which you see address and type strings are already usable.
If there remain drives invisible which the superuser can see by the same
command, then the following examples might help:
---------------------
On all three systems:
---------------------
Add the authorized users of CD drives to group "floppy" in /etc/group.
If missing: create this group.
Changes to /etc/group often only affect new login sessions. So log out and in
before making the first tests.
---------
On Linux:
---------
Allow rw-access to the drives
chgrp floppy /dev/sr0 /dev/sr1
chmod g+rw /dev/sr0 /dev/sr1
It might be necessary to perform chgrp and chmod after each reboot or to
edit distro dependent device configuration files for permanent settings.
-----------
On FreeBSD:
-----------
Edit /etc/devfs.rules and make sure to have these lines
[localrules=10]
add path 'acd*' mode 0664 group floppy
add path 'cd*' mode 0664 group floppy
add path 'pass*' mode 0664 group floppy
add path 'xpt*' mode 0664 group floppy
[localrules=5]
add path 'pass*' mode 0664 group floppy
add path 'cd*' mode 0664 group floppy
add path 'xpt*' mode 0664 group floppy
add path 'acd*' mode 0664 group floppy
Edit /etc/rc.conf and add the following line if missing
devfs_system_ruleset="localrules"
This gets into effect by reboot or by command
/etc/rc.d/devfs start
-----------
On Solaris:
-----------
Run cdrskin by
pfexec cdrskin ...arguments...
The following settings will make pfexec keep original UID and EUID and prevent
most superuser powers. Be aware that you still can manipulate all device files
if you have the file permissions for that.
Full root privileges for cdrskin can then be aquired only by command su.
Edit /etc/security/exec_attr and add this line to the other "Media Backup"
lines:
Media Backup:solaris:cmd:::/usr/local/bin/cdrskin:privs=basic,sys_devices
Edit /etc/user_attr and add profile "Media Backup" to the user's line:
thomas::::profiles=Media Backup,Primary Administrator;roles=root
See also man privileges, man exec_attr, man user_attr.
Then allow the group r-access to the drives
pfexec chgrp floppy /dev/rdsk/c3t0d0s2 /dev/rdsk/c4t0d0s2
pfexec chmod g+r /dev/rdsk/c3t0d0s2 /dev/rdsk/c4t0d0s2
The last two commands have to be executed after each boot. I do not know
the relevant device configuration files yet.
------------------------------------------------------------------------------
Project aspects and legal stuff

View File

@ -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.8"
skin_release="0.8.2"
patch_level=".pl00"
skin_rev="$skin_release""$patch_level"

View File

@ -38,7 +38,7 @@ original="./libburn_svn.tgz"
# My changes are in $changes , mainly in $changes/cdrskin
changes="./libburn-develop"
skin_release="0.7.9"
skin_release="0.8.3"
patch_level=""
skin_rev="$skin_release""$patch_level"

View File

@ -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 "Feb 29, 2010"
.TH CDRSKIN 1 "Jun 10, 2010"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -271,19 +271,22 @@ the drive is somewhat higher but the overall system is much less at stake.
Consider to restrict rw-access to a single group which bundles the users who
are allowed to use the burner drive (like group "floppy").
.br
For drive permission examples on Linux, FreeBSD, and Solaris,
see cdrskin/README.
.br
.PP
If you only got one CD capable drive then you may leave out cdrskin option
\fBdev=\fP. Else you should use this option to address the drive you want.
.br
cdrskin option dev= not only accepts the listed addresses but also
traditional cdrecord SCSI addresses which on Linux consist of three
numbers: Bus,Target,Lun. There is also a related address family "ATA" which
traditional cdrecord SCSI addresses which consist of three numbers:
Bus,Target,Lun. On Linux there is also a related address family "ATA" which
accesses IDE drives not under control of Linux SCSI drivers:
ATA:Bus,Target,Lun.
.br
See option -scanbus for getting a list of cdrecord style addresses.
.br
Further are accepted on Linux: links to libburn-suitable device files,
Further are accepted: links to libburn-suitable device files,
device files which have the same major and minor device number,
and device files which have the same SCSI address parameters (e.g. /dev/sg0).
.br

View File

@ -88,7 +88,7 @@ or
/** The official program version */
#ifndef Cdrskin_prog_versioN
#define Cdrskin_prog_versioN "0.7.9"
#define Cdrskin_prog_versioN "0.8.2"
#endif
/** The official libburn interface revision to use.
@ -98,10 +98,10 @@ or
#define Cdrskin_libburn_majoR 0
#endif
#ifndef Cdrskin_libburn_minoR
#define Cdrskin_libburn_minoR 7
#define Cdrskin_libburn_minoR 8
#endif
#ifndef Cdrskin_libburn_micrO
#define Cdrskin_libburn_micrO 9
#define Cdrskin_libburn_micrO 2
#endif
@ -135,13 +135,13 @@ or
#endif /* Cdrskin_libburn_cvs_A60220_tS */
#ifdef Cdrskin_libburn_0_7_8
#define Cdrskin_libburn_versioN "0.7.8"
#ifdef Cdrskin_libburn_0_8_2
#define Cdrskin_libburn_versioN "0.8.2"
#define Cdrskin_libburn_from_pykix_svN 1
#endif /* Cdrskin_libburn_0_7_8 */
#endif /* Cdrskin_libburn_0_8_2 */
#ifdef Cdrskin_libburn_0_7_9
#define Cdrskin_libburn_versioN "0.7.9"
#ifdef Cdrskin_libburn_0_8_3
#define Cdrskin_libburn_versioN "0.8.3"
#define Cdrskin_libburn_from_pykix_svN 1
/* Place novelty switch macros here.
@ -153,29 +153,29 @@ or
*/
#endif /* Cdrskin_libburn_0_7_9 */
#endif /* Cdrskin_libburn_0_8_3 */
#ifndef Cdrskin_libburn_versioN
#define Cdrskin_libburn_0_7_8
#define Cdrskin_libburn_versioN "0.7.8"
#define Cdrskin_libburn_0_8_2
#define Cdrskin_libburn_versioN "0.8.2"
#define Cdrskin_libburn_from_pykix_svN 1
#endif
#ifdef Cdrskin_libburn_0_7_8
#ifdef Cdrskin_libburn_0_8_2
#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 8
#define Cdrskin_libburn_minoR 8
#define Cdrskin_libburn_micrO 2
#endif
#ifdef Cdrskin_libburn_0_7_9
#ifdef Cdrskin_libburn_0_8_3
#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 9
#define Cdrskin_libburn_minoR 8
#define Cdrskin_libburn_micrO 3
#endif
@ -4200,8 +4200,9 @@ int Cdrskin_abort_handler(struct CdrskiN *skin, int signum, int flag)
if(getpid()!=skin->control_pid) {
if(skin->verbosity>=Cdrskin_verbose_debuG)
ClN(fprintf(stderr,
"\ncdrskin_debug: ABORT : [%d] Thread rejected: pid=%d, signum=%d\n",
skin->control_pid,getpid(),signum));
"\ncdrskin_debug: ABORT : [%lu] Thread rejected: pid=%lu, signum=%lu\n",
(unsigned long int) skin->control_pid, (unsigned long int) getpid(),
(unsigned long int) signum));
#ifdef Not_yeT
/* >>> find more abstract and system independent way to determine

View File

@ -38,8 +38,8 @@ About any CD, DVD, or BD recorder produced in the recent ten years.
<BR>
<A HREF="http://libburnia-project.org">libburn</A>
supports recorders which are compliant to standards MMC-1 for CD and
MMC-5 for DVD or BD. Linux and FreeBSD allow to access drives connected
via SCSI, PATA (aka IDE, ATA), USB, or SATA.
MMC-5 for DVD or BD. Linux, FreeBSD, and Solaris allow to access drives
connected via SCSI, PATA (aka IDE, ATA), USB, or SATA.
<BR>
</P>
@ -52,6 +52,8 @@ via SCSI, PATA (aka IDE, ATA), USB, or SATA.
<DT>or FreeBSD (with libc, of course) :</DT>
<DD>ATA and SATA drives need atapicam running.</DD>
<DD>libcam has to be installed.</DD>
<DT>or Solaris (with libc, of course) :</DT>
<DD>Tested on kernel 5.11, hopefully suitable for older ones too.</DD>
<DT>libpthread</DT>
<DD>is supposed to be a standard system component.</DD>
</DL>
@ -62,7 +64,7 @@ via SCSI, PATA (aka IDE, ATA), USB, or SATA.
GPL software included:<BR>
</H2>
<DL>
<DT>libburn-0.7.8</DT>
<DT>libburn-0.8.2</DT>
<DD>(founded by Derek Foreman and Ben Jansens,
developed and maintained since August 2006 by
Thomas Schmitt from team of libburnia-project.org)
@ -72,8 +74,8 @@ Thomas Schmitt from team of libburnia-project.org)
</P>
<P>
This program system has been tested on Intel/AMD Linux and FreeBSD systems
only.<BR>
This program system has been tested on Intel/AMD with Linux, FreeBSD,
and OpenSolaris based operating systems.<BR>
Ports to other usable systems are appreciated. Reports are welcome.
</P>
@ -105,8 +107,9 @@ BD-R. Write mode -tao works with anything but quickly blanked DVD-RW.
<DD>#<KBD>&nbsp;cdrskin --devices</KBD></DD>
<DT>Being superuser avoids permission problems with /dev/srN resp. /dev/hdX .
</DT>
<DT>Ordinary users should then get granted rw access to the /dev files
as listed by option --devices.</DT>
<DT>Ordinary users should then get granted access to the /dev files
as listed by option --devices. Linux and FreeBSD demand rw-permission.
On Solaris it is r-permission and privileges "basic,sys_devices".</DT>
<DT>&nbsp;</DT>
<DT>Get info about a particular drive or loaded media:</DT>
@ -194,8 +197,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.8.pl00.tar.gz">cdrskin-0.7.8.pl00.tar.gz</A>
(820 KB).
<DD><A HREF="cdrskin-0.8.2.pl00.tar.gz">cdrskin-0.8.2.pl00.tar.gz</A>
(845 KB).
</DD>
<DD>
The cdrskin tarballs are source code identical with libburn releases
@ -244,23 +247,24 @@ 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.6.pl00:
Enhancements towards previous stable version cdrskin-0.8.0.pl00:
<UL>
<LI>
Abort handling is more suitable for FreeBSD now.
</LI>
<LI>A new system adapter allows to burn CD, DVD and BD on OpenSolaris</LI>
<!--
<LI>none</LI>
-->
</UL>
Bug fixes towards cdrskin-0.7.6.pl00:
Bug fixes towards cdrskin-0.8.0.pl00:
<UL>
<LI>
On FreeBSD: Piped input was falsely attributed a small fixed size
CD TOC was not read if the first track did not start at LBA 0
</LI>
<LI>
cdrskin fs=0 led to SIGSEGV. Regression introduced by version 0.7.4.
CD-ROM media got attributed random lead-in and lead-out adresses
</LI>
<LI>
SIGSEGV of experimental libcdio system adapter if drive list is empty
</LI>
<!--
<LI>none</LI>
@ -271,29 +275,31 @@ cdrskin fs=0 led to SIGSEGV. Regression introduced by version 0.7.4.
<P>
<DL>
<DT><H3>Development snapshot, version 0.7.9 :</H3></DT>
<DD>Enhancements towards current stable version 0.7.8.pl00:
<DT><H3>Development snapshot, version 0.8.3 :</H3></DT>
<DD>Enhancements towards current stable version 0.8.2.pl00:
<UL>
<LI>none yet</LI>
<!--
<LI>none yet</LI>
-->
</UL>
</DD>
<DD>Bug fixes towards cdrskin-0.7.6.pl00:
<DD>Bug fixes towards cdrskin-0.8.2.pl00:
<UL>
<LI>none yet</LI>
<!--
<LI>none yet</LI>
-->
</UL>
</DD>
<DD>&nbsp;</DD>
<DD><A HREF="README_cdrskin_devel">README 0.7.9</A>
<DD><A HREF="cdrskin__help_devel">cdrskin_0.7.9 --help</A></DD>
<DD><A HREF="cdrskin_help_devel">cdrskin_0.7.9 -help</A></DD>
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.7.9)</A></DD>
<DD><A HREF="README_cdrskin_devel">README 0.8.3</A>
<DD><A HREF="cdrskin__help_devel">cdrskin_0.8.3 --help</A></DD>
<DD><A HREF="cdrskin_help_devel">cdrskin_0.8.3 -help</A></DD>
<DD><A HREF="man_1_cdrskin_devel.html">man cdrskin (as of 0.8.3)</A></DD>
<DD>&nbsp;</DD>
<DT>Maintainers of cdrskin unstable packages please use SVN of
<A HREF="http://libburnia-project.org"> libburnia-project.org</A></DT>
@ -313,8 +319,8 @@ admins with full system souvereignty.</DT>
<A HREF="README_cdrskin_devel">upcoming README</A> ):
</DD>
<DD>
<A HREF="cdrskin-0.7.9.tar.gz">cdrskin-0.7.9.tar.gz</A>
(840 KB).
<A HREF="cdrskin-0.8.3.tar.gz">cdrskin-0.8.3.tar.gz</A>
(845 KB).
</DD>
<!-- This is not offered any more since spring 2008

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2010.04.09.090645"
#define Cdrskin_timestamP "2010.06.11.080001"

View File

@ -8227,14 +8227,263 @@ Made number transition to 0.7.9
+ cdrskin/add_ts_changes_to_libburn_0_7_9
Updated cdrskin tarball generator
10 Mar 2010 []
10 Mar 2010 [3119]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------------ cycle - cdrskin-0.7.9 - 2010.03.10.134802
10 Mar 2010 [3120]
svn move -m 'libburn release 0.7.8 is ready'
http://svn.libburnia-project.org/libburn/branches/ZeroSevenEight
http://svn.libburnia-project.org/libburn/tags/ZeroSevenEight
------------------------------------ cycle - cdrskin-0.7.9 -
------------------------------------ cycle - cdrskin-0.7.9 -
------------------------------------ cycle - cdrskin-0.7.9 - 2010.03.10.143607
2010.03.17.185222 [3123]
cdrskin/cdrskin.c
Small bug fix about track size with cdrskin -minfo
17 Mar 2010 [3124]
configure.ac
Corrected initialization of configure option --enable-dvd-obs-64k
2010.03.25.113536 [3131]
libburn/spc.c
libburn/sg-freebsd.c
Changed sg-freebsd.c to work with ahci, advise by Alexander Motin
2010.03.26.083158 [3132]
libburn/sg-freebsd.c
Had to make ahci change conditional for now: -DLibburn_for_freebsd_ahcI
2010.03.27.155659 [3133]
libburn/mmc.c
Avoiding to inquire NWA of unwritable media or states
2010.03.27.172644 [3134]
libburn/os-freebsd.h
libburn/sg-freebsd.c
Trying to detect FreeBSD ahci devices and to handle others the old way
------------------------------------ cycle - cdrskin-0.7.9 - 2010.03.27.184614
* Now able to work with ahci driver of FreeBSD 8-STABLE
2010.03.29.103141 [3135]
libburn/spc.c
libburn/sg-linux.c
libburn/sg-freebsd.c
libburn/sg-libcdio.c
Adjusted libcdio system adapter to FreeBSD peculiarities
2010.04.04.181237 [3146]
test/libburner.c
Let libburner warn programmers if they forget to set 64 bit off_t
2010.04.09.090645 [3155]
libburn/sg-linux.c
Reporting eventual SCSI sense in sg-linux repeat loop
9 Apr 2010 [3156]
svn copy -m "Branching for libburn release 0.8.0" \
http://svn.libburnia-project.org/libburn/trunk \
http://svn.libburnia-project.org/libburn/branches/ZeroEightZero
2010.04.09.100001 [3157]
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.8.0
09 Apr 2010 [3158]
- cdrskin/add_ts_changes_to_libburn_0_7_8
- cdrskin/add_ts_changes_to_libburn_0_7_9
+ cdrskin/add_ts_changes_to_libburn_0_8_0
+ cdrskin/add_ts_changes_to_libburn_0_8_1
Updated cdrskin tarball generator
09 Apr 2010 [3159]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.8.0.pl00 - 2010.04.09.100001
* Now able to work with ahci driver of FreeBSD 8-STABLE
2010.04.09.104907 [3160]
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.8.1
09 Apr 2010 [3161]
- cdrskin/add_ts_changes_to_libburn_0_7_8
- cdrskin/add_ts_changes_to_libburn_0_7_9
+ cdrskin/add_ts_changes_to_libburn_0_8_0
+ cdrskin/add_ts_changes_to_libburn_0_8_1
Updated cdrskin tarball generator
09 Apr 2010 [3162]
cdrskin/changelog.txt
Documented changes and release timestamp
09 Apr 2009 [3163]
svn move -m libburn release 0.8.0 is ready
http://svn.libburnia-project.org/libburn/branches/ZeroEightZero
http://svn.libburnia-project.org/libburn/tags/ZeroEightZero
------------------------------------ cycle - cdrskin-0.8.1 - 2010.04.09.110341
2010.04.30.180350 [3206]
libburn/mmc.c
Avoided to create track without toc_entry from "hidden first track" on CD
------------------------------------ cycle - cdrskin-0.8.1 - 2010.04.30.182846
* Bug fix: CD TOC was not read if the first track did not start at LBA 0
2010.05.01.082808 [3207]
libburn/util.c
libburn/mmc.c
Bug fix: CD-ROM media got attributed random lead-in and lead-out adresses
------------------------------------ cycle - cdrskin-0.8.1 - 2010.05.01.083316
* Bug fix: CD-ROM media got attributed random lead-in and lead-out adresses
2010.05.16.090624 [3219]
libburn/async.c
libburn/cleanup.c
libburn/crc.c
libburn/ddlpa.c
libburn/debug.c
libburn/drive.c
libburn/ecma130ab.c
libburn/file.c
libburn/init.c
libburn/libdax_audioxtr.c
libburn/libdax_msgs.c
libburn/mmc.c
libburn/null.c
libburn/options.c
libburn/read.c
libburn/sbc.c
libburn/sector.c
libburn/sg.c
libburn/sg-dummy.c
libburn/sg-freebsd.c
libburn/sg-freebsd-port.c
libburn/sg-libcdio.c
libburn/sg-linux.c
libburn/source.c
libburn/spc.c
libburn/structure.c
libburn/toc.c
libburn/util.c
libburn/write.c
Eventually including ../config.h generated by autotools
2010.05.29.074318 [3237]
libburn/sg-libcdio.c
Bug fix: SIGSEGV of libcdio system adapter if drive list is empty
2010.06.07.171552 [3239]
libburn/sg-libcdio.c
Avoiding to resolve /dev/rdsk/cXtYdZs2 drive addresses on Solaris libcdio
2010.06.07.171706 [3240]
libburn/init.c
cdrskin/cdrskin.c
Reacted on harmless compiler warnings on Solaris
2010.06.07.172925 [3241]
README
cdrskin/README
Makefile.am
libburn/os.h
libburn/sg.c
+ libburn/os-solaris.h
+ libburn/sg-solaris.c
libburn/libdax_msgs.h
cdrskin/cdrskin_eng.html
New system adapter for Solaris uscsi (tested on snv134, kernel 5.11)
2010.06.08.173156 [3244]
libburn/os-solaris.h
Corrected comment
2010.06.08.174946 [3245]
libburn/sg-solaris.c
Handled SCSI status "BUSY" on Solaris
------------------------------------ cycle - cdrskin-0.8.1 - 2010.06.08.175125
* Bug fix: SIGSEGV of libcdio system adapter if drive list is empty
* New system adapter for Solaris uscsi (tested on snv134, kernel 5.11)
2010.06.08.200313 [3246]
libburn/sg-libcdio.c
libburn/sg-solaris.c
Implemented block device capacity determination fo Solaris
2010.06.10.170901 [3247]
libburn/sg-solaris.c
Removed obsolete development remark
2010.06.10.171018 [3248]
README
cdrskin/README
cdrskin/cdrskin.1
Mentioned Solaris and system dependent drive permission settings
[]
svn copy -m "Branching for libburn release 0.8.2" \
http://svn.libburnia-project.org/libburn/trunk \
http://svn.libburnia-project.org/libburn/branches/ZeroEightTwo
2010.06.11.080001 [3251]
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.8.2
11 Jun 2010 [3252]
- cdrskin/add_ts_changes_to_libburn_0_8_0
- cdrskin/add_ts_changes_to_libburn_0_8_1
+ cdrskin/add_ts_changes_to_libburn_0_8_2
+ cdrskin/add_ts_changes_to_libburn_0_8_3
Updated cdrskin tarball generator
[]
cdrskin/changelog.txt
Documented changes and release timestamp
------------------------------ release - cdrskin-0.8.2.pl00 - 2010.06.11.080001
* Bug fix: CD TOC was not read if the first track did not start at LBA 0
* Bug fix: CD-ROM media got attributed random lead-in and lead-out adresses
* Bug fix: SIGSEGV of experimental libcdio system adapter if drive list is empty
* New system adapter for Solaris uscsi (tested on snv134, kernel 5.11)
------------------------------------ cycle - cdrskin-0.8.3 -
------------------------------------ cycle - cdrskin-0.8.3 -
===============================================================================
@ -8242,6 +8491,15 @@ Documented changes and release timestamp
===============================================================================
-------------------------------- Solaris -----------------------------------
Locking of device files.
Could need ioctl to obtain SCSI bus,target,lun from fd rather than name
----------------------------------------------------------------------------
- change all malloc() to calloc()
- find out from where libburn/crc.c stems. What algorithm is crc_32() ?
@ -8272,13 +8530,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 ?
(needs read chunks much larger than 2 kB)
? Enable profile 0x42 BD-R random recording
Provide DVD+R DL layer break setter

View File

@ -8,7 +8,7 @@ debug_opts="-O2"
def_opts=
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
fifo_opts=""
libvers="-DCdrskin_libburn_0_7_9"
libvers="-DCdrskin_libburn_0_8_2"
# To be used if Makefile.am uses libburn_libburn_la_CFLAGS
# burn="libburn/libburn_libburn_la-"
@ -47,15 +47,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_8"
elif test "$i" = "-libburn_0_8_2"
then
libvers="-DCdrskin_libburn_0_7_8"
libvers="-DCdrskin_libburn_0_8_2"
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_9"
libvers="-DCdrskin_libburn_0_8_3"
libdax_audioxtr_o="$burn"libdax_audioxtr.o
libdax_msgs_o="$burn"libdax_msgs.o
cleanup_src_or_obj="$burn"cleanup.o
@ -109,7 +109,7 @@ do
echo "Options:"
echo " -compile_cdrfifo compile program cdrskin/cdrfifo."
echo " -compile_dewav compile program test/dewav without libburn."
echo " -libburn_0_7_8 set macro to match libburn-0.7.8"
echo " -libburn_0_8_2 set macro to match libburn-0.8.2"
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."

View File

@ -1,4 +1,4 @@
AC_INIT([libburn], [0.7.9], [http://libburnia-project.org])
AC_INIT([libburn], [0.8.2], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
@ -9,7 +9,7 @@ LIBBURNIA_SET_FLAGS
AM_INIT_AUTOMAKE([subdir-objects])
dnl Notes by ts A71207 - B00310 :
dnl Notes by ts A71207 - B00611 :
dnl
dnl Regrettably the meaning of the various version types was misunderstood
dnl before version 0.4.1.
@ -80,6 +80,8 @@ 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 0.7.8 = libburn.so.4.43.0
dnl 0.8.0 = libburn.so.4.45.0
dnl 0.8.2 = libburn.so.4.47.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.
@ -104,8 +106,8 @@ dnl If BURN_*_VERSION changes, be sure to change AC_INIT above to match.
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=9
BURN_MINOR_VERSION=8
BURN_MICRO_VERSION=2
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
AC_SUBST(BURN_MAJOR_VERSION)
@ -116,15 +118,15 @@ AC_SUBST(BURN_VERSION)
dnl Libtool versioning
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
dnl
dnl ts B00310
dnl ### This is the release version libburn-0.7.8 = libburn.so.4.43.0
dnl This is the development version after above release version
dnl ts B00409
dnl This is the release version libburn-0.8.2
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 = 47 - 43 = 4 . Linux library name = libburn.so.4.43.0
LT_CURRENT=47
LT_AGE=43
dnl SONAME = 51 - 47 = 4 . Linux library name = libburn.so.4.47.0
LT_CURRENT=51
LT_AGE=47
LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`

View File

@ -23,6 +23,9 @@
#define Libburn_detach_done_workeR 1
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include "libburn.h"
#include "transport.h"

View File

@ -10,6 +10,10 @@
cc -g -o cleanup -DCleanup_standalonE cleanup.c
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>

View File

@ -1,5 +1,9 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include "crc.h"
static unsigned short ccitt_table[256] = {
@ -104,6 +108,15 @@ unsigned long crc32_table[256] = {
0x71C0FC00L, 0xE151FD01L, 0xE0E1FE01L, 0x7070FF00L
};
/* Exploration ts B00214 :
ECMA-130, 22.3.6 "CRC field"
Generating polynomial: x^16 + x^12 + x^5 + 1
Also known as CRC-16-CCITT, CRC-CCITT
Use in libburn for raw write modes in sector.c.
There is also disabled code in read.c which would use it.
*/
unsigned short crc_ccitt(unsigned char *q, int len)
{
unsigned short crc = 0;
@ -112,6 +125,20 @@ unsigned short crc_ccitt(unsigned char *q, int len)
crc = ccitt_table[(crc >> 8 ^ *q++) & 0xff] ^ (crc << 8);
return ~crc;
}
/* Exploration ts B00214 :
ECMA-130, 14.3 "EDC field"
"The EDC codeword must be divisible by the check polynomial:
P(x) = (x^16 + x^15 + x^2 + 1) . (x^16 + x^2 + x + 1)
"
>>> Test whether this coincides with CRC-32 IEEE 802.3
x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10
+ x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
Used for raw writing in sector.c
*/
unsigned int crc_32(unsigned char *data, int len)
{
unsigned int crc = 0;

View File

@ -22,6 +22,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

View File

@ -4,6 +4,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#ifdef WIN32
#include <windows.h>

View File

@ -6,6 +6,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -1,6 +1,10 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/* ts A91016 : libburn/ecma130ab.c is the replacement for old libburn/lec.c
Copyright 2009, Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org

View File

@ -6,6 +6,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdlib.h>
#include <sys/types.h>
@ -399,9 +403,13 @@ int burn_fifo_source_shoveller(struct burn_source *source, int flag)
else
ret = fs->inp->read_xt( fs->inp,
(unsigned char *) bufpt, fs->inp_read_size);
if (ret == 0)
if (ret == 0) {
/* >>> ??? ts B00326 */
/* >>> report EOF of fifo input and fs->in_counter */;
break; /* EOF */
else if (ret < 0) {
} else if (ret < 0) {
libdax_msgs_submit(libdax_messenger, -1, 0x00020153,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
"Read error on fifo input", errno, 0);

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <unistd.h>
@ -338,7 +342,7 @@ char *burn_util_thread_id(pid_t pid, pthread_t tid, char text[80])
{
int i, l;
sprintf(text, "[%d,", getpid());
sprintf(text, "[%lu,", (unsigned long int) getpid());
l= strlen(text);
for(i= 0; i < sizeof(pthread_t) && 2 * i < 80 - l - 3; i++)
sprintf(text + l + 2 * i,

View File

@ -2627,8 +2627,8 @@ 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 9
#define burn_header_version_minor 8
#define burn_header_version_micro 2
/** Note:
Above version numbers are also recorded in configure.ac because libtool
wants them as parameters at build time.

View File

@ -4,6 +4,10 @@
Copyright (C) 2006 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -5,6 +5,10 @@
provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

View File

@ -434,6 +434,8 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020009 (SORRY,HIGH) = Neither stdio-path nor its directory exist
0x0002000a (FAILURE,HIGH) = Cannot accept '...' as SG_IO CDROM drive
0x0002000b (FAILURE,HIGH) = File object '...' not found
0x0002000c (FAILURE,HIGH) = Cannot start device file enumeration
0x0002000d (FAILURE,HIGH) = Cannot enumerate next device
General library operations:

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/* ts A61009 */
/* #include <a ssert.h> */
@ -1400,6 +1404,11 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
fprintf(stderr, "libburn_experimental: toc entry #%d : %d %d %d\n",i,tdata[8], tdata[9], tdata[10]);
*/
#ifdef Libburn_allow_first_hiddeN
/* ts B00430 : this causes problems because the track has
no entry. One would have to coordinate this
with other parts of libburn.
*/
if (tdata[3] == 1) {
if (burn_msf_to_lba(tdata[8], tdata[9], tdata[10])) {
d->disc->session[0]->hidefirst = 1;
@ -1408,9 +1417,10 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
session[tdata[0] - 1],
track, BURN_POS_END);
burn_track_free(track);
}
}
#endif /* Libburn_allow_first_hiddeN */
if (tdata[0] <= 0 || tdata[0] > d->disc->sessions)
tdata[0] = d->disc->sessions;
if (tdata[3] < 100 && tdata[0] > 0) {
@ -1968,8 +1978,13 @@ void mmc_read_atip(struct burn_drive *d)
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
burn_print(1, "atip shit for you\n");
/* ts B00501 : now caring for error */
if (c.error) {
d->erasable= 0;
d->start_lba= 0;
d->end_lba= 0;
return;
}
/* ts A61021 */
data = c.page->data;

View File

@ -5,6 +5,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include "null.h"
#include "libburn.h"
#include <stdlib.h>

View File

@ -4,6 +4,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include "libburn.h"
#include "options.h"
#include "drive.h"

68
libburn/os-solaris.h Normal file
View File

@ -0,0 +1,68 @@
/* os-solaris.h
Operating system specific libburn definitions and declarations. Included
by os.h in case of compilation for
Solaris based systems, e.g. SunOS 5.11
with Solaris uscsi MMC transport adapter sg-solaris.c
Copyright (C) 2010 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
*/
/** List of all signals which shall be caught by signal handlers and trigger
a graceful abort of libburn. (See man signal.h)
*/
/* 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, SIGURG, SIGWINCH
/* The number of above list items */
#define BURN_OS_NON_SIGNAL_COUNT 5
/* 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.
>>> ??? is 64 kB ok for Solaris uscsi ?
*/
#define BURN_OS_TRANSPORT_BUFFER_SIZE 65536
/* >>> */
/* To hold the position of the most recently delivered address from
device enumeration.
*/
struct burn_drive_enumerator_struct {
void *dir;
};
#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 \
int fd;

View File

@ -14,6 +14,14 @@
*/
#ifdef Libburn_use_sg_dummY
/* --------- Any other system. With dummy MMC transport sg-dummy.c --------- */
#include "os-dummy.h"
#else
#ifdef Libburn_use_libcdiO
@ -45,6 +53,14 @@
#include "os-linux.h"
#else
#ifdef __sun
/* ------- Solaris (e.g. SunOS 5.11) with uscsi ------ */
#include "os-solaris.h"
#else
@ -52,10 +68,12 @@
#include "os-dummy.h"
#endif /* ! __sun*/
#endif /* ! __linux */
#endif /* ! __FreeBSD__kernel__ */
#endif /* ! __FreeBSD__ */
#endif /* ! Libburn_use_libcdiO */
#endif /* ! Libburn_use_sg_dummY */
#endif /* ! BURN_OS_H_INCLUDED */

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/* #include <m alloc.h> ts A61013 : not in GNU/Linux man 3 malloc */

View File

@ -7,6 +7,9 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <string.h>
#include <unistd.h>

View File

@ -5,6 +5,9 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdio.h>

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/*

View File

@ -95,6 +95,10 @@ Send feedback to libburn-hackers@pykix.org .
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/** PORTING : ------- OS dependent headers and definitions ------ */

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <errno.h>
#include <unistd.h>
#include <stdio.h>

View File

@ -94,6 +94,10 @@ Send feedback to libburn-hackers@pykix.org .
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/** PORTING : ------- OS dependent headers and definitions ------ */
@ -131,6 +135,13 @@ Send feedback to libburn-hackers@pykix.org .
#define Libburn_guess_freebsd_atapi_devicE 1
#ifdef sun
#define Libburn_is_on_solariS 1
#endif
#ifdef __sun
#define Libburn_is_on_solariS 1
#endif
#include <cdio/cdio.h>
#include <cdio/logging.h>
#include <cdio/mmc.h>
@ -225,8 +236,9 @@ static int sg_give_next_adr_raw(burn_drive_enumerator_t *idx,
}
} else if (initialize == -1) {
if (*(idx->ppsz_cd_drives) != NULL)
cdio_free_device_list(idx->ppsz_cd_drives);
if (idx->ppsz_cd_drives != NULL)
if (*(idx->ppsz_cd_drives) != NULL)
cdio_free_device_list(idx->ppsz_cd_drives);
idx->ppsz_cd_drives = NULL;
}
@ -417,7 +429,7 @@ int sg_dispose_drive(struct burn_drive *d, int flag)
int sg_give_next_adr(burn_drive_enumerator_t *idx,
char adr[], int adr_size, int initialize)
{
int ret, recursion_count = 0;
int ret, recursion_count = 0, l;
char path[4096];
ret = sg_give_next_adr_raw(idx, adr, adr_size, initialize);
@ -425,8 +437,19 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
return ret;
if (strlen(adr) >= sizeof(path))
return ret;
strcpy(path, adr);
ret = burn_drive_resolve_link(path, adr, &recursion_count, 2);
#ifdef Libburn_is_on_solariS
/* >>> provisory : preserve Solaris /dev/rdsk/cXtYdZs2 addresses */
l = strlen(adr);
if (l >= 18)
if (strncmp(adr, "/dev/rdsk/c", 11) == 0 && adr[11] >= '0' &&
adr[11] <= '9' && strcmp(adr + (l - 2), "s2") == 0)
return 1;
#endif /* Libburn_is_on_solariS */
ret = burn_drive_resolve_link(adr, path, &recursion_count, 2);
if(ret > 0 && strlen(path) < adr_size)
strcpy(path, adr);
return (ret >= 0);
}
@ -437,7 +460,7 @@ int sg_give_next_adr(burn_drive_enumerator_t *idx,
int scsi_enumerate_drives(void)
{
burn_drive_enumerator_t idx;
int initialize = 1, ret, i_bus_no = -1, recursion_count = 0;
int initialize = 1, ret, i_bus_no = -1, recursion_count = 0, l;
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
char buf[4096], target[4096];
@ -446,7 +469,22 @@ int scsi_enumerate_drives(void)
initialize = 0;
if (ret <= 0)
break;
ret = burn_drive_resolve_link(buf, target, &recursion_count,2);
ret = 1;
#ifdef Libburn_is_on_solariS
/* >>> provisory : preserve Solaris /dev/rdsk/cXtYdZs2 */
l = strlen(buf);
if (l >= 18)
if (strncmp(buf, "/dev/rdsk/c", 11) == 0 &&
buf[11] >= '0' && buf[11] <= '9' &&
strcmp(buf + (l - 2), "s2") == 0)
ret = 0;
#endif /* Libburn_is_on_solariS */
if (ret == 1) {
ret = burn_drive_resolve_link(buf, target,
&recursion_count,2);
}
if (ret <= 0)
strcpy(target, buf);
if (burn_drive_is_banned(target))
@ -880,7 +918,24 @@ int burn_os_stdio_capacity(char *path, off_t *bytes)
return -2;
*bytes = add_size;
#endif/* Libburn_is_on_freebsD */
#endif /* Libburn_is_on_freebsD */
#ifdef Libburn_is_on_solariS
} else if(S_ISBLK(stbuf.st_mode)) {
int open_mode = O_RDONLY, fd;
fd = open(path, open_mode);
if (fd == -1)
return -2;
*bytes = lseek(fd, 0, SEEK_END);
close(fd);
if (*bytes == -1) {
*bytes = 0;
return 0;
}
#endif /* Libburn_is_on_solariS */
} else if(S_ISREG(stbuf.st_mode)) {
add_size = stbuf.st_blocks * (off_t) 512;

View File

@ -104,6 +104,10 @@ Hint: You should also look into sg-freebsd-port.c, which is a younger and
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/** PORTING : ------- OS dependent headers and definitions ------ */

868
libburn/sg-solaris.c Normal file
View File

@ -0,0 +1,868 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/*
Copyright (c) 2010 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
/*
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: Solaris uscsi, e.g. for SunOS 5.11
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 .
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/** PORTING : ------- OS dependent headers and definitions ------ */
#include <unistd.h>
#include <stropts.h>
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#ifdef Libburn_os_has_statvfS
#include <sys/statvfs.h>
#endif /* Libburn_os_has_stavtfS */
#include <sys/dkio.h>
#include <sys/vtoc.h>
#include <sys/scsi/impl/uscsi.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_solaris_retry_usleeP 100000
#define Libburn_sg_solaris_retry_incR 100000
/** PORTING : ------ libburn portable headers and definitions ----- */
#include "transport.h"
#include "drive.h"
#include "sg.h"
#include "spc.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)
{
if (d->fd != -1) {
close(d->fd);
d->fd = -1;
return 1;
}
return 0;
}
static int decode_btl_number(char **cpt, int stopper, int *no)
{
*no = 0;
for ((*cpt)++; **cpt != stopper; (*cpt)++) {
if (**cpt < '0' || **cpt > '9')
return 0;
*no = *no * 10 + **cpt - '0';
}
return 1;
}
/* Read bus, target, lun from name "cXtYdZs2".
Return 0 if name is not of the desired form.
*/
static int decode_btl_solaris(char *name, int *busno, int *tgtno, int *lunno,
int flag)
{
char *cpt;
int ret;
*busno = *tgtno = *lunno = -1;
cpt = name;
if (*cpt != 'c')
return 0;
ret = decode_btl_number(&cpt, 't', busno);
if (ret <= 0)
return ret;
ret = decode_btl_number(&cpt, 'd', tgtno);
if (ret <= 0)
return ret;
ret = decode_btl_number(&cpt, 's', lunno);
if (ret <= 0)
return ret;
cpt++;
if (*cpt != '2' || *(cpt + 1) != 0)
return 0;
return 1;
}
static int start_enum_cXtYdZs2(burn_drive_enumerator_t *idx, int flag)
{
DIR *dir;
idx->dir = NULL;
dir = opendir("/dev/rdsk");
if (dir == NULL) {
libdax_msgs_submit(libdax_messenger, -1,
0x0002000c, LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
"Cannot start device file enumeration. opendir(\"/dev/rdsk\") failed.",
errno, 0);
return 0;
}
idx->dir = dir;
return 1;
}
static int next_enum_cXtYdZs2(burn_drive_enumerator_t *idx,
char adr[], int adr_size, int flag)
{
int busno, tgtno, lunno, ret, fd = -1;
char volpath[160];
struct dirent *entry;
struct dk_cinfo cinfo;
DIR *dir;
dir = idx->dir;
while (1) {
errno = 0;
entry = readdir(dir);
if (entry == NULL) {
if (errno) {
libdax_msgs_submit(libdax_messenger,
-1, 0x0002000d,
LIBDAX_MSGS_SEV_FAILURE, LIBDAX_MSGS_PRIO_HIGH,
"Cannot enumerate next device. readdir() from \"/dev/rdsk\" failed.",
errno, 0);
return -1;
}
break;
}
if (strlen(entry->d_name) > sizeof(volpath) - 11)
continue;
ret = decode_btl_solaris(entry->d_name,
&busno, &tgtno, &lunno, 0);
if (ret <= 0)
continue; /* not cXtYdZs2 */
sprintf(volpath, "/dev/rdsk/%s", entry->d_name);
if (burn_drive_is_banned(volpath))
continue;
fd = open(volpath, O_RDONLY | O_NDELAY);
if (fd < 0)
continue;
/* See man dkio */
ret = ioctl(fd, DKIOCINFO, &cinfo);
close(fd);
if (ret < 0)
continue;
if (cinfo.dki_ctype != DKC_CDROM)
continue;
if (adr_size <= strlen(volpath))
return -1;
strcpy(adr, volpath);
return 1;
}
return 0;
}
static int end_enum_cXtYdZs2(burn_drive_enumerator_t *idx, int flag)
{
DIR *dir;
dir = idx->dir;
if(dir != NULL)
closedir(dir);
idx->dir = NULL;
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,
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 Solaris uscsi */
/* Adapter specific handles and data */
out.fd = -1;
/* 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)
{
sprintf(msg, "internal Solaris uscsi adapter sg-solaris");
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)
{
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
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;
if (initialize == 1) {
ret = start_enum_cXtYdZs2(idx, 0);
if (ret <= 0)
return ret;
} else if (initialize == -1) {
ret = end_enum_cXtYdZs2(idx, 0);
return 0;
}
ret = next_enum_cXtYdZs2(idx, adr, adr_size, 0);
return ret;
}
/** 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;
int i_host_no = -1, i_channel_no = -1, i_target_no = -1, i_lun_no = -1;
char buf[4096];
while(1) {
ret = sg_give_next_adr(&idx, buf, sizeof(buf), initialize);
initialize = 0;
if (ret <= 0)
break;
if (burn_drive_is_banned(buf))
continue;
sg_obtain_scsi_adr(buf, &i_bus_no, &i_host_no,
&i_channel_no, &i_target_no, &i_lun_no);
enumerate_common(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->fd != -1);
}
/** 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)
{
char msg[4096];
int os_errno, ret;
struct dk_cinfo cinfo;
if (d->fd != -1) {
d->released = 0;
return 1;
}
d->fd = open(d->devname, O_RDONLY | O_NDELAY);
if (d->fd == -1) {
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;
}
ret = ioctl(d->fd, DKIOCINFO, &cinfo);
if (ret < 0)
goto revoke;
if (cinfo.dki_ctype != DKC_CDROM)
goto revoke;
/* >>> obtain eventual locks */;
d->released = 0;
return 1;
revoke:;
sprintf(msg, "Could not grab drive '%s'. Not a CDROM device.",
d->devname);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020003,
LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
return 0;
}
/** 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->fd < 0) {
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 i, usleep_time, timeout_ms, no_retry = 0, ret;
time_t start_time;
struct uscsi_cmd cgc;
char msg[80];
static FILE *fp = NULL;
c->error = 0;
memset(c->sense, 0, sizeof(c->sense));
if (d->fd == -1)
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);
memset (&cgc, 0, sizeof (struct uscsi_cmd));
/* No error messages, no retries,
do not execute with other commands, request sense data
*/
cgc.uscsi_flags = USCSI_SILENT | USCSI_DIAGNOSE | USCSI_ISOLATE
| USCSI_RQENABLE;
cgc.uscsi_timeout = 200;
cgc.uscsi_cdb = (caddr_t) c->opcode;
cgc.uscsi_bufaddr = (caddr_t) c->page->data;
if (c->dir == TO_DRIVE) {
cgc.uscsi_flags |= USCSI_WRITE;
cgc.uscsi_buflen = c->page->bytes;
} else if (c->dir == FROM_DRIVE) {
cgc.uscsi_flags |= USCSI_READ;
if (c->dxfer_len >= 0)
cgc.uscsi_buflen = c->dxfer_len;
else
cgc.uscsi_buflen = BUFFER_SIZE;
/* touch page so we can use valgrind */
memset(c->page->data, 0, BUFFER_SIZE);
} else {
cgc.uscsi_buflen = 0;
}
cgc.uscsi_cdblen = c->oplen;
cgc.uscsi_rqlen = sizeof(c->sense);
cgc.uscsi_rqbuf = (caddr_t) c->sense;
/* retry-loop */
start_time = time(NULL);
timeout_ms = 200000;
for(i = 0; ; i++) {
ret = ioctl(d->fd, USCSICMD, &cgc);
/* For cgc.uscsi_status see SAM-3 5.3.1, Table 22
0 = GOOD , 2 = CHECK CONDITION : Sense Data are delivered
8 = BUSY
*/
if (ret != 0 && cgc.uscsi_status != 2) {
sprintf(msg,
"Failed to transfer command to drive. (uscsi_status = 0x%X)",
(unsigned int) cgc.uscsi_status),
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002010c,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
msg, errno, 0);
sg_close_drive(d);
d->released = 1;
d->busy = BURN_DRIVE_IDLE;
c->error = 1;
return -1;
}
c->sense[2] &= 15;
/* >>> valid sense: cgc.uscsi_rqlen - cgc.uscsi_rqresid */;
if (c->sense[2] || c->sense[12] || c->sense[13]) {
if (no_retry || !c->retry) {
c->error = 1;
goto ex;
}
switch (scsi_error(d, c->sense, 18)) {
case RETRY:
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);
scsi_log_cmd(c,fp,0);
}
break;
case FAIL:
c->error = 1;
goto ex;
}
/*
Calming down retries and breaking up endless cycle
*/
usleep_time = Libburn_sg_solaris_retry_usleeP +
i * Libburn_sg_solaris_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)
{
int ret;
/* Try to guess from path */
if (strncmp("/dev/rdsk/", path, 10) == 0) {
ret = decode_btl_solaris(path + 10,
bus_no, target_no, lun_no, 0);
if (ret > 0) {
*host_no = *bus_no;
*channel_no = 0;
return 1;
}
}
*bus_no = *host_no = *channel_no = *target_no = *lun_no = -1;
/* >>> Could need a ioctl which gives SCSI numbers */;
return (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);
}
/* 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.
@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;
} else if(S_ISBLK(stbuf.st_mode)) {
int open_mode = O_RDONLY, fd;
fd = open(path, open_mode);
if (fd == -1)
return -2;
*bytes = lseek(fd, 0, SEEK_END);
close(fd);
if (*bytes == -1) {
*bytes = 0;
return 0;
}
} 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;
}

View File

@ -1,10 +1,21 @@
/* sg.c
Switcher for operating system dependent transport level modules of libburn.
Copyright (C) 2009 Thomas Schmitt <scdbackup@gmx.net>, provided under GPLv2+
Copyright (C) 2009 - 2010 Thomas Schmitt <scdbackup@gmx.net>,
provided under GPLv2+
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#undef HAVE_CONFIG_H
#endif
#ifdef Libburn_use_sg_dummY
#include "sg-dummy.c"
#else
#ifdef Libburn_use_libcdiO
#include "sg-libcdio.c"
@ -24,6 +35,11 @@
#include "sg-linux.c"
#else
#ifdef __sun
#include "sg-solaris.c"
#else
/* The dummy adapter formally fulfills the expectations of libburn towards
@ -46,8 +62,10 @@ static int intentional_compiler_warning(void)
#include "sg-dummy.c"
#endif /* ! __sun */
#endif /* ! __linux */
#endif /* ! __FreeBSD_kernel__ */
#endif /* ! __FreeBSD__ */
#endif /* ! Libburn_use_libcdiO */
#endif /* ! Libburn_use_sg_dummY */

View File

@ -5,6 +5,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <stdlib.h>
#include <string.h>

View File

@ -5,9 +5,12 @@
Provided under GPL version 2 or later.
*/
/* scsi primary commands */
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>

View File

@ -4,6 +4,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/* ts A61008 */
/* #include <a ssert.h> */

View File

@ -5,6 +5,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
/* ts A61008 */
/* #include <a ssert.h> */

View File

@ -4,6 +4,10 @@
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <string.h>
/* ts A61008 */
@ -138,6 +142,10 @@ char *burn_guess_cd_manufacturer(int m_li, int s_li, int f_li,
char buf[1024];
char *result = NULL;
if (m_li == 0 && s_li == 2 && f_li == 0) {
result = strdup("(no manufacturer code)");
return result;
}
f_li_0 = f_li - (f_li % 10);
for (i = 0; mid_list[i].manufacturer[0]; i++) {
if (m_li == mid_list[i].m_li &&

View File

@ -6,6 +6,10 @@
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <unistd.h>
#include <signal.h>