ude:~# mkdir /tmp/boot ude:~# mount /dev/sdb1 /tmp/boot ude:~# ls /tmp/boot conf_save.tgz initrd.buffalo lost+found patch.buffalo.zip u-boot.buffalo uImage.buffalo uImage.buffalo.orig ude:~# cd /tmp/boot ude:/tmp/boot# dd if=initrd.buffalo of=initrd.gz bs=64 skip=1 23077+1 records in 23077+1 records out 1476938 bytes (1.5 MB) copied, 1.14623 seconds, 1.3 MB/s ude:/tmp/boot# gunzip initrd.gz ude:/tmp/boot# mkdir /tmp/root ude:/tmp/boot# mount -o loop initrd /tmp/root ude:/tmp/boot# ls -l /tmp/root total 33 drwxr-xr-x 2 root root 1024 Nov 13 11:16 bin drwxr-xr-x 3 root root 1024 Nov 13 11:16 dev drwxr-xr-x 8 root root 1024 Nov 13 11:16 etc drwxr-xr-x 2 root root 1024 Nov 13 11:16 initrd drwxr-xr-x 2 root root 1024 Nov 13 11:16 lib -rwx------ 1 root root 7078 Nov 12 15:44 linuxrc drwx------ 2 root root 12288 Nov 13 11:16 lost+found drwxr-xr-x 2 root root 1024 Dec 20 2006 mnt drwxr-xr-x 2 root root 1024 Dec 20 2006 proc drwxr-xr-x 2 root root 1024 Dec 20 2006 root drwxr-xr-x 2 root root 1024 Dec 20 2006 rootfs drwxr-xr-x 2 root root 1024 Nov 13 11:16 sbin drwxr-xr-x 2 root root 1024 Dec 20 2006 sys drwxr-xr-x 2 root root 1024 Nov 13 11:16 tmp drwxr-xr-x 6 root root 1024 Nov 13 11:16 usr drwxr-xr-x 5 root root 1024 Nov 13 11:16 var ude:/tmp/boot#
ude:/tmp/boot# cd /tmp/root ude:/tmp/root# mv linuxrc linuxrc.orig ude:/tmp/root# cp linuxrc.orig linuxrc ude:/tmp/root# ls -l linuxrc* -rwx------ 1 root root 7078 Dec 24 20:26 linuxrc -rwx------ 1 root root 7078 Nov 12 15:44 linuxrc.orig ude:/tmp/root# vi linuxrc : :どこにいれようか迷ったが、/boot をマウントした直後。
ude:/tmp/root# diff -c linuxrc.orig linuxrc *** linuxrc.orig Mon Nov 12 15:44:26 2007 --- linuxrc Mon Dec 24 20:34:08 2007 *************** *** 176,181 **** --- 176,182 ---- if [ $? -ne 0 ]; then return 0 fi + touch ${MPT_BOOT}/hack # delete lost+founc rm -rf ${MPT_BOOT}/lost+found/* # ude:/tmp/root#
ude:/tmp/root# cd / ude:/# umount /tmp/root ude:/# cd /tmp/boot ude:/tmp/boot# gzip initrd ude:/tmp/boot# mkimage -l initrd.buffalo Image Name: initrd Created: Tue Nov 13 11:16:17 2007 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 1476938 Bytes = 1442.32 kB = 1.41 MB Load Address: 0x00000000 Entry Point: 0x00000000 ude:/tmp/boot# mkimage -A ARM -O Linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initrd -d initrd.gz initrd.buffalo Image Name: initrd Created: Mon Dec 24 20:40:16 2007 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 1487974 Bytes = 1453.10 kB = 1.42 MB Load Address: 0x00000000 Entry Point: 0x00000000 ude:/tmp/boot# ls -l initrd.buffalo* -rw-r--r-- 1 root root 1488038 Dec 24 20:40 initrd.buffalo -rw-r--r-- 1 root root 1477002 Nov 13 11:16 initrd.buffalo.orig ude:/tmp/boot# cd / ude:/# umount /tmp/boot ude:/#
ude:/# telnet whi Trying 192.168.2.41... telnet: Unable to connect to remote host: Connection refused ude:/#電源を落とす
ude:/# mount /dev/sdb1 /tmp/boot ude:/# ls /tmp/boot conf_save.tgz initrd.buffalo initrd.gz patch.buffalo.zip uImage.buffalo hack initrd.buffalo.orig lost+found u-boot.buffalo uImage.buffalo.orig ude:/#ある!
ということは、カーネルと initrd は起動している。
ちょっと光が見えてきたぞっ!
|
← 中の様子を探る |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ 中の様子を探る(3) |