Installing Alpine Linux on OrangePi RV2

From Alpine Linux
Revision as of 05:35, 29 March 2026 by Aarch0x40 (talk | contribs)
This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Aarch0x40 on 29 Mar 2026.)

Main Page > Architectures > Riscv64 > Installing Alpine Linux on OrangePi RV2

Warning: The contributors to the Alpine Linux project are not responsible for any damage/loss experienced by using the following guide. This article is provided as a general reference to be adapted to your specific setup. It is assumed that the implementer will have the knowledge and ability to close the gap between what is described here and their specific setup.


The OrangePi RV2 is a credit-card sized development board with a Ky X1 8-Core SoC. The Ky X1 is for all intents and purposes a SpacemiT K1 SoC. The remainder of this guide is more likely to use the terms SpacemiT or K1 as is prevalent throughout the Linux community. Please understand that these terms all refer to the same RISC-V ISA implementation.

This guide assumes that the manufacturer provided OpenSBI and U-Boot binaries have been applied to the SPI Flash device. This stock bootloader will look for an extlinux/extlinux.conf which will be used to configure the boot process.

Those following this guide may find it useful to have a USB UART serial cable available to debug kernel loading.

This guide borrows heavily from the article install Alpine Linux riscv64 under qemu with u-boot loader by Milan P. Stanić and posted to Risc64 by User:AnIDFB.

Known issues


Warning: The following are the issues that are known to exist between the result of this guide and the manufacturer provided image


  • WiFi is not functional
  • Manufacturer tools are not included
  • Custom built and manually installed kernel required
  • Need to explicitly disable the RealTek 8852BS module

Setting up a workspace

Begin by setting up a RISC-V workspace by following Running Alpine riscv64 in QEMU. You'll need to establish a build environment in this QEMU guest.

doas apk add alpine-sdk bison flex openssl-dev ncurses ncurses-dev
Note: ncurses and ncurses-dev aren't a hard requirements but are useful if you want to run make menuconfig

Cloning the source, configuring and building the kernel

Unfortunately the stock kernels provided by the Alpine Linux project and even the source tarballs from kernel.org will not work. There's still a bit of patchwork involved as not all support is up-streamed. Fortunately there is someone who is maintaining repository with patched kernel sources. These sources are current

The following command will clone just the current HEAD of the patched repository

git clone --depth 1 https://github.com/jasonmontleon/linux-spacemit.git
cd linux-spacemit
make ARCH=riscv k1_defconfig
make -j$(nprocs)
Note: The kernel build may fail. I recommend starting with the k1_defconfig and working through errors as they come up. Only the RealTek 8852BS was an issue at the time of this writing.

Preparing the media

Partition and setup the filesystems

Install parted package

doas apk add parted

Insert and partition the boot media

The media can be either an SD card or USB drive. An 2280 PCIe NVMe is also possibly if you have the ability to write it from the host setting up the media. For the purposes of this guide we will refer to our boot media as /dev/sdb. The following section requires a root shell.

alias p="parted -sa optimal /dev/sdb"
p mklabel gpt
p mkpart boot ext4 0G 512M
p set 1 boot
p mkpart root ext4 512M 100%
p p

The final command should produce output to confirm the result of the executed commands. It should look something like the following.

Model: Generic STORAGE DEVICE (scsi)
Disk /dev/sdb: 15.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  512MB   511MB   ext4         boot  boot, esp
 2      512MB   15.5GB  15.0GB               root

Installing the kernel and configuring the bootloader