Skip to content
Snippets Groups Projects
Commit ad3c365a authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak
Browse files

librem5-base-defaults: Use librem5.state file to store ALSA state

This prevents the old asound.state file to be loaded with outdated
values that are potentially incompatible with the new UCM.

As an added bonus, allow the state to be reset when the user deletes
the librem5.state file manually and reboots - previously
alsa-restore.service would simply regenerate the state file on
shutdown, making it hard to intentionally reset the state.
parent 0e83f898
No related branches found
No related tags found
1 merge request!311defaults: ucm2: Rework ALSA UCM profiles
......@@ -6,7 +6,7 @@ default/adwaita-phone.jpg usr/share/librem5/default-theme/
default/audio/pulse etc/
default/audio/profile-sets usr/share/pulseaudio/alsa-mixer/
default/audio/ucm2 usr/share/alsa/
default/audio/alsa-restore.service.d lib/systemd/system/
default/sm.puri.OSK0.desktop usr/share/applications/
default/osk-wayland usr/bin/
......
[Service]
# Make sure to not load outdated asound.state file and use librem5.state to store current state instead.
# As an added bonus, allow the state to be reset when the user deletes the librem5.state file manually and reboots.
ExecStartPre=/bin/rm -f /var/lib/alsa/asound.state
ExecStart=
ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime -f /var/lib/alsa/librem5.state restore
ExecStartPost=/usr/bin/touch /var/lib/alsa/librem5.state
ExecStop=
ExecStop=/bin/rm -f /var/lib/alsa/asound.state
ExecStop=/bin/sh -c '[ -f /var/lib/alsa/librem5.state ]'
ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime -f /var/lib/alsa/librem5.state store
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment