CM4S Tested for uConsole, ArchLinux minimal OS image with RPi 6.6.y kernel for CM3/CM4/CM4S UC

It’s pretty much the same code for CM4S and CM3. EVEYTHING working on a CM3 will also work on a CM4S(including on-board WiFi). The linux package for ArchLinux is updated to 6.6.y(current is 6.6.30). For CM4, the device tree is a bit different. I’ve utilized dtoverlay selection implemented by RPi’s bootloader, so this image is suitable for all known working RPi platforms.

One OS image for all RPi cores.

Default config and download link

The default configuration of the userspace is:

  • packages
    • base
    • vim
    • sudo
    • NetworkManager
    • uConsole kernel, bootloader and their dependencies
  • root has no password, and cannot be used directly
  • a normal user account named ucon is set up, with the password ucon
    • it’s in group adm and wheel so it has full access to sudo

After booting, initialize the pacman keyring and populate the Arch Linux ARM package signing keys:

pacman-key --init
pacman-key --populate archlinuxarm

Direct link for minimal prebuilt OS image(no support unless missing core features):

# compressed image, ~800MB, 4GiB uncompressed
# b2sum
  • uConsole with RPi cores only
  • built in a VM
  • use dd or whatever you like to write it directly to your SD card
    • example dd command: xzcat xxx.img.zst | sudo dd of=/dev/your-tfcard-block-device


The repository for the source code: GitHub - PotatoMania/uconsole-cm3: Now you can put RPi CM3/CM4S in uConsole and run ArchLinux! Support CM3, CM4(S) in uConsole.

Prebuilt packages and automatic os image build scripts(need root privilege): GitHub - PotatoMania/uconsole-cm3-arch-image-builder: Build ready-to-use ArchLinux system image for uConsole(RPi core)

About the DSI panel init issue on CM3 and CM4:

  • on cm3, linux rpi-6.1.y, about 10 percent chance to fail, 400 trials
  • on cm3, linux rpi-6.6.28(current stable), no error in 400 trials? ah, I hope it works well.
  • on cm4s, linux rpi-6.6.28(current stable), 13 failures out of 411 trials
  • on cm3 and cm4s, linux rpi-6.6.30(latest 6.6.y), somehow buggy(DSI panel cannot be turned on/off fast or driver will fail) fixed now, still having initialization failures

CM4S is a CM4 variant with CM3 form factor.

I think updating kernel major version is not that easy. Besides, a big single patch of mixed features makes it non-trivial especially for beginners.


I understand that a CM4S is supposed to be the “same” as a CM4 right? Not sure, but so happy right now haha.

No schematics available so I assume the CM4 and CM4S are the same, except the form factor and peripherals(wireless module and GPIOs exposed, to be specific). After all, a SoC is a very compact chip which packs every significant part together.

1 Like

I’ll just try it out and see what happens. I’m on it, but first I need to learn how to apply the patches. I’m investigating haha :smiley:

Do these instructions work without having to patch the kernel?

The source code repo is for people who want to build/update their own kernel, or audit the code.

The scripts and prebuilt packages are made for user convenience and don’t need manually apply the patches.

Your options:

  1. build the kernel using code from source code repo, then
    • either build the os image/install arch manually or utilizing the scripts
  2. use existing prebuilts and scripts to build the whole os image

The compressed os image is about 800MB(4GB uncompressed). Directly distribute the image involves more security issues(reused keys etc.) so I’m kind of reluctant to do that, though it has no affect on me.

I tried to build it yesterday (learning, first time). It crashed a couple of times and gave up. Monday I’ll give it another go, this just takes foreeveeeeeeeeeer and you know nothing of progress, quite frustrating haha

oooooookay I give up. Here’s a minimal os image for everyone to test. I’D SUGGEST TO BUILD YOUR OWN!

This is a direct link! (or should I add an AD link :thinking:) The link is available until I delete the file on the server.

# This one is built in a VM,
# use dd to write it directly to your SD card or mass storage.

I’ll provide NO assistance if the image above is used, unless a supported hardware feature is missing. I’m happy to hear if it’s working on your uConsole though.

I do can try it to see if it works, still my mission is to build it. I’ll get there haha

It does indeed run on CM4, and didn’t find any problem yet. Having problems with the display tho, can’t find a way to rotate X for some reason.

First, congratulations!

Your problem is more of a software configuration one. Here’s a possible solution from yatli:

And there are plenty of other possible solutions in the forum.

I’m using sway(on a wayland session) right now. If you are interested in that, here’s the necessary config for sway to rotate the screen:

# DSI-1 is 720*1280
output DSI-1 transform 90 pos 0,0
1 Like

Hey Potato!

Thanks, I will try that. I was looking for that answer before and couldn’t find it. I was fighting with xrandr tho for some reason…

Thanks for the sway tip also, I actually wanted to try it at some point.
I’m really new to “linux” myself (some months now, not sure if even half a year), and having transitioned from Windows from one day to another completely, still I find myself mostly all the time on terminal, so I wanted to make it purely “tty” which is what I basically tried so far. Don’t take my “everything works” as totally accurate (I saw you have some CM check list on GitHub. Mentioning this just in case), as you can see I ran it without environment and with my totally lack of linux knowledge haha

I still want to compile the kernel with patches, as you provided everything to do it, but it’s getting quite difficulty to learn how to do it, as normally every bit of info you find is mostly a “copy paste tutorial” instead of explaining actually what are you doing so far, so I can’t understand a thing I’m doing. I get some errors at the end which just cancels everything out, and I don’t even know how to debug it, so a lot to learn.

