LinuxBIOS SDK provides a build root environment to speed up the process to build
a miniumal Linux from scratch. After linuxbios-sdk-xxx.i386.rpm is installed,
it will create /usr/src/linuxbios/buildroot which contains all the essential
tools to build a minimals root filesystem.
To reduce the size of the root filesystem, LinuxBIOS SDK uses uclibc as the C
library. Since not all applications can be built under uclibc, there are 2
kinds of projects under LinuxBIOS SDK, uclibc and glibc. For those projects
cannot be built under uclibc, they will be built with glibc and statically
linked such that it can run under uclibc environment. However, it will increase
the root filesystem size significantly.
All the required tarballs are listed in the following tables. You can either
have the Makefile to download all the tarballs during the make process or
download one by one and then put them in /usr/src/linuxbios/buildroot/tarballs
directory.
Package Name | Version | Website |
uClibc | 0.9.9 | http://www.uclibc.org |
busybox | 0.60.2 | http://www.busybox.net |
gpm | 1.19.3 | ftp://arcana.linux.it/pub/gpm |
iptables | 1.2.5 | http://www.iptables.org |
ppp | 2.4.1 | http://www.samba.org/ppp |
squid | 2.4.STABLE3 | www.squid-cache.org |
thttpd | 2.20c | http://www.acme.com/software/thttpd |
tinylogin | 0.8.0 | http://tinylogin.busybox.net |
openssl | 0.9.6c | http://www.openssl.org |
zlib | 1.1.3 | http://www.zlib.org |
flnx | 0.60.2 | ftp://ftp.viewml.com/pub/flnx |
microwin | 0.84pre8 | http://www.microwindows.org |
viewml | 0.21 | http://www.viewml.org |
w3c-libwww | 5.3.2 | http://www.w3.org/Library |
xmlrpc-c | 0.9.9 | http://www.xmlrpc.com |
All files and directories are located in /usr/src/linuxbios/builroot.
File/Directory | Description |
Makefile | Makefile for the whole SDK project |
$PROJECT/Makefile | Makefile for individual project |
Rule.mak | Defines different variable for Makefile |
data/conf/ | Contains default config file for different projects |
data/root/ | Default root filesystem structure |
data/root/dev/mkdev | Script to make all the essential device files |
data/samples/ | Contains sample linuxBIOS images |
tarballs | Place to store source code |
patches | Place to store patches |
The default root filesystem structure are stored in /usr/src/linuxbios/buildroot/data/root. It provides a basic root filesystem structure for most common applications. For custom application, new files and directories can also be added in here.
All initscripts are located at
/usr/src/linuxbios/buildroot/data/root/etc/init.d. The naming of initscripts
are similar to other distribution. The first character is either S or K. S
means service will start when booting up, and K means service will not start
when boot up. The next 2 digit indicates the priority for starting services.
01 has the highest priority and 99 has the lowest. The last portion of the name
is the service name.
For example, S01mount
It means mount service will start when system boots and it also has 01
priority.
All kernel modules which are needed to load at boot time, can be added in
/usr/src/linuxbios/buildroot/data/root/etc/init.d/S15modules. For example, when
8139too is needed to load at boot time, then added the following line to
/usr/src/linuxbios/buildroot/data/root/etc/init.d/S15modules
.
modprobe 8139too
All dns information are stored in
/usr/src/linuxbios/buildroot/data/root/etc/resolv.conf. The format is as the
same as Bind. For example,
domain cwlinux.com
nameserver 206.13.28.12
nameserver 202.60.252.8
/usr/src/linuxbios/buildroot/data/root/etc/sysconfig/network contains all
ethernet information. The following shows a sample network config file.
# /etc/sysconfig/network
export HOSTNAME="sis630.cwlinux.com"
export GATEWAY="192.168.1.254"
export LO_IPADDR="127.0.0.1"
export ETH0_IPADDR="192.168.1.180"
export ETH0_NETMASK="255.255.255.0"
Since each device file contains inode which uses disk space, default root
filesystem only contains basic device files. All device files are generated by
a script called mkdev.linuxbios which is located at
/usr/src/linuxbios/buildroot/utils. To add extra device files, just add the new
deivce files at the end of the file. For example,
mknod $1/st0 c 9 0
st0 device file will be created next time when mkdev.linuxbios runs.
Before building root filesystem, kernel modules are needed to install in build root directory,
$ cd /usr/src/linuxbios/linux
$ make INSTALL_MOD_PATH=/usr/src/linuxbios/buildroot/root modules_install
To build the default root filesystem, go to /usr/src/linuxbios/buildroot and
$ make
It will compile all packages and create a cramfs root image called rootfs.cramfs
at /usr/src/linuxbios/buildroot.
Beside cramfs, LinuxBIOS SDK also supports ext2 and minix.
To build a ext2 root filesystem image,
$ make ext2
To build a minix root filesystem image,
$ make minix
LinuxBIOS SDK supports ext2, minix and cramfs. A basic understanding of the
nature of each filesystem can help you to determine which filesystem fit your
application. The following table shows the differences between ext2, minix and
cramfs.
Filesystem | Advantage | Disadvantage |
ext2 | Compatiable with other Linux Distribution | No compression, large fs overhead |
minix | Small foot print, read/write | No compression |
cramfs | Compress fs | read only |
To select what packages to put in the root filesystem, edit Makefile.
Add or remove the package that you want to put in the root filesystem