Merge ~seb128/casper:desktop-canary-tweaks into casper:main

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: e665f06e6b97026e1dcf1fc3faeb1d130ca749f7
Proposed branch: ~seb128/casper:desktop-canary-tweaks
Merge into: casper:main
Diff against target: 65 lines (+59/-0)
1 file modified
scripts/casper-bottom/61desktop_canary_tweaks (+59/-0)
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+429002@code.launchpad.net

Description of the change

The changes have been tested in the canary ppa (without the check on ubuntu-desktop-installer/exit 0, which was added now because we don't want to impact the non canary ISO)

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This all seems OK, although couldn't most of these changes also be done in the live layer at ISO build time? Fine to land like this, I not going to insist on anything.

The -d /root/snap/ubuntu-desktop-installer/ relies on the snaps having been preseeded which is probably always true in practice but isn't quite guaranteed. I'm not sure what would be a better check, we could look for /root/var/lib/snapd/seed/ubuntu*.snap or something but it's probably OK for now.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the review. It sounded lika a +1 with suggestion for futur improvements so I merged that one for now, which should give us a working canary build without ppa and no regressions on days where there is a casper upload to Ubuntu which we didn't rebase yet.

I've no strong opinion on what's the right place to do the customization, we have a bunch of similar hacks in casper today which is why I added there but we can move things later if wanted

And on the 'check that the image is a canary one' we will check if there is a better way but that should go away anyway once canary becomes the new desktop installer

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

That all makes sense to me.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/casper-bottom/61desktop_canary_tweaks b/scripts/casper-bottom/61desktop_canary_tweaks
2new file mode 100755
3index 0000000..f67b59b
4--- /dev/null
5+++ b/scripts/casper-bottom/61desktop_canary_tweaks
6@@ -0,0 +1,59 @@
7+#! /bin/sh
8+
9+PREREQ=""
10+DESCRIPTION="Tweaks for the desktop canary image..."
11+
12+prereqs()
13+{
14+ echo "$PREREQ"
15+}
16+
17+case $1 in
18+# get pre-requisites
19+prereqs)
20+ prereqs
21+ exit 0
22+ ;;
23+esac
24+
25+. /scripts/casper-functions
26+
27+log_begin_msg "$DESCRIPTION"
28+
29+if [ ! -d /root/snap/ubuntu-desktop-installer/ ]; then
30+ exit 0
31+fi
32+
33+# change settings to have an 'installer only' session by default
34+printf "[org.gnome.desktop.a11y]\nalways-show-universal-access-status=true\n" >> /root/usr/share/glib-2.0/schemas/casper.gschema.override
35+# 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
36+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
37+printf "[org.gnome.shell]\ndisabled-extensions=['ding@rastersoft.com']\n" >> /root/usr/share/glib-2.0/schemas/casper.gschema.override
38+
39+chroot /root glib-compile-schemas /usr/share/glib-2.0/schemas/
40+
41+# set the right kernel variant
42+echo "linux-generic-hwe-22.04" > /run/kernel-meta-package
43+
44+# start the installer on session start, restore normal session on close
45+cat > /root/usr/lib/systemd/user/ubuntu-desktop-installer.service << EOF
46+
47+[Unit]
48+Description=Ubuntu Desktop Installer
49+PartOf=graphical-session.target
50+After=graphical-session.target
51+
52+# Never run in GDM
53+Conflicts=gnome-session@gnome-login.target
54+
55+[Service]
56+Type=oneshot
57+ExecStart=/snap/bin/ubuntu-desktop-installer
58+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@rastersoft.com"
59+Restart=no
60+EOF
61+
62+mkdir /root/etc/systemd/user/graphical-session.target.wants/
63+ln -s /root/usr/lib/systemd/user/ubuntu-desktop-installer.service /root/etc/systemd/user/graphical-session.target.wants/
64+
65+log_end_msg

Subscribers

People subscribed via source and target branches