root fs の書込み(2)

SheevaPlug

jffs2 image を NAND Flash に書いたのに、 マウントできなかった。
やっぱり /proc/mtd の差が原因じゃないかと。

内蔵 Flash から起動したときは、

root@debian:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "uImage"
mtd1: 1fb00000 00020000 "rootfs"
root@debian:~#
NFS から起動したときは、
-sh-3.2# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00200000 00020000 "uImage"
mtd2: 1fd00000 00020000 "root"
-sh-3.2#

bootargs の変更

bootargs の mtdparts を 内蔵 Flash から起動したときのパターンに変えて NFS boot してみる
Marvell>> set bootargs console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/nfs rw nfsroot=$(serverip):/srv/nfs/rootfsv1.0 ip=$(ipaddr):$(serverip)$(bootargs_end)
Marvell>> printenv bootargs
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/nfs rw nfsroot=192.168.2.38:/srv/nfs/rootfsv1.0 ip=192.168.2.85:192.168.2.38:::DB88FXX81:eth0:none
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>> reset
	:
	:
eth0: started
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
      device=eth0, addr=192.168.2.85, mask=255.255.255.0, gw=255.255.255.255,
     host=DB88FXX81, domain=, nis-domain=(none),
     bootserver=192.168.2.38, rootserver=192.168.2.38, rootpath=
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
Looking up port of RPC 100003/2 on 192.168.2.38
eth0: link up, full duplex, speed 1 Gbps
Looking up port of RPC 100005/1 on 192.168.2.38
VFS: Mounted root (nfs filesystem).
Freeing init memory: 124K
init started: BusyBox v1.7.0 (2008-02-26 19:25:17 IST)
starting pid 277, tty '': '/etc/init.d/rcS'
starting pid 279, tty '': '/bin/sh'
-sh-3.2#
/proc/mtd は
-sh-3.2# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00020000 "uImage"
mtd1: 1fb00000 00020000 "rootfs"
-sh-3.2#
2つ。

以下、 SheevaPlug Development Kit - Writing Jaunty Filesystem on the NAND flash-Rev1.2.pdf の
mtd2 を mtd1 に、
mtdblock2 を mtdblock1 に読み替えて実行する

7. mtd1 のパーティション削除

-sh-3.2# flash_eraseall -j /dev/mtd1
Erasing 128 Kibyte @ 1d20000 --  5 % complete. Cleanmarker written at 1d20000.
Skipping bad block at 0x01d40000
Erasing 128 Kibyte @ 4940000 -- 14 % complete. Cleanmarker written at 4940000.
Skipping bad block at 0x04960000
Erasing 128 Kibyte @ 4dc0000 -- 15 % complete. Cleanmarker written at 4dc0000.
Skipping bad block at 0x04de0000
Erasing 128 Kibyte @ 74e0000 -- 23 % complete. Cleanmarker written at 74e0000.
Skipping bad block at 0x07500000
Erasing 128 Kibyte @ bce0000 -- 37 % complete. Cleanmarker written at bce0000.
Skipping bad block at 0x0bd00000
Erasing 128 Kibyte @ ca00000 -- 39 % complete. Cleanmarker written at ca00000.
Skipping bad block at 0x0ca20000

Skipping bad block at 0x0ca40000
Erasing 128 Kibyte @ 12760000 -- 58 % complete. Cleanmarker written at 12760000.
Skipping bad block at 0x12780000
Erasing 128 Kibyte @ 12fa0000 -- 59 % complete. Cleanmarker written at 12fa0000.
Skipping bad block at 0x12fc0000
Erasing 128 Kibyte @ 13520000 -- 60 % complete. Cleanmarker written at 13520000.
Skipping bad block at 0x13540000
Erasing 128 Kibyte @ 14ae0000 -- 65 % complete. Cleanmarker written at 14ae0000.
Skipping bad block at 0x14b00000
Erasing 128 Kibyte @ 14b20000 -- 65 % complete. Cleanmarker written at 14b20000.
Skipping bad block at 0x14b40000
Erasing 128 Kibyte @ 14d40000 -- 65 % complete. Cleanmarker written at 14d40000.
Skipping bad block at 0x14d60000
Erasing 128 Kibyte @ 14fe0000 -- 66 % complete. Cleanmarker written at 14fe0000.
Skipping bad block at 0x15000000
Erasing 128 Kibyte @ 15540000 -- 67 % complete. Cleanmarker written at 15540000.
Skipping bad block at 0x15560000
Erasing 128 Kibyte @ 15680000 -- 67 % complete. Cleanmarker written at 15680000.
Skipping bad block at 0x156a0000
Erasing 128 Kibyte @ 176c0000 -- 73 % complete. Cleanmarker written at 176c0000.
Skipping bad block at 0x176e0000
Erasing 128 Kibyte @ 1ac80000 -- 84 % complete. Cleanmarker written at 1ac80000.
Skipping bad block at 0x1aca0000
Erasing 128 Kibyte @ 1fae0000 -- 99 % complete. Cleanmarker written at 1fae0000.
-sh-3.2#
相変わらず

9. jffs2 image の書込み

-sh-3.2# nandwrite -p /dev/mtd1 ubuntu-9.0.5.Release.jffs2
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
	:
	:
Writing data to block 87e0000
Writing data to block 8800000
Writing data to block 8820000
Writing data to block 8840000
-sh-3.2#

10. マウント

-sh-3.2# mount -t jffs2 /dev/mtdblock1 /mnt1
-sh-3.2# ls /mnt1
bin      etc      media    proc     selinux  tmp
boot     home     mnt      root     srv      usr
dev      lib      opt      sbin     sys      var
-sh-3.2#

11. リスタート

12. bootargs を戻す

Marvell>> printenv bootargs
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/nfs rw nfsroot=192.168.2.38:/srv/nfs/rootfsv1.0 ip=192.168.2.85:192.168.2.38:::DB88FXX81:eth0:none
Marvell>> set bootargs 'console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none'
Marvell>> printenv bootargs
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs) rw root=/dev/mtdblock1 rw ip=10.4.50.4:10.4.50.5:10.4.50.5:255.255.255.0:DB88FXX81:eth0:none
Marvell>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done
Marvell>>

13. reboot

IP-Config: Complete:
      device=eth0, addr=10.4.50.4, mask=255.255.255.0, gw=10.4.50.5,
     host=DB88FXX81, domain=, nis-domain=(none),
     bootserver=10.4.50.5, rootserver=10.4.50.5, rootpath=
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
eth0: link up, full duplex, speed 1 Gbps
VFS: Mounted root (jffs2 filesystem).
Freeing init memory: 124K
 * Setting preliminary keymap...                                         [ OK ]
 * Setting the system clock
 * Starting basic networking...                                          [ OK ]
 * Starting kernel event manager...                                      [ OK ]
 * Loading hardware drivers...                                           [ OK ]
 * Setting the system clock
 * Loading kernel modules...                                                     * Loading manual drivers...                                             [ OK ]
 * Setting kernel variables (/etc/sysctl.conf)...                        [ OK ]
 * Setting kernel variables (/etc/sysctl.d/10-console-messages.conf)...  [ OK ]
 * Setting kernel variables (/etc/sysctl.d/10-network-security.conf)...  [ OK ]
 * Setting kernel variables (/etc/sysctl.d/10-process-security.conf)...         error: "vm.mmap_min_addr" is an unknown key
                                                                         [fail]
 * Setting kernel variables (/etc/sysctl.d/10-tcp-timestamps-workaround.conf)...                                                                         [ OK ]
 * Activating swap...                                                    [ OK ]
FATAL: Could not load /lib/modules/2.6.22.18/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.22.18/modules.dep: No such file or directory
 * Starting early crypto disks...                                        [ OK ]
FATAL: Could not load /lib/modules/2.6.22.18/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.22.18/modules.dep: No such file or directory
 * Starting remaining crypto disks...                                    [ OK ]
 * Checking file systems...                                                     fsck 1.41.3 (12-Oct-2008)
                                                                         [ OK ]
 * Mounting local filesystems...                                         [ OK ]
 * Activating swapfile swap...                                           [ OK ]
 * Configuring network interfaces...                                     [ OK ]
 * Setting up console font and keymap...                                 [ OK ]
 * Starting system log daemon...
Ubuntu jaunty (development branch) debian ttyS0

debian login:                                                            [ OK ]
                                                                                * Starting kernel log daemon...                                          [ OK ]
                                                                                * Starting OpenBSD Secure Shell server sshd                              [ OK ]
                                                                                * Starting periodic command scheduler crond                              [ OK ]
                                                                               Mon Jan 26 18:00:00 UTC 2009

Ubuntu jaunty (development branch) debian ttyS0

debian login:
よーやく戻った。 実機とドキュメントとがあっていないと如何に苦労するかという実例


←(前のページ)
root fs の書込み
当月のハックの記録
SheevaPlug/玄柴(KURO-SHEEVA)をハックしよう トップ
(次のページ)→
時計を合わせる

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