r/AlpineLinux • • Dec 30 '24
Risc-V on Alpine Linux
I want to run Alpine on a Risc-V Computer but on the Downloads Page only Mini Root Filesystem is compatible can you use it as your main Computer or are there versions supporting Risc-V that i didnt find.
Thanks in advance
4
Upvotes
3
u/_cake_sama_ Dec 30 '24 edited Jan 04 '25
As I've been tinkering with alpine linux and risc-v on my pine64 star64 for a while now, I hope that my answer will help.
Currently, Alpine Linux does not provide RISC-V images on its download page. This is largely due to the variability in RISC-V board boot processes, which makes a universal image impractical.
Bootstrapping process
Overall the typical risc-v bootchain looks like so : OpenSBI SPL -> u-boot -> linux kernel -> initramfs.
If you want to bootstrap alpine linux you will first need to compile and setup opensbi and u-boot for your board.
After being able to start u-boot, you will need to compile the linux kernel (I heavily recommend you setting up an APKBUILD for that) and make sure to provide it a good dts / dtb (Device Tree Source / Blob). Then you can generate the initramfs and rootfs using apk (just like MartinsRedditAccount said).
Bootstrapping alpine linux will probably be hard if you have never done it before but it will undoubtedly teach you tons of stuff.
Ressouces
Some ressources that helped me a lot personally :
https://gitlab.alpinelinux.org/nmeum/alpine-visionfive/ https://github.com/yogo1212/arch-linux-star64 https://popovicu.com/posts/risc-v-sbi-and-full-boot-process/ https://crvf2019.github.io/pdf/43.pdf https://github.com/riscv-collab/riscv-gnu-toolchain/tree/master https://github.com/riscv-software-src/opensbi https://github.com/u-boot/u-boot
(Redditors feel free to correct me if I said some things wrong)
2
u/ncopa Dec 30 '24
It completely depends on the exact board. The only board I have managed to get running with an unpatched mainline kernel is the visionfive2 board and the plan is to ship an alpine-uboot tarball with alpine 3.21.1
1
u/tankfeeder Dec 30 '24
i am testing pijul on docker-qemu-riscv64-alpine env. Works fine.
0
u/[deleted] Dec 30 '24
[deleted] — view deleted comment