ユーザ用ツール

サイト用ツール


mae_devel:make_customfirm:start

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
mae_devel:make_customfirm:start [2013/09/03 14:29]
admin
mae_devel:make_customfirm:start [2013/09/03 14:44] (現在)
admin
ライン 1: ライン 1:
 +====== カスタムファームウェアの作成 ======
 +
 +[[mae_devel:​build_kernel:​start|カーネルの再構築]]で作成した、カーネルイメージとモジュールを組み込んで
 +カスタムしたファームウェアイメージをビルドします。
 +
 +適当なrootfsイメージ作成用のアーカイブを準備し、root権限で展開します。
 +
 +<​code>​
 +ma-devel ~ # ls
 +MAE210_mtdroot_100.tar.bz2
 +ma-devel ~ # tar jxvf MAE210_mtdroot_100.tar.bz2 ​
 +MAE210_mtdroot/​
 +MAE210_mtdroot/​rootfs.sh
 +MAE210_mtdroot/​kernel.img
 +  〜〜〜 中略 〜〜〜
 +MAE210_mtdroot/​embedded_glibc/​opt/​mae2xx/​app/​htdocs/​img/​indicator.gif
 +MAE210_mtdroot/​embedded_glibc/​opt/​mae2xx/​app/​htdocs/​csshover2.htc
 +MAE210_mtdroot/​embedded_glibc/​opt/​sbin/​
 +MAE210_mtdroot/​embedded_glibc/​opt/​system/​
 +ma-devel ~ # 
 +</​code>​
 +
 +カーネルモジュールを入れ替えます。
 +
 +<​code>​
 +ma-devel ~ # cd MAE210_mtdroot/​embedded_glibc/​lib/​modules/​
 +ma-devel modules # ls
 +2.6.28.10-Magnolia2
 +ma-devel modules # rm -rf 2.6.28.10-Magnolia2/​
 +ma-devel modules # cp -af /​tmp/​lib/​modules/​2.6.28.10-Magnolia2 .
 +</​code>​
 +
 +所有者がビルドしたユーザ(user1:​users)になっているので修正します。
 +
 +<​code>​
 +ma-devel modules # ls -l
 +total 4
 +drwxr-xr-x 3 user1 users 4096 Sep  3 13:49 2.6.28.10-Magnolia2
 +ma-devel modules # chown -R root:root 2.6.28.10-Magnolia2/​
 +ma-devel modules # ls -l
 +total 4
 +drwxr-xr-x 3 root root 4096 Sep  3 13:49 2.6.28.10-Magnolia2
 +</​code>​
 +
 +ファームウェアのrootファイルシステムのイメージを作成します。
 +
 +<​code>​
 +ma-devel modules # cd ../../../
 +ma-devel MAE210_mtdroot # ls -l
 +total 3592
 +drwxr-xr-x 18 root root    4096 Jun 17  2010 embedded_glibc
 +-rw-r--r-- ​ 1 root root 3670016 Jul 31 14:29 kernel.img
 +-rwxr-xr-- ​ 1 root root     871 Jul 31 14:22 rootfs.sh
 +ma-devel MAE210_mtdroot # ./​rootfs.sh ​
 +backup embedded_glibc
 +cd embedded_glibc.dist
 +cd usr/​lib/​python2.6
 +Listing . ...
 +Compiling ./​BaseHTTPServer.py ...
 +Compiling ./​Bastion.py ...
 +  〜〜〜 中略 〜〜〜
 +Parallel mksquashfs: Using 4 processors
 +Creating little endian 3.1 filesystem on opt/​system/​usr.sqfs,​ block size 131072.
 +lzmadic 131072
 +[===========================================================================================/​] 2940/2940 100%
 +Exportable Little endian filesystem, data block size 131072, compressed data, compressed metadata, compressed fragments, duplicates are removed
 +lzmadic 131072
 +Filesystem size 15488.09 Kbytes (15.13 Mbytes)
 + 33.61% of uncompressed filesystem size (46077.12 Kbytes)
 +Inode table size 27033 bytes (26.40 Kbytes)
 + 25.65% of uncompressed inode table size (105383 bytes)
 +Directory table size 30070 bytes (29.37 Kbytes)
 + 51.22% of uncompressed directory table size (58709 bytes)
 +Number of duplicate files found 12
 +Number of inodes 3278
 +Number of files 2823
 +Number of fragments 249
 +Number of symbolic links  274
 +Number of device nodes 0
 +Number of fifo nodes 0
 +Number of socket nodes 0
 +Number of directories 181
 +Number of uids 3
 + root (0)
 + nobody (65534)
 + unknown (1001)
 +Number of gids 6
 + unknown (407)
 + tty (5)
 + root (0)
 + users (100)
 + wheel (10)
 + unknown (1000)
 +ma-devel MAE210_mtdroot # ls -l
 +total 32272
 +drwxr-xr-x 18 root root     4096 Jun 17  2010 embedded_glibc
 +drwxr-xr-x 19 root root     4096 Sep  3 14:20 embedded_glibc.dist
 +-rw-r--r-- ​ 1 root root  3670016 Jul 31 14:29 kernel.img
 +-rw-r--r-- ​ 1 root root 29360128 Sep  3 14:20 rootfs.jffs2
 +-rwxr-xr-- ​ 1 root root      871 Jul 31 14:22 rootfs.sh
 +drwxr-xr-x ​ 6 root root     4096 Sep  3 14:20 usr_backup
 +</​code>​
 +
 +rootfs.jffs2 ができました。
 +
 +[[mae_devel:​build_kernel:​start|カーネルの再構築]]で作成したカーネルイメージ(uImage)を、ターゲットのフラッシュメモリ領域サイズにあわせてパディングを行います。
 +
 +<​code>​
 +ma-devel MAE210_mtdroot # cp /​home/​user1/​src/​linux-2-6-28-x_mae2xx/​arch/​arm/​boot/​uImage .
 +ma-devel MAE210_mtdroot # ls -l
 +total 35344
 +drwxr-xr-x 18 root root     4096 Jun 17  2010 embedded_glibc
 +drwxr-xr-x 19 root root     4096 Sep  3 14:20 embedded_glibc.dist
 +-rw-r--r-- ​ 1 root root  3670016 Jul 31 14:29 kernel.img
 +-rw-r--r-- ​ 1 root root 29360128 Sep  3 14:20 rootfs.jffs2
 +-rwxr-xr-- ​ 1 root root      871 Jul 31 14:22 rootfs.sh
 +-rw-r--r-- ​ 1 root root  3143408 Sep  3 14:24 uImage
 +drwxr-xr-x ​ 6 root root     4096 Sep  3 14:20 usr_backup
 +ma-devel MAE210_mtdroot # dd if=uImage of=kernel.img conv=notrunc
 +6139+1 records in
 +6139+1 records out
 +3143408 bytes (3.1 MB) copied, 0.016493 s, 191 MB/s
 +ma-devel MAE210_mtdroot # ls -l
 +total 38928
 +drwxr-xr-x 18 root root     4096 Jun 17  2010 embedded_glibc
 +drwxr-xr-x 19 root root     4096 Sep  3 14:20 embedded_glibc.dist
 +-rw-r--r-- ​ 1 root root  3670016 Sep  3 14:26 kernel.img
 +-rw-r--r-- ​ 1 root root 29360128 Sep  3 14:20 rootfs.jffs2
 +-rwxr-xr-- ​ 1 root root      871 Jul 31 14:22 rootfs.sh
 +-rw-r--r-- ​ 1 root root  3143408 Sep  3 14:24 uImage
 +drwxr-xr-x ​ 6 root root     4096 Sep  3 14:20 usr_backup
 +ma-devel MAE210_mtdroot # rm kernel.img.bk ​
 +</​code>​
 +
 +rootfs.jffs2 と kernel.img を結合すると、TFTPもしくはWebUIからアップデート可能なファームウェアイメージとなります。
 +
 +<​code>​
 +ma-devel MAE210_mtdroot # cat rootfs.jffs2 kernel.img > firmware.img
 +ma-devel MAE210_mtdroot # ls -l firmware.img ​
 +-rw-r--r-- 1 root root 33030144 Sep  3 14:43 firmware.img
 +</​code>​
  
mae_devel/make_customfirm/start.1378186176.txt.bz2 · 最終更新: 2013/09/03 14:29 by admin