最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

buildroot-2009.11编译全过程

Buildroot crifan 3753浏览 0评论

(just need do the steps, red color contents, should be OK.)
untar the buildroot:

tar xvjf buildroot-2009.11.tar.bz2

then go into buildroot-2009.11, to do:

make menuconfig

error happen:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ make menuconfig
make CC="/usr/bin/gcc" -C package/config mconf
make[1]: Entering directory `/home/crifan/develop/buildroot/buildroot-2009.11/package/config'
/usr/bin/gcc -DCURSES_LOC="<curses.h>" -DLOCALE  -g -O2  -c conf.c -o conf.o
conf.c: In function ‘conf_askvalue’:
conf.c:105: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
conf.c: In function ‘conf_choice’:
conf.c:307: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
/usr/bin/gcc -DCURSES_LOC="<curses.h>" -DLOCALE  -g -O2  -c kxgettext.c -o kxgettext.o
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
*** 
*** Install ncurses (ncurses-devel) and try again.
*** 
make[1]: *** [dochecklxdialog] Error 1
make[1]: Leaving directory `/home/crifan/develop/buildroot/buildroot-2009.11/package/config'
make: *** [package/config/mconf] Error 2

that means lack of the ncurses-devel lib, so use apt-cache to find and use apt-get to install it, but failed:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libncurses5 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
libncurses5 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libncurses 
libncurses5    libncursesw5  
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libncursesw5 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
libncursesw5 已经是最新的版本了。
共升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件未被升级。
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install ncurses
ncurses           ncurses-bin       ncurses-term      
ncurses-base      ncurses-runtime  
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install ncurses
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
现在没有可用的软件包 ncurses,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到
E: 软件包 ncurses 还没有可供安装的候选者
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libncurses5-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
E: 无法找到软件包 libncurses5-dev

that means we should update/ change  the apt source list, do as says in:
http://wiki.ubuntu.org.cn/Qref/Source

sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak

then copy any source into it, after test, for me, the speed is about:

#USTC
# ~60KB
#deb http://debian.ustc.edu.cn/ubuntu/ karmic main multiverse restricted universe
#deb http://debian.ustc.edu.cn/ubuntu/ karmic-backports main multiverse restricted universe
#deb http://debian.ustc.edu.cn/ubuntu/ karmic-proposed main multiverse restricted universe
#deb http://debian.ustc.edu.cn/ubuntu/ karmic-security main multiverse restricted universe
#deb http://debian.ustc.edu.cn/ubuntu/ karmic-updates main multiverse restricted universe
#deb-src http://debian.ustc.edu.cn/ubuntu/ karmic main multiverse restricted universe
#deb-src http://debian.ustc.edu.cn/ubuntu/ karmic-backports main multiverse restricted universe
#deb-src http://debian.ustc.edu.cn/ubuntu/ karmic-proposed main multiverse restricted universe
#deb-src http://debian.ustc.edu.cn/ubuntu/ karmic-security main multiverse restricted universe
#deb-src http://debian.ustc.edu.cn/ubuntu/ karmic-updates main multiverse restricted universe
 
# Mirrors.shlug.org更新服务器
#(电信服务器,Ubuntu China Official Mirror, maintained by Shanghai Linux User Group)
# ~20KB
deb http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu karmic-proposed main restricted universe multiverse
 
# Mirror.lupaworld.com更新服务器(浙江省杭州市双线服务器)
# !!! ~230KB/s
deb http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu karmic-proposed main restricted universe multiverse

so, we use Mirror.lupaworld.com.then do:

sudo apt-get update

after done , we can find the useful ncurses:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-cache search ncurses | grep "ncurses"
lib64ncurses5-dev - developer's libraries for ncurses (64-bit)
libncurses5-dbg - debugging/profiling libraries for ncurses
libncurses5-dev - developer's libraries and docs for ncurses
libncursesw5-dbg - debugging/profiling libraries for ncurses
libncursesw5-dev - developer's libraries for ncursesw
...

