Re: Inappropriate ioctl for device

Francesco <[email protected]> Tue, 22 Feb 2005 03:43:21 +0100
Newsgroups gmane.linux.suse.packet-writing,gmane.linux.debian.user
Message-ID <[email protected]>
Wayne Topa ha scritto:

>Francesco([email protected]) 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"
>
>
>
>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.
>
>udftools  1.0.0b3-9.  UDF not compiled into kernel not modules.  
>I am not running udev.
>
Ok, I found that the problem is caused by pktsetup which I compiled from 
the cvs sources.
Perheaps the cvs sources are not so up to date with the new pktcdvd 
kernel module, so I downloaded and installed udftools-1.0.0b3-9
i386 deb package and everything turned bright.

Being a Fedora user and not wanting to mess with the debian scripts 
included in the package I added these lines to my /etc/modprobe.conf:

# PACKET WRITING:
alias /dev/pktcdvd/0 pktcdvd
alias block-major-252 pktcdvd
install udf     /sbin/modprobe --ignore-install udf; \
                /usr/local/bin/pktsetup 0 /dev/dvd

In this way everytime /dev/pktcdvd/0 is mounted I get my dvd device 
correctly mapped to pktcdvd. It could sound as a sort of kludge but it 
works.
Thanks to everyone who put me to the right direction to solve the problem!

--
Francesco