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:
1 2 3 |
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:
1 2 3 4 5 6 7 |
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:
1 |
git clone git://github.com/cnxsoft/a10-tools.git |
Then build the hardware packs:
1 2 |
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:
1 |
./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:
1 2 |
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:
1 2 3 4 |
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:
1 |
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:
1 2 3 4 |
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
1 |
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!
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
hey if the wifi, and gpu can be switched off in the kernel/fex it will make a great low power low cost replacement for my little plugs … hopefully running debian wheezy .. come on A1000 boards arrive at my house soon soon !!!
As i understand it as it stands the A1000 is pretty useless for anything meaty linux video wise until decent drivers are available .. prob. months away …
Is this platform really practical for a server? What kind of Iperf performance have you seen using ethernet?
It’s amazing no one has yet made a image that burns into the main device memory. A stage that will need to be crossed to gain speed increases.
@ Mark
The big pitfull is 32bit. No mainstream ARM chip yet 64bit.
A server running say PHP is nice to have 64bit integers for speed, constants and other computation reasons.
ARM wont be big in server fields until they are 64bit.
“To use this image, you’ll need to a serial terminal, because eth0 is not enabled by default.”
Other words you need a device connected to the USB? A UART Dongle some have made or been supplied by Mele reseller.
Others words if you don’t have an UART Dongle then don’t download this.
@e8hffff
you can get these for $20 incl shipping from the guy on Aliexpress) from ebay … comes via HK post so far better than china post .. so in my case I paid GBP 1.78 (uk ebay) for the item plus cables incl shipping and it works perfectly (i ordered a couple extra at this price as spares 😉
@ mac me
The GPU and video output are already disabled in this image, but I kept Wi-Fi. My wild guess is that if you don’t load the WiFi drivers (I load the module at boot time automatically now), WiFi would not use power.
A more brutal approach would be to unsolder the Wi-Fi module on the board (Close to the IR sensor and LEDs).
@ e8hffff
For now, I only have one Mele A1000, and I also use Android. So I won’t try that personally yet.
The image I provide now have a few error messages at boot time. Ubuntu seems to use things like initrd / initramfs and upstart which I’ve never used in other systems I worked on. So the image does not have an initrd right now, and for example ureadahead (use to reduce boot time) fails, as fail as some others process. But after boot, everything seems alright. Still more work is needed.
@ e8hffff
As I mentioned, at the end of the post, you don’t need the USB to TTL to use the SD card image provided because I enabled networking (eth0) and ssh already. So you just need to find Mele IP address either with Wireshark or your router client list. I’ll update the post to make that more clear.
On another note, I’ve seen Calxeda processor has 2 UART ports, so I suppose one of those might be used for configuration in the server.
@ mac me
It’s also available on Aliexpress for 7.74 USD inc. shipping. That’s exactly the one I use, and the seller will also include the cables (Just make sure to ask).
@ Mark
I’ve done 2 quick tests. 192.168.0.102 a virtual machine (VirtualBox) running Ubuntu and 192.168.0.105 is the Mele.
iperf -c 192.168.0.102
————————————————————
Client connecting to 192.168.0.102, TCP port 5001
TCP window size: 16.0 KByte (default)
————————————————————
[ 3] local 192.168.0.105 port 55037 connected with 192.168.0.102 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 63.4 MBytes 53.1 Mbits/sec
iperf -c 192.168.0.105
————————————————————
Client connecting to 192.168.0.105, TCP port 5001
TCP window size: 21.0 KByte (default)
————————————————————
[ 3] local 192.168.0.102 port 58340 connected with 192.168.0.105 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 73.2 MBytes 61.3 Mbits/sec
There are apparently performance issues with the ethernet driver (Wemac), see https://github.com/amery/linux-allwinner/pull/39.
Once this is fixed, we could be closer to the 100 Mbits/sec limit.
@ cnxsoft
Thanks for running those iperf benchmarks. It’s about what I expected. I briefly tested a gigabit USB->ethernet adapter on an A10 tablet and got even lower @ ~25 Mbit/sec.
How was the CPU usage during your tests? Was it maxed out?
@ Mark
The CPU is between 50% to 75% idle during iperf test.
Could you explain how to customize the kernel configuration to get the maximum memory?
@ Yury
The kernel config is here: https://github.com/cnxsoft/a10-config/blob/master/kernel/mele-a1000-server.config
and script.bin: https://github.com/cnxsoft/a10-config/blob/master/script.fex/mele-a1000-server.fex
I basically followed the instructions available @ http://rhombus-tech.net/allwinner_a10/hacking_the_mele_a1000/#index5h1 (See “Update:”) that is disabling the GPU and video output in the kernel and script.bin.
@ cnxsoft
I had to add explicit “mem” option to get all memory, otherwise it was using only 448M for some reason.
@ Vayu
Do you mean you added mem=512M in the boot command line and now you have 512MB for Linux?
There is some reserved memory, so I would be surprised if that works, and the system is stable with that trick. But if it really works reliably that an easy hack, and I’ll add that to github.
@ cnxsoft
Yes, I did it in kernel config, since I don’t know how to change cmdline in bootloader.
CONFIG_CMDLINE=”mem=512M@0x40000000″
# CONFIG_CMDLINE_FROM_BOOTLOADER is not set
CONFIG_CMDLINE_EXTEND=y
AFAIK the upper 64M are reserved for MALI GPU, if it is disabled there should be no problem in using them. Still have to test it more extensively.
Very good Job. Exactly what I am locking for.
Respect !!!!!!!
By the way – What is the password for user ‘root’ in the Image?
@ GermanNorbert
Sorry, I don’t know the root password, I just use “sudo” with Linaro user.
I found a way with sudo -su passwd to change the root password.
And now my next question. Is it possible that there no drivers for usb and/or sata in the Image?
I can’t see my Stick on the usb port and also not my FAT32 formatted Sata-HD in the doc.
I tried to install samba. It works but no drives where found.
Thanks in advance
@ GermanNorbert
USB and FAT 32 works for me
mount -t vfat /dev/sda1 mnt
I can’t comment on SATA, I don’t had a drive to test. I’m assuming you are using a 2.5″ SATA drive, right ?
@ GermanNorbert
I forgot to mention Samba.
You can use the command below to list the file systems enabled
cat /proc/filesystems
You can see CIFS (Samba) is enabled, so there must be another issue.
Youre right i use a 2.5 ” Sata drive 160 GB.
The other mention i can only check later because I am at work now (still for 3h)
Sorry. In the moment is no time for the mele. I watch the European Championchip Germany against Italy
It don’t loks good for germany.
We will see us tomorrow
@ Vayu
I’ve added mem=512M to u-boot and it seems to work fine.
I’ve run “memtester 512” to check the memory and all tests passed:
I’m now at the sixth loop without failure, so I’ve committed the changes to github.
@ cnxsoft
I have similar experience (I waited 46 iterations).
It might be useful to completely disable drivers which need reserved memory (and related). Because now Mali reserves memory only implicitly (in boot parameter) and loading the driver is likely to crash the system. G2D seems to be quite broken, because it does not reserve memory at all, while it should take about 16M.
CONFIG_SUN4I_G2D
CONFIG_VIDEO_SUN4I_CEDAR
CONFIG_MALI
CONFIG_LYCHEE_LCD_SUN4I
CONFIG_LYCHEE_HDMI_SUN4I
CONFIG_SND_SUN4I_SOC_HDMIAUDIO
and all video-output related (maybe I missed some)
@ Vayu
All of them are already disabled, except CONFIG_SUN4I_G2D. I don’t have CONFIG_SND_SUN4I_SOC_HDMIAUDIO in my config. https://github.com/cnxsoft/a10-config/blob/master/kernel/mele-a1000-server.config
@ cnxsoft
Ah, sorry I missed the custom kernel commit.
CONFIG_SND_SUN4I_SOC_HDMIAUDIO is hidden under CONFIG_SOUND and CONFIG_SND_SOC
I didn’t have a chance to try it. Though suspect it wont work…
It also might be a good idea to disable some android modules. I disabled these in my config (which is based on yours)
# CONFIG_ANDROID_BINDER_IPC is not set
# CONFIG_ANDROID_LOGGER is not set
# CONFIG_ANDROID_TIMED_OUTPUT is not set
# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
Especially ANDROID_LOW_MEMORY_KILLER is not something anyone would like to see on a server machine.
@ Vayu
Thanks. I’ve just disabled SUN4I_G2D and ANDROID in the config.
Hello, I am back again,
in the interim I have intensely tried my SATA-Hd to run.
Unfortunately, without success 🙁
Can somebody maybe help me??
@ GermanNorbert
Module sw_ahci_platform.ko not loading automatically,
If you want the module SATA loading automatically then edit /etc/modules and at the sw_ahci_platform in a line.
But in this case does not always happen automount, and build a new kernel with built-in SATA module, now all ok.
Sorry for my english.
@ Yury
I have integrated the module like you have described.
Also testet libahci and libata.
Unfortunately, it does not function, nevertheless.
lsmod indicates the module sw_ahci_platform as loaded, but the harddisk is to be found nowhere.
fdisk -l dosent show the disk and no entry in /dev
Has tested 2 harddisks.
I can not make a new Kernel (Newbe).
Can this maybe do someone else for me?
Here is a part from dmesg
[ 130.610000] ata1: exception Emask 0x10 SAct 0x0 SErr 0x4000000 action 0xe frozen
[ 130.630000] ata1: irq_stat 0x00000040, connection status changed
[ 130.640000] ata1: SError: { DevExch }
[ 130.650000] ata1: limiting SATA link speed to 1.5 Gbps
[ 130.660000] ata1: hard resetting link
[ 132.900000] ata1: SATA link down (SStatus 1 SControl 310)
[ 132.900000] ata1: EH complete
(This part repeats endless in the syslog)
@ GermanNorbert
You are not the only one to have this problem, and you may want to follow this issue:
https://github.com/amery/linux-allwinner/issues/40
So some hard drives might work and others not.
@ Yury
Yuri, are you also using the hardware pack above? Or did you modify something else, apart from rebuilding the kernel with SATA built-in ?
@ cnxsoft
Many thanks! I think that is the right place to get the problem solved.
@ cnxsoft
I only add CIFS modules, and code pages for Russian language.
@ GermanNorbert
@ Yury
One last question, could you indicate the brand and model number of your hard drive, it might help finding which ones are known to work, and get the right hdd for people to debug.
@ cnxsoft
My hdd 160Gb Hitachi:
HDD: 5K320-160
MODEL: HTS543216L9A300
@ cnxsoft
how can I find out this?
by the way, I am on the holidays till Monday
@ GermanNorbert
You could find it on the sticker on your hard drive.
Enjoy your holiday…
Hi there
I’m compiling myself a debian root kernel / fs and it works well. The only problem I have is that I can’t get the 512 MB ram (or maybe less) but I just end up with about 320 MB ram available.
Could you point out what exactely is needed to change?
@ SJ
Normally there is nothing to do. Did you use https://dl.dropbox.com/u/45842273/mele-a1000-server_hwpack_2012.06.29.7z ?
hi,
i have a stable headless (not tested sata yet) debian wheezy armhf running now which i compiled from scratch and have only about 360MB total mem .. i have used my own armhf kernel/rootfs and boot.scr/script.bin
what do i need to modify to get 512MB RAM or as close to it as possible .. presumably i need to change whats selected/settings in the compilation process ?
thx
ian
@ mac me
The instructions are above, but if you want to try it, a quick way is to use the hardware pack above as follows:
./a1x-media-create.sh /dev/sdb mele-a1000-server_hwpack_2012.06.29.7z norootfs
The “norootfs” option will not change your existing rootfs (except /etc/modules), on the FAT partition and u-boot.
Or if you need to customize your kernel config: https://github.com/cnxsoft/a10-config/blob/master/kernel/mele-a1000-server.config
+ https://github.com/cnxsoft/a10-config/blob/master/script.fex/mele-a1000-server.fex
Hi,
I have the same question as mac me. Yet I would like to run X. Do you have a mele-a1000 config where 512MB are available? I tried to find the correct file yesterday but could not grep to the correct spot. Now I read you edited the server.config. HDMI would be a sweet thing. 🙂
Greetings, Frank
@ Frank
If you want HDMI output forget about having 512MB memory available, since you need to reserve memory for the framebuffer as well. You can try to disable a few options in the kernel and script.fex to save memory. See http://rhombus-tech.net/allwinner_a10/hacking_the_mele_a1000/#index5h1 for (some) details.
When running X I use the default kernel config and have around 320 MB, which you can improve slightly with the instructions above.
.. i read from the comments here where there was too’ing and fro’ing over kernel config changes and I wondered if there was a final kernel config fully optimised for the 512mb .. hence my qu.
.. i did try just just for fun adding the extra mem512MB uboot change but as expected it made no diff
.. i’ll have a try next at using the mele deb arm hf as a build machine to setup and build hopefully a 512 lean headless setup with the kernel config as guide
thx
I am back again.
In the interim I have explained a lot of test. But everything without success.
I need help!!!!!
By the way, I have several SATA-HDs: Fujitsu, WD, Hitachi and none of them functions.
In Android they all run!?
@ GermanNorbert
If so many HDDs fail that’s probably a bug in the kernel then. It could also be a power supply issue, but the 5V/2A power supply provided with the Mele should be enough. Sorry I can’t help as I don’t have a 2.5″ hard drive.
I give up first !!!!!!
The harddisk is moved back into the cover and connected to the Mele over the USB port.
So I can share via Samba.
When something new happens, I’ll try again.
The next challenge is now, of course, install the SD-Card image on the internal NAND.
Has there been anyone have experience? Or where there is a tutorial for it?
Thanks to all
@ GermanNorbert
No experience, but there is a tutorial: https://www.miniand.com/forums/forums/2/topics/73. Good luck! 🙂
@ cnxsoft
Thanks for the quick reply.
I will soon try and report back here.
Can you explain better how do I create write the image to a SD card?
The file you provided is a .bin, when I try to burn it using Win32DiskImager, it doesn’t do anything..
Do I need to do anything to the .bin file 1st? BTW, I only have Windows to work with..
Thanks!
@CZ
Hmm.. I extracted the .bin file and I see a .img file there.
Going to use Win32DiskImager and see if that .img is good!
@CZ Hmm.. I extracted the .bin file and I see a .img file there.
Going to use Win32DiskImager and see if that .img is good!
Nope… still can’t write the .img found in the .bin file…
@ CZ
After you decompress ubuntu-precise-server-linaro-mele-a1000.bin.7z (https://dl.dropbox.com/u/45842273/ubuntu-precise-server-linaro-mele-a1000.bin.7z), you should get a 4 GB image. You should then be able to use that image with Win32DiskImager on a 4GB SD card or larger. Does the Win32DiskImager part succeed? Win32DiskImager should just be a “dumb” tool, in the sense that it does not check the data, it just takes whatever data you provide and writes it to the SD card. The only reason is may fail if if your SD card is too small or is not writable.
@cnxsoft
Yes, I can decompress the .7z file and I get a .bin file. I can force Win32DiskImager to write the .bin file to a SD card (I’m using a 32GB card), and it finishes OK with no errors. However, I don’t see any files or anything being written into the SDCard (maybe because it’s in EXT and not FAT or NTFS?)
Then when I try to boot the MeleA2000 with the card, I get no display, and I don’t see any IP in my DHCP server. It seems that the MeleA2000 is just sitting there, not booting up at all..
Any ideas? Thanks for replying so fast!
@ CZ
There are 2 partitions: FAT32 and EXT-4, so I think you should be the FAT32 on in Windows. It’s normal, you don’t get any display with that image, since video output is disabled. You could use Wireshark to see if you receive any messages.
If you had a USB to TTL debug board it would help, but I have the feeling you don’t.
@cnxsoft
Well, let me try again soon. I just got my Rasberry Pi, so going to be playing with it for now 🙂
Thanks for your help!
@CZ
BTW, I finally got it to work! My MeleA2000 is now an Ubuntu server! Woohoo!
Thanks for all your help!
I tried the scenario on a freshly installed Ubuntu 12.04 server, 64-bit Athlon…
first, these packages were missing:
sudo apt-get install python-software-properties bzr
but then the “sudo lb build” was running for about an hour, and ended up with:
Hit http://ports.ubuntu.com precise-security/universe Translation-en
Hit http://ports.ubuntu.com precise-updates/main Translation-en
Hit http://ports.ubuntu.com precise-updates/universe Translation-en
Fetched 1238 kB in 7s (174 kB/s)
Reading package lists… Done
P: Installing diversions
Leaving ‘diversion of /bin/sh to /bin/sh.distrib by dash’
Leaving ‘diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.1.gz.distrib by dash’
Reading package lists… Done
qemu: uncaught target signal 11 (Segmentation fault) – core dumped
Segmentation fault (core dumped)
P: Begin unmounting filesystems…
P: Saving caches…
the final filesystem was not built…
@ Stanislav Sinyagin
oh oh. It does not look good, qemu crashes with a segfault.
I wonder if this could be related to https://bugs.launchpad.net/ubuntu/+source/qemu-linaro/+bug/1017847
I don’t really know the details about the live-build part, you may try to ask on http://fullshovel.wordpress.com/2012/06/18/new-life-into-a-linaro-based-server-image/
@ Stanislav Sinyagin
hmm, after cleaning and building again, it seems to succeed. I should probably replace my old Athlon PC
@ cnxsoft
it’s definitely a problem with my build machine, so no worries, I’ll come back when I get a new one 🙂
hi,
was there a resolution to the sata drive bug ? .. i have the same issue with an old 60GM toshiba 2.5″ that ive been using to test with … unless the mobo limits the power the drive gets (this drive is pretty low power) i cant see it being a power issue (usually if theres a power issue anyway the 2.5 inch drive no longer spins at full speed) .. ive swapped out the sata cable in the mele with 2 different known working ones and still the same error issues .. so maybe a driver issue ?
well, looks like it’s not only my machine that makes the problem.
every time I start from “mkdir dirforbld”, then “sudo lb build” is stuck in a forefer loop, with the last messages as follows:
All runlevel operations denied by policy
invoke-rc.d: policy-rc.d denied execution of stop.
then I do “sudo lb clean; sudo lb build”, and the procedure finishes successfully.
So, something is wrong with the scripts.
@ Stanislav Sinyagin
ok, I’ve added “sudo lb clean” before “sudo lb build” in the instructions. Hopefully lb clean also works before lb build is ever called.
Hi, it’s me again 🙂
I got the Server Image working on my A2000 and I updated to the latest Hardware packs using the A1-mediare-create.sh
Now, I’m trying to create the rootfs myself (I got a Ubuntu 12.04 lts system now). After executing all the steps (including the sudo lb clean), the process finishes, with many warnings, but I don’t see any .tar.gz file. All I see is a chroot directory in the dirforbld folder.
The last lines of the build process were:
P: Begin copying chroot…
P: This may take a while.
cp: cannot create regular file ‘chroot/usr/bin/./qemu-arm-startic’: Text file busy
P: Begin unmounting filesystems…
P: Savings caches..
Then it ends..
Any ideas? Thanks !
@CZ
Hmm.. Never mind, I just re-run again: sudo lb clean, then sudo lb build and this time, no errors.
I see the binary-tar-tar.gz !!!
@ CZ
That’s my favorite kind of problems. The problems that fix themselves 🙂
@cnxsoft
Thanks a lot for all your work! I’ll be building my own image soon, once the USB to UART adapter & cables come in.
I’ve learned a lot so far… not bad for someone who knew very little Linux just a week ago 🙂
how do I do to activate wifi?
i ve been using wired connection but I find it pretty slow
@jj benitez
You just need to edit /etc/network/interfaces file, in case you don’t know how to do there’s plenty of documentation on the web.
@cnxsoft
thanks, got it working
the only problem is that when system load is too high, I can t reach the server anymore (sometimes I can still access via samba) and I have to manualky reset the Mele to get it working again
so I m back with the wired connection now
hi,
i tried to follow the steps described above.
i used
bzr branch lp:~tom-gall/linaro/live-helper.config.precise.server
cp live-helper.config.precise.server/conf_create.sh .
sed -i -e “s/bootstrap debootstrap/bootstrap multistrap/” conf_create.sh
but if i run
sh ./conf_create.sh
i get this:
P: Updating config tree for a ubuntu system
./conf_create.sh: 58: ./conf_create.sh: cannot create config/includes/precise/common/boot/filesystem.dir/etc/hostname: Directory nonexistent
sed: can’t read config/includes/precise/common/boot/filesystem.dir/etc/hosts: No such file or directory
acutally config/includes is empty!? what’s wrong here? did i miss something?
thanks
@me here
found the problem: forget to add CONFIG argument :/
you can delete my post – everything works fine 🙂
@me here
I’ll leave the comment, maybe somebody else with have the same “issue”.
is it possible to use your a1x-media-create.sh script to create an image file (that can be used with dd later) instead of writing to SD card?
@me here
I think so, as somebody (abgoyal) added support for loop devices. But I don’t know how to use it yet.
Here’s the commit – https://github.com/cnxsoft/a10-tools/commit/ceb92d2cf1fe679440ca20e41ec1a225ec39b3ae
You could post you comment there, abgoyal might reply.
@cnxsoft
thx, i will give this a try later.
today i received my a2000 and thanks to your nice work i got it running as server!
hd works fine as well, however it seems that sata and sd are using the same hardware-interface, IO subsystem or whatever.
unfortunately there is not much difference between sata and sd speed 🙁
i used hdparm -tT for testing. this is very sad – if sata is as slow as SD it sort of usesless 🙁 and the nand seems to be even slower.
well, however you did a nice job! 😉
you used android kernel for the server – is this correct? is it possible to build normal linux kernel 3.4 or 3.5 for mele or are there any issues (hardware not working because of lack of drivers?) – are there any instructions (links) howto build your own linux kernel for mele?
again thanks – great work so far!
this may be the reason why SATA works for some people and not for others … would love to get SATA working on my mele so fingers crossed something like this is the reason
——————————————————————————————————
Hi,
done some testing and quite a trial and error elimination on kernel config and eliminated it as an issue (with my newbie knowledge of kernel config) other than the allwinner sata driver having to be activated ..
googled quite a bit and interestingly libata/etc had an issue at around kernel 2.6 where hot plug was brought in and caused the same errors with certain drives (WD an example) .. coincidently I have tried a hotplug WD 640MB 2.5 SATA as well and saw the same errors as the old toshiba sata drive ive been using for testing … these issues were dealt with i think on the iMX53 for example by patching libata .. and they state an emergency workaround of depending on which article you read adding libata.force=norst, libata.force=noncq, libata.noacpi=1 to kernel options … I tried to add these to boot.cmd/convert to boot.scr .. but i think probably my lack of knowledge on the format of these commands screwed it up :
boot.cmd:
setenv bootargs console=ttyS0 root=/dev/mmcblk0p1 extra ‘rootfstype=ext4 rootwait mem=512M libata.force=norst’
ext2load mmc 0 0x43000000 boot/script.bin
ext2load mmc 0 0x48000000 boot/uImage
bootm 0x48000000
heres an excerpt of a Mx53 post
— don’t ask how many times I re-compiled the kernel.
I did trace the problems I having to the ahci code in the kernel not properly handling an ahci CONINIT event generated by my WD5000BEVT drive. Seems this drive has extra SATA features implemented so that it can be used in hot-plug arrays and these features aren’t recognized by the kernel driver so it just seems to shut down the drive and ignore it. The other SATA drive that I do have working with the kernel doesn’t implement the extra features so the kernel is happy. Presumably these problems were fixed in later kernels and the patches didn’t make it into Freescales 2.6.35.3 branch. On the other hand, the kernel might be fine and the firmware in the drive isn’t conforming to the ahci specs, but I think that wold cause problems with the drive on other systems. I’m going to keep looking into this as I do want to get my 500GB SATA drive working with the iMX53 Quick Start.
So, if you add the following kernel option during installation and afterwards for every boot, the disk seems to work quite well libata.force=norst
So here I am .. ive come to the conclusion that its either a duff sata board connection on my mele (i should really see if it works in a stock old mele android to eliminate this) or a libata and/or allwinner sata driver which needs updating to cope with common sata drive commandsets
@me here
I’m using the default branch of https://github.com/amery/linux-allwinner which is 3.0.39 right now, but they also have a branch for Kernel 3.4 (incomplete) – https://github.com/amery/linux-allwinner/tree/linux-sunxi-3.4.
Everything is built with scripts: https://github.com/cnxsoft/a10-tools. The one to build the hardware packs (inc kernel and u-boot is: https://github.com/cnxsoft/a10-tools/blob/master/a10-hwpack-bld.sh
This is now built nightly: http://www.cnx-software.com/2012/07/20/nightly-builds-for-allwinner-a10-u-boot-linux-kernel-and-hardware-packs/
@cnxsoft
thx!
i will try to build my own linux 3.4 kernel soon.
i think android kernel is a bad choice if you want to run mele as server – it can cause several misc issues running software that is written for linux kernel (i dont remember exactly why, but i read this somewhere)
what does “incomplete” mean? i read “incomplete/dev” on github as well, but i am new to this stuff. is there any documentation about features that work/do not work with kernel 3.4? how can i check this in advance? or is there only the “issues” section on git?
i have another stupid question. i know you cannot mix armhf and armel libs/binaries. do i have to build a special armhf kernel or is the kernel independent from this?
@me here
Kernel 3.0 source code was the one used in Android, but the way it’s build now is just for Linux, and it would not be able to run Android (unless you re-enable the Android stuff in the config and rebuild it.).
I don’t know what is missing in Kernel 3.4, you could get the issue tracker, ask on the arm-netbook mailist list or IRC.
I found that it was possible to mix armel kernel / modules with armhf rootfs. But now everything is built using the arm-linux-gnueabihf- toolchain, at least in the nightly build.
@cnxsoft
android kernel causes issues.
i just tried to run vlc to test streaming, but vlc thinks i am root even i am not logged in as root and it is not allowed to run vlc as root…
thus i had to compile a patched version of vlc in order to run it “as root” … i think this is issue is caused by android kernel, never had this issue before. (btw: streaming works nice, but for transcoding the cpu is not strong enough… i wish i could do this with gpu, but i think you can do this only with mali 6xx)
now i have setup a system do compile my own kernel, but what do i have todo to build an armhf kernel?
i used this command, but i think it builds armel kernel:
“make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j3 uImage”
so i replaced CROSS_COMPILE=arm-linux-gnueabi- with CROSS_COMPILE=arm-linux-gnueabihf-
but this command does not exists on the squeeze system i have setup in order to compile kernel
(i followed kernel compile guide @rhombus)
any help?
thanks
@me here
Video Transcoding should be possible with the video engine (in theory) and this is not related to the GPU.
You can install linaro toolchain: https://launchpad.net/linaro-toolchain-binaries/trunk/2012.07/+download/gcc-linaro-arm-linux-gnueabihf-2012.07-20120720_linux.tar.bz2
I’m assuming arm-linux-gnueabihf- automatically compiles for armhf, but you might also need to add an option (something like -mhard-float) to build an armhf kernel.
I’m trying to get audio working on the server (trying to build a music player for the family room using mpd with a web interface). The server image is working beautifully, but there don’t appear to be any audio drivers. I’ve read through these instructions & taken a look at the config files on github & it looks to me like the audio drivers are disabled in the build – is that correct?
@Dave
You’re correct audio is disabled in the config. You’d have to enable audio, but not HDMI, if you want to play audio and still keep 512 MB for Linux.
If you can do with 320 MB Linux memory, use the default Mele A1000 hardware packs in the nightly builds instead of the server one.
@cnxsoft
Thanks for your feedback. Can you let me know if I’m on the right track with this?
I used bin2fex to convert the script.bin on my SD card to a .fex file. I changed the “audio_used” value to 1 and used fex2bin to rebuild the script.bin file. I placed that on my SD card and rebooted my Mele. Next, I did an “apt-get –purge remove linux-sound-base alsa-base alsa-utils alsa-tools” and reinstalled the linux-sound-base, alsa-base, and alsa-utils packages.
I’m still getting an error “no soundcard found” when I try “aplay -l”.
I’m comfortable administering linux servers, but I’m new to the world of linux audio. I’m sure there’s a step I’m missing somewhere.
Thanks
Sorry, I posted that before I read your whole reply. I have tried the VGA hardware pack linked to in this post, but with no luck. I used the same process as in my earlier reply (purge old packages & reinstall). Do I need to use a different kernel as well? This is going to be a headless system, so I’m hesitant to use the desktop ubuntu image.
@Dave
Sorry, I don’t know enough about the audio system. You could try Ubuntu Desktop and see if that works, then see what’s needed to make it work on your headless system.
If audio does not work on your Mele with Ubuntu desktop, I recommend you ask on arm-netbook, you are more likely to get a useful answer.
@cnxsoft
No problem. Thanks for all your help!
@cnxsoft
hi again,
first of all using the gpu for transcoding would be really nice, but we need a software that supports it 🙁
now im am almost ready to build my own kernel and filesystem, but i still have a question concerning the hardware-pack.
as far as i understand the hardware pack contains the closed source drivers.
1) where did you download the binaries (i know you have stored them on github, but where is the original source?)
2) it seems only openGL drivers for mele are close source – am i right?
3) as i will build my own kernel (linux kernel 3.4 and not android kernel) i wonder if the binaries work at all with linux3.4?
afaik linux modules must match kernel version – does this apply to the closed source libraries as well or should they work with any kernel?
4) i assume the closed source binaries are armel and not armhf – right?
5) for plain server we don’t need a hardware pack at all – unless we could use mali for transcoding – right? 😉
thanks again for your support – now i just have to wait for my usb adapter to get console
@me here
1) http://rhombus-tech.net/allwinner_a10/Compile_X11_driver_for_A10/
2) Yes
3) Libs will work
4) Those are armhf lib
5) “Hardware packs” are mainly there to make it easy for people to test the latest u-boot/kernel without having to build it themselves.
@cnxsoft
thx again…
i have already played around with my own kernel (3.4) and it works nice (building wifi modules fails, but at the moment eth0 is ok for me) – i use your filesystem (still waiting for my usb-device to get console.)
now i have another question:
your fat partition contains
mele-a1000-server.scr
script.bin
i understand that the script.bin is the configuration file for mele device
and i understand that mele-a1000-server.scr is uboot configuration file
but in mele-a1000-server.cmd (on git) and in .scr you use this command
setenv boot.scr ‘if fatload mmc 0 0x44000000 boot.scr || ext2load mmc 0 0x44000000 boot.scr || ext2load mmc 0 0x44000000 boot/boot.scr; then source 0x44000000; fi; true’
shouldn’t be the file mele-a1000-server.scr renamed to boot.scr in order to get loaded?
@me here
Yep, that was a bug, I committed a fix in github. Thanks.
@cnxsoft
well, as i am still waiting for my usb adapter to get console i changed script.bin to get vga:
disp_init_enable=1
screen0_output_type = 4
screen0_output_mode = 0
this should give me 1680×1050 vga output, but all i get is a black screen!?
it seems my tft gets a vga signal, but no visible console…
switching to vga works with original mele rom – so this is no hardware issue
any ideas? did i miss something?
@me here
Are you using the kernel in the server hardware? All video outputs have been disabled in order to get maximum memory. If you need VGA output use mele-a1000-vga hwpack.
@cnxsoft
first i used my own kernel
now i used your nightly vga_hwpack (kernel 3.0.39+)
same issue: my monitor does an autosync, but that’s it – the screen remains black
i can connect via ssh, so the system is running
@me here
It seems there is a problem, as another person does not get display either on arm-netbook mailing list.
@cnxsoft
hmm, thats bad news
i tried it with initramfs, other resolutions (as my monitor gets a signal i hoped this would fix the problem)
is it possible that something may be missing in the kernel or is this more likely a driver issue?
@me here
I’ve tried it today, and HDMI works for me using the latest mele-a1000 hwpack + linaro alip 12.05 rootfs.
@cnxsoft
well i have no HDMI port on my monitor, so i have just tested VGA. if you say HDMI works, than it seems that the VGA driver (disp.ko?) is somehow broken or not proper initialized. as is said my monitor gets a VGA signal, but the screen remains black, so maybe it just gets the wrong resolution. i tried to pass vga= argument to kernel with serveral resolutions, but this did not help at all.
now i am quite familar with building my own kernel filesystem, configs etc. and i found ways around the need of console (mounting+copying required files), but i would really like to get a vga-console output, but i don’t know what else i can do or how to debug this. any ideas are welcome.
@me here
Sorry, I forgot you used VGA. I actually tried both HDMI and VGA. I can’t remember the VGA resolution, but it’s set in the fex file (maybe 1280×1024 since it’s my monitor res).
console output support is tricky and seems related to the disp driver. See: https://github.com/amery/linux-allwinner/issues/6
Everything works except SATA.
Does anybody know how to get the Hdd to show up?
dd’ed the image but the hdmi monitor says no signal. any ides?
ok I see that is headless.
user?
host?
passwd?
I need to ssh please
@blades
As mentioned in the post: linaro/linaro. The IP is provided by your DHCP server.
First thank you for this great build. It’s exactly that I was looking for.
I can’t get it to work on the Mele A2000. I put the SD card on the A2000, power on, and it don’t seem to work, at least it’s not making dhcp requests to the router. As I have no console access, I can’t do more. Is it possible that the Ethernet hardware is different on the A2000 than the A1000? I tried an ubuntu desktop build with VGA (made for the A1000), and it starts but says no ethernet.
Thanks in advance for any help.
@pamplina
AFAIK the hardware on Mele A1000 & Mele A2000 is the same. So it should work. It’s difficult to know what’s going on without serial interface.
Just to make sure, you did decompress the image after download before dumping it to the SD card, right?
@cnxsoft
Yes, I got a big file “ubuntu-precise-server-linaro-mele-a1000.bin” with 3.7 GB, transferred it to the 4 GB SD card with Win32DiskImager, and then tried to boot the A2000 with that card. The device don’t do anything, even the ethernet lights don’t blink, nor the router receives request.
This night I will try to redo the card with the makeSD script, that seems to be more precise than the disk imager.
Thanks for your help.
I found in a forum (http://forum.doozan.com/read.php?6,9527) that there’s a 1.7 version of the A2000 that can’t be boot with the regular uboot. It seems that mine is 1.7.
I got from there the sun4i-spl.bin and u-boot.bin for the 1.7, but now I have a long road until I could rebuild it all. It seems so much tricky
@pamplina
If that’s the case I assume, you don’t need to rebuild all, you just need to dd uboot and uboot-spl to the right offset in the SD card.
@cnxsoft
I was thinking the same, but I don’t know what the offsets are. I tried to dd the new .bin files with the same offsets as stated in the a1x-media-create.sh script, that are:
sudo dd if=sun4i-spl.bin bs=1024 of=/dev/sdb seek=8
sudo dd if=u-boot.bin bs=1024 of=/dev/sdb seek=32
The result is that the device ignore the SD and boot on Android.
By the way, what serial cable/software do you recommend to obtain a terminal window on the PC? Is it RS-232 or USB?
@pamplina
Even when I have a correct SD card, Mele will sometimes boot to Android, I just touch the SD card a bit, and can restart in Linux. I’m not sure if this is a timing issue in the bootROM of the CPU, or bad contacts. I suspect the former because the SD always works in Android.
I’m using this serial cable: http://goo.gl/EAfZz. (Which is not available in this shop anymore, but there are plenty on the Internet). In Windows, I use Putty which I find much better than Hyperterminal.
@cnxsoft
Thank you for all your support. How do you calculate the correct offsets for the dd command?
@pamplina
I did not calculate. I followed the instructions posted on Rhombus Tech site at the time. I believe this is hardcoded in the bootROM of Allwinner A10.
PS: Thanks for the nice tweet.
I tried different .bin files from several hwpacks sets, but still don’t work. I’ve ordered the serial cable, I hope it will help when I have it.
I finally managed to boot with the Ubuntu Lucid image from this page:
http://rhombus-tech.net/allwinner_a10/a10_image/
This system boots perfect, except some details:
– It uses the HDMI output, and I would prefer the VGA (as my HDMI port is usually busy with the PS3 🙂
– The screen size is bigger than my TV, so I can’t see the menus on the desktop
– The network don’t work (not ethernet nor wifi) (major problem!!)
Any tips to hack the image and change this settings?
@pamplina
The solution for networking and VGA (ugly hack) is here:
http://www.cnx-software.com/2012/04/28/how-to-create-your-own-debian-ubuntu-image-for-mele-a1000-allwinner-a10-based-stb/
For VGA, you could also try to change script.bin or mele.bin (whatever it is called in the image) to enable VGA. Make sure to backup the original script file. See: https://github.com/cnxsoft/a10-config/blob/master/script.fex/mele-a1000-vga.fex for config for Mele with VGA.
Short “tutorial” to use the tools to convert fex to bin: http://www.cnx-software.com/2012/05/06/editing-allwinner-a10-board-configuration-files-script-bin/
The problem with the screen size is due to overscan. You’d have to adjust your TV settings (if possible). Otherwise some videomodes file may need to be changed. You won’t have this problem with VGA.
Have fun.
Thank you for the info.
My primary goal is still to use the server system described in this page. The VGA, screen size, etc. is secondary for me. The networking is the major issue.
I will try to merge both images, i.e. the boot section from the lucid image and the rest from the precise server image.
At least I will try it, before I receive the serial cable and proceed to the ugly hacks. 🙂
Finally I managed to boot this ubuntu server! Yeah!
I keep the image untouched and at some point it decided to boot and get IP. I don’t know why. I think that all the issue was that the system works only one of every 5 or 6 tries, so is some sort of random problem. It was confusing me.
I’ve done several reboots and it works (or doesn’t work) eventually.
I will do more tests when I have the serial cable.
Thanks for all the support.
I got the USB-UART bridge:
http://www.ebay.es/itm/ws/eBayISAPI.dll?ViewItem&item=320947266297
I connected it to the Mele and all I get is garbage characters. I think that I’m wrong with the settings. What are the right settings on speed/data bits/stop bits/parity/flow control?
Thanks!
@pamplina
I use 115200 bps. I can’t quite remember the other settings, I think 8-bit / no parity / no flow control.
If you have garbage it could also be because Tx and Rx are inverted.
@cnxsoft
I swap Tx and Rx and… voila!! I have now console access. Thank you very much for your help.
This server changes etherhet’s MAC address every reboot. My router changes the assigned IP and it’s a mess for me. How can I set up a static MAC?
I finally found how to set up MAC address in /etc/network/interfaces. No worry 🙂
@pamplina
You can use a spoof MAC in /etc/network/interfaces like you did, but normally you’d just edit script.bin to set the MAC. It’s set to “00:00:00:00:00:00” now it’s just just automatic/random at boot time.
is it possible to run linaro 13.02 on a10/a20?
according to this https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/LiveBuild
the steps described here to build the live system are outdated, but the allwinner is not in the list of supported hardware. thus it would be nice if you could update this article with instructions how to build a linaro 13.02 filesystem for a10/a20 – thanks
@mehere
It should be possible yes. You don’t need to build the image, simply use the hardware pack together with the latest Ubuntu server rootfs at http://releases.linaro.org/13.02/ubuntu/quantal-images/server . You should have an image that boots, probably with some more stuffs to configure, but it’s a starting point.
@cnxsoft
thx,
by adding several config files i managed to run linaro 13.02 (as i am running a headless server i did not installed the hardware pack), however the old way to build the base system was imho better as it was possible to select packages. using the prebuild system requires to uninstall stuff you dont want (like apache and mysql – running those apps on single core is no good idea…) and installing ssh-server (so serial connection is required)
– i did not try the usual way to upgrade ubuntu to a higher version – does work as well with linaro?
(did not found any howtos to upgrade linaro)
@mehere
You could also use the minimal image (NANO): https://releases.linaro.org/13.02/ubuntu/quantal-images/nano
In that case you may have to install a few more things though.
You can upgrade Linaro normally (apt-get upgrade) every month, but you may lose your manual changes in the process.
@cnxsoft
ok, i will check the nano images next time
with upgrading i do not mean upgrading packages (apt-get upgrade) – i mean ‘do-release-upgrade’ – if this works with linaro it would be much easier instead of reinstalling. i have not tested this as i did not want to break my running system so it would be interesting if anybody tried this with this image or any other linaro systemn and performed a successful release upgrade
Hi, guys. I have Mele A2000G – it’s mele A2000 with 1024Mb RAM. Involved only 512 MB 🙁 How to use the entire RAM
Hi. I’m planning to install a new Mele A2000 firmware to update android system. My question is: Installing a new firmware can break the loading of the Ubuntu system from SD?
Thanks
@Pamplina
Allwinner boards can boot without internal storage (e.g. Orange Pi PC), so I don’t see how a firmware update could break the SD card boot.
@cnxsoft
Many thanks. I was almost sure that it won’t break, but is good to confirm.
I have so many services running in the ubuntu server that I can’t live without it. The Mele A2000 is a rock and it’s running for years 24×7 without a faint. Wow!