*[PC]HDL4-G u-boot覚え書き

・HDL4-Gの起動はu-bootが使われているらしい
ls /boot
initrd.l4g lost+found uImage.l4g

・initrd.l4gの中を覗いてみる
dd if=initrd.l4g of=initrd.gz bs=64 skip=1
gunzip initrd.gz
mkdir test
mount -o loop initrd test
cd test

ls
bin etc lib lost+found proc sys usr
dev home linuxrc mnt sbin tmp var

linuxrcが起動スクリプト


・uimageを作るにはmkimageが必要らしい
コンパイルの参考サイトはこちら
http://www.yamasita.jp/linkstation/2007/12/071219_post_63.html
1.1.4以外だとうまくいかなかった
<追記>
・1.2.0のmkimageコンパイル
cd u-boot-1.2.0
export OBJTREE=`pwd`
export SRCTREE=`pwd`
export TOPDIR=`pwd`
cd tools/
make mkimage
・1.3.4のmkimageコンパイル ※1.3.4のmkimageはちょっとでかい
cd u-boot-1.3.4
make linkstation_HGLAN_config
make tools

u-bootソース
ftp://ftp.denx.de/pub/u-boot/

bzip2 -d u-boot-1.1.4.bz2
tar xvf u-boot-1.1.4.tar
cd u-boot-1.1.4
cd tools

TOPDIR=`pwd`
export TOPDIR
make mkimage ※エラーになる
make mkimage ※もう一回
cp mkimage /usr/bin/ ※適当な場所にコピー

mkimage --help
Usage: mkimage -l image
-l ==> list image header information
mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image
-A ==> set architecture to 'arch'
-O ==> set operating system to 'os'
-T ==> set image type to 'type'
-C ==> set compression type 'comp'
-a ==> set load address to 'addr' (hex)
-e ==> set entry point to 'ep' (hex)
-n ==> set image name to 'name'
-d ==> use image data from 'datafile'
-x ==> set XIP (execute in place)


mkimage -l /boot/initrd.l4g
Image Name:
Created: Fri May 22 16:36:32 2009
Image Type: ARM Linux RAMDisk Image (uncompressed)
Data Size: 3278801 Bytes = 3201.95 kB = 3.13 MB
Load Address: 0x00000000
Entry Point: 0x00000000

mkimage -l /boot/uImage.l4g
Image Name: Linux-2.6.12.6-arm1
Created: Wed May 13 18:55:21 2009
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1742476 Bytes = 1701.64 kB = 1.66 MB
Load Address: 0x00008000
Entry Point: 0x00008000http://www.filesonic.com/file/1009410801

<追記>
環境変数
HDL4-G>> printenv
bootargs=root=/dev/md2 initrd=0x2000040,16M rw console=ttyS0,115200
bootcmd=ide detect; if ext2ls ide 2:1 && ext2lo ide 2:1 2000000 /initrd.l4g && ext2lo ide 2:1 200000 /uImage.l4g ;then bootm ; elif ext2ls ide 3:1 && ext2lo ide 3:1 2000000 /initrd.l4g && ext2lo ide 3:1 200000 /uImage.l4g ;then bootm ; elif ext2ls ide 4:1 && ext2lo ide 4:1 2000000 /initrd.l4g && ext2lo ide 4:1 200000 /uImage.l4g ;then bootm ; elif ext2ls ide 5:1 && ext2lo ide 5:1 2000000 /initrd.l4g && ext2lo ide 5:1 200000 /uImage.l4g ;then bootm ; elif echo fail to boot HDL4-G... && GTbtn && bootp && tftp 2000000 /tftpboot/initrd.l4g && tftp 200000 /tftpboot/uImage.l4g;then bootm; else echo Give up to boot HDL4-G...; fi
bootdelay=3
baudrate=115200
loads_echo=0
serverip=xxx.xxx.xxx.xxx
autoload=n
rootpath=/mnt/ARM_FS/
cpuName=926
CASset=min
MALLOC_len=4
ethprime=egiga0
disaMvPnp=no
usb0Mode=host
usb1Mode=host
ethact=egiga0
ethaddr=xx:xx:xx:xx:xx:xx
stdin=serial
stdout=serial
stderr=serial
enaMonExt=no
enaFlashBuf=yes
enaCpuStream=no
overEthAddr=no

Environment size: 1029/40956 bytes
HDL4-G>>