カーネルの更新

SheevaPlug

現状のカーネルは、、、
root@debian:~# uname -a
Linux debian 2.6.22.18 #1 Thu Mar 19 14:46:22 IST 2009 armv5tejl GNU/Linux
root@debian:~#
3/19 版。

SheevaPlug_LSP1.2.zip を展開すると、 uImage.sheeva.040309 が納められている。
3/9 だったら古いやん良く見たら、09/04/03

SheevaPlug_DocumentationPackage1.2.zip を展開してできた SheevaPlug Development Kit - Writing Jaunty Filesystem on the NAND flash-Rev1.2.pdf の 3 章に準じてカーネル(uImage)を更新する。
ただし、このドキュメントと実記とは NAND Flash の パーティション構成が違うようなので、 下手すると SheevaPlug はレンガになる。

NAND Flash のパーティション構成

再掲
root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "uImage"
mtd1: 1fb00000 00020000 "rootfs"
root@debian:~#
/dev/mtd0 に書く事にする。

コマンドの確認

6. に記述のある2つのコマンドを確認する
root@debian:~# ls -l /usr/sbin/flash_eraseall
-rwxr-xr-x 1 root root 13772 Dec  7  2008 /usr/sbin/flash_eraseall
root@debian:~# ls -l /usr/sbin/nandwrite
-rwxr-xr-x 1 root root 14372 Dec  7  2008 /usr/sbin/nandwrite
root@debian:~#

uImage ファイルの準備

どうやって SheevaPlug にファイルを送り込む?

ftp で送り込む?

yasunari@ude:/srv/tftp$ ftp 192.168.2.85
ftp: connect: Connection refused
ftp> bye
yasunari@ude:/srv/tftp$
ftpd が動いていない

SheevaPlug 側から ftp で get する?

root@debian:~# ftp 192.168.2.38
-bash: ftp: command not found
root@debian:~#
ftp 以外は、、、
root@debian:~# wget
-bash: wget: command not found
root@debian:~# rsync
-bash: rsync: command not found
root@debian:~#
ftp コマンドをインストールする。って、いきなり?
root@debian:~# apt-get install ftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libx11-data libxcb1 libxau6 libxdmcp6 libxcb-xlib0 libx11-6
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  ftp
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
E: Could not open lock file /var/cache/apt/archives/lock - open (2 No such file or directory)
E: Unable to lock the download directory
root@debian:~# 
楽し。
root@debian:~# ls /var/cache/apt/*
/var/cache/apt/pkgcache.bin  /var/cache/apt/srcpkgcache.bin
root@debian:~#
/var/cache/apt/archives がないので作る。
root@debian:~# mkdir /var/cache/apt/archives
root@debian:~#
再実行
root@debian:~# !apt
apt-get install ftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libx11-data libxcb1 libxau6 libxdmcp6 libxcb-xlib0 libx11-6
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  ftp
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
E: Archive directory /var/cache/apt/archives/partial is missing.
root@debian:~#
もー
root@debian:~# mkdir /var/cache/apt/archives/partial
root@debian:~# !apt
apt-get install ftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libx11-data libxcb1 libxau6 libxdmcp6 libxcb-xlib0 libx11-6
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  ftp
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 56.3kB of archives.
After this operation, 168kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  ftp
Install these packages without verification [y/N]? y
Get:1 http://ports.ubuntu.com jaunty/main ftp 0.17-18 [56.3kB]
Fetched 56.3kB in 1s (35.8kB/s)
Selecting previously deselected package ftp.
(Reading database ... 10231 files and directories currently installed.)
Unpacking ftp (from .../archives/ftp_0.17-18_armel.deb) ...
Setting up ftp (0.17-18) ...

root@debian:~#
ようやく get
root@debian:~# !ftp
ftp 192.168.2.38
Connected to 192.168.2.38.
220 ude FTP server (GNU inetutils 1.5) ready.
Name (192.168.2.38:root): 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 /mnt/SheevaPlug
250 CWD command successful.
ftp> bin
200 Type set to I.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> get uImage.sheeva.040309
local: uImage.sheeva.040309 remote: uImage.sheeva.040309
200 PORT command sucessful.
150 Opening BINARY mode data connection for 'uImage.sheeva.040309' (2070316 bytes).
########################################(略)
226 Transfer complete.
2070316 bytes received in 4.74 secs (426.3 kB/s)
ftp> bye
221 Goodbye.
root@debian:~#

パーティションの消去

7. に準じ、uImage の mtd0 だけを消す
root@debian:~# flash_eraseall /dev/mtd0
Erasing 128 Kibyte @ 3e0000 -- 96 % complete.
root@debian:~#

uImage の書込み

8. に準じ、uImage を書込む
root@debian:~# nandwrite -p /dev/mtd0 uImage.sheeva.040309
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Writing data to block 80000
Writing data to block a0000
Writing data to block c0000
Writing data to block e0000
Writing data to block 100000
Writing data to block 120000
Writing data to block 140000
Writing data to block 160000
Writing data to block 180000
Writing data to block 1a0000
Writing data to block 1c0000
Writing data to block 1e0000
root@debian:~#
どきどき

再起動

覚悟を決めて再起動
root@debian:~# shutdown -r now
	:
	:

Ubuntu jaunty (development branch) debian ttyS0

debian login:
無事起動してきた

確認

root@debian:~# uname -a
Linux debian 2.6.22.18 #1 Fri Apr 3 18:49:38 PDT 2009 armv5tejl GNU/Linux
root@debian:~#
4月3日版!


←(前のページ)
mtd
当月のハックの記録
SheevaPlug/玄柴(KURO-SHEEVA)をハックしよう トップ
(次のページ)→
root ファイルシステムの更新

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