On Mon, Sep 26, 2011 at 9:23 PM, Adrian Chadd <adr...@freebsd.org> wrote:
> .. and if someone would like to contribute patches to burncd to update
> it, I think there'd be at least one committer here who would be happy
> to help you get your changes into the tree.
>
> :-)

Hi,

I think we need something like the following patch.

-- 
Craig Rodrigues
rodr...@crodrigues.org
Index: sbin/atacontrol/atacontrol.c
===================================================================
--- sbin/atacontrol/atacontrol.c        (revision 225368)
+++ sbin/atacontrol/atacontrol.c        (working copy)
@@ -28,6 +28,7 @@
 
 #include <sys/types.h>
 #include <sys/ata.h>
+#include <sys/sysctl.h>
 
 #include <err.h>
 #include <errno.h>
@@ -377,7 +378,19 @@
 main(int argc, char **argv)
 {
        int fd, mode, channel, array;
+       int ata_cam;
+       size_t ata_cam_len = sizeof(int);
 
+       if (sysctlbyname("hw.ata.ata_cam_enabled", &ata_cam, &ata_cam_len,
+           NULL, 0) < 0) {
+               ata_cam = 0;
+       }
+
+       if (ata_cam == 1) {
+               errx(1, "ATA_CAM option is enabled in kernel.\n"
+                   "Please use camcontrol instead.\n");
+       }
+
        if (argc < 2)
                usage();
 
Index: sbin/atacontrol/atacontrol.8
===================================================================
--- sbin/atacontrol/atacontrol.8        (revision 225368)
+++ sbin/atacontrol/atacontrol.8        (working copy)
@@ -25,12 +25,19 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 21, 2009
+.Dd September 27, 2011
 .Dt ATACONTROL 8
 .Os
 .Sh NAME
 .Nm atacontrol
 .Nd ATA device driver control program
+.Pp
+This utility was
+.Em deprecated
+in
+.Fx 9.0 .
+See
+.Sx NOTES .
 .Sh SYNOPSIS
 .Nm
 .Aq Ar command
@@ -361,11 +368,17 @@
 up all the time.
 .Sh SEE ALSO
 .Xr ata 4
+.Xr cam 4
+.Xr camcontrol 8
 .Sh HISTORY
 The
 .Nm
 utility first appeared in
 .Fx 4.6 .
+.Pp
+.Nm
+was deprecated in
+.Fx 9.0 .
 .Sh AUTHORS
 .An -nosplit
 The
@@ -377,3 +390,16 @@
 This manual page was written by
 .An S\(/oren Schmidt
 .Aq s...@freebsd.org .
+.Sh NOTES
+The
+.Nm
+utility was deprecated in
+.Fx 9.0 .
+When
+.Bd -ragged -offset indent
+.Cd "options ATA_CAM"
+.Ed
+.Pp
+is compiled into the kernel, then
+.Xr camcontrol 8
+must be used instead.
Index: usr.sbin/burncd/burncd.8
===================================================================
--- usr.sbin/burncd/burncd.8    (revision 225368)
+++ usr.sbin/burncd/burncd.8    (working copy)
@@ -33,6 +33,13 @@
 .Sh NAME
 .Nm burncd
 .Nd control the ATAPI CD-R/RW driver
+.Pp
+This utility was
+.Em deprecated
+in
+.Fx 9.0 .
+See
+.Sx NOTES .
 .Sh SYNOPSIS
 .Nm
 .Op Fl deFlmnpqtv
@@ -211,6 +218,10 @@
 .Nm
 utility appeared in
 .Fx 4.0 .
+.Pp
+.Nm
+was deprecated in
+.Fx 9.0 .
 .Sh AUTHORS
 The
 .Nm
@@ -220,3 +231,19 @@
 .Aq s...@freebsd.org .
 .Sh BUGS
 Probably, please report when found.
+.Sh NOTES
+When
+.Bd -ragged -offset indent
+.Cd "options ATA_CAM"
+.Ed
+.Pp
+is compiled into the kernel, then
+.Xr cdrecord 1 ,
+available in the
+.Fx
+Ports Collection as part of the
+.Pa sysutils/cdrtools
+port, must be used instead.
+Refer to:
+.Pp
+http://www.freebsd.org/doc/handbook/creating-cds.html#CDRECORD
Index: usr.sbin/burncd/burncd.c
===================================================================
--- usr.sbin/burncd/burncd.c    (revision 225368)
+++ usr.sbin/burncd/burncd.c    (working copy)
@@ -44,6 +44,7 @@
 #include <sys/cdrio.h>
 #include <sys/dvdio.h>
 #include <sys/param.h>
+#include <sys/sysctl.h>
 #include <arpa/inet.h>
 
 #define BLOCKS 16
@@ -80,8 +81,24 @@
        int dao = 0, eject = 0, fixate = 0, list = 0, multi = 0, preemp = 0;
        int nogap = 0, speed = 4 * 177, test_write = 0, force = 0;
        int block_size = 0, block_type = 0, cdopen = 0, dvdrw = 0;
+       int ata_cam;
+       size_t ata_cam_len = sizeof(int);
        const char *dev, *env_speed;
 
+       if (sysctlbyname("hw.ata.ata_cam_enabled", &ata_cam, &ata_cam_len,
+           NULL, 0) < 0) {
+               ata_cam = 0;
+       }
+
+       if (ata_cam == 1) {
+               printf("\nATA_CAM option is enabled in kernel.\n"
+                   "Install the sysutils/cdrtools port and use cdrecord "
+                   "instead.\n\n"
+                   "Please refer to:\n"
+                   
"http://www.freebsd.org/doc/handbook/creating-cds.html#CDRECORD\n";);
+               exit(1);
+       }
+
        if ((dev = getenv("CDROM")) == NULL)
                dev = "/dev/acd0";
 
Index: sys/dev/ata/ata-all.c
===================================================================
--- sys/dev/ata/ata-all.c       (revision 225368)
+++ sys/dev/ata/ata-all.c       (working copy)
@@ -101,6 +101,9 @@
 /* local vars */
 static int ata_dma = 1;
 static int atapi_dma = 1;
+#ifdef ATA_CAM
+static int ata_cam_enabled = 1;
+#endif
 
 /* sysctl vars */
 SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters");
@@ -120,6 +123,11 @@
 TUNABLE_INT("hw.ata.setmax", &ata_setmax);
 SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, &ata_setmax, 0,
           "ATA disk set max native address");
+#ifdef ATA_CAM
+SYSCTL_INT(_hw_ata, OID_AUTO, ata_cam_enabled,
+       CTLFLAG_RD, &ata_cam_enabled, 1,
+       "ATA devices are accessed through the cam(4) driver");
+#endif
 
 /*
  * newbus device interface related functions
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to