-
Notifications
You must be signed in to change notification settings - Fork 74
[WIP] Enable Rockchip arch in kernel #2556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP] Enable Rockchip arch in kernel #2556
Conversation
CONFIG_ARCH_BCM_IPROC=y | ||
# CONFIG_ARCH_MEDIATEK is not set | ||
# CONFIG_ARCH_QCOM is not set | ||
CONFIG_ARCH_ROCKCHIP=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CONFIG_ARCH_MULTI_V7 might be required too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RK3566 is ARMv8-A (it has only 4 Cortex A-55, which are ARMv8.2-A) and CONFIG_ARCH_MULTI_V7
is for ARMv7 (if I understand correctly). So at first sight, it should not be required but if my real test fails, I'll try to add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is weird because it says it's for Rockchip Cortex-A9 so I'll try without it and if it doesn't work, I'll try to add it.
If I add it, I'll try to use the SDK container to build locally and make the change if it helps.
@sambonbonne the image was built, you can download it and try it from the github actions artifacts page. https://github.com/flatcar/scripts/actions/runs/12575139169?pr=2556 |
Build action triggered: https://github.com/flatcar/scripts/actions/runs/18092542388 |
The vmlinuz image increase is pretty big, by 3MB, which is more than the space allowed for the updates to work, that s why some of the tests failed. But as a PoC, you can try first the resulting image and see if it works. |
@ader1990 thank you! I had some problems when trying to edit the partition layout of my SD card with I understand 3MB is too big, unfortunately I don't know enough about "kernel things" to help on this so if I manage to have a working image, I hope we will be able to reduce the added size or find an alternative. |
@ader1990 I'm trying to use $ flatcar-install -d /dev/sdb -B arm64-usr -i /path/to/ignition.json -f /path/to/flatcar_production_image.bin -u
Using existing image: /path/to/flatcar_production_image.bin
Writing /path/to/flatcar_production_image.bin...
Running in chroot, ignoring request.
Running in chroot, ignoring request.
mount: /tmp/flatcar-install.77HskzhsAm/oemfs: WARNING: source write-protected, mounted read-only.
Installing Ignition config /path/to/ignition.json...
cp: cannot create regular file '/tmp/flatcar-install.77HskzhsAm/oemfs/config.ign': Read-only file system
Error: return code 1 from [[ -n "${IGNITION}" ]]
/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdb: calling ioctl to re-read partition table: Success If you have any idea to help me, I will be very happy! |
@ader1990 I managed to fix my problem and to use But it seems the first partition, the EFI one, is not mountable when installed so I could not write the Anyway, the image does not seem to boot so I added Can you launch the pipeline so I can try a new image with the added kernel parameter? Otherwise, should I ask for help with the SDK container (if yes, where? The Matrix channel?)? Just FYI, here is the
|
@sambonbonne had to solve some conflicts, I did trigger a new build and you should be able to download the image artifact in a few hours, if all goes well. |
@ader1990 thanks! I hope the new image will boot. I'll give it a try when I'm able to. |
@ader1990 it seems I cannot set
See https://github.com/flatcar/scripts/actions/runs/12743950372/job/35527535677#step:7:4656. So I guess I can't enable the |
it seems that the newer kernel 6.12 does not need it anymore. You can push a new change and I can start the build. For building the kernel properly with Flatcar, I have the following notes for https://www.flatcar.org/docs/latest/reference/developer-guides/sdk-modifying-flatcar/#getting-started:
|
Hello @ader1990 and thanks for those details! I pushed a commit to remove the Speaking of, I tried to build again after removing this config, so I enter the SDK container with
I will try to run both I hope I don't ask for too much with all my questions, to be honest this is my first time building an entire distro, it's challenging and very instructive. |
What usually happens when trying to run When I have errors with the build process, I usually start with a very clean environment from scratch, as there might be leftovers or errors introduced by multiple builds. Being a dockerized environment, it is usually easy to create a new env, just remove the cloned repository, do a docker rm of the dangling containers and images, do a docker system prune for safety (of course, make sure you are not using that env for other work), and start over. Always start with a new cloned repo of flatcar/scripts, otherwise you can do a git reset, git clean -fxd, git rebase on flatcar/scripts main branch, and start the process from step 1: |
@sambonbonne image was built here: https://github.com/flatcar/scripts/actions/runs/12845716694 |
@ader1990 just wanted to tell you I'm still investigating the boot problem. I tried multiple Beside this, I managed to boot MicroOS with this simple
So I know U-Boot is capable of booting a working OS, I just don't know why it doesn't boot Flatcar. Edit: I just decided to order a serial cable to see if U-Boot logs message to the UART port, it may take some time to arrive but I still want to work on this. |
9ed0ab0
to
87bc1d5
Compare
Latest push is due to me rebasing this branch from |
Good news: I got my cable and I already have some things. Bad news: right now, it's still complicated to find why Flatcar doesn't boot. I can see the Grub menu through the serial port but after booting Flatcar, even by adding a
I also tried to boot the A partition directly (still from Grub menu) with the I think I miss a kernel configuration, I'm looking for it. Fortunately, Home Assistant provides a working image for Odroid M1S so I will try to find out what they use. I hope I'll be able to build locally this time, this would avoid multiple pipelines just to find out missing parameters. |
I see that the support has been there since the 6.12 torvalds/linux@10dc64f, so it should work. For the debug logs, I might suggest adding more kernel config params - mainly Thanks. |
My comment is a bit long so I tried to structure it two parts. DebugI tried different parameters for debug logs: the four Maybe I do it wrong but it's not my first time adding a temporary kernel parameter from Grub: I use Kernel configsAs a theoretically working kernel config, I have two sources for Odroid M1S:
Gentoo wiki configs tryI tried to add configs from Gentoo wiki but that's where I got some build error when running /build/arm64-usr/var/log/portage/app-containers:podman-5.3.0:20250212-102732.log
I built from a fresh environment (new clone and remove all Flatcar containers and images) so I don't understand how I can still face this kind of errors (I run the Is it possible to build a smaller set just to try the boot, without Podman for example? Home Assistant OS infoFor HAOSS (short for Home Assistant OS), it bootloops when installed on SD card so I may have to try to install it directly on eMMC and maybe I can find a way to copy the |
I managed to build with more parameters but still no luck. I created a PR on my repo for that and started a self-hosted runner with the required labels. Build working but image still not booting: sambonbonne@1eb4d0b Build failing: sambonbonne@98c0da9 (build log: https://github.com/sambonbonne/flatcar-scripts/actions/runs/13437246231/job/37542450165) My next try, when I have the time, will be to run the HAOSS image directly in eMMC (instead of SD) and see if the kernel config is available. 🤞 |
703fd43
to
af68cf7
Compare
@chewi I forgot: no ethernet cable plugged for now, so Flatcar is not able check updates online right now. So it may not be it. Thanks for this explanation, I'll give it a try after my today's rebase is built. In fact I didn't try to remove these parameters since multiple builds because I thought I should get an HDMI console in parallel of the logs I get on UART. |
51b283e
to
7d99468
Compare
107fe61
to
fdf10b6
Compare
fdf10b6
to
2f46d31
Compare
c697d77
to
23ee2ec
Compare
23ee2ec
to
e1f8cba
Compare
Just a little update: I didn't abandon this PR, it's just taking some time. I made some progress (like, the blue LED of my board is blinking, which means it boots) but I still miss some things (no HDMI output, plus I didn't test with an vnme yet, neither I tried ethernet). I'm working on another branch right now because I added a lot of configs so it would be a mess to put everything in the PR but I still want to make Flatcar work on my Odroid M1s :) |
@sambonbonne I have a ROC-RK3399-PC to test if necessary. And a aml-s905d3-cc and aml-a311d-cc, but they need the MESON ARCH. |
Thank you for the work here, it's not easy to dig up all needed kernel configs from a diff to a working kernel.
Regarding meson, I've the la frite to test. |
@guilhem when I have a new image that builds, I'll send you the link so you can test it. @guilhem @pothos IDK if I should enable Meson in this PR or if another PR would be required, as it's not the same CPU brand. But when I have a booting image for Rockchip, and after cleaning up the kernel, I can try adding |
Hello @sambonbonne, it would be great if you could summarize on the main description of this PR what works and what does not currently work (maybe with bullet points?), so that we can advance on the non-working items. Thanks for the work! |
@ader1990 good point, I should take the time to update my PR to use new configs first, then I can list what doest work and what doesn't. I'll try to do this on friday! |
e06241a
to
dfdcc41
Compare
Remove CONFIG_AMD_IOMMU_V2, CONFIG_FB_ARMCLCD, CONFIG_MD_LINEAR, CONFIG_NET_ACT_IPT. Add CONFIG_MODULE_COMPRESS. See: torvalds/linux@5a0b11a linux: remove CONFIG_MD_LINEAR See: torvalds/linux@849d18e linux: remove CONFIG_NET_ACT_IPT See: torvalds/linux@86fe596 linux: add required CONFIG_MODULE_COMPRESS=y See: torvalds/linux@c7ff693 linux: remove CONFIG_FB_ARMCLCD See: torvalds/linux@dee56cc
dfdcc41
to
1fb1326
Compare
Set CONFIG_ARCH_ROCKCHIP
After some discussion on Matrix about Odroid M1S (based on RK3566), I made this PR to enable Rockchip arch in the kernel.
The goal is to test the generated aarch64 image on my hardware and to see if the initrd size is not increased to much before discussing about the possible inclusion of this configuration in Flatcar.
How to use
Installing the image in Odroid M1S requires U-Boot binaries and multiple steps. I will add testing commands if it works on my hardware and someone want to try it on real hardware.
What works and doesn't work
This list shows what works and doesn't work on an Odroid M1S SBC (eg nothing really works right now):
Testing done
No testing for now (the image does not boot on Odroid M1S).
changelog/
directory (user-facing change, bug fix, security fix, update)/boot
and/usr
size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.