Merge ~waveform/ubuntu/+source/ubuntu-settings:bonfire-of-hacks into ~ubuntu-desktop/ubuntu/+source/ubuntu-settings:master

Proposed by Dave Jones
Status: Merged
Merged at revision: a37bb9bfbbb867b77ae43bb45e57f22c27a0e5b6
Proposed branch: ~waveform/ubuntu/+source/ubuntu-settings:bonfire-of-hacks
Merge into: ~ubuntu-desktop/ubuntu/+source/ubuntu-settings:master
Diff against target: 161 lines (+84/-1)
10 files modified
data/raspberrypi/01-use-network-manager.yaml (+4/-0)
data/raspberrypi/meson.build (+6/-0)
data/raspberrypi/mkswap.service (+16/-0)
data/raspberrypi/swapfile.swap (+8/-0)
debian/changelog (+10/-0)
debian/control (+1/-1)
debian/rules (+4/-0)
debian/ubuntu-raspi-settings-desktop.install (+3/-0)
debian/ubuntu-raspi-settings-desktop.lintian-overrides (+7/-0)
debian/ubuntu-raspi-settings-desktop.postinst (+25/-0)
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+436647@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dave Jones (waveform) wrote :

Please see associated bug; it should link to both relevant merge requests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/data/raspberrypi/01-use-network-manager.yaml b/data/raspberrypi/01-use-network-manager.yaml
2new file mode 100644
3index 0000000..4a8fd08
4--- /dev/null
5+++ b/data/raspberrypi/01-use-network-manager.yaml
6@@ -0,0 +1,4 @@
7+# Let NetworkManager manage all devices on this system
8+network:
9+ version: 2
10+ renderer: NetworkManager
11diff --git a/data/raspberrypi/meson.build b/data/raspberrypi/meson.build
12index a390c5e..d082316 100644
13--- a/data/raspberrypi/meson.build
14+++ b/data/raspberrypi/meson.build
15@@ -16,3 +16,9 @@ install_data('raspi-zswap.conf',
16 install_dir: usr_share / 'initramfs-tools/modules.d')
17 install_data('99-fake-cloud.cfg',
18 install_dir: etc / 'cloud/cloud.cfg.d')
19+install_data('mkswap.service',
20+ install_dir: '/lib/systemd/system')
21+install_data('swapfile.swap',
22+ install_dir: '/lib/systemd/system')
23+install_data('01-use-network-manager.yaml',
24+ install_dir: etc / 'netplan')
25diff --git a/data/raspberrypi/mkswap.service b/data/raspberrypi/mkswap.service
26new file mode 100644
27index 0000000..6fc4829
28--- /dev/null
29+++ b/data/raspberrypi/mkswap.service
30@@ -0,0 +1,16 @@
31+[Unit]
32+Description=Create the default swapfile
33+DefaultDependencies=no
34+Requires=local-fs.target
35+After=local-fs.target
36+Before=swapfile.swap
37+ConditionPathExists=!/swapfile
38+
39+[Service]
40+Type=oneshot
41+ExecStartPre=fallocate -l 1GiB /swapfile
42+ExecStartPre=chmod 600 /swapfile
43+ExecStart=mkswap /swapfile
44+
45+[Install]
46+WantedBy=swap.target
47diff --git a/data/raspberrypi/swapfile.swap b/data/raspberrypi/swapfile.swap
48new file mode 100644
49index 0000000..d52a3f6
50--- /dev/null
51+++ b/data/raspberrypi/swapfile.swap
52@@ -0,0 +1,8 @@
53+[Unit]
54+Description=The default swapfile
55+
56+[Swap]
57+What=/swapfile
58+
59+[Install]
60+WantedBy=swap.target
61diff --git a/debian/changelog b/debian/changelog
62index 27c9fa0..c4f4cc9 100644
63--- a/debian/changelog
64+++ b/debian/changelog
65@@ -1,3 +1,13 @@
66+ubuntu-settings (23.04.4) UNRELEASED; urgency=medium
67+
68+ * ubuntu-raspi-settings-desktop: migrated livecd-rootfs hacks that
69+ introduce mkswap.service and swapfile.swap (LP: #2004430)
70+ * ubuntu-raspi-settings-desktop: migrated netplan network-manager
71+ configuration (LP: #2004430)
72+ * Bump standards version to current (4.6.2)
73+
74+ -- Dave Jones <dave.jones@canonical.com> Tue, 28 Mar 2023 13:48:22 +0100
75+
76 ubuntu-settings (23.04.3) lunar; urgency=medium
77
78 * gnome-initial-setup.desktop: Set StartupWMClass to fix app name & icon
79diff --git a/debian/control b/debian/control
80index 5735844..18486e5 100644
81--- a/debian/control
82+++ b/debian/control
83@@ -3,7 +3,7 @@ Section: x11
84 Priority: optional
85 Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com>
86 Build-Depends: debhelper-compat (= 12), meson (>= 0.40.1), dh-translations
87-Standards-Version: 4.6.0.1
88+Standards-Version: 4.6.2
89 Vcs-Browser: https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/ubuntu-settings
90 Vcs-Git: https://git.launchpad.net/~ubuntu-desktop/ubuntu/+source/ubuntu-settings
91
92diff --git a/debian/rules b/debian/rules
93index 6c33aaa..f68d3f9 100755
94--- a/debian/rules
95+++ b/debian/rules
96@@ -6,6 +6,10 @@
97 override_dh_missing:
98 dh_missing --fail-missing
99
100+override_dh_installsystemd:
101+ dh_installsystemd -pubuntu-raspi-settings-desktop --name=mkswap mkswap.service
102+ dh_installsystemd -pubuntu-raspi-settings-desktop --name=swapfile swapfile.swap
103+
104 override_dh_installgsettings:
105 dh_installgsettings -pubuntu-raspi-settings --priority 15
106 dh_installgsettings --remaining-packages
107diff --git a/debian/ubuntu-raspi-settings-desktop.install b/debian/ubuntu-raspi-settings-desktop.install
108index 6e4a375..12a9b2a 100644
109--- a/debian/ubuntu-raspi-settings-desktop.install
110+++ b/debian/ubuntu-raspi-settings-desktop.install
111@@ -1,3 +1,6 @@
112 usr/share/initramfs-tools/modules.d/raspi-zswap.conf
113 var/lib/polkit-1/localauthority/10-vendor.d/disable-suspend.pkla
114 usr/lib/NetworkManager/conf.d/ZZraspi-wifi-powersave-off.conf
115+lib/systemd/system/mkswap.service
116+lib/systemd/system/swapfile.swap
117+etc/netplan/01-use-network-manager.yaml
118diff --git a/debian/ubuntu-raspi-settings-desktop.lintian-overrides b/debian/ubuntu-raspi-settings-desktop.lintian-overrides
119new file mode 100644
120index 0000000..1914c78
121--- /dev/null
122+++ b/debian/ubuntu-raspi-settings-desktop.lintian-overrides
123@@ -0,0 +1,7 @@
124+# Yes, we actually want swap.target for the swap file...
125+systemd-service-file-refers-to-unusual-wantedby-target swap.target [lib/systemd/system/mkswap.service]
126+
127+# We don't support any init-system other than systemd, and mkswap is a trivial
128+# oneshot service
129+package-supports-alternative-init-but-no-init.d-script [lib/systemd/system/mkswap.service]
130+systemd-service-file-missing-documentation-key [lib/systemd/system/mkswap.service]
131diff --git a/debian/ubuntu-raspi-settings-desktop.postinst b/debian/ubuntu-raspi-settings-desktop.postinst
132new file mode 100644
133index 0000000..5e1db8a
134--- /dev/null
135+++ b/debian/ubuntu-raspi-settings-desktop.postinst
136@@ -0,0 +1,25 @@
137+#!/bin/sh
138+
139+set -e
140+
141+case "$1" in
142+ configure)
143+ # Unconditionally remove the obsolete (unpackaged) links activating the
144+ # (previously unpackaged) mkswap.service and swapfile.swap units. These
145+ # will instead be activated by dh_installsystemd creating links in
146+ # /etc/systemd/system/swap.target.wants (which is where they should be
147+ # rather than under /lib)
148+ rm -f \
149+ /lib/systemd/system/swap.target.wants/mkswap.service \
150+ /lib/systemd/system/swap.target.wants/swapfile.swap
151+ # Unconditionally remove the obsolete (unpackaged) netplan config file.
152+ # This isn't done with rm_conffile or conffiles because those both
153+ # refuse to work except on upgrade. We can't do it on upgrade to
154+ # another package (e.g. ubuntu-raspi-settings) either because the
155+ # "proper" methods both demand the prior version actually owned the
156+ # file being removed. So...
157+ rm -f /etc/netplan/01-network-manager-all.yaml
158+ ;;
159+esac
160+
161+#DEBHELPER#

Subscribers

People subscribed via source and target branches

to all changes: