Steps to create a root filesystem using buildroot and run Linux kernel using QEMU$ git clone git://git.buildroot.net/buildroot
$ cd buildroot
$ git pull
- Change configuration to build for i386
$ make menuconfig
$ make
$ qemu -kernel /boot/vmlinuz -initrd /boot/initrd.img -hda binaries/uclibc/rootfs.i386.ext2 -append "root=/dev/sda rw" -m 1024
Steps to create a bootable disk image using EXTLINUX, buildroot, Linux kernel and run using QEMU- Mount buildroot root filesystem
$ sudo mount binaries/uclibc/rootfs.i386.ext2 buildrootfs -o loop -t ext2
$ dd if=/dev/zero of=rootfs.img bs=1M count=10
$ mke2fs -j rootfs.img
$ tune2fs -c 0 -i 0 rootfs.img
$ sudo mount rootfs.img rootfs -o loop -t ext2
- Copy buildroot to disk image
$ rsync -a buildrootfs/ rootfs
$ mkdir rootfs/boot
- Copy Linux kernel and initial ramdisk to boot directory
$ cp vmlinuz rootfs/boot
$ cp initrd.img rootfs/boot
- Install EXTLINUX bootloader
$ extlinux --install rootfs/boot
$ vi rootfs/boot/extlinux.conf
default linux
timeout 10
prompt 1
label linux
kernel /boot/vmlinuz
append initrd=/boot/initrd.img root=/dev/sda clocksource=kvm-clock
$ sudo umount rootfs
$ qemu -hda rootfs.img -m 1024