Ubuntu Linux on D1

39 views
Skip to first unread message

Denis Ovsienko

unread,
Oct 23, 2022, 7:33:27 AM10/23/22
to RISC-V Developer Board Community
Hello list.

As it turns out, Canonical published an Ubuntu 22.04 disk image for
Nezha D1 two months ago. I tried the image yesterday and noted the
following:

* The partition table is GPT and has a partition for U-Boot (unknown
type) and GRUB (EFI), but not for the SPL.
* The image auto-resizes to fit entire device.
* GRUB reports version 2022.04.
* It correctly detected my D1-1GB as D1-1GB (later disk images published
by ISCAS had a problem with the RAM size nailed down to 2GB and
crashed).
* The kernel version after installing all updates is 5.17.0.
* The RGB LED works.
* Ethernet NIC works, but by default the MAC address is random every
reboot.
* Serial console works, but the boot process is organized in a way that
looks a bit odd on the serial console, in that it starts in the
usual verbose way, then sits quiet for one or two minutes before
starting to print late service startup messages. In other words, out
of the box all of the kernel output and some early services are not on
the serial console.
* Onboard flash is available as one unstructured MTD.
* GCC 11 is available and works.
* Clang 14 is available, but is broken (dumps core due to an illegal
instruction).
* As before, there is a kernel panic at the end of system power off,
but not on reboot.
* The system takes a few minutes after a seemingly complete boot before
it is ready to accept SSH logins (sshd is enabled by default).

For now this seems to be in acceptable shape to switch my use case
(Buildbot worker) to this image and to let it run for a couple weeks to
see how it works. The image is generally available on the Internet.
The file meta-data and the boot log are now in my table of disk images.

--
Denis Ovsienko

Gareth Halfacree

unread,
Oct 23, 2022, 8:49:18 AM10/23/22
to RISC-V Developer Board Community
On Sun, 23 Oct 2022 at 12:34, Denis Ovsienko <de...@ovsienko.info> wrote:
> As it turns out, Canonical published an Ubuntu 22.04 disk image for
> Nezha D1 two months ago.

There's also a 22.10 image for the Nezha D1 (and for the LicheeRV
Dock, StarFive VisionFive, and HiFive Unmatched), if you don't need
the LTS version:

https://cdimage.ubuntu.com/releases/22.10/release/

-Gareth

Heinrich Schuchardt

unread,
Oct 23, 2022, 8:57:56 AM10/23/22
to Denis Ovsienko, RISC-V Developer Board Community


On 10/23/22 13:33, Denis Ovsienko wrote:
> Hello list.
>
> As it turns out, Canonical published an Ubuntu 22.04 disk image for
> Nezha D1 two months ago. I tried the image yesterday and noted the
> following:
>
> * The partition table is GPT and has a partition for U-Boot (unknown
> type) and GRUB (EFI), but not for the SPL.
> * The image auto-resizes to fit entire device.
> * GRUB reports version 2022.04.
> * It correctly detected my D1-1GB as D1-1GB (later disk images published
> by ISCAS had a problem with the RAM size nailed down to 2GB and
> crashed).
> * The kernel version after installing all updates is 5.17.0.
> * The RGB LED works.
> * Ethernet NIC works, but by default the MAC address is random every
> reboot.
> * Serial console works, but the boot process is organized in a way that
> looks a bit odd on the serial console, in that it starts in the
> usual verbose way, then sits quiet for one or two minutes before
> starting to print late service startup messages. In other words, out
> of the box all of the kernel output and some early services are not on
> the serial console.

Hello Denis,

thanks for sharing your test results.

Currently GRUB issues 'quiet splash' on the Linux command line. For more
output you want 'efi=debug earlycon'.

E.g. create file /etc/default/grub.d/cmdline.cfg (it must have cfg
ending) with content:

# Booting on many riscv64 systems is slow. Let the user view progress.
# For minimum output use
# GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX_DEFAULT="efi=debug earlycon"

