OpenWrt Forum Archive

Topic: PWC driver: How to build?

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am stymied trying to build the PWC driver for my BCM947xx 2.6 r7540 build system.  It is enabled "M" in the default configuration menus, but nothing gets built.  I tried changing it from "M" to "*" but that didn't work either.  I wish I understood the kernel config process better than I do.

There is a patch reported in r7450 by Florian that would imply it's being maintained and ?should build.

If anyone knows how to make it happen, I'd be very much obliged.

I have the same problem, but with another kernel modul. I've tried to add the desired in:

package/kernel/modules/other.mk

by appending the following lines:

define KernelPackage/dm-mod
  TITLE:=dm-mod
  DESCRIPTION:=A description
  SUBMENU:=My Modules
  KCONFIG:=$(CONFIG_MD)
  FILES:=$(LINUX_DIR)/drivers/md/dm-mod.$(LINUX_KMOD_SUFFIX)
endef
$(eval $(call KernelPackage,dm-mod))

define KernelPackage/dm-crypt
  TITLE:=dm-crypt
  DESCRIPTION:=a description
  SUBMENU:=My Modules
  KCONFIG:=$(CONFIG_DM_CRYPT) \
           $(CONFIG_MD)
  FILES:=$(LINUX_DIR)/drivers/md/dm-crypt.$(LINUX_KMOD_SUFFIX)
endef
$(eval $(call KernelPackage,dm-crypt))

After make menuconfig I'm able to select the kernel modul. Then when I save the configuration and start make. When make finished everything is build except dm_crypt and dm_mod? Anyone some hints?

Hi,

it seems that you can find the solution here:
http://wiki.openwrt.org/BuildRoot

In section 3.1. Customizing the kernel options you will find the awnser. After executing the commands the modules appear.

for post #1:

there seems to be a bug in the kernel.

if you run 'make kernel_menuconfig' (in kernel_menuconfig you can search with /usb_pwc to find the option in the menus) in the openwrt buildsystem and go to:
-> Device Drivers
-> Multimedia devices
  -> Video For Linux (VIDEO_DEV [=m])
   -> Video Capture Adapters
    -> V4L USB devices
you will see there is no menu entry for USB_PWC you can select. the menu is simply empty.

EDIT: well, not a kernel problem. it's a openwrt buildsystem bug. if you manually extract the linux kernel tarball and run normal menuconfig there are lots of entries in the V4L USB devices submenu. i don't know how to fix this. maybe you file a ticket.

(Last edited by forum2006 on 10 Jun 2007, 21:26)

for post #2:

the kernel options for the modules are simply not selected in the default kernel config file in target/linux/brcm47xx-2.6/config/default. to fix this run 'make kernel_menuconfig' select the options and you are done. kernel_menuconfig changes the kernel .config file and copies the changes back to target/linux/brcm47xx-2.6/config/default so that kernel changes are persistent over a 'make clean'.

1. run 'make kernel_menuconfig' and select:
-> Device Drivers
   -> Multi-device support (RAID and LVM) -> set to y (CONFIG_MD)
      -> Device mapper support -> set to m (result is: CONFIG_BLK_DEV_DM, dm-mod.ko)
         -> Crypt target support -> set to m (result is: CONFIG_DM_CRYPT, dm-crypt.ko)

2. fix your entries in package/kernel/modules/others.mk like the one below. the layout for the menus is still not perfect, but your modules are built and packaged. you can also add AUTOLOAD.

define KernelPackage/dm-mod
  TITLE:=dm-mod
  DESCRIPTION:=A description
  SUBMENU:=My Modules
  KCONFIG:=$(CONFIG_BLK_DEV_DM)
endef

define KernelPackage/dm-mod/2.6
  FILES:=$(LINUX_DIR)/drivers/md/dm-mod.$(LINUX_KMOD_SUFFIX)
endef
$(eval $(call KernelPackage,dm-mod))

define KernelPackage/dm-crypt
  TITLE:=dm-crypt
  DESCRIPTION:=A description
  SUBMENU:=My Modules
  KCONFIG:=$(CONFIG_DM_CRYPT)
endef

define KernelPackage/dm-crypt/2.6
  FILES:=$(LINUX_DIR)/drivers/md/dm-crypt.$(LINUX_KMOD_SUFFIX)
endef
$(eval $(call KernelPackage,dm-crypt))

3. rebuild. remove the tmp/ and bin/ directory and run menuconfig (save and exit) to rebuild the dependencies.

rm -rf tmp/ bin/
make menuconfig
make target/linux-clean world

4. check the result

ubuntu@DevEnv:~/trunk$ find build_mipsel/linux-2.6-brcm47xx/ -name dm-*.ko
build_mipsel/linux-2.6-brcm47xx/linux-2.6.21.1/drivers/md/dm-mod.ko
build_mipsel/linux-2.6-brcm47xx/linux-2.6.21.1/drivers/md/dm-crypt.ko
build_mipsel/linux-2.6-brcm47xx/packages/ipkg/kmod-dm-mod/lib/modules/2.6.21.1/dm-mod.ko
build_mipsel/linux-2.6-brcm47xx/packages/ipkg/kmod-dm-crypt/lib/modules/2.6.21.1/dm-crypt.ko
ubuntu@DevEnv:~/trunk$

ubuntu@DevEnv:~/trunk$ ll -h bin/packages/kmod-dm*
-rw-r--r-- 1 ubuntu ubuntu 9,0K 2007-06-10 21:49 bin/packages/kmod-dm-crypt_2.6.21.1-brcm47xx-1_mipsel.ipk
-rw-r--r-- 1 ubuntu ubuntu  32K 2007-06-10 21:49 bin/packages/kmod-dm-mod_2.6.21.1-brcm47xx-1_mipsel.ipk
ubuntu@DevEnv:~/trunk$

to create a patch do:

svn diff target/linux/brcm47xx-2.6/config/default package/kernel/modules/others.mk > add-dm.patch

(Last edited by forum2006 on 10 Jun 2007, 22:21)

Does anyone know where the file lies that serves as the input to generate the kernel's .config file?

That seems to be the key (or one of them, at least) to solving this.  I've looked and watched and tried to catch where it's coming from, but so far without success.

There's a file named "default" in ~/target/linux/<arch>/config, but that's not the one that's being used.

forum2006 wrote:

for post #1:

EDIT: well, not a kernel problem. it's a openwrt buildsystem bug. if you manually extract the linux kernel tarball and run normal menuconfig there are lots of entries in the V4L USB devices submenu. i don't know how to fix this. maybe you file a ticket.

I opened up a bug on this matter, and it was promptly closed.

Here's the note Florian added to the bug tracker:

> You need to have CONFIG_VIDEO_V4L1 checked for V4L USB devices to appear

That did indeed help, but it wasn't the end of my woes.  There is also a mis-named path in the usb.mk file in package/kernel/modules.

I will open a bug on that one.

The discussion might have continued from here.