<p>1) Create workspace (e.g.:

<p>2) Download the linux kernel image from here.</p>

<p>3) Download latest kernel
# bzip2 ­d linux­.x.xx.tar.bz2
# tar ­xvf linux­.x.xx.xx.tar</p>

<p>4) Download Busybox from here
# tar ­xvzf busybox­xxx.tar.gz</p>


<p>5) Now creating the kernel:
# cd linux­xxx
# make allnoconfig
# make menuconfig</p>

<p>I used the following setting :</p>

<p>Executable file formats ­>  Kernel support for ELF binaries ­> YES </br>
File systems ­> Second extended fs support ­> YES </br>
Device Drivers ­> support ­> support > YES </br>
Enhanced support ­> YES </br>
Include IDE/ATA­2 DISK support ­> YES </br>
Use multi­mode by default ­> YES
</p>

<p># make</p>

<p>6) Now Creating the filesystem
# cd ../
# dd of=rootfs.img bs=1024k count=1
# mkfs.ext4 i 1024 ­F rootfs.img</p>


<p>7) Now Creating the Busybox
# cd busybox­xxx
# make menuconfig
Busybox Settings ­> Build Options ­> Build BusyBox as a static binary ­> YES
Busybox Settings ­> Build Options ­> Build BusyBox with a Cross Compiler ­> YES
Busybox Settings ­> Build Options ­> Cross Compiler prefix:

Coreutils ­> cat chmod chown chroot cp cut date df du echo env false head ln ls mkdir
mknod mv printf pwd rm rmdir sleep sort stat stty sync tail test touch true tty uname
Console Utilities ­> setconsole
Editors ­> vi
Finding Utilities ­> grep
Init Utilities ­> init
Login/Password Management Utilities ­> addgroup delgroup adduser deluser getty login
passwd su
Linux System Utilities ­> more mount umount
Process Utilities ­> free kill
Shells ­> ash
Shells ­> Choose your default shell ­> ash
# make
# make install</p>

<p>8) Creating the node and the required support for the filesystem
# cd ..
# sudo mkdir
# sudo mount ­o loop rootfs.img
# rsync ­a
# sudo mkdir
# sudo mkdir
# sudo mkdir
# sudo mkdir
# sudo mkdir
# sudo mknod c 5 1
# sudo mknod c 1 3</p>

<p>Create file
# This is run first script

# Start an “askfirst” shell on the console

# Stuff to do when restarting the init process

# Stuff to do before rebooting

­a ­r</p>

Create file

mount ­t proc none /proc
mount ­t sysfs none /sys

# sudo chown ­R root.root
# sync

Emulate kernel and filesystem
# qemu ­m 32 ­hda rootfs.img ­kernel ­append \
clock=pit”