[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Inappropriate ioctl for device



Francesco(francesco@follonica.org) is reported to have said:
> Wayne Topa ha scritto:
> 
> >And for even more info,
> >
> >read the doc in /usr/src/linux/Documentation/cdrom/packet-writing.txt
> >for more features, built into the 2.6.10 kernel
> >
> >wt
> > 
> >
> 
> I followed your advices and these are my results:
> 
> created the right block devices into /dev/pktcdvd:
> 
Yoy should not have to do that.  Take a look at /etc/init.d/udftools,
it sets up the devices.  The /etc/init.d/udftools I "had" been running
was not working correctly so I modified it like:

/etc/init.d/udftools (Modified)
--snip--
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="udftools packet writing"
PKTSETUP=/usr/bin/pktsetup
DEFAULTFILE=/etc/default/udftools
DEVICES=""
#  Added next line
NEWINTNAMES="dvd cdrw"   # Added this
#NEWINTNAMES="0 1 2 3"   
UDEVNAMES="/dev/pktcdvd/0 /dev/pktcdvd/1 /dev/pktcdvd/2 /dev/pktcdvd/3"
UDEV=""
NEWINT=""

if test -e /dev/.devfsd; then
    OLDINTNAMES="/dev/pktcdvd/0 /dev/pktcdvd/1 /dev/pktcdvd/2 /dev/pktcdvd/3"
else
#    OLDINTNAMES="/dev/pktcdvd0 /dev/pktcdvd1 /dev/pktcdvd2 /dev/pktcdvd3"
# added next line
     NEWINTNAMES="/dev/pktcdvd/dvd /dev/pktcdvd/cdrw"  # Added this
fi
--snip--

Now when /etc/init.d/udftools start is run it creates the files
/dev/pktcdvd/dvd and /dev/pktcdvd/cdrw, and deletes them when 
/etc/init.d/udftools stop is run.  

> # ls -l /dev/pktcdvd
> totale 0
> crw-r--r--  1 root root  10, 61 18 feb 19:38 control
> brw-r--r--  1 root root 254,  0 18 feb 19:29 pktcdvd0
> brw-r--r--  1 root root  97,  0 18 feb 19:29 pktcdvd1
> 
> I created pktcdvd0 and pktcdvd1 rispectively with major 254 and 97 just 
> to make some tests.

/etc/init.d/udftools should do all of this 

> # pktsetup /dev/pktcdvd/pktcdvd0 /dev/hdb
> ioctl: No such device
If you have setup the /etc/default/udftools file correctly, and then
pktsetup is then done by the /etc/init.d/udftools file.

My /etc/default/udftools file:

# Drives to register for packet writing:
DEVICES="/dev/hdc /dev/hdd"
NEWINT=true
NEWINTNAMES="dvd cdrw"


> 
> # pktsetup /dev/pktcdvd/pktcdvd1 /dev/hdb
> open packet device: No such device or address
> 
> If I run pktsetup without the full path to the block device, it creates 
> a setgid file in the same directory where it is launched:
> 
> # pktsetup pktcdvd /dev/hdb
> ioctl: Inappropriate ioctl for device
> # ls -l
> ---x--sr-x  1 root root     0 18 feb 19:27 pktcdvd
> 
> I use pktsetup from the latest CVS of udftools so I think to be up to date.
> 
Try the above setup and let me know id it works for you.  Note I have a DVD and
CDRW drives so I defined them both.  You should modify the scripts if you have 
only the DVD RW drive.
> PS: I use an SMP enabled kernel, I hope pktcdvd is smp safe:)

Don't know about that being a problem.  (??)

> # modinfo pktcdvd
> description:    Packet writing layer for CD/DVD drives
> author:         Jens Axboe <axboe@suse.de>
> license:        GPL
> vermagic:       2.6.10-section9 SMP preempt PENTIUMIII 4KSTACKS gcc-3.4
> depends:

udftools  1.0.0b3-9.  UDF not compiled into kernel not modules.  
I am not running udev.

HTH=Hope This Helps, YMMV=Your Mileage May Vary, HAND=Have A Nice Day

Wayne

-- 
A computer scientist is someone who fixes things that aren't broken.
_______________________________________________________



Reply to: