ファームウェアのマウント


ファームウェアが展開できたので、 中身をみてみる。

マウント

yasunari@vl:~$ cd /mnt/share/meobankSD_fw_20130110
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ dd if=CWFB109-PXX-324-V253117CS4_20121210-Taxan-M1.bin of=/tmp/3rd bs=1168816 skip=1
2+1 records in
2+1 records out
2687486 bytes (2.7 MB) copied, 0.0673566 s, 39.9 MB/s
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ mkdir /tmp/meobank
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ sudo mount -o loop /tmp/3rd /tmp/meobank/
[sudo] password for yasunari:
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

yasunari@vl:/mnt/share/meobankSD_fw_20130110$
うーん。マウントできない

fs type を指定してみる

yasunari@vl:/mnt/share/meobankSD_fw_20130110$ sudo mount -o loop -t squashfs /tm
p/3rd /tmp/meobank/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

yasunari@vl:/mnt/share/meobankSD_fw_20130110$
あかん。

何かパッケージが要る?

squashfs をキーに探してみた。
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ apt-cache search squashfs
squashfs-tools-dbg - Tool to create and append to squashfs filesystems (debug)
squashfs-tools - Tool to create and append to squashfs filesystems
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ 
squashfs-tools をインストールしてみる
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ sudo apt-get install squashfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  squashfs-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 126 kB of archives.
After this operation, 295 kB of additional disk space will be used.
Get:1 http://ftp.jp.debian.org/debian/ squeeze/main squashfs-tools armel 1:4.0-8 [126 kB]
Fetched 126 kB in 0s (142 kB/s)
Selecting previously deselected package squashfs-tools.
(Reading database ... 20164 files and directories currently installed.)
Unpacking squashfs-tools (from .../squashfs-tools_1%3a4.0-8_armel.deb) ...
Processing triggers for man-db ...
Setting up squashfs-tools (1:4.0-8) ...
!yasunari@vl:/mnt/share/meobankSD_fw_20130110$
マウントしてみる
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ sudo mount -t squashfs -o loop /tmp/3rd /tmp/meobank/
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

yasunari@vl:/mnt/share/meobankSD_fw_20130110$

カーネルの作り直し

CONFIG_SQUASHFS_EMBEDDED を y にしたカーネルを作ってみる
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ cd /usr/src/linux-2.6.31.8
File systems --->
Miscellaneous filesystems --->
で、
Additional option for memory-constrained systems を * に
Number of fragments cached (NEW) をデフォルトのまま 3 に
する。
yasunari@vl:/usr/src/linux-2.6.31.8$ diff -c .config.old .config
*** .config.old Sun Feb 17 23:37:18 2013
--- .config     Mon Feb 18 01:23:24 2013
***************
*** 1,7 ****
  #
  # Automatically generated make config: don't edit
  # Linux kernel version: 2.6.31.8
! # Sun Feb 17 23:37:18 2013
  #
  CONFIG_ARM=y
  CONFIG_SYS_SUPPORTS_APM_EMULATION=y
--- 1,7 ----
  #
  # Automatically generated make config: don't edit
  # Linux kernel version: 2.6.31.8
! # Mon Feb 18 01:23:24 2013
  #
  CONFIG_ARM=y
  CONFIG_SYS_SUPPORTS_APM_EMULATION=y
***************
*** 1504,1510 ****
  # CONFIG_UBIFS_FS_DEBUG is not set
  # CONFIG_CRAMFS is not set
  CONFIG_SQUASHFS=y
! # CONFIG_SQUASHFS_EMBEDDED is not set
  CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
  # CONFIG_VXFS_FS is not set
  # CONFIG_MINIX_FS is not set
--- 1504,1510 ----
  # CONFIG_UBIFS_FS_DEBUG is not set
  # CONFIG_CRAMFS is not set
  CONFIG_SQUASHFS=y
! CONFIG_SQUASHFS_EMBEDDED=y
  CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
  # CONFIG_VXFS_FS is not set
  # CONFIG_MINIX_FS is not set
yasunari@vl:/usr/src/linux-2.6.31.8$
コンパイルする
yasunari@vl:/usr/src/linux-2.6.31.8$ make -j2 uImage
	:
	:
Load Address: 0x00008000
Entry Point:  0x00008000
  Image arch/arm/boot/uImage is ready
yasunari@vl:/usr/src/linux-2.6.31.8$
続いて、モジュール
yasunari@vl:/usr/src/linux-2.6.31.8$ make modules
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CALL    scripts/checksyscalls.sh
:1351:2: warning: #warning syscall migrate_pages not implemented
:1407:2: warning: #warning syscall pselect6 not implemented
:1411:2: warning: #warning syscall ppoll not implemented
:1451:2: warning: #warning syscall epoll_pwait not implemented
  Building modules, stage 2.
  MODPOST 108 modules
yasunari@vl:/usr/src/linux-2.6.31.8$
インストールする
yasunari@vl:/usr/src/linux-2.6.31.8$ sudo make modules_install
	:
	:
yasunari@vl:/usr/src/linux-2.6.31.8$ sudo cp arch/arm/boot/uImage /boot/uImage.buffalo
yasunari@vl:/usr/src/linux-2.6.31.8$
リブート
yasunari@vl:/usr/src/linux-2.6.31.8$ sudo reboot
再起動したところでログイン
Linux 2.6.31.8 (shinjuw.yamasita.jp) (pts/0)

vl login: yasunari
Password:
Last login: Sun Feb 17 23:49:09 JST 2013 from shinjuw.yamasita.jp on pts/0
Linux vl 2.6.31.8 #12 Mon Feb 18 01:25:08 JST 2013 armv5tel

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@vl:~$
マウントしてみる
yasunari@vl:~$ cd /mnt/share/meobankSD_fw_20130110
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ dd if=CWFB109-PXX-324-V253117CS4_20121210-Taxan-M1.bin of=/tmp/3rd bs=1168816 skip=1
2+1 records in
2+1 records out
2687486 bytes (2.7 MB) copied, 0.0673566 s, 39.9 MB/s
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ mkdir /tmp/meobank
yasunari@vl:/mnt/share/meobankSD_fw_20130110$ sudo mount -o loop /tmp/3rd /tmp/meobank/
[sudo] password for yasunari:
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

yasunari@vl:/mnt/share/meobankSD_fw_20130110$
あかんかー。。。。

MeoBankSD

楽天市場
amazon

←(前のページ)
ファームウェアの展開
当月のハックの記録
MeoBankSD をハックしよう トップ
(次のページ)→
オープンソースカンファレンス 2013 Kansai @ Kyoto 出展 #osckansai

ツイート Tweet to @yasunari_y @yasunari_yをフォロー

Copyright (C) 2003-2013 Yasunari Yamashita. All Rights Reserved.
yasunari @ yamasita.jp 山下康成@京都府向日市