Browse Source

Create /etc/dconf/profile/user dynamically, if not present

The /etc/dconf/profile/user file in some distributions is part of dconf
package, in some not. There are even cases where it changes between
package versions (Fedora 27 don't have it, but Fedora 28 do).
Also, base Debian Stretch don't have it, but Kali Linux based on it do.

To avoid overly complex dependency handling, create the file dynamically
on package installation if it's missing in that particular case. The
file content is canonical:

    user-db:user
    system-db:local

Fixes QubesOS/qubes-issues#3834
Marek Marczykowski-Górecki 6 years ago
parent
commit
23250f84b2

+ 0 - 3
Makefile

@@ -299,9 +299,6 @@ install-common: install-doc
 	install -d $(DESTDIR)/usr/share/nautilus-python/extensions
 	install -m 0644 qubes-rpc/*_nautilus.py $(DESTDIR)/usr/share/nautilus-python/extensions
 
-ifeq ($(findstring CentOS,$(shell cat /etc/redhat-release)),)
-	install -D -m 0644 misc/dconf-profile-user $(DESTDIR)/etc/dconf/profile/user
-endif
 	install -D -m 0644 misc/dconf-db-local-dpi $(DESTDIR)/etc/dconf/db/local.d/dpi
 
 	install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)$(BINDIR)/qubes-desktop-run

+ 8 - 0
archlinux/PKGBUILD.install

@@ -82,6 +82,14 @@ update_qubesconfig() {
     #/usr/lib/qubes/update-proxy-configs
     # Archlinux pacman configuration is handled in update_finalize
 
+    if ! [ -r /etc/dconf/profile/user ]; then
+        mkdir -p /etc/dconf/profile
+        echo "user-db:user" >> /etc/dconf/profile/user
+        echo "system-db:local" >> /etc/dconf/profile/user
+    fi
+
+    dconf update &> /dev/null || :
+
     # Location of files which contains list of protected files
     mkdir -p /etc/qubes/protected-files.d
     # shellcheck source=init/functions

+ 0 - 1
debian/qubes-core-agent.install

@@ -3,7 +3,6 @@ etc/apt/apt.conf.d/00notify-hook
 etc/apt/apt.conf.d/70no-unattended
 etc/apt/sources.list.d/qubes-r4.list
 etc/apt/trusted.gpg.d/qubes-archive-keyring.gpg
-etc/dconf/profile/user
 etc/dconf/db/local.d/dpi
 etc/default/grub.d/30-qubes.cfg
 etc/fstab

+ 6 - 0
debian/qubes-core-agent.postinst

@@ -181,6 +181,12 @@ case "${1}" in
 
         glib-compile-schemas /usr/share/glib-2.0/schemas || true
 
+        if ! [ -r /etc/dconf/profile/user ]; then
+            mkdir -p /etc/dconf/profile
+            echo "user-db:user" >> /etc/dconf/profile/user
+            echo "system-db:local" >> /etc/dconf/profile/user
+        fi
+
         if [ -x /usr/bin/dconf ]; then
             dconf update
         fi

+ 6 - 3
rpm_spec/core-agent.spec.in

@@ -342,6 +342,12 @@ if test -f /etc/yum.conf && ! grep -q '/etc/yum\.conf\.d/qubes-proxy\.conf' /etc
   echo 'include=file:///etc/yum.conf.d/qubes-proxy.conf' >> /etc/yum.conf
 fi
 
+if ! [ -r /etc/dconf/profile/user ]; then
+    mkdir -p /etc/dconf/profile
+    echo "user-db:user" >> /etc/dconf/profile/user
+    echo "system-db:local" >> /etc/dconf/profile/user
+fi
+
 dconf update &> /dev/null || :
 
 # And actually setup the proxy usage in package managers
@@ -586,9 +592,6 @@ rm -f %{name}-%{version}
 %config(noreplace) /etc/yum.repos.d/qubes-r4.repo
 /etc/yum/pluginconf.d/yum-qubes-hooks.conf
 %config(noreplace) /etc/dnf/plugins/qubes-hooks.conf
-%if 0%{?fedora} >= 23
-%config(noreplace) /etc/dconf/profile/user
-%endif
 %config(noreplace) /etc/dconf/db/local.d/dpi
 /usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf
 /usr/sbin/qubes-serial-login