Rebuild OS for R01

Has anyone attempted to rebuild an OS image for the DevTerm R01?

I can see that there are instructions on how to do this / how to build the existing image, but the kernel provided seems to be reasonably old[1] so I was wondering whether anyone had built a more up-to-date kernel source, or built an image from anything other than Ubuntu?

I’m also curious about some of the decisions made with the image. For example, there’s a reference at the end of the wiki page to removing all of the motd content, but this (for me) appears to cause apt updates to take ages due to one of the update scripts looking for it, so I ended up running apt remove update update-notifier-common to resolve that; also disabling avahi-daemon does not seem particularly helpful (to me); etc.

Finally, I’m not sure why the user space modifications, particularly the twm config etc, are shipped as a binary zipfile on GitHub, rather than being shared as source. Not a dealbreaker, but a bit annoying.


[1] for example, the proc: Bad value for 'hidepid' warnings that appear in dmesg are due to systemd and the kernel version not behaving nicely together, annoyance rather than anything else.

1 Like

I’ve rebuild using Debian. In fairness to the instructions it does say “more suitable for the guidance”. I get the impression that it was more of a release what we have and clean up later, so better provide a tar of home a quick and dirty. The kernel is old, but it is an LTS release.

Tom

1 Like

Yes, that’s a fair point. I was just wondering what the state of the art is. How are you finding a newer (presumably?) build on Debian?

There is probably not much difference at the moment, my rebuild[0] is using the same spl/opensbi/uboot and same kernel. Step one was just taking the Create DevTerm R01 OS image from scratch · clockworkpi/DevTerm Wiki · GitHub instruction and understanding them, which for me means doing it myself. It’s still work in progress, so various things now don’t work, backlight/audio/etc. I think the first thing I’m going to attack is to understand where the Linux source tree came from. The instructions reference GitHub - cuu/last_linux-5.4: last_linux-5.4 allwinner d1, but that git tree has no history, again I think this was a case of better get something released out early. But it’s not clear what it was forked from accept that it says it’s an Android kernel, so lords knows what other patches are needed to get a allwinnder d1 running on a mainline kernel.

[0] Debian on Devterm R-01 | TomsWeb

3 Likes

Rebuilt OS image for DevTerm R-01 and succeeded in booting. :smiley:
DevTerm R‐01: Create OS image from scratch.

3 Likes

Now, who is going to be the first one to build a new distro? :wink:
Shouldn’t be a big problem if we can get qemu-user-static-riscv working, so that steps for building archlinux-arm could be borrowed!
(Or, of course, use a proper crosscompile toolchain as @emutyworks suggests)

… And hey there’s Haiku! My Haiku RISC-V port progress - #323 by kallisti5 - OS - Haiku Community
Actually these guys have been aware of DevTerm. See their thread.

4 Likes

Well, I have been working on building a new distribution for the R01.

3 Likes

Would love to help test, when you have something!

I can’t seem to get the image written to an SD card and booting, unfortunately…

I succeeded in that procedure.
I’m sorry, I’ve published it as a reference, but I can’t guarantee it will succeed.
Find a way to succeed on your own.

1 Like

Of course, thank you - I appreciate you sharing your guide! This is super helpful!

1 Like

I will post here and on my blog. So far the cross compiler is set, I have an experimental kernel build that isn’t yet fully driving all hardware, but I will get there in time.

Once it’s working 100%, I plan to do busybox and a minimal image. This is when I will invite testing and further discussion.

With that done, I will focus on porting a tool chain. Once I have something self-hosting, I will start building something fit for public consumption.

The hard part is trying to drill down exactly what is and isn’t needed for the D1 and DevTerm.

3 Likes

Hello, Thank you for publishing the document. :smiley:
I’m running it now.
I will inform you that the config version of “DevTerm_R01_v0.1.img” seems to be different.


Reference: Debian on Devterm R-01 | TomsWeb

I will try it to the end.

1 Like

Hello, I’m trying “Debian on Devterm R-01”. :smiley:

DevTerm_R01_v0.1.img (/dev/loop0p3) -> "config-5.4.61" is found.
DevTerm_R01_v0.1.img (/dev/loop0p4) -> "config-5.4.61" not found.

- Grab the kernel config from the clockworkpi image.
wget -c http://dl.clockworkpi.com/DevTerm_R01_v0.1.img.bz2
bunzip2 DevTerm_R01_v0.1.img.bz2
u=$(sudo losetup --show -f -P DevTerm_R01_v0.1.img)
mkdir ubuntu
#sudo mount ${d}p4 ubuntu
sudo mount ${d}p3 ubuntu

#sudo cp ubuntu/boot/config-5.4.61 .
sudo cp ubuntu/config-5.4.61 .
sudo umount ubuntu
sudo losetup -d $u

Reference: Debian on Devterm R-01 | TomsWeb

2 Likes

According to this website Linux — RISC-V - Getting Started Guide there are projects supporting RISC V in general

The fedora implementation even mentions the Allwinner D1: Architectures/RISC-V/Allwinner - Fedora Project Wiki

A pre-build fedora image for the Allwinner D1 can be downloaded here: Index of /pub/dl/riscv/Allwinner/Nezha_D1/images-release/Fedora

Site note:
They state, that “[c]urrently D1 is not officially supported by Fedora.”

Does this help you guys?

1 Like

I had found these resources previously. For me, the hold up is actually just complications from my build environment and tooling being non-standard. I am working on getting something else setup though.

1 Like

Ubuntu 22.0.4.1 seems to have a D1 image as well. https://cdimage.ubuntu.com/releases//22.04.1/release/ubuntu-22.04.1-preinstalled-server-riscv64+nezha.img.xz

Source:

1 Like

Interesting, has anyone tried this on the DevTerm yet?

I’ve just tried the Ubuntu 22.04.1 for Nezha image as-is, and it doesn’t seem to boot from SD card on the DevTerm with R01 core. Not sure where it is getting stuck, but may try to connect on UART to see if there are any boot messages later on.

I might try updating an R01 image from the Ubuntu RISC-V PPA later to see what happens…

1 Like

Interestingly, I’ve now created a new SD card with the R01 image, booted, SSH’d in, and replaced the APT sources with the Ubuntu PPA - and no updates are showing. So no obvious benefit here? Going to try booting the Ubuntu image again with UART conencted…