Skip to content
michaelko edited this page Apr 8, 2013 · 3 revisions

Memos for myself in the future...

Compile a kernel

For Ubuntu 12.04

apt-get install gcc-arm-linux-gnueabi
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-

(Re)build a initramfs

mkdir initramfs ; cd initramfs
lzop -dc /some/where/initramfs.cpio.lzo | sudo cpio -i
# modify files
sudo find . | sudo cpio --quiet -H newc -o > /some/where/initramfs.cpio
lzop -c -9 /some/where/initramfs.cpio > /some/where/initramfs.cpio.lzo

Update a DTB file

If you updated initramfs (and its file size has been changed), you have to update DTB as well because DTB includes a kernel cmdline which specifies iniramfs size. This is how a part of a DTS file might look like:

chosen {
        bootargs = "rw root=/dev/ram0 console=ttyAMA0 earlyprintk initrd=0x00800000,135433";
};

The number appearing the last of bootargs is initramfs size. In oder to change the DTB file, decompile it to a DTS file with

dtc -I dtb -O dts vexpress-armjs.dtb > vexpress-armjs.dts

Edit the dts file, and compile it:

dtc -I dts -O dtb vexpress-armjs.dts > vexpress-armjs.dtb

dtc command is included in device-tree-compiler package for Ubuntu 12.04.

Build a customized busybox binary

Setup a cross-compiler for ARM.

wget http://www.uclibc.org/downloads/binaries/0.9.30.1/cross-compiler-armv5l.tar.bz2
tar xvf cross-compiler-armv5l.tar.bz2 -C /some/where/
PATH=$PATH:/some/where/cross-compiler-armv5l/bin

Compile a busybox binary.

wget http://busybox.net/downloads/busybox-1.20.2.tar.bz2
tar xvf busybox-1.20.2.tar.bz2 -C /some/where
cd /some/where/busybox-1.20.2
make menuconfig  # Set CONFIG_CROSS_COMPILER_PREFIX="armv5l-"
make busybox
Clone this wiki locally