Making Fenix images in Github

Hi guys,
This was just a little thing we attempted and came out successfully in a few tries,
for anyone who needs a fresh build of Ubuntu or Debian using Fenix, you can now do it without having a Linux computer, all thanks to Github CI/actions,

I’d like to thank the team at the Khadas discord group who helped me with this, and showed me the way through this little project

with just a Github account, you can do these simple steps to get jumpstarted and have a latest image that is also up to date in just around 1 Hour, which is the typical amount of time for a build of Ubuntu/Debian
with a fresh clone of fenix

The only things you need are these simple requirements:

  • A github account
  • any computer or device you prefer to use to Interact with Github
  1. First Fork the Khadas Fenix repo to your Repo, you can do this by first logging into your account,
    Navigating to the Khadas/Fenix repo, and clicking Fork

  1. Once forked to your Repo, you need to create a Actions “Workflow”.
    just click on Actions,
    image

Click on create a new workflow, and click on “setup up a workflow yourself

image

  1. Hold on to this file, and now open a new browser tab, go to my repo where you can get the workflow file which is at zephyrlabs/fenix

  1. copy all the contents of that file, and paste it in the workflow file you created before for your repo…
    click on commit and the workflow is now automatically created…

to modify configuration of the image you want, you can go to the master branch of your repo, and modify the “config-template.conf” file by clicking on the “pen” symbol" on the top corner to edit it to what ever build configuration you require eg. you need a Image for VIM3 mainline linux for SD-USB usage…

your .conf should look something like this…

Once you have modified a file, it should auto trigger the build process,
The resultant images, are obtained in a zip file, which you can download, by clicking on the actions tab, and clicking on the build…
If you get a green arrow, then the build was successfully made,

You can click on it to enter and see the workflow result…

as you can see, a file named Firmware.zip is created containing the image, you can download it and unzip it, to obtain your image,

click on the side to open the logs…

If any one of them are having a red cross, it might have failed…
you can check if the error came from the build files or due to dependency issues…

to re-run the process, just click on re-run jobs and click on all…

you should have obtained your image then…

I hope this Helps many,

stay happy, and keep hacking :slight_smile:

cheers!

6 Likes

@numbqq I believe you will find this to be a very cool thing, maybe it will become a part of the Original khadas repo someday… :smile:

1 Like

And howand where exactly do you retrieve the generated image files(s) ?

1 Like

Oops I forgot to include that step :sweat_smile:
Lemme fix it, thanks for reminding :+1:

Thank you!

I ever tried Travis-CI, but there is a execution time limitation, so I can’t build the full image. There is no execution time limitation for GitHub Actions ?

No there is not, it takes around 60 minutes for a build to happen, and till now, each one has been successful !
(other than testing and a few builds where the server was offline…)

1 Like

@Electr1
The build failed:

KHADAS_BOARD=VIM1
LINUX=mainline
UBOOT=mainline
DISTRIBUTION=Ubuntu
DISTRIB_RELEASE=focal
DISTRIB_TYPE=lxde
DISTRIB_ARCH=arm64
INSTALL_TYPE=EMMC

Error is:

2020-08-25T05:55:09.2086016Z e[0;32mInfo:e[0m Image install type: EMMC
2020-08-25T05:55:09.2163354Z /home/runner/work/fenix/fenix
2020-08-25T05:55:09.2256194Z [Msg]Pack Item[USB         ,              DDR] from (/home/runner/work/fenix/fenix/build/images_upgrade-dfeef5710f824069fa855236474997eddca5f983/Amlogic/u-boot.bin.usb.bl2),[ERR]f(AmlImagePack.cpp)L1332:failed to open source file : /home/runner/work/fenix/fenix/build/images_upgrade-dfeef5710f824069fa855236474997eddca5f983/Amlogic/u-boot.bin.usb.bl2 
2020-08-25T05:55:09.2256635Z Image pack FAILED
2020-08-25T05:55:09.2259783Z Cleanup...
2020-08-25T05:55:09.2389137Z make: *** [Makefile:7: all] Error 253
2020-08-25T05:55:09.2581686Z ##[error]Process completed with exit code 2.

Bonus question:
I would like to use a low-latency / preemp kernel (for audio stuff). Is there something available for me?

Weird, but all the VIM1 images fail to build…
@numbqq could you please observe the Issue please, Thank you

Note: it fails at the u-boot Integration part…

@11h11 you could try to build an image by removing all the unnecessary stuff you don’t require…

Wait, wait, where’s the YouTube video with all the details ?!
:thinking::face_with_hand_over_mouth:

1 Like

I don’t mind having all the unnecessary stuff (drivers), but how to use the Linux X.X.X**-lowlatency** #46-Ubuntu SMP PREEMPT kernel when building with Fenix? Maybe I need to use something else as LINUX=mainline?

Sorry @Vladimir.v.v , I didn’t have time at the moment to make Videos…
You can expect one coming up a bit later…

@11h11 you can try, but generally by reducing the extra stuff you should reduce the kernel latencies and take the load from unnecessary stuff… This is why Audio is better handled by PRUs which aren’t bound by the latencies of a Kernel…

1 Like

I think my options are either the mainline or 4.9 - not sure what is the difference…

case "$LINUX" in
mainline)
	LINUX_DTB="arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dtb"
	LINUX_GIT_BRANCH="master"
	LINUX_DEFCONFIG="${LINUX_DEFCONFIG:- defconfig}"
	SERIALCON="ttyAML0"
	GPU_VER=""
	GPU_PLATFORM=""
	GPU_DESC=""
	MODESETTING_CONF="01-lima.conf"
	;;
4.9)
	LINUX_DTB="arch/arm64/boot/dts/amlogic/kvim_linux.dtb"
	LINUX_GIT_BRANCH="khadas-vims-4.9.y"
	LINUX_DEFCONFIG="${LINUX_DEFCONFIG:- kvims_defconfig}"
	SERIALCON="ttyS0"
	GPU_VER="r7p0"
	GPU_PLATFORM="fbdev"
	GPU_DESC="m450"
	MODESETTING_CONF=""
	;;

4.9 is the bsp kernel… or base support package…
basically the old stuff that works with all hardware, and has drivers…

Mainline is the fresh stuff, straight out of Linus Torvald’s Linux bakery… has all kinds of new stuff, but the drivers and things are still “work in progress” for some periphery…

one day, the current mainline becomes the new bsp, and a new mainline version will come out…

for your task, I am sure anything will work… That said, I’d say stick with Mainline…

Thanks for the clarification, will retry to build for VIM1 when ready. I will monitor this thread.

I don’t think so, I talked with hyphop about that and he said it’s a lot of work to make it work. Maybe running your ALSA thread in a single core where it only runs that (so no interrupts happening) is what you want?

I think that the most supported way to built a Linux distro for VIMS is to use fenix, but to make it the most predictable, use fenix inside docker because it is a pain in the assss to align heterogeneous Linux build tools dependencies

Error configuration file.

You choose mainline kernel, the INSTALL_TYPE MUST be set to SD-USB, eMMC image is not supported for VIM mainline kernel.

@numbqq this configuration also gave me errors…
image

OK. I’m only testing mainline kernel with SD-USB installation now, I will check this issue later.

1 Like