Banner

Banner
Ramast
Linux Developer

Wednesday, September 25, 2013

Running MK802 as linux server

The goal:

Installing linux distro on MK802 and it has to
  • Be very light weight
  • Support most USB devices that I might need (Webcam, bluetooth dongle, ...) plus internal wireless lan and video card
  • Support iptables
  • Be easy to install and maintain
  • Has right package repository

First I found this page that offer wide selection of linux distros
http://liliputing.com/2012/07/linux-distributions-that-can-run-on-an-mk802-mini-pc.html

Puppy Linux 

Is very lightweight and can work from memory
That means it won't need to constantly writing on the SD Card which will extend its life.
Also means it will be very fast.
However when I clicked on the link I found that its development has been discontinued.

Miniand Lubuntu 12.04

was my choice  because Ubuntu has very good support for different devices and with Lubuntu I get a light version too.

Turns out Lubuntu didn't support my webcam, I had to download & compile the corresponding kernel modules manually for it to work

After that I found it doesn't support iptables because of missing kernel modules
This time compiling the corresponding modules wasn't enough.
I had to compile the kernel itself. and no matter what I do any kernel I compile fails to boot.

Debian Server


Was my next distro, I downloaded it from this link
http://romanrm.ru/en/a10
and it was really amazing.
extremely lightweight, not so many services, no X11 not even vim!
iptables and my webcam were working like a charm.

only one problem though, I couldn't see anything!
The server doesn't support any graphics card so even installing X11 didn't help. xorg won't start.

I contacted the developer "Roman Mamedov" and explained the problem to him and his answer was:

This is because the image uses a kernel which disables all graphic components
to save RAM (about 100 MB). If you want Mali, you need to replace the kernel
with a Desktop or Video variant from http://romanrm.ru/en/a10/kernel 
 
I followed that link, there you will find two other kernels along with their installation instructions.
I installed the Desktop kernel and now everything is working perfectly fine.

Thank you  Roman Mamedov for this great distro

Emulator  for MK802


The next thing I needed is an emulator to run the debian image on, install all development stuff plus kernel source to compile any extra drivers I might be missing.

For that I found qemu very handy
I followed the guide here
http://romanrm.ru/en/a10/qemu

Basically you need to download kernel files
initrd.img-3.2.0-4-vexpress


linux-image-3.2.0-4-vexpress_3.2.35-2_armhf.deb


vmlinuz-3.2.0-4-vexpress


from http://romanrm.ru/dl/a10/kernels/qemu/

Then run quemu
qemu-system-arm \
  -M vexpress-a9 \
  -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress \
  -append root=/dev/mmcblk0p2 \
  -drive if=sd,cache=unsafe,file=image.im