uConsole R01 apt-get update / apt-get full-upgrade -> dead

I have done a apt-get update / apt-get upgrade which installed a 5.19 something -starfive kernel.
After a reboot the system is simply dead. A black screen. You can not even see a boot message. I suppose it tries to boot the new kernel and fails. Now I wonder why the repo has a kernel linked which is not bootable. This makes me wonder on whats the proper way to recover this. As there is no grub menu you can access or any other option to choose an older kernel or so. The only thing is to remove the SD card and put it into another computer and fiddle around that way.

The shipped 5.4 kernel is not good enough for me. I need support in the kernel for LVM and other stuff which is simply not available. I would recompile the kernel but I have not found the sources of this exact build or any way on how to get there. Furthermore compiling software seems broken in the current ubuntu repository. You can install clang but if you call “clang --version” it crashes. binutil lacks the gold linker (which is mandatory for objectiveC compilation). mold, another modern linker which might work apparently doesn’t know how to produce anything else than x86 code. it reports “mold: unknown -m argument: elf64lriscv”. And the standard linker ld.bfd messes up ObjC structures and optimizes stuff away it shouldnt (at least it did on intel).

Anyone having any hints?

Ok, I forgot to upload R01 uconsole patch code

now the code is here

and I’ve tested it with http://dl.clockworkpi.com/uConsole_R01_v1.3b.img.7z

and made a minor update for uconsole-kernel-r01 , you can get it


sudo apt update 
sudo apt install -y uconsole-kernel-r01

for the apt upgrade, I’ve also tested on uConsole_R01_v1.3b.img.7z twice

it seems that apt upgrade won’t make your uconsole R01 dead

the upgraded packages is

The following packages will be upgraded:
  alsa-ucm-conf apparmor apport apt apt-utils avahi-daemon base-files bind9-dnsutils bind9-host bind9-libs binutils binutils-common binutils-riscv64-linux-gnu ca-certificates cpp-10
  cpp-11 cups cups-browsed cups-bsd cups-client cups-common cups-core-drivers cups-daemon cups-filters cups-filters-core-drivers cups-ipp-utils cups-ppdc cups-server-common curl dbus
  dbus-user-session dbus-x11 devterm-audio-patch distro-info distro-info-data dmidecode dnsmasq-base dpkg dpkg-dev emacs emacs-bin-common emacs-common emacs-el emacs-gtk
  firmware-sof-signed fwupd g++-11 gcc-10 gcc-10-base gcc-11 gcc-11-base gcc-12-base ghostscript gir1.2-gdkpixbuf-2.0 gir1.2-pango-1.0 git git-man gstreamer1.0-gl
  gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-x gzip imagemagick imagemagick-6-common imagemagick-6.q16 initramfs-tools initramfs-tools-bin initramfs-tools-core
  ipp-usb iptables isc-dhcp-client isc-dhcp-common kbd krb5-locales less libapparmor1 libapt-pkg6.0 libasan6 libatomic1 libavahi-client3 libavahi-common-data libavahi-common3
  libavahi-core7 libavahi-glib1 libbinutils libbpf0 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-pulse libcanberra0 libcap2 libcap2-bin libcc1-0 libctf-nobfd0 libctf0 libcups2
  libcupsfilters1 libcurl3-gnutls libcurl4 libdbus-1-3 libdpkg-perl libdrm-amdgpu1 libdrm-common libdrm-nouveau2 libdrm-radeon1 libdrm2 libegl-mesa0 libexpat1 libexpat1-dev libflac8
  libfontembed1 libfreetype-dev libfreetype6 libfreetype6-dev libfwupd2 libfwupdplugin5 libgbm1 libgcc-10-dev libgcc-11-dev libgcc-s1 libgdk-pixbuf-2.0-0 libgdk-pixbuf2.0-bin
  libgdk-pixbuf2.0-common libgfortran5 libgl1-amber-dri libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgles2-mesa libglib2.0-0 libglib2.0-bin libglib2.0-data libglx-mesa0
  libgnutls-openssl27 libgnutls30 libgomp1 libgpgme11 libgs9 libgs9-common libgssapi-krb5-2 libgstreamer-gl1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer-plugins-good1.0-0 libidn12
  libimage-magick-perl libimage-magick-q16-perl libinput-bin libinput10 libip4tc2 libip6tc2 libjavascriptcoregtk-4.0-18 libjbig0 libjson-c5 libk5crypto3 libkrb5-3 libkrb5support0 libksba8
  libldap-2.5-0 libldap-common liblouis-data liblouis20 libmagick++-6.q16-8 libmagickcore-6.q16-6 libmagickcore-6.q16-6-extra libmagickwand-6.q16-6 libmbim-glib4 libmbim-proxy libmm-glib0
  libnautilus-extension1a libncurses6 libncursesw6 libnetplan0 libnss-systemd libnss3 libntfs-3g89 libpam-cap libpam-modules libpam-modules-bin libpam-runtime libpam-systemd libpam0g
  libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libpangoxft-1.0-0 libpcre2-16-0 libpcre2-8-0 libpcsclite1 libperl5.34 libpixman-1-0 libpoppler-cpp0v5 libpoppler-glib8 libpoppler118
  libpulse-mainloop-glib0 libpulse0 libpulsedsp libpython3-stdlib libpython3.10 libpython3.10-minimal libpython3.10-stdlib libqmi-glib5 libqmi-proxy libqt5core5a libqt5dbus5 libqt5gui5
  libqt5network5 libqt5opengl5 libqt5printsupport5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5widgets5 libqt5xml5 libraw20 librsvg2-2 librsvg2-common libsasl2-2 libsasl2-modules
  libsasl2-modules-db libsnmp-base libsnmp40 libsqlite3-0 libssh-4 libssh-gcrypt-4 libssl3 libstdc++-11-dev libstdc++6 libsystemd0 libtiff5 libtinfo6 libudev1 libwayland-client0
  libwayland-cursor0 libwayland-egl1 libwayland-server0 libwebkit2gtk-4.0-37 libwebp7 libwebpdemux2 libwebpmux3 libx11-6 libx11-data libx11-dev libx11-xcb1 libxml2 libxpm4 libxtables12
  linux-libc-dev login mdadm mesa-va-drivers mesa-vdpau-drivers modemmanager motd-news-config ncurses-base ncurses-bin ncurses-term netplan.io ntfs-3g openssh-client openssh-server
  openssh-sftp-server openssl passwd perl perl-base perl-modules-5.34 poppler-utils pulseaudio pulseaudio-utils python-apt-common python3 python3-apport python3-apt python3-debian
  python3-distro-info python3-distupgrade python3-distutils python3-gdbm python3-lib2to3 python3-minimal python3-numpy python3-oauthlib python3-pkg-resources python3-problem-report
  python3-requests python3-setuptools python3-software-properties python3-tz python3.10 python3.10-minimal qt5-gtk-platformtheme rsync snapd software-properties-common sosreport sudo
  systemd systemd-sysv systemd-timesyncd tar tcpdump tmux tzdata u-boot-sifive ubuntu-release-upgrader-core ubuntu-standard udev ufw vim vim-common vim-runtime vim-tiny xfce4-helpers
  xfce4-settings xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-legacy xserver-xorg-video-amdgpu xxd zlib1g zlib1g-dev

no kernel, or image package involved, so I guess the upgrade won’t touch /boot/* files to destory the uconsole r01 kernel,make R01 unable to boot

but for safety

you can mask those packages by

sudo bash -c 'cat <<EOF > /etc/apt/preferences.d/cpi
Package: linux-starfive
Pin: release *
Pin-Priority: -1

sudo bash -c 'cat <<EOF > /etc/apt/preferences.d/linux-firmware
Package: linux-firmware
Pin: release *
Pin-Priority: -1

sudo bash -c 'cat <<EOF > /etc/apt/preferences.d/cloud-init 
Package: cloud-init 
Pin: release *
Pin-Priority: -1

so far my uconsole R01 works well after upgraded

and here is the new os image come with the updated uconsole-kernel-r01 and package masks
if you like to try it

the full-upgrade is what installed a new kernel and it s not a uconsole kernel but either a “generic” or “starfive” variant.
I now took the SD card out, changed the bootloader config to use the old kernel and booted again. It came back.

I now try to get clang working. The one from the repository installs but then fails when you run it

clang --version

spills out an error illegal instruction. And thats true for all versions of clang11,12,13,14.
Now I have to compile clang from sources. Thats probably going to take several days…

binutil is missing the ld.gold linker.

These two items is what I desperately need to get GNUStep compiled so I can write nice GUI apps for the uConsole. ObjectiveC makes things so much easier in that respect. gcc is not supporting a couple of very useful ObjectiveC features (ARC, @properties) so its not an option. clang works great on all my other platforms. Seems to be hard on the RiscV. On my RaspberryPi4 it was rather easy. (Thats why I ordered some CM4 adapter and CM4 modules to have a backup plan if RiscV is really too early).

What I am really impressed is about the build quality of the enclosure. Its super precise and very smooth to put together. I really like the uConsole over the devterm in that respect.
The only thing which is on the downside is the slow storage. Im not sure if this is because its a SD card (I’m using the fastest one I could get. a 1TB SAN DIsk Extreme Pro which should deliver > 100Mbyte/sec transfer speeds) or if its due to the CPU architecture or interfaces.

i just had a discussion with developers of clang. They say

<<Looks like a duplicate of #50090 ; there’s a hardware bug in Allwinner D1 CPUs handling the fence.tso instruction. I think there might be a workaround for the issue in newer kernels; try a newer version of Ubuntu.>>

Unfortunately your kernel does not have the workaround and the standard ubuntu kernel doesnt run on uconsole.

We really need a way to compile our own kernel version, preferrably a recent one (6.1 or 6.2).

So what can we do there?

Andreas Fink

1 Like