ude:~# apt-cache search tftpd atftpd - advanced TFTP server tftpd - Trivial file transfer protocol server tftpd-hpa - HPA's tftp server ude:~#ここは、無難に tftpd - Trivial file transfer protocol server だな。
ude:~# apt-get install tftpd Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tftpd 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 16.0kB of archives. After this operation, 81.9kB of additional disk space will be used. Get:1 http://ftp.jp.debian.org lenny/main tftpd 0.17-16 [16.0kB] Fetched 16.0kB in 1s (12.6kB/s) Selecting previously deselected package tftpd. (Reading database ... 10049 files and directories currently installed.) Unpacking tftpd (from .../tftpd_0.17-16_armel.deb) ... Processing triggers for man-db ... Setting up tftpd (0.17-16) ... ude:~#
まずは、inetd.conf を見る。
ude:~# grep tftp /etc/inetd.conf tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp ude:~#inetd から起動し、ファイルは /srv/tftp に置けばよいように見える。
一応、man でも確認。
LS-CL にログイン
Debian GNU/Linux 5.0 hackkit ttyS0 hackkit login: yasunari Password: Last login: Sat May 6 04:19:42 JST 2000 from uxl.yamasita.jp on pts/0 Linux hackkit 2.6.22.7 #357 Tue Jan 6 15:43:23 JST 2009 armv5tejl The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. yasunari@hackkit:~$/boot のファイルを確認
yasunari@hackkit:~$ cd /boot yasunari@hackkit:/boot$ ls -l total 8966 -rw-r--r-- 1 root root 7013293 Jan 9 18:24 initrd.buffalo drwx------ 2 root root 12288 Jan 9 18:19 lost+found -rw-r--r-- 1 root root 2115656 Jan 8 22:16 uImage.buffalo yasunari@hackkit:/boot$ftp でさっきインストールした LS-GL の ftp サーバに転送。
yasunari@hackkit:/boot$ ftp ude.yamasita.jp Connected to ude.yamasita.jp. 220 ude FTP server (GNU inetutils 1.5) ready. Name (ude.yamasita.jp:yasunari): 331 Password required for yasunari. Password: 230- Linux ude 2.6.16.16-arm1 #37 Tue May 20 10:01:57 JST 2008 armv5tejl 230- 230- The programs included with the Debian GNU/Linux system are free software; 230- the exact distribution terms for each program are described in the 230- individual files in /usr/share/doc/*/copyright. 230- 230- Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent 230- permitted by applicable law. 230 User yasunari logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd /tmp 250 CWD command successful. ftp> bin 200 Type set to I. ftp> hash Hash mark printing on (1024 bytes/hash mark). ftp> mput *buffalo mput initrd.buffalo? y 200 PORT command sucessful. 150 Opening BINARY mode data connection for 'initrd.buffalo'. #############################(略) 226 Transfer complete. 7013293 bytes sent in 0.47 secs (14666.0 kB/s) mput uImage.buffalo? y 200 PORT command sucessful. 150 Opening BINARY mode data connection for 'uImage.buffalo'. #############################(略) 226 Transfer complete. 2115656 bytes sent in 0.14 secs (15101.4 kB/s) ftp> bye 221 Goodbye. yasunari@hackkit:/boot$/srv/tftpd には yasunari 権限では書けないので、 一旦 /tmp に置いた。
LS-GL にログインし、 /srv/tftpd に置き直し。
ude:~# cd /tmp ude:/tmp# ls -al total 8924 drwxrwxrwt 2 root root 48 Jan 24 09:02 . drwxr-xr-x 20 root root 4096 Jan 24 07:25 .. -rw-r----- 1 yasunari yamasita 7013293 Jan 24 09:02 initrd.buffalo -rw-r----- 1 yasunari yamasita 2115656 Jan 24 09:02 uImage.buffalo ude:/tmp# ls /srv ude:/tmp# !grep grep ftp /etc/inetd.conf tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp ftp stream tcp nowait root /usr/sbin/tcpd ftpd ude:/tmp# mkdir /srv/tftp ude:/tmp# mv *buffalo !$ mv *buffalo /srv/tftp ude:/tmp# chown root.root !$/* chown root.root /srv/tftp/* ude:/tmp# ls -l /srv/tftp/ total 8920 -rw-r----- 1 root root 7013293 Jan 24 09:02 initrd.buffalo -rw-r----- 1 root root 2115656 Jan 24 09:02 uImage.buffalo ude:/tmp#
: : hit any key to switch tftp boot. Hit any key to stop autoboot: 0 Hit any key to stop autoboot: 0 Marvell>> printenv bootargs=$(bootargs_base) $(bootargs_root) baudrate=115200 loads_echo=0 ipaddr=192.168.11.150 serverip=192.168.11.1 : :
Marvell>> setenv serverip 192.168.2.38 Marvell>> setenv ipaddr 192.168.2.47 Marvell>> printenv : : serverip=192.168.2.38 ipaddr=192.168.2.47 Environment size: 1073/4092 bytes Marvell>> saveenv Saving Environment to Flash... . Un-Protected 1 sectors Erasing Flash... . Erased 1 sectors Writing to Flash... done . Protected 1 sectors Marvell>>
Marvell>> reset buffalo_change_power_status > Writing 0x18Orion1 CPU = Low : : Booting from Device 0 hit any key to switch tftp boot. Hit any key to stop autoboot: 0 switched to TFTP boot. Hit any key to stop autoboot: 0 Using egiga0 device TFTP from server 192.168.2.38; our IP address is 192.168.2.47 Filename 'uImage.buffalo'. Load address: 0x100000 Loading: * TFTP error: 'Access violation' (2) Starting again error Using egiga0 device TFTP from server 192.168.2.38; our IP address is 192.168.2.47 Filename 'uImage.buffalo'. Load address: 0x100000 Loading: * TFTP error: 'Access violation' (2) Starting again error Abort Marvell>>できない。
サーバのログを見る。
ude:/tmp# less /var/log/daemon.log : : Jan 24 09:14:42 ude in.tftpd[723]: connect from 192.168.2.47 (192.168.2.47) Jan 24 09:14:42 ude tftpd[724]: tftpd: trying to get file: uImage.buffalo Jan 24 09:14:42 ude tftpd[724]: tftpd: serving file from /srv/tftp Jan 24 09:14:52 ude in.tftpd[725]: connect from 192.168.2.47 (192.168.2.47) Jan 24 09:14:52 ude tftpd[726]: tftpd: trying to get file: uImage.buffalo Jan 24 09:14:52 ude tftpd[726]: tftpd: serving file from /srv/tftpできてるみたいだけどなぁ。。。
ude:/tmp# ls -l /srv/tftp/uImage.buffalo -rw-r----- 1 root root 2115656 Jan 24 09:02 /srv/tftp/uImage.buffalo ude:/tmp#よめへんやん。置いたときに ls しているのに見逃していた。節穴。
ude:/tmp# chmod 664 /srv/tftp/* ude:/tmp# ls -l /srv/tftp/ total 8920 -rw-rw-r-- 1 root root 7013293 Jan 24 09:02 initrd.buffalo -rw-rw-r-- 1 root root 2115656 Jan 24 09:02 uImage.buffalo ude:/tmp#もう一回 tftpboot
Marvell>> reset buffalo_change_power_status > Writing 0x18Orion1 CPU = Low : : Booting from Device 0 hit any key to switch tftp boot. Hit any key to stop autoboot: 0 switched to TFTP boot. Hit any key to stop autoboot: 0 Using egiga0 device TFTP from server 192.168.2.38; our IP address is 192.168.2.47 Filename 'uImage.buffalo'. Load address: 0x100000 Loading: ################################################################# #######################(略)#################################### ################################################################# ######################## done Bytes transferred = 2115656 (204848 hex) Using egiga0 device TFTP from server 192.168.2.38; our IP address is 192.168.2.47 Filename 'initrd.buffalo'. Load address: 0x800000 Loading: ################################################################# #######################(略)#################################### ################################################################# ##### done Bytes transferred = 7013293 (6b03ad hex) ## Booting image at 00100000 ... Image Name: Linux-2.6.22.7 Created: 2009-01-06 6:43:29 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2115592 Bytes = 2 MB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK OK ## Loading Ramdisk Image at 00800000 ... Image Name: initrd Created: 2009-01-09 9:24:31 UTC Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 7013229 Bytes = 6.7 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Starting kernel ... arg:console=ttyS0,115200 root=/dev/sda2 rw initrd=0x00800040,15M panic=5 BOOTVER=1.22 tftpboot=yes CONFIG_BUFFALO_PLATFORM --- Uncompressing Linux..................................................................................................................................... done, booting the kernel. Linux version 2.6.22.7 (root@build2.dd-hot24.nas.buffalo.local) (gcc version 4.2.0 20070413 (prerelease)) #357 Tue Jan 6 15:43:23 JST 2009 CPU: ARM926EJ-S [41069260] revision 0 (ARMv5TEJ), cr=a0053177 Machine: Feroceon :ぐっじょーっ!
ude:/tmp# cd /srv/tftp/ ude:/srv/tftp# mkdir LS-CL+HackKit ude:/srv/tftp# mv initrd.buffalo uImage.buffalo !$ mv initrd.buffalo uImage.buffalo LS-CL+HackKit ude:/srv/tftp#
|
|
← 第三世代 LinkStation ハックキットに ftp サーバ |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 重畳 |