For those who may be interested in running regular 32 bit arm binaries on your S905 64 bit arm (AARCH64 architecture), you will be happy to hear the linux kernel compiled by LibreELEC Odroid C2 as well as kszaq's builds already has all kernel config parameters to allow for that. The only thing missing were the actual 32 bit libraries so I created this simple modification to add those to your LibreELEC setup.
F.A.Q.
[Q] why would I want to run 32 bit binaries on my awesome 64 bit arm device?
[A] Unfortunately not all source packages out there have already been ported to AARCH64. And from the packages not available yet, you will find many gaming related ones which make use of some assembly coding for faster responses (I believe those will take a little longer to be ported). One example is RetroArch, which although I have been able to compile it for S905 AARCH64, it does not make use of assembly code and therefore is quite slow on some cores. But if you use the RetroArch compiled for S805 devices for instance, which is an armhf 32bit binary, you can enjoy faster emulation.
[Q] what is the trade-off of running both 64 and 32 bit programs on my box.
[A] Slight RAM usage increase. When you start a 32bit program it will need to load the required libraries (ld-linux-armhf at a very minimum plus others it needs) into memory for the first time. So by running 64 bits and 32 bits applications in parallel you will use a bit of more memory. However, in most situations this side effect will not be noticeable and not affect your box's performance. Also by just having the 32 bits libraries there you are not using more RAM, just when you start launching 32 bit apps.
[Q] for which boxes does this MOD work?
[A] All S905 boxes for which kszaq's LibreELEC package work as well as the Odroid C2 based on official LE 7.9 Alpha build. It is basically the same as these original builds with the additional 32 bit libraries.
[Q] how was this modification implemented
[A] It is a very simple mod. I unpacked LibreELEC-S905.aarch64-7.0.2.008-fix.zip, extracted the SYSTEM squashfs image file and mounted it so I could access the files. I then did the same for the S805 LibreELEC image from kszaq and then copied the 32 libraries from S805 version into equivalent /lib32 and /usr/lib32 new folders I created on the S905 SYSTEM partition file. Next I created a symbolic link of /lib/ld-linux-armhf.so.3 pointing to /lib32/ld-linux-armhf.so.3 and added a startup script into /etc/profile.d to add these two new library folders into LD_LIBRARY_PATH. In the end, I just repackaged the updated SYSTEM into a tar file for easy update on LibreELEC.
If you want to make this modification on your own, feel free to do so and leverage the source code for the script I made available here.
INSTALLATION
1) Recommended method (this is the only method that works for LE installed to NAND)
This installation is done as an update to a working LibreELEC installation. Steps to follow:
- If not done yet, you should first install the latest original build from either LE (for OdroidC2) or kszaq (for generic S905 and S905X devices) as per instructions provided by them
- download the tar file from the link provided below and copy it into the /storage/.update folder of your box. You can do this via SSH or samba mapping as per official LibreELEC upgrade instructions from here. For generic S905(X) devices using kszaq's builds you should also download the appropriate device tree for your device (as per update instructions from kszaq`s thread), rename it to dtb.img and put it into .update folder as well. The link for the appropriate device trees is also provided in the download section below. Then just reboot the box and it will start installing the mod.
2) Dirty & Risky method (not recommended; can be used for LE installed to SD or USB only)
On this installation method you just replace the SYSTEM file (which is the actual system filesystem for LibreELEC compressed into one squashfs image file) directly in your removable media (SD card or USB storage). Steps to follow:
- Turn off your device and remove the USB key or SD card.
- Plug your USB or SD card into your windows computer. It may take a little but at some point you will see the first 500MB partition mounted. That is the FAT32 partition where the KERNEL and SYSTEM files are.
- Replace the SYSTEM and SYSTEM.md5 files on the USB device or SD card with the modified ones you can download from the link below (rename them to SYSTEM and SYSTEM.md5 respectively). You may want to backup the existing ones from USB/SD prior to overwriting them so you have a a way to revert back in case things stop working. Also please make sure you do not modify any other file other than SYSTEM and SYSTEM.md5.
- That's it. Just plug the USB or SD back into your device and it "should" work
THANKS
Credits to LE team for the offical builds
Credits for the S905 unofficial version of LibreELEC go to its maintainer: kszaq.
DOWNLOAD
I have repackaged a few of the latest available builds based on LE 7.0 as well the preview of LE 8.0 (which is for now called 7.9-Alpha). Please chose the version you want from the list below (and remember to always install the MOD for the same version of the original build you have installed). Also if you are already using a version I created prior to Nov 21, 2016, you may want to update it once again as I made a minor improvement that might help to run binaries created for generic ARM devices.
LibreELEC 7.0 Stable versions
[hr]
Build Name: 7.0.2.008
Type: Released
Device: s905
Original installation: LibreELEC-S905.aarch64-7.0.2.008-fix.img.gz
Device trees to use: device_trees
MOD update (tar): LibreELEC-S905.aarch64-7.0.2.008-fix_lib32Added.tar
Just SYSTEM file: SYSTEM_S905-7.0.2.008_lib32Added
Just SYSTEM.md5 file: SYSTEM_S905-7.0.2.008_lib32Added.md5
[hr]
Build Name: 7.0.2.009
Type: Released
Device: s905
Original installation: LibreELEC-S905.aarch64-7.0.2.009.img.gz
Device trees to use: device_trees
MOD update (tar): LibreELEC-S905.aarch64-7.0.2.009_lib32Added.tar
Just SYSTEM file: SYSTEM_S905-7.0.2.009_lib32Added
Just SYSTEM.md5 file: SYSTEM_S905-7.0.2.009_lib32Added.md5
LibreELEC 7.0 Development versions
[hr]
Build Name: 7.0 Development 2016-11-19
Type: Development
Device: s905
Original installation: LibreELEC-S905.aarch64-7.0-devel-20161119092613-r23439-gc23e2fb.img.gz
Device trees to use: device_trees
MOD update (tar): LibreELEC-S905.aarch64-7.0-devel-20161119092613-r23439-gc23e2fb_lib32Added.tar
Just SYSTEM file: SYSTEM_S905-7.0-devel-20161119092613-r23439-gc23e2fb_lib32Added
Just SYSTEM.md5 file: SYSTEM_S905-7.0-devel-20161119092613-r23439-gc23e2fb_lib32Added.md5
LibreELEC 7.9-Alpha Development versions
[hr]
Build Name: 7.90 Alpha [Krypton 8.0 preview] Development 2016-11-22 PR10887
Type: Development
Device: s905
Original installation: LibreELEC-S905.aarch64-8.0-devel-20161122210840-r24442-g1aa8951.img.gz
Device trees to use: device_trees
MOD update (tar): LibreELEC-S905.aarch64-8.0-devel-20161122210840-r24442-g1aa8951_lib32Added.tar
Just SYSTEM file: SYSTEM_S905-8.0-devel-20161122210840-r24442-g1aa8951_lib32Added
Just SYSTEM.md5 file: SYSTEM_S905-8.0-devel-20161122210840-r24442-g1aa8951_lib32Added.md5
[hr]
Build Name: 7.90 Alpha [Krypton 8.0 preview] Development 2016-11-09
Type: Development
Device: s905
Original installation: LibreELEC-S905.aarch64-8.0-devel-20161109230131-r24433-g7e8b96d.img.gz
Device trees to use: device_trees
MOD update (tar): LibreELEC-S905.aarch64-8.0-devel-20161109230131-r24433-g7e8b96d_lib32Added.tar
Just SYSTEM file: SYSTEM_S905-8.0-devel-20161109230131-r24433-g7e8b96d_lib32Added
Just SYSTEM.md5 file: SYSTEM_S905-8.0-devel-20161109230131-r24433-g7e8b96d_lib32Added.md5
[hr]
Build Name: 7.90.008 Alpha [Krypton 8.0 preview]
Type: Development
Device: Odroid C2
Original installation: LibreELEC-Odroid_C2.aarch64-7.90.008.img.gz
MOD update (tar): LibreELEC-Odroid_C2.aarch64-7.90.008_lib32Added.tar
Just SYSTEM file: SYSTEM_OdroidC2-7.90.008_lib32Added
Just SYSTEM.md5 file: SYSTEM_OdroidC2-7.90.008_lib32Added.md5
As new versions are released I will create correspondent packages with 32 bit libraries.
SOURCE
If you want to implement the mod on your own, please use the suggested source code from here (instructions provided in the readme file):
GitHub - JoKeRzBoX/MOD_add_32bit_libraries_to_LibreELEC_AARCH64: Simple instructions and additional files to combine 32 bit ARM libraries to a 64 bit AARCH64 LibreELEC Build.
That's it. I hope you enjoy it and feel free to ask questions on this thread and I will try to answer as time permits.
Cheers!