then we can install it:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libncurses5-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
下列【新】软件包将被安装:
libncurses5-dev
共升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 247 个软件未被升级。
需要下载 1,564kB 的软件包。
...

then continue do:

make menuconfig

do your settings by yourself. then choose "Save an Alternate Configuration File"
to save the settings to ".config" — the default config file.
after done, save and exit.
then do:

make

error happen:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ make
if [ ! -e "/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/bin/sed" ]; then
mkdir -p "/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/bin"; 
rm -f "/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/bin/sed"; 
ln -sf "/bin/sed"
"/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/bin/sed"; 
fi
 
Checking build system dependencies:
BUILDROOT_DL_DIR clean:                    Ok
CC clean:                         Ok
CXX clean:                         Ok
CPP clean:                         Ok
CFLAGS clean:                         Ok
INCLUDES clean:                         Ok
CXXFLAGS clean:                         Ok
which installed:                    Ok
sed works:                         Ok (/bin/sed)
GNU make version '3.81':               Ok
C compiler '/usr/bin/gcc'
C compiler version '4.4.1':               Ok
C++ Compiler installed:               FALSE
 
You may have to install 'g++' on your build machine
 
awk installed:                         Ok
bash installed:                         Ok
bison installed:               FALSE
 
 
You must install 'bison' on your build machine
 
make: *** [dependencies] Error 1

this means we lack of many basic develop related tools, so install it:

crifan@crifan-laptop:~$ sudo apt-get install build-essential 
[sudo] password for crifan: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
将会安装下列额外的软件包:
cpp-4.4 dpkg-dev fakeroot g++ g++-4.4 gcc-4.4 gcc-4.4-base libgcc1 libgomp1 libstdc++6 libstdc++6-4.4-dev patch
建议安装的软件包:
gcc-4.4-locales debian-keyring debian-maintainers g++-multilib g++-4.4-multilib gcc-4.4-doc libstdc++6-4.4-dbg gcc-4.4-multilib
libmudflap0-4.4-dev libgcc1-dbg libgomp1-dbg libmudflap0-dbg libcloog-ppl0 libppl-c2 libppl7 libstdc++6-4.4-doc diff-doc
下列【新】软件包将被安装:
build-essential dpkg-dev fakeroot g++ g++-4.4 libstdc++6-4.4-dev patch
下列的软件包将被升级:
cpp-4.4 gcc-4.4 gcc-4.4-base libgcc1 libgomp1 libstdc++6
共升级了 6 个软件包,新安装了 7 个软件包,要卸载 0 个软件包,有 241 个软件未被升级。
需要下载 14.1MB 的软件包。
解压缩后会消耗掉 23.5MB 的额外空间。
......
正在设置 build-essential (11.4) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place

after done, also need install others:

sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install gettext

then we can continue to make.
then the buildroot will download codes and patch&compile it according to your choices in make menuconfig.
………………..
if occur error, then just to find reason and fix it or avoid it, then after compilation done,
the needed cross compile tools for ARM that I choose will generated.

error happened:

