主要参考http://forum.wdlxtv.com/viewtopic.php?f=43&t=3108
sb2 –e 调用的是rootstrap中的程序
cd make-3.82/
sb2 ./configure --prefix=/usr
sb2 make
sb2 make install DESTDIR=$BUILDROOT
root@james-desktop:~/buildroot/hello-world# sb2 -eR make
exec: 1: /bin/sh: not found
原因是没有bash,所以安装bash:
sb2 ./configure --prefix=/
sb2 make
sb2 make install DESTDIR=$BUILDROOT
~/buildroot/bin# ln -s bash sh
//卸载
sb2 make DESTDIR=$BUILDROOT uninstall
编译hello-world时候
sb2 make
sb2 -eR make install
提示:
/bin/bash: /bin/mkdir: No such file or directory
mkdir包含在coreutils中
http://www.ha97.com/book/lfs-book-6.6/chapter06/coreutils.html
wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.8.tar.gz
sb2 ./configure --prefix=/usr
sb2 make –j4
sb2 make install DESTDIR=$BUILDROOT
mv -v usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} bin mv -v usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} bin
mv -v usr/bin/{rmdir,stty,sync,true,uname} bin
mv -v usr/bin/chroot usr/sbin
mv -v usr/bin/{head,sleep,nice} bin
注意:ubuntu sh默认是dash
sudo dpkg-reconfigure dash
选择no
======================================================================================================
http://lists.scratchbox.org/pipermail/scratchbox-users/2008-July/001287.html
SB2 by default (using the "simple" mapping mode) doesn't give you a "chroot", it's that way by design. Idea is to be as unintrusive as possible, while still functioning for cross compilation. It is possible to "chroot" by running sb2 in the emulation mode (sb2 -e). Maemo uses the "maemo" mode, which you can enable by running sb2 -m maemo. What works best depends what you plan to do. I'd say that for constructing a new distro, simple mode should be enough as you can and should clean up the most attrocious build system failures instead of relying on sb2 to paper over them. For supporting debian style building a mode similar to maemo is useful, as the idea obviously is to deviate as little as possible from the upstream. Overall it's not terribly obvious (even after many years...) what is *the* right way to deal with this. This is one of the reasons why I like to position SB2 as a tool for creating an SDK instead of being the SDK.
SB2默认不chroot,尽量非侵入(unintrusive).用sb2 –e 模拟模式可以进入chroot.Maemo 使用maemo模式.maemo是为了不合上游部门脱离.
======================================================================================================
http://lists.scratchbox.org/pipermail/scratchbox-users/2009-April/001473.html
emulate: Run the target binaries, virtually chrooting into the target buildroot, useful for testing or maintaining the target directory (if you have a debian in it, apt-get & co can be run under emulate mode). simple: Very straightforward compilation oriented mapping mode, does as little as possible, trying to be predictable. This is the default. devel: A much more complex mapping mode designed for Maemo SDK+, produces an environment functionally similar to SB1 maemo_simple: simple mode modified to work with Maemo peculiarities tools: Build tool distribution maintenance, for example if you're developing for a debian target on a Fedora host, you may want to have a debian for your host machine available in a directory ~/debian_chroot to be used for building, this mode makes it possible to maintain that without root access. When creating a target with sb2-init, -t <path> option can specify the tools to use. install: sb2 ./configure --prefix=/usr && sb2 make && sb2 -m install make install, this assists in installing files to where you want them (in the buildroot), while allowing the build system to *attempt* to install them into /usr -------------------------------------------------------------
devel模式和SB1相似。Maemo SDK+中使用。
Both "accel" and "devel" are intended to be used with a separate
"tools root" directory, consisting of host-compatible binaries of the same programs that exist in the target file system
as foreign binaries。
包含一个tools root目录,里面放host上的软件,但是版本配置和target一样。
"tools" mode is very much like "emulate", except that there most things are mapped to tools root
tools模式和emulate相似,但是是来自tools root目录。
======================================================================================================