その2
(2)必要なファイルを探して
第三世代 LinkStation ハックキットのルートファイルシステム側に
コピーする。
(3)ハック de 録!!を動作させる。
gin:/mnt/buffalo# find . -print > ../allfiles gin:/mnt/buffalo#として作った標準ファームの全ファイルリストの中から 要りそうなファイルにマークをつけていく。
gin:/mnt# grep '^+' allfiles +./dev/usb/mv7dxu2_0 +./dev/usb/mv7dxu2_1 +./dev/usb/mv7dxu2_2 +./dev/usb/mv7dxu2_3 +./etc/melco/pcast_channel.dat +./etc/melco/pcast_spchannel.dat +./etc/melco/pcast_mp2000 +./etc/melco/mediaserver.conf +./etc/melco/mediaserver_accesscontrol.conf +./etc/melco/pcast_PlayDb +./etc/melco/pcast_EpgData.gl +./etc/melco/pcast_omakase0.dat +./etc/melco/pcast_omakase1.dat +./etc/melco/pcast_omakase2.dat +./etc/melco/pcast_omakase3.dat +./etc/melco/pcast_omakase4.dat +./etc/melco/pcast_omakase5.dat +./etc/pcast +./etc/apache/httpd8080.conf +./etc/init.d/module_loader.sh +./etc/init.d/httpd.sh +./etc/init.d/epg.sh +./etc/init.d/pcastd.sh +./lib/modules +./mnt/disk1/mediaserver +./usr/etc/mediaserver_discoveredclients.conf +./usr/etc/mediaserver_accesscontrol.conf.init +./usr/etc/mediaserver.conf.init +./usr/etc/mediaserver_accesscontrol.conf +./usr/etc/mediaserver.conf +./usr/lib/libmediabolic_mediaserver.so.1.8 +./usr/lib/libmediabolic_mediaserver.so +./usr/lib/libmediabolic_import.so.1.8 +./usr/lib/libmediabolic_upnppower.so +./usr/lib/libmediabolic_client.so +./usr/lib/libmediabolic_mediaserver_verify.so.1.8.220 +./usr/lib/libmediabolic_mediaserver_verify.so +./usr/lib/libmediabolic_mediaserver_verify.so.1.8 +./usr/lib/libmediabolic_import.so +./usr/lib/libmediabolic_mediaserver.so.1.8.220 +./usr/lib/mediaserver +./usr/lib/libmediabolic_import.so.1.8.194 +./usr/lib/libmediabolic_client.so.1.8 +./usr/lib/libmediabolic_upnppower.so.1.8 +./usr/lib/libmediabolic_client.so.1.8.225 +./usr/lib/libmediabolic_upnppower.so.1.8.211 +./usr/local/bin/pcastd_job.sh +./usr/local/bin/build_sync_period.sh +./usr/local/bin/chk_mediaserver_conf.sh +./usr/local/bin/watch_mediaserver.sh +./usr/local/bin/build_mediaserver_conf.sh +./usr/local/bin/chk_mediaserver.sh +./usr/local/PCast +./usr/mediaserver gin:/mnt#多分何か足りない。多分何か余分
gin:/mnt# sed -n -e 's/^+//p' /mnt/allfiles ./dev/usb/mv7dxu2_0 ./dev/usb/mv7dxu2_1 ./dev/usb/mv7dxu2_2 ./dev/usb/mv7dxu2_3 : : ./usr/local/PCast ./usr/mediaserver gin:/mnt#
gin:/mnt# (cd /mnt/buffalo/; tar cf - `!!` )|(cd /; tar xvf -) (cd /mnt/buffalo/; tar cf - `sed -n -e 's/^+//p' /mnt/allfiles` )|(cd /; tar xvf -) ./dev/usb/mv7dxu2_0 ./dev/usb/mv7dxu2_1 ./dev/usb/mv7dxu2_2 ./dev/usb/mv7dxu2_3 : : ./usr/mediaserver/webui2/app/webframe/htmlapp.js ./usr/mediaserver/webui2/app/webframe/htmlcore.js gin:/mnt#
gin:~# cd /etc/init.d/ gin:/etc/init.d# sh module_loader.sh start gin:/etc/init.d# lsmod Module Size Used by mv7dxu2_3 40804 0 mv7dxu2_2 40804 0 mv7dxu2_1 40804 0 mv7dxu2_0 40772 0 mv7dxu2_d 3560 4 mv7dxu2_3,mv7dxu2_2,mv7dxu2_1,mv7dxu2_0 vfat 10720 0 fat 47484 1 vfat usblp 12160 0 gin:/etc/init.d# ls /proc/mv7dxu2 /proc/mv7dxu2 gin:/etc/init.d# cat !$ cat /proc/mv7dxu2 device00=nodevice device01=nodevice device02=nodevice device03=nodevice gin:/etc/init.d# sh module_loader.sh stop gin:/etc/init.d# lsmod Module Size Used by vfat 10720 0 fat 47484 1 vfat usblp 12160 0 gin:/etc/init.d# cat /proc/mv7dxu2 cat: /proc/mv7dxu2: No such file or directory gin:/etc/init.d#問題なさそう。
gin:/etc/init.d# /usr/local/PCast/Scheduler /usr/local/PCast/Scheduler: error while loading shared libraries: libvweb.so: cannot open shared object file: No such file or directory gin:/etc/init.d#いきなりアウト。
gin:/etc/init.d# grep libvweb.so /mnt/allfiles ./usr/lib/libvweb.so gin:/etc/init.d#これも追加。
gin:/etc/init.d# vi /mnt/allfiles : : gin:/etc/init.d# grep libvweb.so /mnt/allfiles +./usr/lib/libvweb.so gin:/etc/init.d# (cd /mnt/buffalo/; tar cf - `sed -n -e 's/^+//p' /mnt/allfiles` )|(cd /; tar xvf -) : : gin:/etc/init.d#もう一回実行
gin:/etc/init.d# /usr/local/PCast/Scheduler /usr/local/PCast/Scheduler: error while loading shared libraries: libdb-4.2.so: cannot open shared object file: No such file or directory gin:/etc/init.d#いつまで続く?
gin:/etc/init.d# ldd /usr/local/PCast/Scheduler libpthread.so.0 => /lib/libpthread.so.0 (0x40026000) libvweb.so => /usr/lib/libvweb.so (0x40044000) libdb-4.2.so => not found libdl.so.2 => /lib/libdl.so.2 (0x40071000) libiconv.so.2 => not found libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4007c000) libm.so.6 => /lib/libm.so.6 (0x40157000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40204000) libc.so.6 => /lib/libc.so.6 (0x40218000) /lib/ld-linux.so.3 (0x40000000) gin:/etc/init.d#libdb-4.2.so, libiconv.so.2 がいると。
gin:/etc/init.d# apt-cache search libdb dbus - simple interprocess messaging system libdb-dev - Berkeley Database Libraries [development] libdb-file-lock-perl - Provides a wrapper for the DB_File module, adding locking libdb-ruby1.8 - Interface to Berkeley DB for Ruby 1.8 libdb-ruby1.9 - Interface to Berkeley DB for Ruby 1.9 libdb1-compat - The Berkeley database routines [glibc 2.0/2.1 compatibility] libdb4.2 - Berkeley v4.2 Database Libraries [runtime] libdb4.2++-dev - Berkeley v4.2 Database Libraries for C++ [development] libdb4.2++c2 - Berkeley v4.2 Database Libraries for C++ [runtime] libdb4.2-dev - Berkeley v4.2 Database Libraries [development] : :libdb4.2-dev がそれらしい。
gin:/etc/init.d# apt-get install libdb4.2-dev Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libdb4.2 Suggested packages: db4.2-doc The following NEW packages will be installed: libdb4.2 libdb4.2-dev 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 842kB of archives. After this operation, 2228kB of additional disk space will be used. Do you want to continue [Y/n]? y Get:1 http://ftp.jp.debian.org lenny/main libdb4.2 4.2.52+dfsg-5 [378kB] Get:2 http://ftp.jp.debian.org lenny/main libdb4.2-dev 4.2.52+dfsg-5 [464kB] Fetched 842kB in 4s (182kB/s) Selecting previously deselected package libdb4.2. (Reading database ... 10737 files and directories currently installed.) Unpacking libdb4.2 (from .../libdb4.2_4.2.52+dfsg-5_armel.deb) ... Selecting previously deselected package libdb4.2-dev. Unpacking libdb4.2-dev (from .../libdb4.2-dev_4.2.52+dfsg-5_armel.deb) ... Setting up libdb4.2 (4.2.52+dfsg-5) ... Setting up libdb4.2-dev (4.2.52+dfsg-5) ... gin:/etc/init.d# ls -l /usr/lib/libdb-4.2.so -rw-r--r-- 1 root root 819268 Sep 13 21:55 /usr/lib/libdb-4.2.so gin:/etc/init.d#good job!
では、さっき標準ファームからコピーした libvweb.so は?
gin:/etc/init.d# apt-cache search libvweb gin:/etc/init.d#これは、debian にはないようだ。ちょっと怪しい。
libiconv は debian にあるでしょう。
gin:/etc/init.d# apt-cache search libiconv enca - Extremely Naive Charset Analyser - binaries libiconv-hook-dev - header files of libiconv-hook libiconv-hook1 - extension of iconv for libapache-mod-encoding libiconv-ruby - transitional dummy package librecode0 - Shared library on which recode is based libruby - Libraries necessary to run Ruby 1.8.x libruby1.8 - Libraries necessary to run Ruby 1.8 recode - Character set conversion utility gin:/etc/init.d#ん?それらしいのがない。
危険かも知れないが、標準ファームからコピーする。
gin:/etc/init.d# vi /mnt/allfiles : gin:/etc/init.d# !?cd?:p (cd /mnt/buffalo/; tar cf - `sed -n -e 's/^+//p' /mnt/allfiles` )|(cd /; tar xvf -) gin:/etc/init.d# (cd /mnt/buffalo/; tar cf - `sed -n -e 's/^+//p' /mnt/allfiles` )|(cd /; tar xvf -)再度実行してみる。
gin:/etc/init.d# /usr/local/PCast/Schedulerとりあえずエラーが出ずに起動したので、CTRL-C
gin:/etc/init.d# ldd /usr/local/PCast/pcastd libpthread.so.0 => /lib/libpthread.so.0 (0x40026000) libvweb.so => /usr/lib/libvweb.so (0x40044000) libdb-4.2.so => /usr/lib/libdb-4.2.so (0x40071000) libiconv.so.2 => /usr/lib/libiconv.so.2 (0x40141000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x40227000) libm.so.6 => /lib/libm.so.6 (0x40302000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x403af000) libc.so.6 => /lib/libc.so.6 (0x403c3000) /lib/ld-linux.so.3 (0x40000000) gin:/etc/init.d#全部そろっている。
gin:/etc/init.d# /usr/local/PCast/pcastd pcastd 0.5.9 start. key='server', value='on' key='media', value='/mnt/disk1/share' Set pcast_mp2000 seting media=global_param.public_root key='usbdisk', value='1' key='limit_media', value='' key='limit_pass', value='' EOF Detect. linkstation_cgi_file_read() public_root failed!!! config '/etc/pcast/pcastd.conf' open. key='server_port', value='8000' key='client_language_code', value='sjis' key='skin_root', value='/etc/pcast/theme/pcast' key='us_skin_root', value='/etc/pcast/theme_us/pcast' key='flag_unknown_extention_file_hide', value='true' key='flag_image_viewer', value='false' key='flag_daemon', value='true' key='flag_debug_log_output', value='false' key='debug_log_filename', value='/mnt/disk1/_share/pcastd_debug.log' EOF Detect. Daemoning.... gin:/etc/init.d#動いた(のか?)
http://gin.yamasita.jp:8000/ にアクセスしてみた。
LinkTheater 用の画面が出てきた。
クリッカブルマップの座標が狂っているが、
メニューを渡り歩けた。
ただし、肝心の「チューナ設定」等は表示されなかった。
まあ、まだ apache 等を動作させていないので仕方がない。
gin:/etc/init.d# ldd /usr/mediaserver/mediaserver libiconv.so.2 => /usr/lib/libiconv.so.2 (0x40026000) libmediabolic_mediaserver.so.1.8 => /usr/lib/libmediabolic_mediaserver.so.1.8 (0x4010c000) libmediabolic_mediaserver_verify.so.1.8 => /usr/lib/libmediabolic_mediaserver_verify.so.1.8 (0x40186000) libmediabolic_client.so.1.8 => /usr/lib/libmediabolic_client.so.1.8 (0x40193000) libdl.so.2 => /lib/libdl.so.2 (0x4029c000) libpthread.so.0 => /lib/libpthread.so.0 (0x402a7000) libc.so.6 => /lib/libc.so.6 (0x402c5000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x403ec000) /lib/ld-linux.so.3 (0x40000000) gin:/etc/init.d#大丈夫そう。
動作させてみる
gin:/etc/init.d# /usr/mediaserver/mediaserver Mediabolic Mediaserver Copyright: 1999-2005 Mediabolic, Inc. Version: 1.8.220 Date: May 9 2008 11:02:51 [17:08:42:498357] MSG [MAIN:1087]: Mediabolic Build Configuration: [17:08:42:500472] MSG [MAIN:1087]: clientlib: 1.8.225 May 9 2008 11:01:43 root@dd2-sugai GCC 3.4.4 serverupnpmsac:linux:mediabolic_d1:ja:BUFFALO:pcx [17:08:42:504032] SYSTEM-INFO[MAIN:1087]: Loading properties from: mediaserver.conf [17:08:42:507276] Net Config-INFO[MAIN:1087]: Set Net Config Defaults [17:08:42:519201] LINUX_NETEVENT-ERR [MAIN:1087]: do_wireless_ioctl: if(eth0:eth0) ioctl(35585:SIOCGIWNAME) (22:Invalid argument) [17:08:42:520041] LINUX_NETEVENT-WARN[MAIN:1087]: flags2ifc: SIOCGMIIPHY if(eth0) (95:Operation not supported) -- Assuming 100mbps : : [17:08:42:599845] MMODULE_LINUX-ERR [MAIN:1087]: Failed to load module: /usr/lib/mediaserver/libmediaserver_sync.so: libxmbjpeg.so.1.8: cannot open shared object file: No such file or directory : :その後もエラーがいっぱい出ているが、 出るべくして出るエラーなのか、解決すべきエラーなのか判断がつかない。
取りあえず libxmbjpeg, libxmbpng をコピーする。
って、libxmb の mb って Media Bolic の略?
gin:/mnt# ls allfiles allfiles.save buffalo disk1 hackderokku.sh gin:/mnt# grep libxmb allfiles +./usr/lib/libxmbpng.so.1.8 ./usr/lib/libxmb_iids.so.1.8.192 +./usr/lib/libxmbjpeg.so +./usr/lib/libxmbjpeg.so.1.8.192 ./usr/lib/libxmb_iids.so ./usr/lib/libxmb_iids.so.1.8 +./usr/lib/libxmbpng.so +./usr/lib/libxmbjpeg.so.1.8 +./usr/lib/libxmbpng.so.1.8.192 gin:/mnt#libxmb_iids もコピーしておこう。
gin:/etc/init.d# /etc/init.d/pcastd.sh start chk_mediaserver.sh: no process killed Start services: pcastd scheduler insmod: error inserting '/lib/modules/mv7dxu2_1.ko': -1 File exists insmod: error inserting '/lib/modules/mv7dxu2_2.ko': -1 File exists insmod: error inserting '/lib/modules/mv7dxu2_3.ko': -1 File exists pcastd 0.5.9 start. key='server', value='on' key='media', value='/mnt/disk1/share' Set pcast_mp2000 seting media=global_param.public_root key='usbdisk', value='1' key='limit_media', value='' key='limit_pass', value='' EOF Detect. linkstation_cgi_file_read() public_root failed!!! config '/etc/pcast/pcastd.conf' open. key='server_port', value='8000' key='client_language_code', value='sjis' key='skin_root', value='/etc/pcast/theme/pcast' key='us_skin_root', value='/etc/pcast/theme_us/pcast' key='flag_unknown_extention_file_hide', value='true' key='flag_image_viewer', value='false' key='flag_daemon', value='true' key='flag_debug_log_output', value='false' key='debug_log_filename', value='/mnt/disk1/_share/pcastd_debug.log' EOF Detect. Daemoning.... mt-daapd: no process killed /etc/init.d/pcastd.sh: line 35: /usr/local/bin/build_mt-daapd_conf.sh: No such file or directory /etc/init.d/pcastd.sh: line 36: /usr/local/sbin/mt-daapd: No such file or directory Start services: mediaservermt-daapd 関連はさておき、
こういうときは sh -x
gin:/etc/init.d# sh -x /etc/init.d/pcastd.sh start + . /etc/melco/pcast_mp2000 ++ server=on ++ media=/mnt/disk1/share ++ usbdisk=1 ++ limit_media= ++ limit_pass= + umask 000 + PATH=/bin:/usr/bin:/sbin:/usr/sbin + tag=linkstation + facility=user.info + '[' -x /usr/local/PCast/pcastd ']' + '[' -x /usr/local/PCast/Scheduler ']' + case "$1" in + start + '[' on = on ']' + killall -KILL chk_mediaserver.sh chk_mediaserver.sh: no process killed + sleep 1 + '[' -f /tmp/no_diskspace ']' + echo 'Start services: pcastd scheduler' Start services: pcastd scheduler + /etc/init.d/module_loader.sh start + /usr/local/PCast/pcastd pcastd 0.5.9 start. + /usr/local/PCast/Scheduler key='server', value='on' key='media', value='/mnt/disk1/share' Set pcast_mp2000 seting media=global_param.public_root key='usbdisk', value='1' key='limit_media', value='' key='limit_pass', value='' EOF Detect. linkstation_cgi_file_read() public_root failed!!! config '/etc/pcast/pcastd.conf' open. key='server_port', value='8000' key='client_language_code', value='sjis' key='skin_root', value='/etc/pcast/theme/pcast' key='us_skin_root', value='/etc/pcast/theme_us/pcast' key='flag_unknown_extention_file_hide', value='true' key='flag_image_viewer', value='false' key='flag_daemon', value='true' key='flag_debug_log_output', value='false' key='debug_log_filename', value='/mnt/disk1/_share/pcastd_debug.log' EOF Detect. Daemoning.... + logger -t linkstation -p user.info 'Started pcastd scheduler' + killall -KILL mt-daapd mt-daapd: no process killed + /usr/local/bin/build_mt-daapd_conf.sh /etc/init.d/pcastd.sh: line 35: /usr/local/bin/build_mt-daapd_conf.sh: No such file or directory + /usr/local/sbin/mt-daapd /etc/init.d/pcastd.sh: line 36: /usr/local/sbin/mt-daapd: No such file or directory + '[' '!' -f /var/run/mediaserver.pid ']' + '[' -f /etc/melco/mediaserver.conf ']' + echo 'Start services: mediaserver' Start services: mediaserver + echo 1 + /usr/local/bin/watch_mediaserver.sh + /bin/nice -n 1 /usr/mediaserver/mediaserver + '[' 1 ']' ++ pidof mediaserver + pid= + '[' '!' -z '' ']' + sleep 1 + '[' 1 ']' ++ pidof mediaserver + pid= + '[' '!' -z '' ']' + sleep 1 + '[' 1 ']' ++ pidof mediaserver + pid= + '[' '!' -z '' ']' + sleep 1pidof mediaserver が期待する値になっていない模様。
もう一度 mediaserver 単体で動作させ、
mkdir: cannot create directory `/mnt/disk1/share/pictures': No such file or directory chmod: cannot access `/mnt/disk1/share/pictures': No such file or directory chown: cannot access `/mnt/disk1/share/pictures': No such file or directory chgrp: cannot access `/mnt/disk1/share/pictures': No such file or directoryと表示されているのを見つけた。
一筋縄ではいかんな。
楽し
|
← 第三世代 LinkStation ハックキットでハック de 録!!(1) |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 第三世代 LinkStation ハックキットでハック de 録!!(3) |