How to rebuild kernel for Megrez?

Hi all,

I have an issue.

I need a kernel with transparent_hugepage support.
As I can see current kernels like linux-image-6.6.87-eic7702 and linux-image-6.6.87-win2030 don’t have such support.

I’ve tried to install headers for it apt install linux-headers-6.6.87-win2030 but installed headers look a bit weird because don’t have Kconfig and many other folders.

How to rebuild a kernel to have transparent_hugepage support ?

P.S. What the difference between linux-image-6.6.87-eic7702 and linux-image-6.6.87-win2030 ?

2 Likes

See the CI workflow here: rockos-kernel/.github/workflows at rockos-v6.6.y · rockos-riscv/rockos-kernel · GitHub

Both native build and cross build steps are there.

EIC7702 is whole another chip. That kernel package is not for Megrez which is EIC7700X.

2 Likes

Hmmm, thanks a lot for your answer but it seems I have a kiddy question again.

How to run such workflow locally on my x86 system?
I couldn’t find some wiki about step by step running and building.

Before I’ve already worked with other boards and it was like:

  • you download some Docker
  • run the Docker
  • enter to Docker
  • run command like build_me_the_kernel.sh

But in case that you‘ve provided i couldn’t find a such instruction.

I’m not so expirenced in building kernel for boards and maybe I don’t know some widely used tool, so sorry in advance.

1 Like

OK, so you want a cross build.

I’ve done this before, you may take a look at this gist for some reference: RockOS kernel deb and bootloader cross compile (Ubuntu 22.04, Docker) · GitHub

Note that I haven’t updated this for quite some time, and you’d better change the toolchain to a more up-to-date version, e.g. the one used in that CI workflow.

If you want a native build, then just remove CROSS_COMPILE stuff and use the GCC provided by your distro instead.

Hope that helps. Maybe I’ll PR/add a kernel compile guide to RockOS docs someday.

(BTW since you’re on 6.6.87, you’re probably on a older image? The latest version should be using 6.6.88)

2 Likes

Yeah, looks good

Will try and will align with the newest component versions.

BTW since you’re on 6.6.87, you’re probably on a older image? The latest version should be using 6.6.88

I’ve just get it from a default repository from apt list
Thanks for you notice. Will try 6.6.88

1 Like

Yeah, I‘ve checked

The process works well. Now HugePage available

At least this file
cat /sys/kernel/mm/transparent_hugepage/enabled
always [madvise] never

Thanks a lot

2 Likes

Updated at: Build kernel | RockOS

1 Like