Today (was) RISC-V Day 2017 Tokyo at the University of Tokyo (programme in English, more information in English). My colleague Wei Fu gave a talk on the status of Fedora on RISC-V. I hope it was recorded somewhere. If it appears online I’ll update this post.
Tag Archives: fedora
Fedora 27 has just been released, and I’ve just uploaded virt-builder images so you can try it right away:
$ virt-builder -l | grep fedora-27 fedora-27 aarch64 Fedora® 27 Server (aarch64) fedora-27 armv7l Fedora® 27 Server (armv7l) fedora-27 i686 Fedora® 27 Server (i686) fedora-27 ppc64 Fedora® 27 Server (ppc64) fedora-27 ppc64le Fedora® 27 Server (ppc64le) fedora-27 x86_64 Fedora® 27 Server $ virt-builder fedora-27 \ --root-password password:123456 \ --install emacs \ --selinux-relabel \ --size 30G $ qemu-system-x86_64 \ -machine accel=kvm:tcg \ -cpu host -m 2048 \ -drive file=fedora-27.img,format=raw,if=virtio &
$ virt-builder -l | grep fedora-26 fedora-26 aarch64 Fedora® 26 Server (aarch64) fedora-26 armv7l Fedora® 26 Server (armv7l) fedora-26 i686 Fedora® 26 Server (i686) fedora-26 ppc64 Fedora® 26 Server (ppc64) fedora-26 ppc64le Fedora® 26 Server (ppc64le) fedora-26 x86_64 Fedora® 26 Server
$ virt-builder fedora-26 $ qemu-system-x86_64 -machine accel=kvm:tcg -cpu host -m 2048 \ -drive file=fedora-26.img,format=raw,if=virtio
Why not s390x? That’s because qemu doesn’t yet emulate enough of the s390x instruction set / architecture so that we can run Fedora under TCG emulation.
It looks like a crazy ball of string and rubber bands now. I added an external SSD in an enclosure powered by the compatible JMS578 chipset. But the board itself cannot supply enough power through USB to external drivers, so there’s also a powered USB hub (thus the whole thing needs two power supplies).
It works is the best I can say about it at this point.
Important edit: I discovered that the powered USB hub is not necessary (presumably because this is an SSD, not a spinning disk). That eliminates the power supply problem.
Well getting Fedora running on the Pine64 has been an adventure. Fedora itself doesn’t work out of the box, but that’s to be expected because we’re waiting for some things to go upstream. But thanks to the tireless efforts of the Linux SunXi project I was able to boot the board with a (mostly) open source firmware, self-compiled near-upstream kernel, and a Fedora filesystem.
rjones@pine:~$ uname -a Linux pine 4.9.0-00036-ge6af24d #14 SMP PREEMPT Sat Mar 18 13:56:36 GMT 2017 aarch64 aarch64 aarch64 GNU/Linux rjones@pine:~$ cat /etc/fedora-release Fedora release 25 (Twenty Five)
Below I will describe how to do this, but note that by the time Fedora 26 comes out you should not need to do any of this stuff.
Cross-compile your own kernel as described here. As well as the standard
defconfig you will also need to enable
make dtbs to create
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dtb which you will need later.
Read about the AllWinner A64/Pine64 boot process. It’s not necessary to replicate those steps exactly, but it helps to explain why we’re doing the next steps.
Grab one of the firmware images from here (it doesn’t matter which) and write it to your micro SD card. But note this firmware and dtb is out of date, and so you must then get the latest firmware from here and overwrite it:
# dd if=pine64_firmware-20170314.img of=/dev/mmcblk0 bs=8k seek=1
The firmware image above will create a single 100 MB FAT partition. Add further partitions to the partition table on the micro SD card so it looks approximately like this. The root filesystem must be on partition 5 (the first logical partition).
Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 204799 202752 99M 6 FAT16 /dev/mmcblk0p2 204800 31116287 30911488 14.8G 5 Extended /dev/mmcblk0p5 206848 21178367 20971520 10G 83 Linux /dev/mmcblk0p6 21180416 25374719 4194304 2G 82 Linux swap / Solaris
Make swap on
From your kernel build, copy
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dtb to the first (FAT) partition. (This will overwrite the existing out of date dtb file.)
Extract the filesystem from a virt-builder Fedora 25 aarch64 image:
$ virt-builder --arch aarch64 fedora-25 $ virt-filesystems -a fedora-25.img --all --long -h $ guestfish --ro -a fedora-25.img run : download /dev/sda4 aarch64-root.fs
This is an XFS filesystem image, which is why you have to enable the XFS driver in the custom kernel above.
Now write this to the fifth (first logical) partition:
# dd if=aarch64-root.fs of=/dev/mmcblk0p5 bs=16M # xfs_growfs /dev/mmcblk0p5
You will now need to mount up the root filesystem and make a few changes. At the very least:
/etc/fstabto reflect reality.
- Disable the root password in
With any luck booting the micro SD card in the Pine64 should now work.
e64As with other low end ARM hardware the $50 I paid for the Pine64 isn’t enough for a fully working system. You will also need a serial port adapter, I recommend the CP2102 of which you’ll find millions on Amazon for under £10. Also, a micro SD card. And a USB to micro USB cable to power the board.
The total cost of this shouldn’t be more than another $40, taking the total cost of the hardware to about $90.
A few weeks ago you will remember that I ordered a Pine64 aarch64 developer kit with the wifi daughter-card, in order to test how well it works with upstream Fedora. It arrived today. The ordering process was very efficient with Pine64 keeping me up to date at all steps along the way, and there were no customs delays or charges.
As I’m rather busy in the next few days, I may not have time to look at it right away.