Jump to content


Photo

Question about building a driver for enigma2


  • Please log in to reply
18 replies to this topic

#1 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 2 October 2009 - 05:48

hi guys,

Just built the cross developer environment for enigma2.

I have a driver i would like to experiment and try to build for my dm8000.

its a usb to serial adapter. I have located a source code for linux.
It has some of the following include statements

#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial.h>

This thread has the make file as well as the source code :

http://www.gossamer-.../kernel/1130475

I realise i will need to change all the refrence paths to some other..


Question i have is how do i go about building this driver to work with the box and current pli image...is it even possible ?

Thanks and sorry for the noobness...

Re: Question about building a driver for enigma2 #2 gerrit

  • Senior Member
  • 1,473 posts

0
Neutral

Posted 2 October 2009 - 06:53

Enigma2 already contains a usb2serial driver, which is downloadable from the menu.
Unless you want to fork your own type, i'd guess you would use the one already present in e2
Droomdoos 7000 Droomdoos 600 pvr bij moeke Droomdoos 7025 met OLED Frysk oersetter foar Pli

Re: Question about building a driver for enigma2 #3 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 2 October 2009 - 09:36

looking at that thread, it should probably work if you just replace the original ark3116.c in your linux-dm8000 workdir by that new sourcefile, it should just build.

Force a rebuild with
bitbake -f -c compile -b ../openembedded/packages/linux/linux-dm8000.bb

Re: Question about building a driver for enigma2 #4 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 11 October 2009 - 12:49

hi pieter just got around to lookin back into this now...

guess ive got a lot to learn... getting confused around some things

The file for the ark has the following folder and file structure.

- /DMProjects/dm8000/dm8000/openembedded/packages/ark3116$ ls

ark3116-0.4.1 ark3116_0.4.1.bb

- /DMProjects/dm8000/dm8000/openembedded/packages/ark3116/ark3116-0.4.1$ ls

ark3116.c.patch Makefile.patch


So my questions are :

1. Do i replace the .c.patch file with the actuall new c file i hav found ? And then run the command mentioned.
2. When i try the command you mentioned i get a - Please set the 'CACHE' variable.

Re: Question about building a driver for enigma2 #5 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 11 October 2009 - 13:02

1. didn't realise the ark had a seperate package.
What we currently use is the driver which is contained in the kernel sourcetree.

2. forgot to source env.source?
I guess the standard build works, and you can build a working image?
The command is to rebuild the kernel (and ark module contained in it), but you could use the same principle if you want to use the externam ark package.

Re: Question about building a driver for enigma2 #6 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 11 October 2009 - 15:21

hi pieter sorry again...

not too sure about the env.source file...and where it resides ? i basically have just built cross development environment.
i havnt yet built an image from the files...

my main aim is to compile those drivers and use them with the pli image...

you mention externam ark package ? what does that mean and how can that be created.

Thanks alot for your help.... if theres any good readings that i could do just pass me some beginner tutorial inks - that would be great...

Re: Question about building a driver for enigma2 #7 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 11 October 2009 - 18:03

looks like you should read up a bit on openembedded & bitbake.
And externam->external (typo)

Re: Question about building a driver for enigma2 #8 jonc

  • Senior Member
  • 2,667 posts

0
Neutral

Posted 11 October 2009 - 18:38

or simply install/build the new openPLi OE for the DM8000 as shown here - http://openpli.pli-i...enembeddedBuild and what has been said above by Pieterg will make more sense.
It's a hobby, so mileage varies Tell your friends about our Pli Wiki as it is there to help you - Click here for the PLi Wiki

Re: Question about building a driver for enigma2 #9 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 15 October 2009 - 02:00

ok , rebuilt the environment - can see the nfi image in the tmp folder...

Attempted to build the ark3116 package...but am getting errors... I did : source env.source , before the bitbake command....

Error as below , not sure what quilt is ?

Error in executing: /home/xman/DMProjects/dm8000/dm8000/openembedded/packages/ark3116/ark3116_0.4.1.bb
ERROR: Exception:<class 'CmdError'> Message:Command Error: exit status: 127 Output:
sh: quilt: not found
ERROR: Printing the environment of the function
Traceback (most recent call last):
File "/home/xman/DMProjects/dm8000/bb/bin/bitbake", line 1111, in <module>
main()
File "/home/xman/DMProjects/dm8000/bb/bin/bitbake", line 1106, in main
cooker.cook( BBConfiguration( options ), args[1:] )
File "/home/xman/DMProjects/dm8000/bb/bin/bitbake", line 860, in cook
self.tryBuildPackage( bf, item, bbfile_data )
File "/home/xman/DMProjects/dm8000/bb/bin/bitbake", line 227, in tryBuildPackage
bb.build.exec_task('do_%s' % self.configuration.cmd, the_data)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 298, in exec_task
task_graph.walkdown(task, execute)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1200, in walkdown
ret = self.walkdown(p, callback, debug, usecache)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1205, in walkdown
return callback(self, item)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 277, in execute
exec_task(item, d)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 298, in exec_task
task_graph.walkdown(task, execute)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/__init__.py", line 1205, in walkdown
return callback(self, item)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 287, in execute
exec_func(item, localdata)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 114, in exec_func
exec_func_python(func, d)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 133, in exec_func_python
utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))
File "/home/xman/DMProjects/dm8000/bb/lib/bb/utils.py", line 142, in better_exec
exec code in context
File "do_patch", line 4, in <module>
File "do_patch", line 2, in do_patch
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 114, in exec_func
exec_func_python(func, d)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 133, in exec_func_python
utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))
File "/home/xman/DMProjects/dm8000/bb/lib/bb/utils.py", line 142, in better_exec
exec code in context
File "base_do_patch", line 4, in <module>
File "base_do_patch", line 2, in base_do_patch
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 114, in exec_func
exec_func_python(func, d)
File "/home/xman/DMProjects/dm8000/bb/lib/bb/build.py", line 133, in exec_func_python
utils.better_exec(comp,g,tmp, bb.data.getVar('FILE',d,1))
File "/home/xman/DMProjects/dm8000/bb/lib/bb/utils.py", line 142, in better_exec
exec code in context
File "patch_do_patch", line 98, in <module>
File "patch_do_patch", line 92, in patch_do_patch
File "<bb>", line 234, in Import
File "<bb>", line 173, in _runcmd
File "<bb>", line 47, in runcmd
__builtin__.CmdError: Command Error: exit status: 127 Output:
sh: quilt: not found
[mail]xman@xman-linux:~/DMProjects/dm8000/dm8000/openembedded/packages/ark3116$[/mail]


Thanks again guys.

Re: Question about building a driver for enigma2 #10 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 15 October 2009 - 12:19

weird, bitbake clearly works, or you wouldn't have completed the full build of the image.
How exactly do you start the build of the ark package?

The first time, you should to

bitbake ark3116

(the -f -c compile is only for consecutive builds, if you changed something in the code)

Also, if the external package doesn't work, try to replace the sourcefile in the kernel instead.
I think this external ark package originates from a very long time ago, when there was no ark support in the kernel yet.

Re: Question about building a driver for enigma2 #11 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 15 October 2009 - 17:13

Hi pieter,

Played around some more and notice the error (last one i posted) occurs even when i do :

bitbake -f -c compile -b linux-dm8000.bb

... perhaps something is wrong with the way im running the command ? I am running source env.source before i run the bitbake command..

Looks like a bitbake issue/setup issue ?

In the work dir i placed the source code (from the forum link in first post) in the usb/serial section and also edited the KCONFIG files to pick up the source, as ARK was not in there....Then i ran the bitbake command to compile the image but no go...can you compile the kernel without bitbake ?... i have tried the instructions but cant see the usb/serial folder being generated...

"To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install"

Re: Question about building a driver for enigma2 #12 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 15 October 2009 - 17:20

bitbake -f -c compile -b linux-dm8000.bb


When using -b, you need to specify the whole path to the bb file
And run it from the build directory, where you sourced env.source.

In the work dir i placed the source code (from the forum link in first post) in the usb/serial section and also edited the KCONFIG files to pick up the source, as ARK was not in there....


Hm, now I see.
Though we have
CONFIG_USB_SERIAL_ARK3116=m
in our defconfig, the ark stuff is indeed missing from usb/serial

So you can choose, try to get the external package working, or indeed add everything to usb/serial, and hope it compiles.

BTW, if you change Kconfig files, you need to repeat the configure step (-f -c configure instead of -f -c compile).


