[Merge] ~edubuntu-dev/casper:main into casper:main

Erich Eickmeyer mp+457266 at code.launchpad.net
Mon Dec 11 21:42:51 UTC 2023


Added Sébastien Bacher since he and I had discussions about this on IRC. I don't believe in making more than the necessary changes just to get this working since it's likely more changes are coming, and what is coming from the original file is what works for Ubuntu Desktop.

Since Edubuntu is structured as an add-on to Ubuntu Desktop's minimal seed, I strenuously object to making any changes that divert from the original file other than what it takes to merely get it functioning. Since 61desktop_canary_tweaks is known to function without error, I see no reason for the extra scrutiny.

Diff comments:

> diff --git a/scripts/casper-bottom/62edubuntu_tweaks b/scripts/casper-bottom/62edubuntu_tweaks
> new file mode 100755
> index 0000000..cc56273
> --- /dev/null
> +++ b/scripts/casper-bottom/62edubuntu_tweaks
> @@ -0,0 +1,56 @@
> +#! /bin/sh

Considering for Ubuntu Desktop it Just Works (tm), is released in production, and is continuing to be released, and I've tested it myself, I'd have to say it works appropriately.

> +
> +PREREQ=""
> +DESCRIPTION="Tweaks for the edubuntu image..."
> +
> +prereqs()
> +{
> +       echo "$PREREQ"
> +}
> +
> +case $1 in
> +# get pre-requisites
> +prereqs)
> +       prereqs
> +       exit 0
> +       ;;
> +esac
> +
> +. /scripts/casper-functions
> +
> +log_begin_msg "$DESCRIPTION"
> +
> +if [ ! -d /root/snap/edubuntu-desktop-installer/ ]; then
> +    exit 0
> +fi
> +
> +# change settings to have an 'installer only' session by default
> +printf "[org.gnome.desktop.a11y]\nalways-show-universal-access-status=true\n" >> /root/usr/share/glib-2.0/schemas/casper.gschema.override
> +# we can't unload the dock because the shell would enter the overview on login, https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1788
> +printf "[org.gnome.shell.extensions.dash-to-dock:ubuntu]\ndock-fixed=false\nintellihide=false\n" >> /root/usr/share/glib-2.0/schemas/casper.gschema.override
> +printf "[org.gnome.shell]\ndisabled-extensions=['ding at rastersoft.com']\n" >> /root/usr/share/glib-2.0/schemas/casper.gschema.override

Perhaps, however, this would also need be done on 61desktop_canary_tweaks as well to mirror this (not my code).

> +
> +chroot /root glib-compile-schemas /usr/share/glib-2.0/schemas/

I'm going to leave this for those that wrote this part of the code, because, for Ubuntu Desktop, it Just Works (tm).

> +
> +# start the installer on session start, restore normal session on close
> +cat > /root/usr/lib/systemd/user/edubuntu-desktop-installer.service  << EOF
> +
> +[Unit]
> +Description=Edbuntu Desktop Installer
> +PartOf=graphical-session.target
> +After=graphical-session.target
> +
> +# Never run in GDM
> +Conflicts=gnome-session at gnome-login.target
> +
> +[Service]
> +Type=oneshot
> +ExecStart=/snap/bin/edubuntu-desktop-installer --try-or-install

Discussed this with Sébastien Bacher and we decided this exact file would have to be duplicated by each flavor intending to use ubuntu-desktop-installer/ubuntu-flavor-installer while also intending to provide the try-or-install screen, so sadly, no.

As far as guaranteed to start after snapd, this might answer your question from the snapd.service file itself:

Description=Snap Daemon
After=snapd.socket
After=time-set.target
After=snapd.mounts.target
Wants=time-set.target
Wants=snapd.mounts.target
Requires=snapd.socket
OnFailure=snapd.failure.service

So, considering it starts right after time-set.target, it's one of the first services to be executed. Therefore, yes, this service that is being written is certainly guaranteed to be running after snapd. systemd services are fairly race-condition-proof when done correctly.

> +ExecStopPost=sh -c "gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true; gsettings set org.gnome.shell.extensions.dash-to-dock intellihide true; gnome-extensions enable ding at rastersoft.com"

Sadly, in systemd unit files, the commands must be done all in one line and cannot be escaped onto a new line, nor can you include variables. This is basically it.

> +Restart=no
> +EOF
> +
> +mkdir /root/etc/systemd/user/graphical-session.target.wants/

Agreed. However, this change should also be done on 61desktop_canary_tweaks as well to mirror this (not my code).

> +ln -s /root/usr/lib/systemd/user/edubuntu-desktop-installer.service /root/etc/systemd/user/graphical-session.target.wants/
> +
> +log_end_msg


-- 
https://code.launchpad.net/~edubuntu-dev/casper/+git/casper/+merge/457266
Your team Edubuntu Developers is subscribed to branch ~edubuntu-dev/casper:main.




More information about the Ubuntu-reviews mailing list