第三世代 LinkStation ハックキットのセットアップは 一通り終わったので、 次は、KURO-RS を用いた赤外線リモコンを実現しようと、 カーネルモジュールを作ったのだが、動作しなかった(藁)
おとなしく LinkStation LS-GL/HS-DHGL をハックしよう に添付している CD に納めている infrared_remocon.tar.gz を使う
yasunari@slam:~$ tar ztf infrared_remocon.tar.gz usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ftdi_sio.ko usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/usbserial.ko usr/local/bin/rs_send usr/local/bin/rs_rec usr/local/bin/infrared_remocon usr/local/lib/kuro-rs/DST_BX500/ usr/local/lib/kuro-rs/DST_BX500/BUTTON_1 usr/local/lib/kuro-rs/DST_BX500/BUTTON_10 usr/local/lib/kuro-rs/DST_BX500/BUTTON_11 usr/local/lib/kuro-rs/DST_BX500/BUTTON_12 usr/local/lib/kuro-rs/DST_BX500/BUTTON_2 usr/local/lib/kuro-rs/DST_BX500/BUTTON_3 usr/local/lib/kuro-rs/DST_BX500/BUTTON_4 usr/local/lib/kuro-rs/DST_BX500/BUTTON_5 usr/local/lib/kuro-rs/DST_BX500/BUTTON_6 usr/local/lib/kuro-rs/DST_BX500/BUTTON_7 usr/local/lib/kuro-rs/DST_BX500/BUTTON_8 usr/local/lib/kuro-rs/DST_BX500/BUTTON_9 usr/local/lib/kuro-rs/DST_BX500/BUTTON_POWER usr/local/src/kuro-rs/rs_send.c etc/init.d/kurors etc/rc2.d/S17kurors yasunari@slam:~$
tar で展開先を変えることはできないはずなので、 一旦仮にどこかに展開してから lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ にコピーが必要。
最近の tar は展開先を変えたりできるのだろうか?
yasunari@slam:~$ tar ztvf infrared_remocon.tar.gz -rw-r--r-- root/root 40876 2007-09-22 16:34 usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ftdi_sio.ko -rw-r--r-- root/root 29561 2007-09-22 16:34 usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/usbserial.ko -rwxr-xr-x yasunari/staff 10589 2007-09-23 12:01 usr/local/bin/rs_send -rwxr-xr-x root/staff 10369 2007-09-22 17:48 usr/local/bin/rs_rec -rwxr-xr-x yasunari/staff 2014 2007-10-13 09:15 usr/local/bin/infrared_remocon drwxr-sr-x root/staff 0 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/ -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_1 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_10 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_11 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_12 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_2 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_3 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_4 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_5 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_6 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_7 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_8 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_9 -rw-r--r-- root/staff 240 2007-09-22 17:51 usr/local/lib/kuro-rs/DST_BX500/BUTTON_POWER -rwxr-xr-x yasunari/staff 4429 2008-02-23 10:27 usr/local/src/kuro-rs/rs_send.c -rwxr-xr-x root/root 314 2008-02-23 13:16 etc/init.d/kurors lrwxrwxrwx root/root 0 2008-02-23 13:26 etc/rc2.d/S17kurors -> ../init.d/kurors yasunari@slam:~$
yasunari@sil:~$ ls -l /usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial total 72 -rw-r--r-- 1 root root 40876 Sep 22 2007 ftdi_sio.ko -rw-r--r-- 1 root root 29561 Sep 22 2007 usbserial.ko yasunari@sil:~$同じ。時間が見えてないが。
yasunari@sil:~$ ls -l /usr/local/bin/infrared_remocon -rwxr-xr-x 1 yasunari staff 2014 Oct 13 2007 /usr/local/bin/infrared_remocon yasunari@sil:~$同じ。
yasunari@sil:~$ ls -l /usr/local/lib/kuro-rs/DST_BX500/ total 52 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_1 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_10 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_11 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_12 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_2 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_3 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_4 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_5 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_6 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_7 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_8 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_9 -rw-r--r-- 1 root staff 240 Sep 22 2007 BUTTON_POWER yasunari@sil:~$同じ。
このアーカイブを使って良さそうだ
slam:/tmp# tar zxvf infrared_remocon.tar.gz usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ftdi_sio.ko usr/local/buffalo/lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/usbserial.ko usr/local/bin/rs_send usr/local/bin/rs_rec usr/local/bin/infrared_remocon usr/local/lib/kuro-rs/DST_BX500/ usr/local/lib/kuro-rs/DST_BX500/BUTTON_1 usr/local/lib/kuro-rs/DST_BX500/BUTTON_10 usr/local/lib/kuro-rs/DST_BX500/BUTTON_11 usr/local/lib/kuro-rs/DST_BX500/BUTTON_12 usr/local/lib/kuro-rs/DST_BX500/BUTTON_2 usr/local/lib/kuro-rs/DST_BX500/BUTTON_3 usr/local/lib/kuro-rs/DST_BX500/BUTTON_4 usr/local/lib/kuro-rs/DST_BX500/BUTTON_5 usr/local/lib/kuro-rs/DST_BX500/BUTTON_6 usr/local/lib/kuro-rs/DST_BX500/BUTTON_7 usr/local/lib/kuro-rs/DST_BX500/BUTTON_8 usr/local/lib/kuro-rs/DST_BX500/BUTTON_9 usr/local/lib/kuro-rs/DST_BX500/BUTTON_POWER usr/local/src/kuro-rs/rs_send.c etc/init.d/kurors etc/rc2.d/S17kurors slam:/tmp#
slam:/tmp# (cd usr/local/buffalo/; tar cf - lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/* )|(cd / ; tar xvf -) lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ftdi_sio.ko lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/usbserial.ko slam:/tmp# ls -l /lib/modules/2.6.16.16-arm1/kernel/drivers/usb/serial/ total 72 -rw-r--r-- 1 root root 40876 Sep 22 2007 ftdi_sio.ko -rw-r--r-- 1 root root 29561 Sep 22 2007 usbserial.ko slam:/tmp#tar でコピーすると、日付が変らない。
slam:/tmp# mv usr/local/bin/infrared_remocon /usr/local/bin slam:/tmp# ls -l !$ ls -l /usr/local/bin total 28 -rwxr-xr-x 1 yasunari staff 2014 Oct 13 2007 infrared_remocon slam:/tmp# mv usr/local/lib/kuro-rs /usr/local/lib slam:/tmp# ls -l !$ ls -l /usr/local/lib total 24 drwxr-xr-x 3 root root 22 Jul 18 08:03 kuro-rs -rwxr-xr-x 1 root root 22634 May 10 2007 libbuffalo_bin.so slam:/tmp#こんなところか。
slam:/tmp# ls -l /etc/modules -rw-r--r-- 1 root root 248 Nov 21 2008 /etc/modules slam:/tmp# cat !$ cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. # Parameters can be specified after the module name. slam:/tmp#ファイルはあるが、空っぽ。
slam:/tmp# echo usbserial >> !$ echo usbserial >> /etc/modules slam:/tmp# ^usbserial^ftdi_sio echo ftdi_sio >> /etc/modules slam:/tmp# !cat cat /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. # Parameters can be specified after the module name. usbserial ftdi_sio slam:/tmp#
slam:/tmp# shutdown -r now
slam:~# lsmod Module Size Used by vfat 10720 0 fat 47484 1 vfat usblp 12160 0 slam:~#あかんやん
depmod してみる
slam:~# depmod -a slam:~# shutdown -r now再起動後に再確認。
slam:~# lsmod Module Size Used by vfat 10720 0 fat 47484 1 vfat usblp 12160 0 ftdi_sio 28520 0 usbserial 24232 1 ftdi_sio slam:~#やっぱり depmod が必要か。
slam:~# tail -f /var/log/messages : : Jul 18 08:18:29 slam kernel: usb 2-1: new full speed USB device using ehci_platform and address 2 Jul 18 08:18:30 slam kernel: usb 2-1: configuration #1 chosen from 1 choice Jul 18 08:18:30 slam kernel: ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected Jul 18 08:18:30 slam kernel: drivers/usb/serial/ftdi_sio.c: Detected FT232BM Jul 18 08:18:30 slam kernel: usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0認識していそう
さて、次は rs_send, rs_rec の作り直し。
|
|
← 楽し |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ いちからやり直し、、、(13)赤外線リモコン(2)BS デジタルチューナの制御 |