Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

unowned /usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-interface.gschema.override after canary install #2315

Open
jibel opened this issue Aug 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jibel
Copy link
Contributor

jibel commented Aug 28, 2023

From https://bugs.launchpad.net/ubuntu-desktop-installer/+bug/2033117

After a classic install (no tpm fde) using the 20230825.2 canary image, I have a file
/usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-interface.gschema.override on the target system which according to dpkg has no owner.

The contents of the file are:

$ cat /mnt/2/usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-interface.gschema.override
[org.gnome.desktop.interface:ubuntu]
color-scheme='prefer-light'
gtk-theme='Yaru'
$

I do not remember if the non-canary image prompted me for a theme preference, or if I made the same selection on the non-canary image. However, the installer should not be writing files under /usr to the target system; /usr is owned by the package manager. Overrides need to be written somewhere else, one of /home, /var, /etc in decreasing order of preference (the theme selection should IMHO only apply to the initial user and not to further users on the system who are added post-install).

On both canary and daily-live, I also see a file /usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-wm.gschema.override which is identical between the two installs.

$ cat /mnt/2/usr/share/glib-2.0/schemas/20_ubuntu-desktop-installer-wm.gschema.override
[org.gnome.desktop.wm.keybindings:ubuntu]
maximize=@as []
unmaximize=@as []
$

I have no idea what this file is for.

This is done by ubuntu-desktop-installer/snap/local/postinst.d/10_override_desktop_settings and four files are created this way:

#!/bin/sh
set -e

user=ubuntu
target=/target
source_schemas=/usr/share/glib-2.0/schemas
target_schemas=$target/$source_schemas

if [ ! -d $source_schemas ] || [ ! -d $target_schemas ] || ! id $user >/dev/null 2>&1; then
    exit
fi

dconf_dump() {
    target_schema=$target_schemas/20_ubuntu-desktop-installer-$1.gschema.override
    sudo -u $user dconf dump /org/gnome/desktop/$1/ > $target_schema
    # - [foo] -> [org.gnome.desktop.$1.foo:ubuntu]
    sed -i -E "s/^\[([^/]*)\]/\[org.gnome.desktop.$1.\1:ubuntu\]/g" $target_schema
    # - [/] -> [org.gnome.desktop.$1:ubuntu]
    sed -i -E "s/^\[\/\]$/\[org.gnome.desktop.$1:ubuntu\]/g" $target_schema
    [ -s $target_schema ] || rm $target_schema
}

dconf_dump a11y
dconf_dump interface
dconf_dump peripherals
dconf_dump wm

glib-compile-schemas $target_schemas
@jibel jibel added the bug Something isn't working label Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant