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
This commit is contained in:
Marek Marczykowski-Górecki 2018-05-02 02:57:37 +02:00
parent d25ecb4e40
commit 23250f84b2
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
5 changed files with 20 additions and 7 deletions

View File

@ -299,9 +299,6 @@ install-common: install-doc
install -d $(DESTDIR)/usr/share/nautilus-python/extensions install -d $(DESTDIR)/usr/share/nautilus-python/extensions
install -m 0644 qubes-rpc/*_nautilus.py $(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 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 install -D -m 0755 misc/qubes-desktop-run $(DESTDIR)$(BINDIR)/qubes-desktop-run

View File

@ -82,6 +82,14 @@ update_qubesconfig() {
#/usr/lib/qubes/update-proxy-configs #/usr/lib/qubes/update-proxy-configs
# Archlinux pacman configuration is handled in update_finalize # 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 # Location of files which contains list of protected files
mkdir -p /etc/qubes/protected-files.d mkdir -p /etc/qubes/protected-files.d
# shellcheck source=init/functions # shellcheck source=init/functions

View File

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

View File

@ -181,6 +181,12 @@ case "${1}" in
glib-compile-schemas /usr/share/glib-2.0/schemas || true 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 if [ -x /usr/bin/dconf ]; then
dconf update dconf update
fi fi

View File

@ -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 echo 'include=file:///etc/yum.conf.d/qubes-proxy.conf' >> /etc/yum.conf
fi 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 || : dconf update &> /dev/null || :
# And actually setup the proxy usage in package managers # 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 %config(noreplace) /etc/yum.repos.d/qubes-r4.repo
/etc/yum/pluginconf.d/yum-qubes-hooks.conf /etc/yum/pluginconf.d/yum-qubes-hooks.conf
%config(noreplace) /etc/dnf/plugins/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 %config(noreplace) /etc/dconf/db/local.d/dpi
/usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf /usr/lib/systemd/system/user@.service.d/90-session-stop-timeout.conf
/usr/sbin/qubes-serial-login /usr/sbin/qubes-serial-login