root@TS-WXL3B3:~# cd /mnt/disk1/tmp/ root@TS-WXL3B3:/mnt/disk1/tmp# mkdir /tmp/root root@TS-WXL3B3:/mnt/disk1/tmp# ls -l /dev/loop* brw-r--r-- 1 root root 7, 0 Jan 31 23:09 /dev/loop0 root@TS-WXL3B3:/mnt/disk1/tmp# mount -o loop initrd /tmp/root root@TS-WXL3B3:/mnt/disk1/tmp# ls /tmp/root bin etc lost+found root share usr debugtool lib mnt rootfs sys var dev linuxrc proc sbin tmp www root@TS-WXL3B3:/mnt/disk1/tmp#
root@TS-WXL3B3:/mnt/disk1/tmp# cd /tmp/root root@TS-WXL3B3:/tmp/root# mv linuxrc linuxrc.orig root@TS-WXL3B3:/tmp/root# cp linuxrc.orig linuxrc root@TS-WXL3B3:/tmp/root# ls -l linuxrc* -rwxr-xr-x 1 root root 10133 Feb 22 22:31 linuxrc -rwxr-xr-x 1 root root 10133 Nov 30 09:46 linuxrc.orig root@TS-WXL3B3:/tmp/root# vi linuxrc : : echo "linuxrc:choose operation (timeout 4[s])" echo -n " 1:RamRoot 2:sda1 2:sda2 other:HddRoot ? " ## timeout is 4[s] #ANSWER=`/usr/local/bin/keyinput -t 4` ANSWER=1 /usr/local/sbin/miconapl -a serialmode_console case "$ANSWER" in 1) RamdiskRoot ;; : :
root@TS-WXL3B3:/tmp/root# ls -l usr/local/sbin/miconapl -rwxr-xr-x 1 root root 73880 Nov 24 17:09 usr/local/sbin/miconapl root@TS-WXL3B3:/tmp/root#あるある。
root@TS-WXL3B3:/tmp/root# cd etc/ root@TS-WXL3B3:/tmp/root/etc# mv shadow shadow.orig root@TS-WXL3B3:/tmp/root/etc# sed -e 's/^root:[^:][^:]*:\(.*\)$/root::\1/' shadow.orig > shadow root@TS-WXL3B3:/tmp/root/etc# ls -l shadow* -rw-r--r-- 1 root root 344 Feb 23 22:14 shadow -rw-r--r-- 1 root root 370 Nov 16 16:49 shadow.orig root@TS-WXL3B3:/tmp/root/etc# grep root shadow root::11009:0:99999:7::: root@TS-WXL3B3:/tmp/root/etc#モードは、400 じゃないといけないんだけれど、、、
root@TS-WXL3B3:/tmp/root/etc# chmod 400 shadow root@TS-WXL3B3:/tmp/root/etc#
root@TS-WXL3B3:/tmp/root/etc# cd / root@TS-WXL3B3:/# umount /tmp/root root@TS-WXL3B3:/#
root@TS-WXL3B3:/# cd /mnt/disk1/tmp/ root@TS-WXL3B3:/mnt/disk1/tmp# ls initrd root@TS-WXL3B3:/mnt/disk1/tmp# gzip initrd5分ほど待つ
root@TS-WXL3B3:/mnt/disk1/tmp#プロンプトが戻ってきた。
root@TS-WXL3B3:/mnt/disk1/tmp# mkimage -l /boot/initrd.buffalo Image Name: initrd Created: Thu Dec 3 23:18:19 2009 Created(epoc):1259849899 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 9291425 Bytes = 9073.66 kB = 8.86 MB Load Address: 0x00000000 Entry Point: 0x00000000 root@TS-WXL3B3:/mnt/disk1/tmp# /mnt/disk1/share/hackkit/mkimage -A ARM -O Linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initrd -d initrd.gz initrd.buffalo Image Name: initrd Created: Tue Feb 23 22:21:54 2010 Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 9239808 Bytes = 9023.25 kB = 8.81 MB Load Address: 0x00000000 Entry Point: 0x00000000 root@TS-WXL3B3:/mnt/disk1/tmp#できた。
root@TS-WXL3B3:/mnt/disk1/tmp# pushd /boot /boot /mnt/disk1/tmp root@TS-WXL3B3:/boot# ls builddate.txt u-boot-mv78100.buffalo conf_save.tgz u-boot.buffalo hddrootfs.buffalo.updated.done u-boot.buffalo.org initrd.buffalo uImage-88f6281.buffalo lost+found uImage-mv78100.buffalo u-boot-88f6281.buffalo uImage.buffalo root@TS-WXL3B3:/boot# mv initrd.buffalo initrd.buffalo.orig root@TS-WXL3B3:/boot# popd /mnt/disk1/tmp root@TS-WXL3B3:/mnt/disk1/tmp# tar cf - initrd.buffalo |(cd /boot/; tar xvf -) initrd.buffalo root@TS-WXL3B3:/mnt/disk1/tmp#
root@TS-WXL3B3:/mnt/disk1/tmp# shutdown -r now : : System halted. BuffaloChangePowerStatusBeforeHalt > Check power status. MagicKey = 0x02 BuffaloGpio_ChangePowerStatus > Writing 0x7a BuffaloChangePowerStatusBeforeHalt > Changed to 0x7a from 0x02 >miconCntl_PowerOff >miconCntl_ShutdownWaitん? -r にしているのに再起動してこない。
電源ボタンを押す
CPU = MV78 Checking DATA BUS OK! Checking ADDRESS BUS OK! : : Image Name: initrd Created: 2010-02-23 13:21:54 UTC Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 9239808 Bytes = 8.8 MB Load Address: 00000000 Entry Point: 00000000 : : ---- in linuxrc --- Version 1.00 2008/ 7/ 1 Tue Feb 23 22:26:40 JST 2010 LibSys_GetUsbDiskStartNum : Usb device not found(/sys/block/sdb/device). Returning 2 grep: /var/tmp/devlink: No such file or directory linuxrc:choose operation (timeout 4[s]) 1:RamRoot 2:sda1 2:sda2 other:HddRoot ? -RamdiskRoot- : : starting pid 1403, tty '': '/sbin/getty' BUFFALO INC. TeraStation series TS-WXL-EM3B3 login:EM で起動してきた。\^_^/
BUFFALO INC. TeraStation series TS-WXL-EM3B3 login: root root@TS-WXL-EM3B3:~# df Filesystem 1k-blocks Used Available Use% Mounted on /dev/root.old 31729 23518 8211 74% / /dev/ram1 15360 568 14792 4% /mnt/ram root@TS-WXL-EM3B3:~#だーん。
|
← シリアルコンソールを使えるようにするには??? |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ ar と wget |