0
AndrewDB

Compiling and booting mainline Linux for your S9XXX TV box

Recommended Posts

Just wanted to report that I have been experimenting compiling the kernel for Oleg's various Armbian images for S9XXX TV boxes and have managed to compile and boot mainline kernel, but this required a small change in Oleg's S905_autoscript in /boot.

Basically I just added a  couple of lines that bootm the uImage if it is present. If there is no uImage it proceeds to booti Oleg's zImage:

 

setenv boot_start_ml bootm ${kernel_addr} ${initrd_addr} ${dtb_mem_addr}
if fatload mmc 0 ${kernel_addr} uImage; then if fatload mmc 0 ${initrd_addr} uInitrd; then if fatload mmc 0 ${env_addr} uEnv.ini; then env import -t ${env_addr} ${filesize};fi; if fatload mmc 0 ${dtb_mem_addr} ${dtb_name}; then run boot_start_ml; else store dtb read ${dtb_mem_addr}; run boot_start_ml;fi;fi;fi;

I wrote two documents - 1. HOWTO compile the Linux kernel (either Oleg's patched kernel or mainline kernel straight from kernel.org) and 2. How to install the Linux kernel - that can be found here: 

http://wiki.loverpi.com/faq:sbc:libre-aml-s805x-install-newly-compiled-kernel

 

Right now I am running mainline 4.19.20 on a S905 TV box:

andrew@mxqpro4k:~$ uname -a
Linux mxqpro4k 4.19.20-adb9ml #1 SMP PREEMPT Sun Feb 10 19:29:08 CET 2019 aarch64 aarch64 aarch64 GNU/
Linux

 

andrew@mxqpro4k:~$ uptime
22:25:55 up 23:52,  1 user,  load average: 0.00, 0.00, 0.00


Note that there are two distinct ways to compile the Linux kernel for any S9XXXX TV box: you can cross-compile the kernel on a PC running Linux, or you can natively compile the Linux kernel on the TV box itself. I am routinely doing native compiles, using distcc on a build farm to speed compilation.

Share this post


Link to post
Share on other sites
9 hours ago, AndrewDB said:

Just wanted to report that I have been experimenting compiling the kernel for Oleg's various Armbian images for S9XXX TV boxes and have managed to compile and boot mainline kernel, but this required a small change in Oleg's S905_autoscript in /boot.

Basically I just added a  couple of lines that bootm the uImage if it is present. If there is no uImage it proceeds to booti Oleg's zImage: 

Add two small patches to the sources and you won't have to use the old and bad uimage format. And you do not need to change anything in the startup scripts, complicating the startup process. These patches work with all my images and kernels (including the latest 5.0).  :)

Share this post


Link to post
Share on other sites
2 hours ago, balbes150 said:

Add two small patches to the sources and you won't have to use the old and bad uimage format. And you do not need to change anything in the startup scripts, complicating the startup process. These patches work with all my images and kernels (including the latest 5.0).  :)

Please Oleg tell me what these patches are and where to download them from! :thumbup:

Share this post


Link to post
Share on other sites
2 hours ago, balbes150 said:

Thank you very much! I am going to try them and will report here! :beer:

 

Edit: I found the original source of the two patches in the LKML archive, in this thread: https://lkml.org/lkml/2016/3/1/1401

Edited by AndrewDB
Found the original source of the patches suggested by Oleg

Share this post


Link to post
Share on other sites

@AndrewDB very nice I will try later then for my KM8 follow your steps. But first what was your impression since I am running the kernel 3.14 here you saw any difference between the old 3.14 for 4.xx kernel series (more faster or just for have more updated and secure kernel or have more compatibility with the tv box) ?

Share this post


Link to post
Share on other sites
40 minutes ago, xispita said:

@AndrewDB very nice I will try later then for my KM8 follow your steps. But first what was your impression since I am running the kernel 3.14 here you saw any difference between the old 3.14 for 4.xx kernel series (more faster or just for have more updated and secure kernel or have more compatibility with the tv box) ?

The main difference I think is that late 4.XX kernels are much more suited to Ubuntu 18.04. The 3.14 kernel is basically the kernel Amlogic released back in 2015/2016, so it's very old.

But I have not been able to boot a 4.XX kernel yet on my Km8 P S912 boxes, still waiting to solder a UART cable and check what's going on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0