Some questions about khadas repos and development workflow setup

Hi dear Khadas devteam, kudos for doing a pretty good job on providing mostly open source codebase, build scripts and environment for VIM boards.

Recently I bought VIM3 Pro board to do some experiments with it to check if it might be usable as an aarch64/armhf build node for the koji/mock RPM building local setup I’m try to create. Let’s keep koji/mock/RPM related stuff off the discussion topic for now as at first I need to get myself comfortable with the expected u-boot/kernel/rootfs image creation process that us currently used to produce Ubuntu/Debian-based Khadas custom images.

From what I gathered from reading official docs and this forum section it seems that the main “entry point” for “tech-savvy” endusers are so-called “Fenix Scripts” available in this repo:

This collection of scripts aims to be an “all included” solution to easily build anything end user might want for his/her Khadas board, starting from u-boot and linux kernel and up to ready to flash SD/USB image having bootloader/kernel/rootfs and Khadas-provided customizations packed together.

For more advanced users it looks like there are some additional repos to take a look at like these:

Comparing contents of the Fenix scripts vs two repos listed above I got a bit lost w.r.t. the way Khadas devteam is handling support and maintenance of the “end user” facing part of the chain while keeping up with a new development for upcoming upstream u-boot and kernel versions.

Main points of interest for me are:

  1. What is the “primary” source to look for u-boot and kernel patches? Am I correct that those included in Fenix scripts are coming from other two repos if/when devteam consider them stable enough for wide end-user audience?
  2. What about the support for LTS kernel releases? From what I see there’s no activity going on for kernel versions 5.4 or 5.10 - which are current “long term support” kernel releases with longest time remaining until the EoL date. Racing against the ever changing kernel mainline is a good thing but it’s a good idea to have some semi-recent, supported and considered to be stable kernel release available for customers who would like to base some project on a VIMx board and have no worries about “living on the edge” for the next couple of years.

@Frank @hyphop @tsangyoujun - please provide some info on the subject if possible. Really huge thanks in advance!

@lexa2 These two repositories are mainly used for 4.9 kernel firmware, which is the kernel version of amlogicrelease, including a lot of amlogic changes and support.

If you compile the mainline firmware, then we are putting some patches on the linux kernel source code. Some of the patches are from libelec. Another part is the patches of our own ported drivers, such as NPU drivers.

The 4.9 kernel is the code in the above warehouse, the branch is khadas-vims-4.9.y.For the main line, we generally follow the update of the main line. Under normal circumstances, we will test each official version, add patches, and then release it for users to use.

Hey @Frank, thanks for a quick answer, really helpful!

You wrote that khadas-linux-kernel and khadas-uboot repos are mainly used for development around LTS 4.9 kernel branch. It raises more questions for me:

  1. What is the place to look for if I’m searching for the development/testing of patchsets for more recent upstream versions of u-boot/kernel? For example, if I would like to build mainline u-boot 2021.10 with Khadas patches - where to search for the patchset? I can see one available in here:

… but as you wrote that this repo is focused on all around kernel 4.9 and its deps - is it an up-to-date patchset at all?

  1. What is the scheme of maintaining patchsets for Fenix scripts then? Are they independent from all other repos that are publicly available? Continuing with my example from the pt. above - I expect that some time in a future “mainline” u-boot in Fenix scripts would move to upstream tag v2021.10 as a base for applying patches. Is there any other repo available where testing takes place for this future move?

  2. Re LTS kernels - your answer implies that that only supported LTS version for now is 4.9 - which is understandable consequence of HW vendor mainly focusing on Android instead of upstream linux kernel and thus using a bit outdated kernel version as a base for its “vendor platform SDK”.
    From my PoV problem with it is the amount of time left till EoL for 4.9.y kernel branch - it’s slightly less than a year from the moment I write this message. Do you know if there are any “upstream vendor” plans to move to some more recent LTS version (best case scenario would be 5.10)?
    If not - is it possible for Khadas devteam to consider keeping more-or-less up to date and stable version of “Khadas patchset” for kernel branches 5.4.y and/or 5.10.y? This branches were “mainline” some time ago so I guess you were basing your patchset over these for some time. Keeping in mind that almost no major changes happen for LTS branches it should be relatively easy to maintain patchset for such a branch keeping it in sync with the HEAD of resp. LTS branch.

1 Like

@lexa2 This is our mainline uboot patch. You can view the patch content directly, and you can see the source of the patch from the author.

We usually burn directly to the board after updating, and then test the basic functions of the board. We do not have a special repo for testing.

The kernel of VIM4 will be 5.4. This is also the version provided by amlogic. The current VIM1/VIM2/VIM3 will not be upgraded to 5.4. However, we will do a corresponding update for each official version of the latest mainline. The update time node is generally within one month of the official version of the mainline