Then run update-grub.

You could open a bug report for package livecd-rootfs on launchpad to
have this changed.

> * Onboard flash is available as one unstructured MTD.

Ubuntu does not use the flash storage. Do you see any necessity for a
change here?

> * GCC 11 is available and works.
> * Clang 14 is available, but is broken (dumps core due to an illegal
> instruction).

Please, report a bug on https://launchpad.net indicating how to
reproduce the issue.

Best regards

Heinrich

Denis Ovsienko

unread,
Oct 24, 2022, 5:10:29 PM10/24/22
to devboard-...@riscv.org
On Sun, 23 Oct 2022 14:57:52 +0200
Heinrich Schuchardt <heinrich....@canonical.com> wrote:

[...]
> You could open a bug report for package livecd-rootfs on launchpad to
> have this changed.

Hello Heinrich.

Done as bug report 1994072.

> > * Onboard flash is available as one unstructured MTD.
>
> Ubuntu does not use the flash storage. Do you see any necessity for a
> change here?

It makes no practical difference to me at this time, but since the
block device is available, it might make more sense to represent it
properly. For reference, here is the result from an older kernel:

mtd0: 00100000 00040000 "boot0"
mtd1: 00400000 00040000 "uboot"
mtd2: 00100000 00040000 "secure_storage"
mtd3: 0fa00000 00040000 "sys"

> > * Clang 14 is available, but is broken (dumps core due to an illegal
> > instruction).
>
> Please, report a bug on https://launchpad.net indicating how to
> reproduce the issue.

Done as bug report 1994071.

--
Denis Ovsienko

Samuel Holland

unread,
Oct 28, 2022, 11:09:15 PM10/28/22
to Denis Ovsienko, devboard-...@riscv.org
On 10/24/22 16:10, Denis Ovsienko wrote:
>>> * Onboard flash is available as one unstructured MTD.
>>
>> Ubuntu does not use the flash storage. Do you see any necessity for a
>> change here?
>
> It makes no practical difference to me at this time, but since the
> block device is available, it might make more sense to represent it
> properly. For reference, here is the result from an older kernel:
>
> mtd0: 00100000 00040000 "boot0"
> mtd1: 00400000 00040000 "uboot"
> mtd2: 00100000 00040000 "secure_storage"
> mtd3: 0fa00000 00040000 "sys"

Note that Allwinner's BSP Linux/U-Boot use interleaved multi-plane
addressing*, so the offsets here do not match how the NAND appears to
mainline Linux. There is not much benefit in trying to match the BSP
partition layout.

Regards,
Samuel

*the BSP sees block0 page0, block1 page0, block0 page1, block1 page1
mainline sees block0 page0, block0 page1, block0 page2, block0 page3

Denis Ovsienko

unread,
Feb 1, 2023, 4:32:00 PM2/1/23
to devboard-...@riscv.org
On Mon, 24 Oct 2022 22:10:08 +0100
Denis Ovsienko <de...@ovsienko.info> wrote:

[...]
> > > * Clang 14 is available, but is broken (dumps core due to an
> > > illegal instruction).
> >
> > Please, report a bug on https://launchpad.net indicating how to
> > reproduce the issue.
>
> Done as bug report 1994071.

As it turns out, the above bug was fixed a while ago, so my project is
using Clang on Ubuntu 22.04 on D1 again.

--
Denis Ovsienko

Vladimir Dudnik

unread,
Feb 1, 2023, 5:17:08 PM2/1/23
to Denis Ovsienko, devboard-...@riscv.org
Denis, does this Clang version support RISCV RVV 0.7.1 extension, which is available on D1?

Regards,
  Vladimir

чт, 2 февр. 2023 г. в 00:32, Denis Ovsienko <de...@ovsienko.info>:
--
You received this message because you are subscribed to the Google Groups "RISC-V Developer Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to devboard-commun...@riscv.org.

Reply all
Reply to author
Forward
0 new messages