カーネルを戻す

玄柴(KURO-SHEEVA)

NFS root でブートしようとしたら、ブートしてこなかった。
カーネルを戻す

uImage の入手

ftp で宅内のファイルサーバから SheevaPlug_USB-Recovery1.2.zip を 入手する
root@debian:~# ftp ude.yamasita.jp
-bash: ftp: command not found
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 103 not upgraded.
Need to get 56.3kB of archives.
After this operation, 168kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com jaunty/main ftp 0.17-18 [56.3kB]
Fetched 56.3kB in 1s (33.8kB/s)
Selecting previously deselected package ftp.
(Reading database ... 10329 files and directories currently installed.)
Unpacking ftp (from .../archives/ftp_0.17-18_armel.deb) ...
Setting up ftp (0.17-18) ...

root@debian:~# ftp ude.yamasita.jp
ftp: ude.yamasita.jp: Host name lookup failure
ftp> bye
root@debian:~# 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/cd_1.2b/
250 CWD command successful.
ftp> bin
200 Type set to I.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> get SheevaPlug_USB-Recovery1.2.zip
local: SheevaPlug_USB-Recovery1.2.zip remote: SheevaPlug_USB-Recovery1.2.zip
200 PORT command sucessful.
150 Opening BINARY mode data connection for 'SheevaPlug_USB-Recovery1.2.zip' (72864326 bytes).
################################################################################
	:
	:
####################################
226 Transfer complete.
72864326 bytes received in 88.16 secs (807.1 kB/s)
ftp> bye
221 Goodbye.
root@debian:~# unzip SheevaPlug_USB-Recovery1.2.zip
Archive:  SheevaPlug_USB-Recovery1.2.zip
  inflating: USB_Recovery/flashware.img
  inflating: USB_Recovery/u-boot-rd88f6281Sheevaplug_400db_nand.bin
  inflating: USB_Recovery/uImage.sheeva.040309
root@debian:~#

uImage を flash に焼く

失敗すると再起不能に、、、
root@debian:~# flash_eraseall -j /dev/mtd0
Erasing 128 Kibyte @ 3e0000 -- 96 % complete. Cleanmarker written at 3e0000.
root@debian:~# nandwrite -pm /dev/mtd0 USB_Recovery/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:~# reboot
root@debian:~#
Broadcast message from root@debian
        (/dev/ttyS0) at 20:43 ...
	:
	:
USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
Marvell>>

戻したカーネルで起動

Marvell>> set bootargs console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=$(ipaddr):$(serverip):$(serverip):255.255.255.0:DB88FXX81:eth0:none
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> reset
	:
	:
Starting kernel ...

Uncompressing Linux.................................................................................................................................. done, booting the kernel.
ここで止った。 どんどん深みには待っているような気がする。

環境変数を戻す

再度 U-Boot のプロンプトに入り
Marvell>> setenv arcNumber
Marvell>> setenv mainlineLinux no
Marvell>> printenv
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/mtdblock2 ro
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
cesvcid=ULULULULULULPPULULULULULDA
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
run_diag=no
bootcmd=nand read.e 0x800000 0x100000 0x400000; bootm 0x800000
ethaddr=00:50:43:01:44:96
serverip=192.168.2.38
ipaddr=192.168.2.89
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=192.168.2.89:192.168.2.38:192.168.2.38:255.255.255.0:DB88FXX81:eth0:none
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0x100000@0(uboot)ro,0x0@0x100000(uImage),0x1ff00000@0x100000(rootfs)rw
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
mainlineLinux=no

Environment size: 1408/131068 bytes
Marvell>>
これでもう一回再起動
Marvell>> reset
	:
	:
Uncompressing Linux.................................................................................................................................. done, booting the kernel.
とまった。

どんどん深みにハマっていく。楽し!



KURO-SHEEVA
楽天市場

←(前のページ)
Squeeze のインストール(3)root fs の入れ換え
当月のハックの記録
SheevaPlug/玄柴(KURO-SHEEVA)をハックしよう トップ
(次のページ)→
レンガからの脱出

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