-
Notifications
You must be signed in to change notification settings - Fork 33
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
[RFE] Add RISC-V support for Flatcar Container Linux #1420
Comments
I managed to get a Gentoo RISC-V built, here is the documentation step by step on how to build the image, maybe someone finds it useful. Need to test it out on my RISC-V board and then see how it can be applied to Flatcar SDK workflow, work in progress. Initial document how-to, the starting pointhttps://wiki.gentoo.org/wiki/User:Dlan/RISC-V/TH1520#Host_Env_Setup Install Gentoo upstream on an AMD64 box was done using the script from this folderprepare the env - install the toolingsemerge dev-vcs/git
emerge app-misc/screen prepare the crossdev repos (instructions from @Chewie)mkdir -p /var/db/repos/crossdev/{metadata,profiles}
echo crossdev > /var/db/repos/crossdev/profiles/repo_name
cat > /var/db/repos/crossdev/metadata/layout.conf <<EOF
masters = gentoo
thin-manifests = true
cache-formats = md5-dict
EOF
cat > /etc/portage/repos.conf/crossdev.conf <<EOF
[crossdev]
priority = 1001
location = /var/db/repos/crossdev
sync-type =
EOF prepare the crossdev env
build uboot
build kernel
get the stage 3 built image |
Got a Gentoo recent version running on the LicheePi4A: localhost ~ # cat /etc/os-release
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"
VERSION_ID="2.15"
localhost ~ # uname -a
Linux localhost 5.10.113-th1520 #2024.05.31.16.27+2dec14431 SMP PREEMPT Fri May 31 16:28:40 UTC riscv64 GNU/Linux
localhost ~ # systemctl --version
systemd 255 (255)
+PAM -AUDIT -SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 +IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 +LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified Next step is to follow up on @chewi great work and how to's to add a new architecture for Flatcar and get a Flatcar on RISC-V PoC: |
WOIP to get a working SDK for cross-building RISCV64 packages: https://github.com/ader1990/scripts/pull/1/files. After the SDK has been created, there will be probably some upstream packages that need to be changed to have the @chewi created this bug report for the selinux* ones: https://bugs.gentoo.org/936297, more to come. Gentoo sys-libs/libselinux-3.6-r1 needs also a fix to handle the .a removal, as it is not working on RISCV64 lp64d. |
Here's the libselinux fix upstream: gentoo/gentoo@7b643df |
Plan to add experimental support for RISC-V in Flatcar, in this chronological order to be done:
|
Something to be aware of. Gentoo is planning to split the riscv keyword into riscv and riscv32. That shouldn't affect this, although there was also a suggestion to use riscv64, and the plan hasn't been finalised yet. |
All over the code bases, there are risc-v, riscv, riscv64, riscv64gc - so many different wordings for the same thing. I hope the industry comes together and decides on just one. |
Linking flatcar/scripts#2247, as mayday was not compiling on risc-v because of the old golang bindings. |
Current situation
Flatcar cannot be built for the RISC-V architecture (https://riscv.org).
Impact
Consumer boards are starting to become widely available, like the Vision 5, LicheePi 4A or Milk-V. Enterprise grade manufacturers like Ventana are also providing server grade RISC-V CPUs.
Also, cloud providers like Scaleway already offer RISC-V instances.
Ideal future situation
To be able to run Flatcar on RISC-V systems.
Implementation options
Upstream Gentoo already has support for most of the packages. The SDK needs to be worked on and maybe also streamline / organize the build code for ARM64 and RISC-V at the same time, so that ARM-on-ARM and RISC-on-RISC builds can be possible, without forcing cross-compilation.
The text was updated successfully, but these errors were encountered: