I’ve seen quite a few people who want to use the Mele A1000 – or its brother the Mele A2000 – media player as a server (Sacrilege!). Since recent ARM servers are running Ubuntu 12.04, and Tom Gall has (conveniently) posted the live-build config necessary to generate Ubuntu 12.04 Server image this week, I thought I’d give it a try on Mele A1000.
The image generated is a headless system running Apache 2 and sshd (openssh_server). I’ll detail the steps I followed to generate this image first, so if you just want to try the SD card image, scroll down at the end of the post.
The first step is to generate Ubuntu Linaro Server rootfs, by following the Live-Build instructions on Linaro website together with Tom’s live build config. I’ve followed those steps in a machine running Ubuntu 12.04.
Let’s install the required packages:
sudo add-apt-repository ppa:linaro-maintainers/tools sudo apt-get update sudo apt-get install live-build multistrap qemu-user-static git p7zip-full
Configure the build and start the build:
mkdir dirforbld ; cd dirforbld bzr branch lp:~tom-gall/linaro/live-helper.config.precise.server config cp config/conf_create.sh . sed -i -e "s/bootstrap debootstrap/bootstrap multistrap/" conf_create.sh sh ./conf_create.sh sudo lb clean sudo lb build
After a while, you’ll get the rootfs with the file name binary-tar.tar.gz which I renamed to ubuntu-server-12.06-armhf.tar.gz . If you want to skip that step, you can download ubuntu-server-12.06-armhf.tar.gz (180 MB).
Now we want to build the hardware packs for Mele A1000 using the server config in order to get as much as memory as possible for Linux. For this purpose, I’ve created a new config (mele-a1000-server) that disables video output in order to increase the memory available for Linux.
First install the scripts:
git clone git://github.com/cnxsoft/a10-tools.git
Then build the hardware packs:
cd a10-tools ./a10-hwpack-bld mele-a1000-server
You just find the hardware pack in a patch similar to bld_a10_hwpack_2012.06.21/mele-a1000-server_hwpack_2012.06.21.7z. Here’s the binary which you can also use for another server distribution.
Now you can create an SD card running Ubuntu Server as follows:
./a1x-media-create.sh /dev/sdb mele-a1000-server_hwpack_2012.06.21.7z ubuntu-server-12.06-armhf.tar.gz
At this stage, you’ll need to a serial terminal to use the image, because eth0 is not enabled by default and sshd keys are missing. Let’s complete a few more step so that it can be used with the serial adapter.
Insert the SD card in Mele A1000, connect to the terminal via Putty / Minicom and once you get to the prompt, edit /etc/network/interfaces and add:
auto eth0 iface eth0 inet dhcp
The other “issue” is that although sshd is running, it can’t be accessed because the keys haven’t been generated. Running those commands will generate the keys:
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key service ssh restart
or simply run:
apt-get install --reinstall openssh-server
That’s all. We now have a (fully?) functional Ubuntu precise server running in Mele A1000 with 435 MB total memory, 106 MB used and 328 MB free:
free -m total used free shared buffers cached Mem: 435 106 328 0 4 48 -/+ buffers/cache: 54 381
[Update: It is possible to get the full 512MB memory for Linuxby adding "mem=512M" to extraargs in u-boot. The changes have been committed to github. Here's the hardware pack for 512MB memory]
As promised at the beginning of the post, here’s the server SD card image (Nearly 1GB 121 MB*) that you can copy to an SD card using dd or Win32DiskImager. As long as you have a DHCP server running on your LAN, you should be able to login to the Mele A1000 via ssh using linaro user with the password linaro.
* After using the command
sfill -z -l -l -f mnt
on the ext4 partition of the SD card, I managed to reduce the compressed size of the SD card image from ~1 GB to ~120 MB!