i have tried the instructions but cant see the usb/serial folder being generated...


it should be there already, in the sourcetree

"To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install"


no, that's a native build, crossbuilds are something completely different.
Use bitbake, it does all the nasty stuff for you.

Re: Question about building a driver for enigma2 #13 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 16 October 2009 - 03:00

Hi pieter thanks again , learning this slowly slowly ill get there... you are a master!


When using -b, you need to specify the whole path to the bb file
And run it from the build directory, where you sourced env.source.



Yup this solved the errors and now able to rebuild the image. However i still cant see the usb/serial folder being generated in the kernel folders...maybe this usb serial compiling is left out of some file....i had a look at the 8000 defconfig n commented out the usb serial line...Keep in mind i am not using the OE opensource-pli build, using the standard one...


Hm, now I see.
Though we have
CONFIG_USB_SERIAL_ARK3116=m
in our defconfig, the ark stuff is indeed missing from usb/serial

So you can choose, try to get the external package working, or indeed add everything to usb/serial, and hope it compiles.

BTW, if you change Kconfig files, you need to repeat the configure step (-f -c configure instead of -f -c compile).




This -f -c configure is throwing me an error, will paste the error when i get back to the computer. And the package compiling results as well...

To be continued...lol...

Thanks.

Re: Question about building a driver for enigma2 #14 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 16 October 2009 - 17:37

ok in the linux-dm8000-2.6.12-r10 folder, the dm8000_deconfig file i have uncommented out the serial line as this :

CONFIG_USB_SERIAL=m (path location : /home/xman/DMProjects/dm8000/dm8000/build/tmp/work/linux-dm8000-2.6.12-r10)

I then -f -c configure , was successfull , then compile and successfull...running the command from the build folder.

But i still cant find this damn usb/serial folder anywhere...its not in the kernel folder...am i looking in the wrong spot, which folder should i be looking at.. ??

I am running the bb file which is in the path : /home/xman/DMProjects/dm8000/dm8000/build/tmp/work/linux-dm8000-2.6.12-r10/linux-8000.bb , called from the build folder.

had a look at the stblinux-2.6.12 sub folder , but cant find nothing....had a look in some staging folder and nothing...

ill get there slowly slowly , even though i could just buy a new adaptor - i am just trying to learn :)

Thanks :)







Re: Question about building a driver for enigma2 #15 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 16 October 2009 - 18:05

should be there, drivers/usb/serial, in the linux-dm8000 workdir
Or use 'find'

Re: Question about building a driver for enigma2 #16 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 16 October 2009 - 18:07

btw, perhaps you should try to get it working on a x86 2.6.12 kernel

If that works, the 8000 should be easy.

Re: Question about building a driver for enigma2 #17 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 16 October 2009 - 18:29

hmmm no go...no kernel folder contains it...

/DMProjects/dm8000/dm8000/build/tmp/work/linux-dm8000-2.6.12-
r10$ find . -name '*serial'

./tmp/work/linux-dm8000-2.6.12-r10/stblinux-2.6.12/drivers/serial
./tmp/work/linux-dm8000-2.6.12-r10/stblinux-2.6.12/drivers/usb/serial
./tmp/work/linux-dm8000-2.6.12-r10/stblinux-2.6.12/Documentation/serial
./stblinux-2.6.12/drivers/serial
./stblinux-2.6.12/drivers/usb/serial
./stblinux-2.6.12/.pc/linux-2.6.12-brcm-5.1.patch.bz2/drivers/serial
./stblinux-2.6.12/Documentation/serial
./stblinux-2.6.12/include/config/snd/serial
./stblinux-2.6.12/include/config/serial
./stblinux-2.6.12/include/config/usb/serial


hmmm....

Re: Question about building a driver for enigma2 #18 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 16 October 2009 - 18:57

5th result (or 2nd, which is a symlink to the same thing)

Re: Question about building a driver for enigma2 #19 xfiles_2007

  • Senior Member
  • 71 posts

0
Neutral

Posted 17 October 2009 - 16:02

ok sweet thanks :)....

i can compile the belkin , pl2303 ... but this ark one is causing me issues...

i think its the include statements causing an issue... will play around a bit more... will try to compile it first in normal ubuntu kernel somehow...

alot of readings to do :)...any tips ?

to be continued.... :)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users