I have 5 microSD’s so I’ll just keep one with this img, but still try to compile it myself on another one.

Again, thanks for everything!

EDIT: SO!! I was doing it inside the chrooted system inside the SD reading it from an external USB2 card reader, and yes I just realize now how stupid that was. Trying it now again :smiley:

I saw you have some CM check list on GitHub

You are right. But the only thing concerns me is the wireless connectivity. There’s no other major difference between models(cm4 and cm4s, specifically). If you have successfully setup the WiFi and bluetooth, then everything should work.

I still want to compile the kernel with patches, as you provided everything to do it, but it’s getting quite difficulty to learn how to do it

I have to admit that what I’ve provided may be not suitable for getting started. That’s just a compact(?) solution for Arch users, and I won’t bother to make it generic.

as normally every bit of info you find is mostly a “copy paste tutorial” instead of explaining actually what are you doing so far, so I can’t understand a thing I’m doing.

Maybe you want to get yourself familiar with common linux commands, faster :open_mouth:

BTW a few explainations for what I’ve done:

  • I need drivers that don’t exist in the newer linux/kernel, so I write code and then patches are created naturally.
  • I need a bootable image, so I need to follow how RPi and uConsole are designed. Thats how to arrange the partitions, modify the configs, etc…
  • I want a clean and upgradable OS image, so I’d better package everything properly so the package manager can handle everything with no hassel. That’s the same if you’re using Debian or most of other distros.
  • I want to have firefox’s hardware acceleration feature, so I want to try wayland and vulkan.

Then I am down to only a few choices.

I get some errors at the end which just cancels everything out, and I don’t even know how to debug it, so a lot to learn.

It looks like having a usable OS image is a positive feedback for your linux journey. Have fun then!


Hey Potato!

I just finished building my own arch following your steps and mixing some knowledge that I’ve got reading yatli’s github aswell. Gotta admit, some steps I was over-complicating myself for some reason, instead of just following what you wrote, but hey, what can I say, I grew loving this brain of mine, for some reason.

WiFi worked right away with your img. I have to try my build now tho. Bluetooth I wanted to try but got distracted with other things. I’ll report you back about it.

About the commands thing, you’re right, but it’s not the actual problem that I find. I mean, I want to know the reasoning etc of why to bind a chroot, or why and when to use this and that, not just remember that “that guide said this command after this one, I’ll always do it like this then”.

And yeah, absolutely! Anything that I can find helps me learn, and you provide a lot! :smiley:

Oh I forgot. I found that I had to take out the --noconfirm when installing the resulting pkgbuild for the patches, as it defaults to N when uninstalling the “linux-aarch64” (as you mentioned it should). I made a fork of your git (oh God, I hope this is how it works and I didn’t bother anything), then made the changes on the readme, with the comment. Now, as I understand, I could pull a request to make that change to the original repo, in this case yours. This gets reviewed, bla bla… etc. Is this an approximate of how this works, or I just don’t even know where the bullets are coming from?

Yes, brutally newb around.

1 Like

Where do you even buy one of these?

That’s a long story and I’d prefer not to tell that :slight_smile:

You’re a Dev, that’s why you have it. Period xd

1 Like

Sorry for the double post and being so annoying in general, but, I cannot make the bluetooth work for the love of someone. I ended up “learning” how to build it from scratch with your sources (lmao you did everything basically), but bluetooth, no way José. Any idea where could I look?

I’m trying to make a “musical workstation” (sequencers and midi stuff basically), to control other stuff. I was trying out I3 and love the way I can just have 4 or 5 programs running on different desktops and just moving from one to another. I do have Sway on the back of my head as you mentioned it the other day, but I’m not really a big fan of wayland, but I’ll give it a go at some point either way.

About your bluetooth problem: What have you tried to setup bluetooth? Have you ever installed bluez? or read about ArchWiki’s bluetooth page? I have no idea of your current situation. If you are sticking with Arch, then ArchWiki is almost always useful.

About sway or wayland: it’s just personal taste and you only need to choose whatever suits you best. Common DEs like GNOME and KDE supports wayland as well. I choose wayland just because I don’t want to mess with xserver, though it does introduce some problems to X11-only apps.

1 Like

Yes I did install bluez and everything. I’m kind of “used” to fight against this, as I had similar problems on my actual desktop machine (both with Arch and Manjaro), but I ended up resolving them.
This time time it’s a different arch on a completely different system, and still too new to all this. To me it looks like it doesn’t load the right module / firmware / whatever, as I cannot see any device / breadcrumb anywhere, or even dmesg.
I did built both kernel and the ap patch (which I understand it’s this one I need to use with CM4), in my desktop directly, in qemu env, directly on he uConsole… WiFi always works right away, but BT, never to be seen anywhere.
I made the mistake of not trying it with the img you provided. I will try it later.

On the other side there’s the Debian version that Rex is making. That just works flawless (with some minor things), but ah, I just cannot stand Debian at all D:

As soon as I fix this BT issue, I will try Sway. You giving me the curiosity now!

EDIT: Now that I think of. Manjaro has some ARM builds, even for RPI and such. I tried them on the uConsole, you just need an HDMI cable out because no screen. If I install your kernel on it… should it work? My brain says yes, but I don’t know.