System may not boot after postmarketos-base upgrade

October 10, 20261 min. read

Since postmarketos-base-77-r0, the /etc/os-release symlink is no longer provided, under the assumption that it will be managed by tmpfiles on reboot. This means that it is not present until next boot.

The change was however incomplete: mkinitfs still looked for that path, resulting in the following error after upgrade:

* 11:48:59.175854 hookfiles: unable to process hook file
  "/usr/share/mkinitfs/files/postmarketos-base.files": unable to add
  "/etc/os-release": getFile: failed to stat file "/etc/os-release": stat
  /etc/os-release: no such file or directory (also tried "/etc/os-release.zst":
  stat /etc/os-release.zst: no such file or directory)
* 11:48:59.175949 failed to generate:  initramfs
* 11:48:59.176391 mkinitfs completed in: 0.08s

If you see this message, do not reboot until you've followed the instructions in the next section. This is because the initramfs also looked for /etc/os-release in the root filesystem during boot in order to determine if it it is a valid Nura installation. With it missing, boot fails with a Root partition does not contain a root filesystem error.

Fix

The postmarketos-base-78-r0 and postmarketos-initramfs-3.12.4-r0 package versions fix this by looking for /usr/lib/os-release instead. If you did not reboot yet, run:

# apk upgrade -a
# apk fix

to get the fixed versions.

Recovery

If you did reboot and ended up with an unbootable system, you can still fix this by entering the following commands in the debug-shell:

# touch /sysroot/etc/os-release
# reboot

This will let your device fully boot, after which you can upgrade to the fixed packages:

# rm /etc/os-release
# apk upgrade -a
# apk fix

Reach out in chat if you need help.

Also see