summarylogtreecommitdiffstats
path: root/002-confdir.patch
blob: ca82be3b0c05e966a1d76a6734adcb3f4b8fb7f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
diff --git a/pipewire-confs/hardware-profiles/pipewire-hwconfig b/pipewire-confs/hardware-profiles/pipewire-hwconfig
index ac7adb6..d46bb14 100755
--- a/pipewire-confs/hardware-profiles/pipewire-hwconfig
+++ b/pipewire-confs/hardware-profiles/pipewire-hwconfig
@@ -51,40 +51,24 @@ dmi_info ()
 install_hwprofile ()
 {
     local -r prpath="$1"
-    local -r runconf=/run/pipewire
+    local -r confdir=/usr/share/pipewire
     local confd
     local cffile
 
-    echo "Installing pipewire hardware profile from '$prpath' in $runconf"
-
-    rm -rf $runconf
+    echo "Installing pipewire hardware profile from '$prpath' in $confdir"
 
     for confd in "${confdirs[@]}"
     do
         if [ -d "$prpath"/"$confd" ]
         then
-            mkdir -p $runconf/"$confd"
+            mkdir -p $confdir/"$confd"
 
             for cffile in "$prpath"/"$confd"/*.conf
             do
-                [ -f "$cffile" ] && cp -av "$cffile" $runconf/"$confd"
+                [ -f "$cffile" ] && /usr/bin/cp -avf "$cffile" $confdir/"$confd"
             done
         fi
     done
-
-    cat - <<EOF > $runconf/README
-This configuration was:
-
- - installed in $runconf
- - by $0
- - from $prpath
-
-It will be regenerated every time the system restarts.
-
-To alter it permanently either:
- - edit $prpath
- - override in \$XDG_CONFIG_HOME/pipewire/
-EOF
 }
 
 unidentified ()
diff --git a/pipewire-confs/systemd/system/pipewire-sysconf.service b/pipewire-confs/systemd/system/pipewire-sysconf.service
index 449a278..baf3a3c 100644
--- a/pipewire-confs/systemd/system/pipewire-sysconf.service
+++ b/pipewire-confs/systemd/system/pipewire-sysconf.service
@@ -11,13 +11,13 @@
 Description=Hardware Specific Pipewire Configuration
 Before=multi-user.target
 Requisite=multi-user.target
-ConditionPathIsDirectory=/run
+Requires=pipewire-workaround.service
 Before=shutdown.target
 
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/usr/share/pipewire/hardware-profiles/pipewire-hwconfig
+ExecStart=/usr/libexec/hwsupport/pipewire-hwconfig
 
 [Install]
 WantedBy=multi-user.target
diff --git a/wireplumber/hardware-profiles/wireplumber-hwconfig b/wireplumber/hardware-profiles/wireplumber-hwconfig
index 3f03354..1e43489 100755
--- a/wireplumber/hardware-profiles/wireplumber-hwconfig
+++ b/wireplumber/hardware-profiles/wireplumber-hwconfig
@@ -46,49 +46,33 @@ dmi_info ()
 install_hwprofile ()
 {
     local -r prpath="$1"
-    local -r runconf=/run/wireplumber
+    local -r confdir=/usr/share/wireplumber
     local confd
     local cffile
 
-    echo "Installing wireplumber hardware profile from '$prpath' in $runconf"
-
-    rm -rf $runconf
+    echo "Installing wireplumber hardware profile from '$prpath' in $confdir"
 
     for confd in "${confdirs[@]}"
     do
         if [ -d "$prpath"/"$confd" ]
         then
-            mkdir -p $runconf/"$confd"
+            mkdir -p $confdir/"$confd"
             case $confd in
                 *.lua.d)
                     for cffile in "$prpath"/"$confd"/*.lua
                     do
-                        [ -f "$cffile" ] && cp -av "$cffile" $runconf/"$confd"
+                        [ -f "$cffile" ] && /usr/bin/cp -avf "$cffile" $confdir/"$confd"
                     done
                     ;;
                 *.conf.d)
                     for cffile in "$prpath"/"$confd"/*.conf
                     do
-                        [ -f "$cffile" ] && cp -av "$cffile" $runconf/"$confd"
+                        [ -f "$cffile" ] && /usr/bin/cp -avf "$cffile" $confdir/"$confd"
                     done
                     ;;
             esac
         fi
     done
-
-    cat - <<EOF > $runconf/README
-This configuration was:
-
- - installed in $runconf
- - by $0
- - from $prpath
-
-It will be regenerated every time the system restarts.
-
-To alter it permanently either:
- - edit $prpath
- - override in \$XDG_CONFIG_DIR/wireplumber/
-EOF
 }
 
 unidentified ()
diff --git a/wireplumber/systemd/system/wireplumber-sysconf.service b/wireplumber/systemd/system/wireplumber-sysconf.service
index cdf5ed9..81cca6e 100644
--- a/wireplumber/systemd/system/wireplumber-sysconf.service
+++ b/wireplumber/systemd/system/wireplumber-sysconf.service
@@ -11,13 +11,13 @@
 Description=Hardware Specific Wireplumber Configuration
 Before=multi-user.target
 Requisite=multi-user.target
-ConditionPathIsDirectory=/run
+Requires=wireplumber-workaround.service
 Before=shutdown.target
 
 [Service]
 Type=oneshot
 RemainAfterExit=yes
-ExecStart=/usr/share/wireplumber/hardware-profiles/wireplumber-hwconfig
+ExecStart=/usr/libexec/hwsupport/wireplumber-hwconfig
 
 [Install]
 WantedBy=multi-user.target