.......
make[4]: 正在进入目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd/doc'
restore=: && backupdir=".am$$" && 
rm -rf $backupdir && mkdir $backupdir && 
if (/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/missing makeinfo --split-size=5000000 --split-size=5000000 --version) >/dev/null 2>&1; then
for f in bfd.info bfd.info-[0-9] bfd.info-[0-9][0-9] bfd.i[0-9] bfd.i[0-9][0-9]; do
if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; 
done; 
else :; fi && 
if /home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/missing makeinfo --split-size=5000000 --split-size=5000000    -I /home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/bfd/doc
-o bfd.info `test -f 'bfd.texinfo' || echo '/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/bfd/doc/'`bfd.texinfo; 
then
rc=0; 
else
rc=$?; 
$restore $backupdir/* `echo "./bfd.info" | sed 's|[^/]*$||'`; 
fi; 
rm -rf $backupdir; exit $rc
WARNING: `makeinfo' is missing on your system.  You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual.  The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX).  You might want to install the `Texinfo' package or
the `GNU make' package.  Grab either from any GNU archive site.
make[4]: *** [bfd.info] 错误 1
make[4]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd/doc'
Making info in po
make[4]: 正在进入目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd/po'
make[4]: 没有什么可以做的为 `info'。
make[4]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd/po'
make[4]: 正在进入目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd'
make[4]: 没有什么可以做的为 `info-am'。
make[4]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd'
make[3]: *** [info-recursive] 错误 1
make[3]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/bfd'
make[2]: *** [all-bfd] 错误 2
make[2]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build'
make[1]: *** [all] 错误 2
make[1]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build'
make: *** [/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19-build/binutils/objdump] 错误 2

it seems is the makeinfo tool is not installed ?
let try it to find and install it, buf not found:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ apt-cache search makeinfo
texi2html - Convert Texinfo files to HTML

so try install it:

sudo apt-get install texi2html

but continue make is still error.
then try to insfall:

sudo apt-get install texinfo

then make still error.
strangely, we now have installed makeinfo:

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ makeinfo --help
用法:makeinfo [选项]... TEXINFO-文件...
 
将 Texinfo 源文件转换为其它各种格式,默认转换为适于
由 Emacs 或独立 GNU Info 在线浏览的 Info 文件。
 
General options:
--error-limit=NUM        quit after NUM errors (default 100).
--document-language=STR locale to use in translating Texinfo keywords
for the output document (default C).
......
 
请将错误报告发送到 [email protected],
一般的问题和讨论请发送到 [email protected]。
Texinfo 主页:http://www.gnu.org/software/texinfo/

but make still not OK, why ???
in the end, I redo all steps for the whole buildroot:
1.untar buildroot code
2.make menuconfig, do config here by yourself, or reload the config file you saved last time ….
3. copy the last time downloaded dl/* into new buildroot
4. then make
this time, the Makefile for binutils is:

gedit output/toolchain/binutils-2.19-build/Makefile


is :

...
MAKEINFO = makeinfo
...
 
# This just becomes part of the MAKEINFO definition passed down to
# sub-makes.  It lets flags be given on the command line while still
# using the makeinfo from the object tree.
# (Default to avoid splitting info files by setting the threshold high.)
MAKEINFOFLAGS = --split-size=5000000
...

not the last time :

...
MAKEINFO = /home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/missing makeinfo --split-size=5000000
...


propably the reason is, last time, not installed texinfo(that is makeinfo), then generated MAKEINFO is no found, so the generated makefile no found makeinfo, look like this :

...
MAKEINFO = /home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/binutils-2.19/missing makeinfo --split-size=5000000
...

this time, have installed texinfo, then auto-generated makefile can found makeinfo:

...
MAKEINFO = makeinfo
...
 
# This just becomes part of the MAKEINFO definition passed down to
# sub-makes.  It lets flags be given on the command line while still
# using the makeinfo from the object tree.
# (Default to avoid splitting info files by setting the threshold high.)
MAKEINFOFLAGS = --split-size=5000000
...

then make is OK now.
so Make Sure you have installed texinfo(that is makeinfo) by :

sudo apt-get install texinfo

before you do make in buildroot !!!
then continue to make…
error happened:

...
/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4-initial/./gcc/xgcc -B/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4-initial/./gcc/ -B/home/crifan/develop/buildroot/buildroot-2009.11/output/staging/usr/arm-linux-uclibc/bin/ -B/home/crifan/develop/buildroot/buildroot-2009.11/output/staging/usr/arm-linux-uclibc/lib/ -isystem /home/crifan/develop/buildroot/buildroot-2009.11/output/staging/usr/arm-linux-uclibc/include -isystem /home/crifan/develop/buildroot/buildroot-2009.11/output/staging/usr/arm-linux-uclibc/sys-include -g -Os -O2 -g -Os -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I. -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc/. -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc/../include -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc/../libcpp/include -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gmp/include -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/mpfr/include -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc/../libdecnumber -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/gcc/../libdecnumber/dpd -I../libdecnumber  -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize  -I. -I. -I../.././gcc -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/. -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc -I/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../include  -o crtbegin.o -MT crtbegin.o -MD -MP -MF crtbegin.dep  
-c /home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc/crtstuff.c -DCRT_BEGIN
/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc/crtstuff.c: In function '__do_global_dtors_aux':
/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc/crtstuff.c:306: error: '__DTOR_LIST__' undeclared (first use in this function)
/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc/crtstuff.c:306: error: (Each undeclared identifier is reported only once
/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4/libgcc/../gcc/crtstuff.c:306: error: for each function it appears in.)
make[2]: *** [crtbegin.o] 错误 1
make[2]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4-initial/arm-linux-uclibc/libgcc'
make[1]: *** [all-target-libgcc] 错误 2
make[1]:正在离开目录 `/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4-initial'
make: *** [/home/crifan/develop/buildroot/buildroot-2009.11/output/toolchain/gcc-4.3.4-initial/.compiled] 错误 2

find reply about this in :
http://lists.busybox.net/pipermail/buildroot/2009-May/027545.html

You have:

BR2_ARM_EABI=y
BR2_GNU_TARGET_SUFFIX="linux-uclibc"

Which doesn't make sense. The correct target suffix for eabi is
"linux-uclibcgnueabi". With that change the toolchain builds. Notice
that it will later fail in libusb and strace
unless you get the post-rc2 fixes in git,

so :

make menuconfig


to change the "Build options" -> "GNU target suffix"
from "(linux-uclibc)" to "(linux-uclibcgnueabi)"
then do make(makesure not seletc libusb and strace)
but also failed, it seems that we need a clean rebuild after that change.
so rebuild the buildroot, a time wasting wo
rk ….
rebuild is work, continue make…
error happen:

正在解析主机 git.infradead.org... 18.85.46.34, 2001:4830:2446:ff00:214:51ff:fe65:c65c
正在连接 git.infradead.org|18.85.46.34|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度: 未指定 [application/x-gzip]
保存到‘/home/crifan/develop/buildroot/buildroot-2009.11/dl/mtd-utils-fcb52ccc99679460640386c297023f852b108f68.tar.gz’
 
[           <=>                                                 ] 330,331       138K/s    in 2.3s     
 
2010-02-18 21:22:26 (138 KB/s) - `/home/crifan/develop/buildroot/buildroot-2009.11/dl/mtd-utils-fcb52ccc99679460640386c297023f852b108f68.tar.gz' 被保存 [330331]
 
gzip -d -c /home/crifan/develop/buildroot/buildroot-2009.11/dl/mtd-utils-fcb52ccc99679460640386c297023f852b108f68.tar.gz | tar -C /home/crifan/develop/buildroot/buildroot-2009.11/output/build  -xf -
rm -rf /home/crifan/develop/buildroot/buildroot-2009.11/output/build/mtd-utils-fcb52ccc99679460640386c297023f852b108f68
mv /home/crifan/develop/buildroot/buildroot-2009.11/output/build/mtd-utils /home/crifan/develop/buildroot/buildroot-2009.11/output/build/mtd-utils-fcb52ccc99679460640386c297023f852b108f68
mv: 无法获取"/home/crifan/develop/buildroot/buildroot-2009.11/output/build/mtd-utils" 的文件状态(stat): 没有该文件或目录
make: *** [/home/crifan/develop/buildroot/buildroot-2009.11/output/build/mtd-utils-fcb52ccc99679460640386c297023f852b108f68/.unpacked] 错误 1

related mtd-util, goto dl/ to see downloaded
dl/mtd-utils-fcb52ccc99679460640386c297023f852b108f68.tar.gz
see after untar it, it include mtd-util-fcb52cc, not mtd-util,
so change its name manually :

crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ cd output/build/
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11/output/build$ ls
buildroot-config  file-4.26          liblockfile-1.08        memstat-0.5         zlib-1.2.3
busybox-1.15.2     file-4.26-target  lockfile-progs-0.1.11  mtd-utils-fcb52cc
dosfstools-3.0.3  libiconv-1.12      lzo-2.03                tgt-config.cache
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11/output/build$ mv mtd-utils-fcb52cc/ mtd-utils


then continue to make….
error happen:

...
Checking for GUI ... no
Checking for iconv program ... no 
No working iconv program found, use 
--charset=UTF-8 to continue anyway.
If you also have problems with iconv library functions use --charset=noconv.
Messages in the GTK-2 interface will be broken then.
make: *** [/home/crifan/develop/buildroot/buildroot-2009.11/output/build/MPlayer-1.0rc2/.configured] 错误 1
it seems lack of iconv, so go to find and install it:
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-cache search iconv | grep "iconv"
...
libiconv-hook-dev - header files of libiconv-hook
libiconv-hook1 - extension of iconv for libapache-mod-encoding
libiconv-ruby - transitional dummy package
...
crifan@crifan-laptop:~/develop/buildroot/buildroot-2009.11$ sudo apt-get install libiconv-hook-dev
正在读取软件包列表... 完成
正在分析软件包的依赖关系树        
正在读取状态信息... 完成        
将会安装下列额外的软件包:
libiconv-hook1
下列【新】软件包将被安装:
libiconv-hook-dev libiconv-hook1
共升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 237 个软件未被升级。
... ...
 
正在设置 libiconv-hook-dev (0.0.20021209-10) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place

but still not work….
and find solution in:
http://www.mplayerhq.hu/DOCS/HTML/zh_CN/unix.html

Solutions to common problems: If you encounter this error message from ./configure: $ ./configure

Checking for iconv program … no
No working iconv program found, use
–charset=US-ASCII to continue anyway.
Messages in the GTK-2 interface will be broken then.
This is because AIX uses non-standard character set names; therefore, converting MPlayer output to another character set is currently not supported. The solution is to use: $ ./configure –charset=noconv

but can not find the place to add this para into configure,
so temp not build MPlayer here.
goto make menuconfig to unselect it.
then continue to make, is OK.
for MPlayer's error, in the end, I retry the MPlayer, when error, do this change:
gedit output/build/MPlayer-1.0rc2/configure

for
Line 646:
change :

_charset="UTF-8"

to:

#_charset="UTF-8"
_charset="noconv"

and
Line 7296
change :

if test "$_charset" ; then
echocheck "iconv program"
iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
if test "$?" -ne 0 ; then
echores "no"
echo "No working iconv program found, use "
echo "--charset=UTF-8 to continue anyway."
echo "If you also have problems with iconv library functions use --charset=noconv."
echo "Messages in the GTK-2 interface will be broken then."
exit 1
else
echores "yes"
fi
fi

to:

if test "$_charset" ; then
echocheck "iconv program"
iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
#if test "$?" -ne 0 ; then
# echores "no"
# echo "No working iconv program found, use "
# echo "--charset=UTF-8 to continue anyway."
# echo "If you also have problems with iconv library functions use --charset=noconv."
# echo "Messages in the GTK-2 interface will be broken then."
# exit 1
#else
echores "yes"
#fi
fi

this is just change the charset to noconv, and not report error when no iconv program.
then continue to make is OK now.

later I add ubifs support, many things need do:
1.add necessary libs:

sudo apt-get install uuid-dev
sudo apt-get install zlib1g-dev

to get its head files for compile of mkfs.ubifs.

sudo apt-get install liblzo2-dev

to add support of lzo lib.
【Note】
later,I have noticed that, the
UBIFS FAQ: How to compile mkfs.ubifs?
has noted this :
"In Debian install zlib1g-dev, liblzo2-dev and uuid-dev packages."
Here, Ubuntu is based on Debian.

2.update mtd-util's makefile according to this site:
http://lists.busybox.net/pipermail/buildroot/2009-July/028136.html

that is;

gedit target/ubifs/ubifsroot.mk

then change the old one to the follow workable one:

#############################################################
#
# mkfs.ubifs to build to target ubifs filesystems
#
#############################################################
#MKFS_UBIFS_VERSION=2582f128dad78591bc3adcc87c343c690bb82e61
#MKFS_UBIFS_URL=http://git.infradead.org/users/dedekind/mkfs.ubifs.git?a=snapshot;h=$(MKFS_UBIFS_VERSION);sf=tgz
MKFS_UBIFS_VERSION=HEAD
MKFS_UBIFS_URL=http://git.infradead.org/mtd-utils.git?a=snapshot;h=$(MKFS_UBIFS_VERSION);sf=tgz
MKFS_UBIFS_SOURCE=mtd-utils-$(MKFS_UBIFS_VERSION).tar.gz
MKFS_UBIFS_DIR=$(BUILD_DIR)/mkfs-utils-ubifs
MKFS_UBIFS_CAT=$(ZCAT)
MKFS_UBIFS_NAME=mtd-utils
MKFS_UBIFS_BINARY=$(MKFS_UBIFS_DIR)/mkfs.ubifs/mkfs.ubifs
 
$(DL_DIR)/$(MKFS_UBIFS_SOURCE):
$(WGET) -O $(DL_DIR)/$(MKFS_UBIFS_SOURCE) "$(MKFS_UBIFS_URL)"
 
$(MKFS_UBIFS_DIR)/.unpacked: $(DL_DIR)/$(MKFS_UBIFS_SOURCE)
$(ZCAT) $(DL_DIR)/$(MKFS_UBIFS_SOURCE) | tar -C $(BUILD_DIR) -xvf -
mv $(BUILD_DIR)/$(MKFS_UBIFS_NAME) $(MKFS_UBIFS_DIR)
toolchain/patch-kernel.sh $(MKFS_UBIFS_DIR) target/ubifs/ mkfs-ubifs-*.patch
touch $@
 
$(MKFS_UBIFS_BINARY): $(MKFS_UBIFS_DIR)/.unpacked
$(MAKE1) -C $(MKFS_UBIFS_DIR) BUILDDIR=$(MKFS_UBIFS_DIR) WITHOUT_XATTR=1
touch -c $@
 
mkfs.ubifs-dirclean:
rm -rf $(MKFS_UBIFS_DIR)
 
mkfs.ubifs: $(MKFS_UBIFS_BINARY)
 
#############################################################
#
# Build the ubifs root filesystem image
#
#############################################################
 
UBIFS_OPTS := -e $(BR2_TARGET_ROOTFS_UBIFS_LEBSIZE) -c $(BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT) -m $(BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE)
 
UBIFS_BASE := $(call qstrip,$(BR2_TARGET_ROOTFS_UBIFS_OUTPUT))
 
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB),y)
UBIFS_OPTS += -x zlib
endif
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_LZI),y)
UBIFS_OPTS += -x lzo
endif
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_RT_NONE),y)
UBIFS_OPTS += -x none
endif
 
UBIFS_ROOTFS_COMPRESSOR:=
UBIFS_ROOTFS_COMPRESSOR_EXT:=
UBIFS_ROOTFS_COMPRESSOR_PREREQ:=
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_GZIP),y)
UBIFS_ROOTFS_COMPRESSOR:=gzip -9 -c
UBIFS_ROOTFS_COMPRESSOR_EXT:=gz
#UBIFS_ROOTFS_COMPRESSOR_PREREQ:= gzip-host
endif
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_BZIP2),y)
UBIFS_ROOTFS_COMPRESSOR:=bzip2 -9 -c
UBIFS_ROOTFS_COMPRESSOR_EXT:=bz2
#UBIFS_ROOTFS_COMPRESSOR_PREREQ:= bzip2-host
endif
ifeq ($(BR2_TARGET_ROOTFS_UBIFS_LZMA),y)
UBIFS_ROOTFS_COMPRESSOR:=lzma -9 -c
UBIFS_ROOTFS_COMPRESSOR_EXT:=lzma
UBIFS_ROOTFS_COMPRESSOR_PREREQ:= lzma-host
endif
 
ifneq ($(UBIFS_ROOTFS_COMPRESSOR),)
UBIFS_TARGET := $(UBIFS_BASE).$(UBIFS_ROOTFS_COMPRESSOR_EXT)
else
UBIFS_TARGET := $(UBIFS_BASE)
endif
 
$(UBIFS_BASE): host-fakeroot makedevs mkfs.ubifs
# Use fakeroot to pretend all target binaries are owned by root
rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
touch $(BUILD_DIR)/.fakeroot.00000
cat $(BUILD_DIR)/.fakeroot* > $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
echo "chown -R 0:0 $(TARGET_DIR)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
ifneq ($(TARGET_DEVICE_TABLE),)
# Use fakeroot to pretend to create all needed device nodes
echo "$(HOST_DIR)/usr/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" 
>> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
endif
# Use fakeroot so mkfs.ubifs believes the previous fakery
echo "$(MKFS_UBIFS_BINARY) -d $(TARGET_DIR) " 
"$(UBIFS_OPTS) -o $(UBIFS_BASE)" >> $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
chmod a+x $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
$(HOST_DIR)/usr/bin/fakeroot -- $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
-@rm -f $(BUILD_DIR)/_fakeroot.$(notdir $(UBIFS_TARGET))
 
ifneq ($(UBIFS_ROOTFS_COMPRESSOR),)
$(UBIFS_BASE).$(UBIFS_ROOTFS_COMPRESSOR_EXT): $(UBIFS_ROOTFS_COMPRESSOR_PREREQ) $(UBIFS_BASE)
$(UBIFS_ROOTFS_COMPRESSOR) $(UBIFS_BASE) > $(UBIFS_TARGET)
endif
 
UBIFS_COPYTO := $(call qstrip,$(BR2_TARGET_ROOTFS_UBIFS_COPYTO))
 
ubifsroot: $(UBIFS_TARGET)
@ls -l $(UBIFS_TARGET)
ifneq ($(UBIFS_COPYTO),)
@cp -f $(UBIFS_TARGET) $(UBIFS_COPYTO)
endif
 
ubifsroot-source: $(DL_DIR)/$(MKFS_UBIFS_SOURCE)
 
ubifsroot-clean:
-$(MAKE) -C $(MKFS_UBIFS_DIR) clean
 
ubifsroot-dirclean:
rm -rf $(MKFS_UBIFS_DIR)
 
#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_TARGET_ROOTFS_UBIFS),y)
TARGETS+=ubifsroot
endif

3.unselect mkfs.jff2 for it has compile error, not compile here.

make menuconfig -> Package Selection for the target ->
Hardware handling / blockdevices and filesystem maintenance ->
mtd/jffs2 utilitie ->
[ ] mkfs.jffs2

4. update old ubifs Config.in :

gedit target/ubifs/Config.in
- depends on BROKEN # upstream git gone, should use mtd-utils
+ depends on BR2_PACKAGE_MTD_UTILS_GIT

5.then continue make, will occur error, say not found mtd-utils,
then you do this:

mv output/build/mtd-utils-HEAD-acabf7f/ output/build/mtd-utils

then continue make is OK, can generated rootfs of ext2 and ubifs image.

[Attachment]
1.config file for buildroot-2009.11 post here:
buildroot-2009.11编译全过程 之 config文件
https://www.crifan.com/buildroot-200911_compile_the_whole_process_of_the_config_file/

转载请注明:在路上 » buildroot-2009.11编译全过程

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.186 seconds, using 22.23MB memory