Review of the “Build, Build, Build” Program: Implications ...
Build uBoot
Transcript of Build uBoot
Build Boot-loader Image
Download a source copy from the mini2440 u-boot project into the /usr/src/bootloader directory and decompress the zip file.
gzip -cd dev-mini2440-stable.tar.gz |tar xvf –
A new directory 'mini2440' is created.
Optionally, change the directory name and make a reference link to the bootloader directory.
mv mini2440 mini2440-1.3.2
ln -s mini2440-1.3.2 u-boot
Create a u-boot configuration file for the target system.
cd u-boot
make clean
ARCH=arm make mini2440_config
Build the bootloader image
ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make
cp -rf u-boot.bin /var/lib/tftpboot
When finish without errors, the u-boot.bin file will be used to flash the u-boot image.
Build Kernel Image
Download a source copy from mini2440 kernel project into the /usr/src/kernels directory and decompress the zip file.
gzip -cd mini2440-stable.tar.gz |tar xvf –
A new directory 'mini2440' is created.
Optionally, change the directory name and create a reference link to the kernel directory.
mv mini2440 mini2440-2.6.32.7
ln -s mini2440-2.6.32.7 arm-linux
Create a kernel configuration file base on the old config_mini2440_n35 file from an earlier version eg. linux-2.6.29 from the Mini2440 package.
cd arm-linux
make clean
cp /usr/src/kernels/linux-2.6.29/config_mini2440_n35 ./.config
ARCH=arm make oldconfig
Press enter to select all the default settings, when finish a new .config file is generated while the old one is save in the .config.old.
Optionally, create a default configuration file if you don't have an existing .config file, this will produce the largest general-purpose configuration.
ARCH=arm make mini2440_defconfig
Change the kernel configuration setting below.
ARCH=arm make menuconfig
Go to 'File Systems' --> 'Network File Systems' --> Select 'NFS client support for NFS' and 'Root file system on NFS'
--- Network File Systems
<*> NFS client support
[*] NFS client support for NFS version 3
[*] NFS client support for the NFSv3 ACL protocol extension
[*] NFS client support for NFS version 4 (EXPERIMENTAL)
[ ] NFS client support for NFSv4.1 (DEVELOPER ONLY)
[*] Root file system on NFS
< > NFS server support
Go to 'Networking Support' --> 'Networking Options' --> Select the 'IP: kernel level autoconfiguration
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[*] IP: RARP support
Go to 'File System' --> 'Pseudo filesystems' --> Select 'Virtual memory file system support'
[*] /proc file system support
[*] Sysctl support (/proc/sys)
[*] Enable /proc page monitoring
[*] sysfs file system support
[*] Virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
Build the kernel image.
ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make zImage
cp -rf arch/arm/boot/zImage /var/lib/tftpboot
Build the kernel modules, if there are modules setup in the configuration file.
ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make modules
ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- make modules_install
Finally, compressed the kernel image to include checksum and header records require for use with u-boot.
mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -d ./zImage ./uImage
Image Name: Created: Tue Mar 2 22:51:28 2010
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2053096 Bytes = 2004.98 kB = 1.96 MB
Load Address: 30008000
Entry Point: 30008000
When finish without errors, the uImage file will be used to flash the kernel image.
Build System Tools and Utilities
Download a source copy from busybox into the /usr/src/toolchain directory and decompress the zip file.
cd /usr/src/toolchain bzip2 -dc busybox-1.16.0.tar.bz2 |tar xvf -
A new directory 'busybox-1.16.0' is created.
Make a reference link to the busybox directory.
ln -s busybox-1.16.0 busybox
Create a busybox configuration file base on the old fa.config file from an earlier version eg. busybox-1.13.3 from the Mini2440 package.
cd busybox
make clean
cp /usr/src/toolchain/busybox-1.13.3/fa.config ./.config
ARCH=arm CC=arm-linux-gcc-4.4.1 make oldconfig
Press enter to select all the default settings, when finish a new .config file is generated while the old one is save in the .config.old.
Optionally, create a default configuration file if you don't have an existing fa.config file , this will produce the largest general-purpose configuration.
ARCH=arm CC=arm-linux-gcc-4.4.1 make oldconfig
Change the configuration setting below.
make menuconfig
Go to 'Busybox Settings' --> 'Installation Options' --> Change the busybox installation prefix to './_install'
[ ] Don't use /usr
Applets links (as soft-links) --->
(./_install) BusyBox installation prefix
Go to 'Busybox Settings' --> 'Build Options' --> Change the cross compiler prefix to 'arm-linux'
[ ] Build BusyBox as a static binary (no shared libs)
[ ] Build BusyBox as a position independent executable
[ ] Force NOMMU build [ ] Build shared libbusybox
[*] Build with Large File Support (for accessing files > 2 GB)
(arm-linux-) Cross Compiler prefix
() Additional CFLAGS
Build the busybox system.
ARCH=arm CC=arm-linux-gcc-4.4.1 make
ARCH=arm CC=arm-linux-gcc-4.4.1 make install
When finish without errors, the _install system folder will be used tobuild the root filesystem.