LS-GL:debian:mkimage の make

initrd の linuxrc から hwclock 関連の実行を削りたいが、 そのためには、U-boot の mkimage が必要。
これまで通り HD-HGLAN で作っても良いが、それでは進歩がないので LS-GL の debian セルフで作ることにする。
initrd をセルフで作るには LS-GL の debian で mkimage を make しなければならない。


ude:/tmp# cd /usr/local/src/
ude:/usr/local/src# ls
ude:/usr/local/src# mkdir u-boot
ude:/usr/local/src# cd u-boot
ude:/usr/local/src/u-boot# ls
ude:/usr/local/src/u-boot# ftp
(u-boot-1.1.4.tar.bz2 を取得)

bzip2 のインストール

bz2 を解くために bzip2 もインストール
ude:/usr/local/src/u-boot# apt-get install bzip2
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
Suggested packages:
The following NEW packages will be installed:
  bzip2 libbz2-1.0
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 276kB of archives.
After unpacking 635kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 sarge/main libbz2-1.0 1.0.2-7 [41.3kB]
Get:2 sarge/main bzip2 1.0.2-7 [234kB]
Fetched 276kB in 1s (245kB/s)
Selecting previously deselected package libbz2-1.0.
(Reading database ... 9583 files and directories currently installed.)
Unpacking libbz2-1.0 (from .../libbz2-1.0_1.0.2-7_arm.deb) ...
Selecting previously deselected package bzip2.
Unpacking bzip2 (from .../archives/bzip2_1.0.2-7_arm.deb) ...
Setting up libbz2-1.0 (1.0.2-7) ...

Setting up bzip2 (1.0.2-7) ...


U-Boot の展開

ude:/usr/local/src/u-boot# tar jxvf u-boot-1.1.4.tar.bz2

mkimage の make

ude:/usr/local/src/u-boot# cd u-boot-1.1.4
ude:/usr/local/src/u-boot/u-boot-1.1.4# TOPDIR=`pwd`
ude:/usr/local/src/u-boot/u-boot-1.1.4# export TOPDIR
ude:/usr/local/src/u-boot/u-boot-1.1.4# cd tools/
ude:/usr/local/src/u-boot/u-boot-1.1.4/tools# make mkimage
ln -s ../common/environment.c environment.c
ln -s ../lib_generic/crc32.c crc32.c
gcc -M -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC environment.c img2srec.c mkimage.c crc32.c envcrc.c
gen_eth_addr.c bmp_logo.c > .depend
environment.c:28:20: config.h: No such file or directory
envcrc.c:32:20: config.h: No such file or directory
make: *** [.depend] Error 1
HS-DGL の時とはちょっと違う。
ude:/usr/local/src/u-boot/u-boot-1.1.4/tools# cd ..
ude:/usr/local/src/u-boot/u-boot-1.1.4# make configure
make: *** No rule to make target `configure'.  Stop.
ude:/usr/local/src/u-boot/u-boot-1.1.4# make
System not configured - see README
make: *** [all] Error 1
ude:/usr/local/src/u-boot/u-boot-1.1.4# cd tools/
ude:/usr/local/src/u-boot/u-boot-1.1.4/tools# make mkimage
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O -c mkimage.c
gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O -c crc32.c
gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O  -o mkimage mkimage.o crc32.o
strip mkimage
皆さんは、こんなんじゃけません(汗)ちゃんと README 読みましょう
ude:/usr/local/src/u-boot/u-boot-1.1.4/tools# ./mkimage -l /boot/initrd.buffalo
Image Name:   initrd
Created:      Thu Sep 14 18:34:39 2006
Image Type:   ARM Linux RAMDisk Image (gzip compressed)
Data Size:    4414847 Bytes = 4311.37 kB = 4.21 MB
Load Address: 0x00000000
Entry Point:  0x00000000

LinkStation/玄箱 をハックしよう

LS-GL:debian:linuxrc の削減

Copyright (C) 2006 Yasunari Yamashita. All Rights Reserved.
yasunari @ 山下康成@京都府向日市