Installing Armbian Linux to Mecool M8S Pro W Android TV Box
Another recycling old hardware into a small server
How to install Armbian Linux to Mecool M8S Pro W Android TV Box (Amlogic S905W)
So, I had an unused TV box. And as far as hardware goes, it was not totally obsolete: Amlogic S905W quad core ARM Cortex-A53 at 1.2GHz, 2GB DDR3 memory and 16GB eMMC flash. Better than my current old SBCs that I use as small servers.
So, Googling revealed that this device is almost the same as Tanix TX3 mini. And there are many articles about installing Linux into it. One issue was that almost all articles linked to yadi.sk as a location for an Armbian image, but it was not there anymore. Looks like the maker of these images got frustrated with Amlogic and stopped supporting them. Eventually I found some images at https://users.armbian.com/balbes150/arm-64/ dated October 2020, which I concluded was still recent enough. And one of them was for Debian Bullseye, which is the Armbian version I wanted.
For installation and trouble recovery I followed instructions from Armbian forum threads https://forum.armbian.com/topic/10685-installation-guide-and-your-questions-answered-for-tv-boxes/ and https://forum.armbian.com/topic/15950-can-not-find-image-to-download-for-tx3-mini/?tab=comments#comment-113364
Below is my notes and log of what I did.
SD card editing
“BOOT” partition in the card is FAT filesystem. There you must edit/create two files:
Edit file extlinux/extlinux.conf:
LABEL Armbian LINUX /zImage INITRD /uInitrd FDT /dtb/amlogic/meson-gxl-s905w-tx3-mini.dtb APPEND root=LABEL=ROOT_EMMC rootflags=data=writeback rw console=ttyAML0,115200n8 console=tty0 no_console_suspend consoleblank=0 fsck.fix=yes fsck.repair=yes net.ifnames=0
u-boot-s905x-s912 into a file
cp u-boot-s905x-s912 u-boot.ext)
How to make it boot from SD card?
With my Android version of Mecool M8S Pro W the box does not boot from SD card. Tanix box seems to have some hidden reset button, but Mecool does not. Luckely the Armbian image includes the solution:
Insert SD card with Armbian image and in Android open “Settings/About/Updates” (or some similar app, depends on Android version you have). Open “Local/From SD Card” (or something like that). It searches and finds “aml_autoscript.zip” that is located in SD card image. Run this as an update. Device reboots, maybe twice, and finally boots Armbian from card!
Running Armbian and installing to eMMC
Login into the device via HDMI console + USB keyboard or SSH into (username/password root/1234). Do your normal Debian/Armbian
updates, installs and configurations.
armbian-config command is handy.
Under the above mentioned users.armbian.com image link there was also a deb-directory with newer Linux kernel packages dated 2020-12-21. I bravely installed them and they seem to work. Unfortunately the future of finding any updated Armbian Amlogic kernels is uncertain…
Then finally I wanted to move the installation into device internal eMMC disk. Under /root there is a script
that should it. Do NOT accidentally run the other ‘install-aml-s905-emmc’ script, it will brick your box (yeah, I made that mistake…).
Remove the SD card and enjoy booting from internal flash. Hopefully.
Most of the things I care are working, i.e. ethernet and USB disks. WLAN and audio not, but for my server use that is fine.
Indeed, it is also too easy to mess that process and accidentally brick this device, so it does not boot from neither eMMC nor SD card.
To recover from this I needed an USB-A to USB-A cable (not common, had to order from Aliexpress), Windows PC (grrh…) and “Amlogic USB Burning Tool” application. For an Android image this needs, I used version found from a forum thread at https://forum.freaktab.com/forum/tv-player-support/amlogic-based-tv-players/s905/others-ac/firmware-roms-tools-bj/690576-rom-mecool-m8s-pro-w-tvstock-nexus-rom-android-tv-7-1
Operation worked, and I redid the Linux installation more carefully and was finally successful.
Potential future attempts
Debian Bullseye will be updated quite long time into future, but this kernel version might never be updated. So it could be interesting to look into compiling my own version (and u-boot?) at some time.
Also I might try Arch Linux, one interesting post is at https://www.codedbearder.com/posts/mainline-linux-on-tx3-mini/