Compiling the Linux Kernel for QNAP (ARMv5-CPU)

Connect cheap webcams to your NAS from QNAP is not possible with the shipped firmware, – under “survillance” you can manage to connect IP-based cameras, but to get cheap usb-webcams working with your QNAP NAS you need to build an own linux kernel module.
Customizing QNAP-Firmware is easy. Follow these steps and you are done.
(I own the TS-110, but also at least these models with ARM (x10/x12/x19 series)
[QNAP TS-110/ 112/ 119/ 210/ 212/ 219/ 219P/ 410/ 412/ 419P/ 419U/ x19P+]
this instructions should work)

(ipkg itself should already be installed, otherwise you can install it as a QPKG via the admin web front end)
Login by SSH as “admin” and start with the installation of some required tools:

ipkg install nano gcc make automake ncurses ncursesw wget w3cam motion

check if there is a newer version for your QNAP Firmware at the QNAP-Website. (Older versions were located at another location at QNAP http://resources.qnap.com/Storage/tsd/QNAP_GPL_3.3.3-20100928.tar.gz, this is some confusing…).

change your working directory to:

cd /share/HDA_DATA

In my case I found GPLed Version 3.4.x and downloaded it with:

wget ftp://gpl:download@ftp.qnap.com/gpl/QNAP_GPL_3.4.x_20110218.tar.gz

This download is huge:

Length: 481095887 (459M)
63% [==========================> ] 305,900,640 125K/s eta 34m 12s

Then, get the Linux-Kernel:

wget ftp://ftp.jp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.2.tar.gz

Untar both files:

tar xzvf QNAP_GPL_3.4.x_20110218.tar.gz
tar xzvf linux-2.6.33.2.tar.gz

Browse to the folder that corrospondents to your QNAP:

cd GPL_TS/kernel_cfg
ls -la
SS-439/ TS-1079/ TS-119/ TS-210/ TS-239/ TS-410P/ TS-419P/
TS-439/ TS-459/ TS-559/ TS-659/ TS-809U/ TS-879/ SS-839/
TS-110/ TS-1279/ TS-219/ TS-259/ TS-410U/ TS-419U/ TS-439U/
TS-509/ TS-639/ TS-809/ TS-859/

I own a TS-110, so lets change to the TS-110 directory:

cd TS-110
[/share/HDA_DATA/cam/GPL_TS/kernel_cfg/TS-110] # ls -la
drwxr-xr-x 2 admin administ 4096 Feb 18 14:30 ./
drwxr-xr-x 27 admin administ 4096 Feb 18 14:30 ../
-rw-r--r-- 1 admin administ 27647 Feb 18 14:30 linux-2.6.22.8.cfg
-rw-r--r-- 1 admin administ 38327 Feb 18 14:30 linux-2.6.30.6-arm.cfg
-rwxr-xr-x 1 admin administ 43437 Feb 18 14:30 linux-2.6.33.2-arm.cfg*

What kernel are we using?

uname -r
2.6.33.2

Copy the kernel config file that corrosponds to your kernel version (type uname -r to find out which one you have) to the kernel source files

cp ./linux-2.6.33.2-arm.cfg ../../../linux-2.6.33.2/.config
cd ../../../linux-2.6.33.2/

Edit the kernel config file “.config” with an editor:

vim .config

Search the following line:

# CONFIG_MEDIA_SUPPORT is not set

and replace it by:

CONFIG_MEDIA_SUPPORT=m

to enable media support as module.

Then copy and paste the following lines behind the changed MEDIA_SUPPORT lilne:

#
# Multimedia core support
#
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
CONFIG_VIDEO_ALLOW_V4L1=y
CONFIG_VIDEO_V4L1_COMPAT=y
CONFIG_DVB_CORE=m
CONFIG_VIDEO_MEDIA=m

#
# Multimedia drivers
#
CONFIG_IR_CORE=m
CONFIG_VIDEO_IR=m
# CONFIG_MEDIA_ATTACH is not set
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_V4L1=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_VMALLOC=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
CONFIG_VIDEO_VIVI=m
CONFIG_VIDEO_CPIA=m
CONFIG_VIDEO_CPIA_USB=m
CONFIG_VIDEO_CPIA2=m
# CONFIG_VIDEO_STRADIS is not set
CONFIG_V4L_USB_DRIVERS=y
CONFIG_USB_VIDEO_CLASS=m
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
CONFIG_USB_GSPCA=m
CONFIG_USB_M5602=m
CONFIG_USB_STV06XX=m
CONFIG_USB_GL860=m
CONFIG_USB_GSPCA_CONEX=m
CONFIG_USB_GSPCA_ETOMS=m
CONFIG_USB_GSPCA_FINEPIX=m
CONFIG_USB_GSPCA_JEILINJ=m
CONFIG_USB_GSPCA_MARS=m
CONFIG_USB_GSPCA_MR97310A=m
CONFIG_USB_GSPCA_OV519=m
CONFIG_USB_GSPCA_OV534=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SN9C20X_EVDEV=y
CONFIG_USB_GSPCA_SONIXB=m
CONFIG_USB_GSPCA_SONIXJ=m
CONFIG_USB_GSPCA_SPCA500=m
CONFIG_USB_GSPCA_SPCA501=m
CONFIG_USB_GSPCA_SPCA505=m
CONFIG_USB_GSPCA_SPCA506=m
CONFIG_USB_GSPCA_SPCA508=m
CONFIG_USB_GSPCA_SPCA561=m
CONFIG_USB_GSPCA_SQ905=m
CONFIG_USB_GSPCA_SQ905C=m
CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_ZC3XX=m
CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_USBVIDEO=m
# CONFIG_USB_VICAM is not set
CONFIG_USB_IBMCAM=m
CONFIG_USB_KONICAWC=m
CONFIG_USB_QUICKCAM_MESSENGER=m
CONFIG_USB_ET61X251=m
CONFIG_USB_OV511=m
CONFIG_USB_SE401=m
CONFIG_USB_SN9C102=m
CONFIG_USB_STV680=m
CONFIG_USB_ZC0301=m
CONFIG_USB_PWC=m
# CONFIG_USB_PWC_DEBUG is not set
CONFIG_USB_PWC_INPUT_EVDEV=y
CONFIG_USB_ZR364XX=m
CONFIG_USB_STKWEBCAM=m
CONFIG_USB_S2255=m
# CONFIG_RADIO_ADAPTERS is not set
CONFIG_DVB_MAX_ADAPTERS=8
# CONFIG_DVB_DYNAMIC_MINORS is not set
CONFIG_DVB_CAPTURE_DRIVERS=y
CONFIG_DVB_TTUSB_DEC=m
CONFIG_SMS_SIANO_MDTV=m

Make some symlinks, so the setup program can do it’s business:

ln -s /opt/lib/libncurses.so /lib/libncurses.so
ln -s /opt/lib/libncurses.so.5 /lib/libncurses.so.5
ln -s /opt/lib/libncurses.so.5.7 /lib/libncurses.so.5.7
ln -s /opt/lib/libncursesw.so /lib/libncursesw.so
ln -s /opt/lib/libncursesw.so.5 /lib/libncursesw.so.5
ln -s /opt/lib/libncursesw.so.7 /lib/libncursesw.so.7

Now, run the kernel configtool and answer all questions asked with the default (just [Enter] is fine):

make oldconfig

and build the modules:

make modules

This takes a lot of time.
Afterwards create a node for the video device:

mknod /dev/video0 c 81 0
ln -s /dev/video0 /dev/video
chmod 666 /dev/video*

Let’s find out which driver we need for our cam:

[/] # ./mnt/ext/usr/sbin/lsusb
Bus 001 Device 003: ID 045e:076d Microsoft Corp. LifeCam HD-5000
Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
/sbin/insmod drivers/media/video/v4l1-compat.ko
/sbin/insmod drivers/media/video/videodev.ko
/sbin/insmod drivers/media/video/v4l2-common.ko
/sbin/insmod drivers/media/video/v4l2-int-device.ko
/sbin/insmod drivers/media/video/videobuf-core.ko
/sbin/insmod drivers/media/video/uvc/uvcvideo.ko

check dmesg:

[/share/HDA_DATA/cam/linux-2.6.33.2] # dmesg
...
Linux video capture interface: v2.00
uvcvideo: Found UVC 1.00 device Microsoft® LifeCam HD-5000 (045e:076d)
input: Microsoft® LifeCam HD-5000 as /class/input/input0
usbcore: registered new interface driver uvcvideo
USB Video Class driver (v0.1.0)
[/share/HDA_DATA/cam/linux-2.6.33.2] #

_________

[1] http://jantino.nl/blog/1/67/USB-Webcam-on-QNAP-s.html

 

Comments

No comments so far.

Leave a Reply

 
  (will not be published)
 
 
 
 

 
© 2012 Dipl.-Ing. (FH) Ingo Baab