Tuesday, June 30, 2009

Running Ubuntu 9.04 kernel on QEMU

Install QEMU
Download QEMU
Extract the package, build and install it.
cd qemu-0.10.5
./configure
make
make install

Build BusyBox
Download it here.
make defconfig
make menuconfig
make
make CONFIG_PREFIX=$bb_install_path install
In menuconfig goto 'Build Options' and set 'Build BusyBox as a static binary'.

Create rootfs image for QEMU
Create file image for rootfs.
Make ext2 filesystem.
Mount image to populate.
Copy BusyBox into mounted filesystem image
dd if=/dev/zero of=rootfs.img bs=1k count=100k
mke2fs -F -m 0 rootfs.img -t ext2
mount rootfs.img /mnt/qemu -t ext2 -o loop
rsync -a $bb_install_path /mnt/qemu

Then create the rootfs
cd /mnt/qemu
mkdir dev etc etc/init.d bin proc mnt tmp var var/shm
sudo chmod 755 . dev etc etc/init.d bin proc mnt tmp var var/shm

cd dev
sudo mknod tty c 5 0
sudo mknod console c 5 1
sudo chmod 666 tty console
sudo mknod tty0 c 4 0
sudo chmod 666 tty0
sudo mknod null c 1 3
sudo chmod 666 null

cd ../etc
echo "::sysinit:/etc/init.d/rcS" > inittab
echo "::askfirst:/bin/sh" >> inittab
sudo chmod 644 inittab

cd init.d
echo "mount -a" >> rcS
sudo chmod 744 rcS

cd ..
sudo echo "proc /proc proc defaults 0 0" >>fstab
sudo chmod 644 fstab

cd ~
sudo umount /mnt/qemu

Running the image on QEMU
You can find the vmlinuz image in /boot folder
Issue the command
qemu -kernel /boot/vmlinuz-2.6.28-11-generic -hda rootfs.img -append "root=/dev/sda"

Friday, June 19, 2009

Intel integrated graphics driver setting in Ubuntu 9.04

Activate UXA, use Option "AccelMethod" "UXA" in the Section "Device" in /etc/x11/xorg.conf
Section "Device"
Identifier "Configured Video Device"
Option "AccelMethod" "UXA"
EndSection
Logout and login for the changes to take effect. This setting gave a good video performance boost to my Ubuntu setup. The performance measured by 'glxgears' increased from 270 FPS to 560 FPS.

Tuesday, June 2, 2009

Mp3 Support in Amarok 2 on Ubuntu 9.04

Mp3 files were not playing in Amarok, even though they were playing on Rhythmbox and VLC. First I installed gstreamer0.10-plugins-ugly, but that did not solve the problem. Installing 'libxine1-ffmpeg' solved the problem.
sudo apt-get install libxine1-ffmpeg