Skip to content

Atomic Debugging

JumpyVi edited this page Oct 26, 2026 · 2 revisions

Debugging

Disabling all sysexts before startup

In systemd-boot, press e to edit the current entry, and add the systemd.mask=systemd-sysext.service option

Enable usroverlay

Enabling an usroverlay can be usefull for testing configurations or software than must be installed in /usr. This may result in catastrophic failures, use at your own risk.

Create a mutable overlay:

You can also make it persist across reboot with /var/lib/extensions.mutable/usr instead of /run/extensions.mutable/usr

sudo systemd-sysext unmerge
sudo mkdir -p /run/extensions.mutable/usr
sudo systemd-sysext merge --mutable=yes

You can now add/modify files in /usr, they are stored in /run/extensions.mutable/usr.

Delete that overlay (and all it's data):

sudo rm -rf /run/extensions.mutable/
sudo systemd-sysext refresh

Installing ephemeral APT packages

Warning: Installing APT packages might mess up your system by adding files to /etc This is ONLY for debuging and elementaryOS devs, NOT for package management

First, enable an ephemeral mutable sysext

Then:

You must re-run this after each upgrade to re-sync the package DB

sudo addgroup --system ssl-cert
sudo rm -rf /var/lib/dpkg
sudo tar -xzvf /usr/share/factory/dpkg/dpkg.tar.gz -C /
sudo /usr/bin/apt update

You can now test out packages that will be auto-discarded on reboot

sudo /usr/bin/apt install cowsay

Common errors

Failed to resolve $BOOT: Required key not available

EFI wasnt mounted properly at boot

sudo mkdir -p /efi
sudo mount /dev/nvme0n1p1 /efi
sudo systemd-sysupdate list

No such target (updating/installing features)

Directly after running sudo updatectl enable --now {feature}, run sudo systemctl status systemd-sysupdated. There should be a clear error

Changing release variant

This is to switch between daily, proposed and stable This is not recommended outside of debugging

While you can switch to daily images with this method, please still consider sponsoring elementary so we can keep making them!

  1. Get a root shell
run0
  1. Set your new variant (daily, proposed or stable)
NEW_STREAM=stable
cp /etc/os-release /tmp/os-release
sed -i "s/^VARIANT_ID=.*/VARIANT_ID=${NEW_STREAM}/" /tmp/os-release
  1. Update to the new variant
SYSTEMD_OS_RELEASE=/tmp/os-release sysupdate update

Clone this wiki locally