Jump to content

Building and installing custom kernels


SteeMan

Recommended Posts

As I have been watching the development of Armbian for TV boxes, there is one area that my needs haven't been addressed yet.  And since this is open source that means I needed to read a lot of posts and get into the code to understand how things are working.  I have been doing that over the last six months or so and wanted to report back on what I am now doing to solve my issue as it may help others.

 

I have a number of TV boxes running as headless servers for a variety of projects.  Once I install Armbian on them I then get OS updates through ubuntu (I am using Ubuntu Bionic on my boxes).  That gives me bug fixes and patches for the software running on these boxes via apt update/upgrade.  However the linux kernel generally stays unpatched at the point in time that I installed one of balbes150's TV box builds.  What I wanted was to be able to build and update kernels so that I can apply new kernel versions to my servers.

 

I am now able to do that successfully across a number of TV boxes ( TX3mini, TX3 X3, H96 Max X2) (Note I only have amlogic based boxes that I test with).  I am building kernels from kernel.org sources, building .deb files and then installing those files across my servers as new kernel versions are released.  My goal was to simply stick with the 5.4 kernel as it is a long term support kernel, but I find that I have moved to 5.6 as I wanted native wireguard support.  Another goal I have is to do all this with as few patches as possible (i.e. running stock base unmodified linux).  And a final goal was to build natively on my arm based boxes.

 

Below are my notes that explain what I have done and hopefully provides others with some of the knowledge I have built up over time to be able to get what I needed working.

 

I hope this is helpful to others who want to get their hands into armbian a little deeper than just installing and running it.

 

 

build-debs.txt

Link to comment
Share on other sites

Thanks for sharing your knowledge !

 

I am going to check out the branch linux-5.6.y  from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git  . But I had a problem to find out the   kernel source version for the 'stable', 'current' and 'dev' builds : when I checked  config/sources/families/meson-gxl.conf , I didnot find out the version name .  Which patch version ( meson64-current , meson64-dev , meson64-legacy ) should I apply to that branch please ?

Link to comment
Share on other sites

 

7 minutes ago, hanguofu said:

Thanks for sharing your knowledge !

 

I am going to check out the branch linux-5.6.y  from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git  . But I had a problem to find out the   kernel source version for the 'stable', 'current' and 'dev' builds : when I checked  config/sources/families/meson-gxl.conf , I didnot find out the version name .  Which patch version ( meson64-current , meson64-dev , meson64-legacy ) should I apply to that branch please ?

You can try to apply dev patches  but do not expect it to just work. There are very likely adjustments necessary to compile.

Link to comment
Share on other sites

4 hours ago, hanguofu said:

Thanks for sharing your knowledge !

 

I am going to check out the branch linux-5.6.y  from https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git  . But I had a problem to find out the   kernel source version for the 'stable', 'current' and 'dev' builds : when I checked  config/sources/families/meson-gxl.conf , I didnot find out the version name .  Which patch version ( meson64-current , meson64-dev , meson64-legacy ) should I apply to that branch please ?

In the TV box builds, balbes150 is focusing most on the aml-s9xxx and arm-64 areas.  So if you look at config/sources/families/aml-s9xxx.conf or arm-64.conf you will see something like this:
 

case $BRANCH in
	legacy)
	KERNELDIR='linux-aml-legacy'
	KERNELSOURCE='https://github.com/150balbes/Amlogic_s905-kernel'
	KERNELBRANCH='branch:5.3'
	;;

	current)
	KERNELDIR='linux-aml-current'
	KERNELSOURCE='https://github.com/150balbes/Amlogic_s905-kernel'
	KERNELBRANCH='branch:5.6'
	;;

	dev)
	KERNELDIR='linux-aml-dev'
	KERNELSOURCE='git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git'
	KERNELBRANCH='branch:master'
	;;
esac

From here you can see that 'current' is on the 5.6 branch. So if you look in patch/kernel/aml-s9xxxx-current you will see the packages-current.patch which is what you want.  (I just realized in my instructions I called this patch by the wrong name, in my instructions I say build-?????.patch, but the name really is packages-?????.patch).  You will notice that balbes150 maintains his own patched kernels that he builds from (KERNELSOURCE).  I have been generally using unpatched kernels from kernel.org so I know exactly what I am building.  But once you understand what is going on, you can experiment with different kernel sources and find what works best for you.  Because in this case balbes150 kernel tree is already patched, there isn't in this patch directory the other required patch (text-offset.patch).  You can find that patch in the 'dev' build (patch/kernel/aml-s9xxx-dev/text-offset.patch) as that build is against a non-patched kernel tree.

 

You mentioned looking at meson-gxl, which I assume means you are working with an aml s905 based tv box.  I use and build kernels for TX3mini boxes that have the s905w cpu (meson-gxl-s905w-tx3-mini.dtb) and yesterday I built and installed both the 5.4.30 and 5.6.2 releases that came out yesterday on my TX3minis.

 

My recommendation is to start simple, learn, and then experiment with more things.  I find that the 5.4 and higher kernels have good support for the amlogic chips (at least up through the s905x3) and as long as I am using these boxes for servers they work fine for my needs.  (i.e. I don't care about wifi, bluetooth, etc).  But if you need more than the base kernel supports, you can start looking at the kernel patches that are around and finding things that you want to experiment with and add them into your build environment.  I find this is a good way to explore the evolving support of these arm based TV boxes.

Link to comment
Share on other sites

  • Werner locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines