OpenElec 5.93.2 Beta and now 5.95.3 Beta for the Matrix mini pc is now available directly from the OpenElec websites in the downloads section.
http://openelec.tv/get-openelecI was using the the Matrix for some development work running Gentoo Linux for some time, but have completed that project, and wanted to go ahead and use it for a media center.
I was happy to see this thread, and subsequently OpenElec for the Matrix downloadable directly from OpenElec. I have no idea if you were involved with getting the necessary files together and included, vpeter, if you were, a big thanks for your time and work. It is a real shame that tbsdtv contributes nothing towards improvements and or updates for the matrix mini pc.
Even though I have run a number of different Linux OS's in a number of different configuration, I have yet to get anything to boot directly from an SATA SSD, despite using the published dip switch positions, and various optional dip switch positions.
Fortunately you can boot to the SATA SSD from a sdcard easily. Since I have not seen anyone post anything about booting from a SATA SSD. I thought I would post how to run OpenElec off a SATA SSD, booting from a sdcard, so that others can enjoy the improved performance, and disk space. Some stats first so you understand some of the differences of what kind of read speeds are generally seen with the various types of disks.
Running: hdparm -tT /dev/sda (replace sda with the drive you want to test)
Will give you and idea of what kind of read speed differences there are between the mmc, sdcard, ssd.
onboard mmc:
Timing cached reads: 348 MB in 2.00 seconds = 173.64 MB/sec
Timing buffered disk reads: 126 MB in 3.01 seconds = 41.90 MB/sec
sdcard: Does not matter what rating your sdcard has 10 or above, even a 4 can get the same speed. High priced sdcard rated for 70MBs read will not be any faster, at least not on my Matrix.
Timing cached reads: 338 MB in 2.00 seconds = 168.87 MB/sec
Timing buffered disk reads: 50 MB in 3.07 seconds = 16.29 MB/sec
sata ssd:
Timing cached reads: 358 MB in 2.01 seconds = 178.43 MB/sec
Timing buffered disk reads: 218 MB in 3.00 seconds = 72.65 MB/sec
Of course you can do dd tests as well as other apps like bonnie++. On all arm devices that have onboard mmc, sdcard along with sata. I found that where a sata ssd really shines, using bonnie++ to really test all the different file sizes for read, write, synchronous and asynchronous, a sata ssd performs considerably better at the 4k, 8k, and other small file writes and reads. Those faster small file size read writes really improve the responsiveness and overall performance of an OS. sdcards are typically slow for the smaller file sizes and are not really well suited for running an OS. While some of the better quality USB disks generally do much better than sdcards. Yet USB disks still do not come close to a sata ssd. The reason for that is that sdcards and usb disks are typically designed for file/data storage, and most files people want to store are in the small MB size to large MB size. They are designed to perform better with larger files sizes, as the
higher advertised read rates, help sell the product. There are numerous tests out there, from a multitude of arm devices, do some searches.
Ok now on to installing OpenElec onto a SATA SSD on the Matrix mini pc.
You will need the OpenElec tarball. You do not need the image. Only the Beta at this time has the Matrix mini pc files, current version is 5.95.3.
You may want to follow the suggestions in the OpenElec manual installation instructions, concerning file system parameters and ssd trim support. For the most part, the manual installation instructions will be followed.
http://wiki.openelec.tv/index.php/Manual_InstallationFirst partition and create a file system on the sdcard. Before partitioning, you may want to zero out the sdcard, especially if you have dd it with various boot files in the past. Make sure you do this to the correct drive, as it WILL DELETE all partition tables and boot loader files. Unless you have backups, you WILL NOT be able to recover. MAKE SURE YOU DO NOT DO THIS TO YOUR PRIMARY COMPUTER DRIVE!
dd if=/dev/zero of=/dev/sdX bs=1M count=8
(a higher count like 16,32,64 can be used if you think it is necessary)
You will not need a large sdcard as only a few files will be on it. 100-250MB partition will suffice or go a head and use the whole disk, unless you want a separate second partition for storage. I used the ext4 file system.
These are the files you need to place on the sdcard. Make sure to use the uEnv-matrix.txt for your uEnv.txt.
Kernel
(found in the target folder of the OpenElec tarball)
imx6q-tbs2910.dtb
(found in the 3rdparty/bootloader folder in the OpenElec tarball)
uEnv.txt
(found in the 3rdparty/bootloader folder in the OpenElect tarball - copied from the uEnv-matrix.txt)
You will need to make a couple changes to the boot & disk args in the uEnv.txt. I removed the last line as it is unnecessary as I have had no trouble with the hwaddress being found. Below is what I have. The last two lines are all one line, the forum cut it due to length.
zImage=/KERNEL
bootfile=/KERNEL
mmcargs=setenv bootargs 'boot=/dev/sda1 disk=/dev/sda2 quiet video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 dmfc=3 consoleblank=0'
You will now need to flash the sdcard with the u-boot-matrix.imx (found in the 3rdparty/bootloader folder of the OpenElec tarball). Make sure you dd the u-boot-matrix.imx to your sdcard and not to some other attached drive/device!
dd if=u-boot-matrix.imx of=/dev/sdX bs=512 seek=2
This is what the manual instructions uses, though I used the above.
dd if=u-boot-matrix.imx of=/dev/sdX bs=440 count=1
For a micro sdcard you will need this dip switch positions on the Matrix:
10000010
For setting up an SATA SSD. Follow the manual installation guide through the SSD Trim Support. The only thing I can add, is since there is plenty of room, depending on what size SSD you have of course. You may want to make the first partition larger, though not necessarily necessary. Currently the System file is 104.7MB in size. 250MB partition per the instructions leaves you with a partition double that size. SSD partitions typically maintain optimum read speed when no more than 50% full. I went with 1GB simply because I do not need that other 750MB's in the second partition. I do store some media in the second partition, the most used, for the faster and smoother read speed and less power usage, but have a secondary USB rotational drive with a much larger body of media files. Of course NFS or SAMBA can be used off a server, that can be setup via the OpenElec/KODA settings.
There is only one file you need in the first partition
SYSTEM
After following the Manual Installation Instructions and placing the System file in the first partition. Slip your sdcard in the slot, plug in your sata ssd drive, and boot.
Upgrades:
I started with the 5.95.2 Beta. I just did the upgrade via the OpenElec Settings page and it worked fine. Though remember that you need to replace the OLD KERNEL with the NEW KERNEL on the SDCA
RD.
With 5.95.2 Beta my system fan after enabling it via systemd was failing. I simply did a cron job every 15 mins restarting it. Just updated to 5.95.3 so do not know if the cron job is still necessary.
SSH into OpenElec. I setup a private public key and turned off ssh password via the OpenElec settings.
cp ~/.config/imx6-soc-fan-monitor.conf.sample ~/.config/imx6-soc-fan-monitor.conf
If you want to change any parameters. I changed the high from 70 to 60.
nano ~/.config/imx6-soc-fan-monitor.conf
systemctl enable imx6-soc-fan-monitor
systemctl start imx6-soc-fan-monitor
Crontab I used, can be adjusted for what you think you need.
*/15 * * * * systemctl restart imx6-soc-fan-monitor
Additional Stuff:
To improve security, in the OpenElec and KODI settings, turn off any services you will not be using. Not only does it make your system more secure, but it reduces OS overhead. Yes your internal network should be secure and having services running does not necessarily introduce unnecessary risk. Yet, if some how, someone, does get access through OpenElec/KODI or some other device with in your network, it will reduce the things that an intruder can leverage. And may save you from clean installing a number of devices in comparison to one that may have fallen into the wrong hands.
Iptables, the Linux Firewall, is up and running out of the box on OpenElec. It is only necessary to load the rules you want.
Here is an nmap -F scan showing what ports are open and or filtered with everything off but ssh and web access. I use my android phone with the KODI control app with a password. rpcbind is open even though everything is off, but ssh and http via the OpenElec/KODI settings. Vulnerabilities have been found in rpcbind in the past, though currently not aware of any bad vulnerabilities.
nmap -F ipaddress
Not shown: 77 closed ports
PORT STATE SERVICE
7/tcp filtered echo
22/tcp open ssh
80/tcp open http
81/tcp filtered hosts2-ns
111/tcp open rpcbind
144/tcp filtered news
515/tcp filtered printer
990/tcp filtered ftps
1755/tcp filtered wms
1900/tcp filtered upnp
2049/tcp filtered nfs
3000/tcp filtered ppp
4899/tcp filtered radmin
5000/tcp filtered upnp
5190/tcp filtered aol
5357/tcp filtered wsdapi
5432/tcp filtered postgresql
6646/tcp filtered unknown
7070/tcp filtered realserver
8008/tcp filtered http
10000/tcp filtered snet-sensor-mgmt
32768/tcp filtered filenet-tms
49155/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 1.59 seconds