[Issue] Running steamos-devmode enable throws a read-only error
Your system information
- Steam client version: 1726683985
- SteamOS version: 3.6.15
- Opted into Steam client beta?: No
- Opted into SteamOS beta?: Yes
- Have you checked for updates in Settings > System?: Yes
Please describe your issue in as much detail as possible:
Running sudo steamos-devmode enable should properly disable read-only and initialize pacman for use, but it throws an read-only error when the script try to touch /usr/lib/steamos/steamos-devmode.
If you check sudo steamos-readonly status it says disable and if you check sudo steamos-devmode status it says disabled.
Even though sudo steamos-readonly status says disable, you can't use sudo pacman -Syy because it throws an read-only error.
Steps for reproducing this issue:
- Enter Konsole
- Set a psswd
- Run
sudo steamos-devmode enable
Been working okay here on SteamOS 3.6.15 and SteamOS 3.7 for me. Did you make any adjustments to your SteamOS install?
:: Developer mode enabled
:: See also `steamos-unminimize --dev` to recover package files pruned
:: from the image and install development packages.
(deck@steamdeck ~)$ sudo steamos-devmode status
enabled
(deck@steamdeck ~)$ sudo steamos-readonly status
disabled
(deck@steamdeck ~)$ sudo pacman -Syy
:: Synchronizing package databases...
jupiter-3.6 127.8 KiB 257 KiB/s 00:00 [######################] 100%
holo-3.6 90.1 KiB 175 KiB/s 00:01 [######################] 100%
core-3.6 213.8 KiB 427 KiB/s 00:01 [######################] 100%
extra-3.6 10.4 MiB 3.97 MiB/s 00:03 [######################] 100%
community-3.6 45.0 B 87.0 B/s 00:01 [######################] 100%
multilib-3.6 225.3 KiB 367 KiB/s 00:01 [######################] 100%
I've rollback to Stable 3.5 and did the sudo steamos-devmode enable with success and was able to use pacman, after that I've upgraded to Beta 3.6.15 and did the sudo steamos-devmode enable and the script throw the error trying to touch the /usr/lib/steamos/steamos-devmode.
Still, even though sudo steamos-readonly status yield disable, pacman do not work because it throws an error saying it was unable to lock the database because the system is readonly. (there's no db.lck file, I've checked if it was the case)
Really awkward error in my opinion. What channel is SteamOS 3.7 deployed? I would like to try to switch to it before switching back to 3.6.15 to see if it would fix this error, if not I may try to repair my image or reimage the Deck.
@mario-aleo
What channel is SteamOS 3.7 deployed?
I suppose that you have tried by not, but just in case: 3.7 on Main at the moment.
BTW, I tested it on 3.6.17 and seems fine.
Same issue on 3.7, rolled back to 3.5 and it was fine, turned to 3.6 and it's still yielding the same error.
touch: cannot touch '/usr/share/steamos/devmode-enabled': Read-only file system
Running sudo pacman -Syy it throws:
error: failed to synchronize all database (unable to lock database)
I'm thinking on maybe reimage the Deck and see if it works.
I've updated to 3.6 after stable release but the error still persisted. I've reimaged and now it is working fine.
I think I figured out what happened here after running into it myself, you end up in this state if you use a systemd-sysext like Tailscale or Yakuake (or if you made one yourself). Technically steamos-readonly is disabled, but because you then add on the systemd-sysext, that essentially locks your rootfs again.
@bertogg do you think it would be worth adding a check for systemd-sysexts inside of steamos-readonly status or steamos-devmode? that way users won't be caught off guard if they get conflicting information from steamos-devmode
@matte-schwartz yeah, maybe it's not a bad idea.
From 047441e5934826dbd64307b3287dbcc554d479df Mon Sep 17 00:00:00 2001
From: Matthew Schwartz <[email protected]>
Date: Thu, 5 Dec 2024 12:14:06 -0800
Subject: [PATCH] steamos-devmode: add systemd-sysext merged extension check
Previously, the steamos-devmode enable command would have some vague
failures if a systemd-sysext extension was merged, as the rootfs is
read-only even while steamos-readonly status returned disabled.
This adds an initial check for any merged systemd-sysext extensions
before proceeding with the rest of the enable_devmode function, and warns
the user to unmerge them before proceeding.
Signed-off-by: Matthew Schwartz <[email protected]>
---
misc/bin/steamos-devmode.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/misc/bin/steamos-devmode.in b/misc/bin/steamos-devmode.in
index 04bf31d..2f9e7ae 100644
--- a/misc/bin/steamos-devmode.in
+++ b/misc/bin/steamos-devmode.in
@@ -63,6 +63,14 @@ usage() {
}
enable_devmode() {
+ # Check for active systemd-sysexts
+ if systemd-sysext status | tail -n +2 | grep -vq ' none '; then
+ eerr "Active systemd-sysext extensions detected."
+ eerr "Please unmerge them with \`systemd-sysext unmerge\`"
+ eerr "before running this script."
+ exit 1
+ fi
+
# ask nicely and give some guidance
print_warning
--
2.47.1
maybe something like this, unless you think there's a better way of checking this (ie a symlinked /var/lib/extensions/, although this could exist without any sysexts active inside). seems to be working properly on SteamOS Main for me.
I've been toying with a similar idea (in steamos-readonly status) and I have a couple of observations:
systemd-sysextallows to merge system extensions in mutable mode, in which case the concerned filesystem hierarchies remain read-write, so the fact that there are loaded extensions isn't a sufficient condition to bail out (but I don't know how to check the mutable state of loaded extensions)- it looks like nothing prevents system extensions from being called "none", which admittedly is a weird corner case, but it would make your test fail (in my tests I've been using the JSON output from
systemd-sysextand parsing it withjqto make the logic more robust)
saw your solution in the latest steamos-customizations push, just tried it on Main and it works great. thanks @oSoMoN!