Date: Mon, 26 Sep 2011 20:30:53 -0700 (PDT) From: Garrett Cooper <yanegomi@gmail.com> To: Craig Rodrigues <rodrigc@crodrigues.org> Cc: Doug Barton <dougb@freebsd.org>, eadler@freebsd.org, FreeBSD Questions <freebsd-questions@freebsd.org>, Fbsd8 <fbsd8@a1poweruser.com>, freebsd-current@freebsd.org Subject: Re: bin/160979: 9.0 burncd error caused by change to cd0 from acd0 Message-ID: <alpine.BSF.2.00.1109262027460.81576@toaster.local> In-Reply-To: <CAG=rPVcTHiPLFG1%2BdZmi1OWpyZsw=Px=PJT55UFGN_mxt3y%2BJw@mail.gmail.com> References: <201109262324.p8QNO0NN070853@freefall.freebsd.org> <4E811FF7.7010607@a1poweruser.com> <4E8126D3.5020407@FreeBSD.org> <CAG=rPVeAPt0_=jNXaHcnB8QCtYuvi5z69MDMFEgyD0HBQT0Mcw@mail.gmail.com> <4E812DB7.3000302@FreeBSD.org> <CAG=rPVcTHiPLFG1%2BdZmi1OWpyZsw=Px=PJT55UFGN_mxt3y%2BJw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Mon, 26 Sep 2011, Craig Rodrigues wrote:
> On Mon, Sep 26, 2011 at 6:58 PM, Doug Barton <dougb@freebsd.org> wrote:
>>>
>>> I have used burncd on many releases of FreeBSD, on many machines
>>> without problem. I can see the fact that burncd suddenly failing to
>>> work on ATAPI hardware could annoy and confused end-users.
>>
>> It doesn't fail to work on ATAPI hardware. It fails to work on cd0 which
>> is a SCSI device. The fact that it's emulated doesn't matter.
>
> True, but the subtlety of that distinction will be lost on a lot of end-users
> not familiar with the implementation of the FreeBSD storage implementation.
> To them "burncd just doesn't work, when it used to".
>
>
>>> Can we modify burncd to somehow detect if ATAPI-CAM is enabled, and print out
>>> a more useful error message?
>>
>> Sure, as soon as someone volunteers to create that patch. No one is
>> *trying* to annoy users, but things change around here because people
>> are interested in changing them.
>
>
> I am not familiar enough with the ATA_CAM work. Is there a a sysctl or ioctl
> that can be queried from userspace to detect if ATA_CAM is configured
> in the kernel?
>
> I would suggest something like:
...
Please fix it and move on.
Thanks,
-Garrett
$ usr.sbin/burncd/burncd -f /dev/cd0 blank
burncd: device provided not an acd(4) device: /dev/cd0.
Please verify that your kernel is built with acd(4) and the beforementioned device is supported by acd(4).
[-- Attachment #2 --]
Index: usr.sbin/burncd/burncd.c
===================================================================
--- usr.sbin/burncd/burncd.c (revision 225704)
+++ usr.sbin/burncd/burncd.c (working copy)
@@ -159,8 +159,16 @@
if ((fd = open(dev, O_RDWR, 0)) < 0)
err(EX_NOINPUT, "open(%s)", dev);
- if (ioctl(fd, CDRIOCGETBLOCKSIZE, &saved_block_size) < 0)
- err(EX_IOERR, "ioctl(CDRIOCGETBLOCKSIZE)");
+ if (ioctl(fd, CDRIOCGETBLOCKSIZE, &saved_block_size) < 0) {
+ if (errno == ENOTTY)
+ errx(EX_IOERR,
+ "device provided not an acd(4) device: %s.\n\n"
+ "Please verify that your kernel is built with "
+ "acd(4) and the beforementioned device is "
+ "supported by acd(4).", dev);
+ else
+ err(EX_IOERR, "ioctl(CDRIOCGETBLOCKSIZE)");
+ }
if (ioctl(fd, CDRIOCWRITESPEED, &speed) < 0)
err(EX_IOERR, "ioctl(CDRIOCWRITESPEED)");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1109262027460.81576>
