Bookworm 6.6.y for the uConsole and DevTerm

I haven’t seen a screen like that on 6.6.78. I did see something like that on 6.6.73 when I hooked up an external monitor.

I’ve tried a few different cards. Using a micro center, and TopeSel now. They seem to be working good. I think I’ll try the TEAMGROUP link you sent above.

Every now and then it seems to get into a weird mode where I can’t shut it down. The power led goes dim. and will turn on. But nothing happens even if I use an external monitor. A really long press on the power button turns off the power led but the backlit screen is still on. Only way I’ve found out of this mode is to pull the batteries. have you seen this?

I have seen it but only when I’ve ran to low on battery with the CM5. Most people with the lite version seem to be having problem but the eMMC not so much. I’m going to be ordering a CM5 lite on payday so hopefully we’ll be able to get it fixed. @Symbiiote does have a lite and says he does not have a problem with these. I have already ordered a set of the 128gb to test when I get mine CM5 lite.

Im waiting on my CM5 but was wondering what you do for cooling with the CM5? I am also going to use a 10000 mah battery in place of the 2 18650’s -Brian-

Normal use the case works well, I put a M.2 heatsink on the back with thermal tape.
running a full extended stress test I top out at 71c.

2 Likes

I just thought of something. Jeff Geerling mentioned in a recent video that some memory capacity pi5 have slightly different chips. Could this be why some cm5 are working and some are not?

WE HAVE LIFE! been through 3 successful boots so far. Currently without batteries, powered by an external battery. I’ll try batteries later. First boot the keyboard was unresponsive but on the second boot it worked. Embarrassed to admit that my cm4 adapter module was not inserted all the way, leading to some frustration when I got home.



5 Likes

I’ll send you a new overlay tomorrow and we’ll get the fan and printer running, give a little air flow to that hot copper.
What sd card are you using?

Awesome. Printer is not a top priority for me but the fan would be good.

I’m using a Raspberry Pi branded 128gb card. No clue to the actual brand but it’s supposedly tested for the 5. I ordered it when I ordered the cm5 (and after reading the trouble people were having), thought it would be the best shot.

2 Likes

I’m glad the panel worked right away. There was some bad distortion on the uConsole’s panel I had to fix.

1 Like

Yah it worked great! I only had to change the screen orientation once I was booted up. I’m having trouble connecting to my home network, but I had that before. I was able to connect to a cell hotspot for a bit. I should check to see that the antenna connection isn’t loose or something.

You have it plugged into the Clockwork main board, you need to plug it into the CM5.
Or remove dtparam=ant2 from config.txt to use the PCB antenna on the CM5.

1 Like

:person_facepalming: I’ll fix that when I reinsert the batteries.

2 Likes

Fixed wifi and inserted batteries. Charging off my external pack, not sure if the charging indicator is working or if my batteries are completely dead. Probably the latter.

1 Like

Your main board is the exact same as the uConsole so the charge indicator works. You might need to let them charge overnight or get new ones.

1 Like

Renoise installed and tested. Those extra MHz of the cm5 make a world of difference. I’m able to play complex resource heavy songs at a much higher sample rate (48000), and lower latency. Previously with the 4 it would crash at these settings. Way worth the upgrade. I have to use screen scaling to fit the renoise window on the devterm (.78%, interface is still legible), had to switch over to labwc. Previously I used xrandr panning but that appears to no longer be available. CPU is getting HOT though, over 80.

1 Like

Okay back with some more testing. I got a bunch of brand new sd cards all the same type and size. I loaded the latest image from the top off the thread and ran the following tests (all on separate cards)

Test A
Running on USB and no battery New flash of the img file. started up and selected default local options, created user account, no network, no updates, and rebooted.
I was able to reboot from the UI menu (shutdown → reboot) 10 times and everything worked perfectly. I then tried to shutdown by double clicking the power button. When trying to restart it failed to boot and I got the bootloader error. I cut power and tried to boot five more times with the same result.

Test B
Same exact configuration as the Test A.
After rebooting from the menu 12 times (just to make sure there is nothing special about 10) I then tried to shutdown using the UI menu. When trying to restart it again failed to boot. I cut power and tried again five more times and it never worked again.

Test C1
Same exact configuration as Test A and B
After rebooting from the menu 8 times, I cut power by pulling the usbc cable. I tried to boot again and got the same bootloader error.

Test C2
Using the same memory card from Test C1 I used my laptop to edit the cmdline.txt with root=/dev/mmcblk0p2
Put card back in device and failed to boot five more times.

Test C3
Took the memory card back out and edited cmdline.txt on my laptop to add sdhci.debug_quirks2=4.
Put the card back in the device and failed to boot five more times.

Test D
Same configuration as Test A but this time I made both changes from C2 and C3 to cmdline.txt before booting the first time.
Same results as before. Able to restart through the menu multiple times, but fails after the first shutdown. Will never boot again.

(Edit: I did all these tests on brand new SanDisk Extreme 64Gb cards. I then repeated test A with a bunch of other random cards I had laying around. Samsung Evo, Kingston, Amazon Basics, etc. Pretty much the same issue, although not as rigorously tested. Oddly, the Samsung 512Gb seemed to work about 50% of the time. Like after getting the bootloader error I could power cycle a few times and get it to boot again sometimes)

3 Likes

Hi @Rex.

I spent a few days creating a custom image with my daily tools and games preloaded / preinstalled and properly configured, using your bookworm lite image.

It works great, thanks a lot for the work you have done !

However, I store a lot of personal data on my sdcard and I want to adapt my previous procedure for Bullseye to encrypt my root partition with LUKS (Guide : encrypted root partition on uConsole).

In theory I cannot see why it would not be possible, but there are definitely some changes with bookworm, notably with initramfs…

I found some resources that helped me a bit :

My current procedure looks like this.

On the live OS on uconsole, install the pre-requisite packages :

sudo apt install busybox cryptsetup initramfs-tools cryptsetup-initramfs

Some of them are already installed by default now.

Next, create a hook script to ensure LUKS is on initramfs : /etc/initramfs-tools/hooks/luks_hooks. Some other binaries are apparently needed :

#!/bin/sh -e
PREREQS=""
case $1 in
        prereqs) echo "${PREREQS}"; exit 0;;
esac

. /usr/share/initramfs-tools/hook-functions

copy_exec /usr/lib/aarch64-linux-gnu/libgcc_s.so.1 /usr/lib/aarch64-linux-gnu
copy_exec /usr/lib/aarch64-linux-gnu/libpthread.so.0 /usr/lib/aarch64-linux-gnu
copy_exec /sbin/resize2fs /sbin
copy_exec /sbin/fdisk /sbin
copy_exec /sbin/cryptsetup /sbin

Making it executable :

sudo chmod +x /etc/initramfs-tools/hooks/luks_hooks

add the following to /etc/initramfs-tools/modules :

algif_skcipher
xchacha20
adiantum
aes_arm
sha256
nhpoly1305
dm-crypt
aes_generic
chacha_generic
nhpoly1350
xts

And finally rebuilding initramfs:

sudo update-initramfs -u

Modify /etc/fstab to expect an open luks container :

/dev/mapper/sdcard / ext4 defaults,noatime 0 1

Edit /etc/crypttab in the same way :

sdcard /dev/mmcblk0p2 none luks

The next stage would be to try to boot this initramfs image after altering /boot/firmware/cmdline.txt :

console=serial0,115200 console=tty1 root=/dev/mapper/sdcard rootfstype=ext4 cryptdevice=/dev/mmcblk0p2:sdcard fsck.repair=yes rootwait fbcon=rotate:1 psi=1

Next, i remove the sdcard from the uconsole, and plug it in my laptop using a USB dongle (recognized as /dev/sda).

I backup my data partition : sudo dd bs=4k if=/dev/sda2 of=./data.img status=progress

Format the LUKS-encrypted partition to-be :

sudo cryptsetup --type luks2 --cipher xchacha20,aes-adiantum-plain64 --hash sha256 --iter-time 5000 --key-size 256 --pbkdf argon2i luksFormat /dev/sda2

I then use parted / gparted to expend the /dev/sda2 partition a bit (some Gb), to ensure my data fill fit in.

Open the LUKS partition : sudo cryptsetup luksOpen /dev/sda2 sdcard

Copy back my data on the LUKS partition : sudo dd bs=4k if=./data.img of=/dev/mapper/sdcard status=progress

Quick fsck : sudo e2fsck -f /dev/mapper/sdcard

And close the LUKS partition : sudo cryptsetup luksClose /dev/mapper/sdcard

At this stage, we should be able to attempt to boot and see it fail to open this partition without someone typing a passphrase and open an initramfs shell, where I would type cryptsetup luksOpen /dev/mmcblk0p2 sdcard, exit the shell, finish proper boot to the os and generate a final initramfs with sudo update-initramfs -u. Thus ensuring that our initramfs is now properly loaded at boot.

I did not manage to have the built-in uconsole screen print these early boot messages, but plugging an external hdmi screen does the trick.

And that’s where I am stuck :

And it stays there indefinitely.

I don’t understand very well how the debian / raspberry pi OS boot process works. But I think that something is wrong at an early stage, since I expected the boot process to fail and drop me to an initramfs shell at the very least.

I am not even sure that my new initramfs is loaded.

I tried to add auto_initramfs=1 in /boot/firmware/config.txt with no success.

I also tried to mount the boot partition on my laptop, manually copy the latest built initramfs (initrd.img-6.6.78-v8-16k+ as initramfs.gz or initramfs) to the /boot/ partition (/dev/sda1 / /dev/mmcblk0p1) and appending initramfs initramfs.gz followkernel or initramfs initramfs followkernel to /boot/firmware/config.txt, but to no avail.

Also, from my understanding, the directory /boot/firmware is a mapping at OS run time of /dev/mmcblk0p1 partition. Is this right ?

For sure I am missing something. I know you have already done a lot, but if with your high linux wisdom you could give me some pointers or a tip to where to look at, I would greatly appreciate it :slight_smile:

P.S.: I am on a CM4 8Gb RAM no EMMC, not a CM5.

I don’t encrypt my FS so I can’t help much there but I do see you are trying to use the CM5s initramfs. You want to use the 6.6.78-v8+ sudo update-initramfs -c -k 6.6.78-v8+ to generate a new one for the CM4.

@ mclbn, I am curious why you don’t just encrypt your home directory instead?

https://wiki.debian.org/TransparentEncryptionForHomeFolder

1 Like

@Rex thanks for pointing it. It was obviously a big part of the problem :smiley: It’s a bit dirty but it works now. Time to clean-up my notes and share a proper procedure.
Also thanks again for your work on porting bookworm & recent kernels to the uconsole. You definitely deserve some coffee !

@cjstoddard I prefer full root partition encryption so I just don’t have to worry at all. In my current setup I store passwords in my /etc/fstab in order to easily mount network drives, WiFi and vpn info are also stored in /etc/NetworkManager and I also don’t like that /var/log is unencrypted and could leak various info. There might be other problematic data locations, but with full root partition encryption I can just not care at all :slight_smile:

Also I have had bad times with home folder encryption in the past (with ecryptfs on Ubuntu I think). It was a very long time ago but I guess it stuck.

1 Like