Merge ~enr0n/ubuntu/+source/systemd:ubuntu-jammy into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-jammy

Proposed by Nick Rosbrook
Status: Merged
Merged at revision: a67e1cae4a3d93755c41364960065dc011ec10a2
Proposed branch: ~enr0n/ubuntu/+source/systemd:ubuntu-jammy
Merge into: ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-jammy
Diff against target: 328 lines (+268/-2)
7 files modified
debian/changelog (+21/-0)
debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch (+24/-0)
debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch (+10/-2)
debian/patches/lp1979951-network-do-not-remove-localhost-address.patch (+66/-0)
debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch (+110/-0)
debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch (+33/-0)
debian/patches/series (+4/-0)
Reviewer Review Type Date Requested Status
Lukas Märdian Approve
Review via email: mp+427303@code.launchpad.net

Description of the change

Stage several changes for upcoming SRU.

To post a comment you must log in.
Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you, LGTM.

The "Ensure dns_search_domain_unlink_marked removes all marked domains (LP: #1975667)" line in d/changelog is > 80 chars, but meh... the autogenerated lines below are longer by design, too.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 95b5b03..2892adb 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,24 @@
6+systemd (249.11-0ubuntu3.5) UNRELEASED; urgency=medium
7+
8+ * Ensure dns_search_domain_unlink_marked removes all marked domains (LP: #1975667)
9+ File: debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
10+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=919d5ddedd5bb8b45ab9437bf42d66c2821bb074
11+ * core,firstboot: workaround timezone issues on Ubuntu Core (LP: #1981042)
12+ Thanks to Robert Ancell for preparing the patch.
13+ File: debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
14+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=b15546361b549217908fb6ca5d473be23d7fa757
15+ * network: do not remove localhost address (LP: #1979951)
16+ File: debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
17+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=2cd88391cce9fe95a486ae6dd214c12f236f3881
18+ * units: remove the restart limit on the modprobe@.service (LP: #1982462)
19+ File: debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch
20+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=8f0acd1b2fbb8eed1259c34963e5e9b201bef900
21+ * pstore: do not try to load mtdpstore (LP: #1981622)
22+ File: debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
23+ https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=15225032c3657f5906ee49d48929f9295a8664a0
24+
25+ -- Nick Rosbrook <nick.rosbrook@canonical.com> Fri, 22 Jul 2022 15:27:16 -0400
26+
27 systemd (249.11-0ubuntu3.4) jammy; urgency=medium
28
29 [ Mustafa Kemal Gilor ]
30diff --git a/debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch b/debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
31new file mode 100644
32index 0000000..65668d7
33--- /dev/null
34+++ b/debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
35@@ -0,0 +1,24 @@
36+From: Ben Efros <befros@gmail.com>
37+Date: Fri, 8 Apr 2022 15:31:09 -0700
38+Subject: Ensure dns_search_domain_unlink_marked removes all marked domains
39+
40+Origin: upstream, https://github.com/systemd/systemd/commit/1196b6a2e61075c029cb959f1e866af04e01fbe4
41+Bug-Ubuntu: https://launchpad.net/bugs/1975667
42+
43+---
44+ src/resolve/resolved-dns-search-domain.c | 2 +-
45+ 1 file changed, 1 insertion(+), 1 deletion(-)
46+
47+diff --git a/src/resolve/resolved-dns-search-domain.c b/src/resolve/resolved-dns-search-domain.c
48+index 94a4657..abfe4e5 100644
49+--- a/src/resolve/resolved-dns-search-domain.c
50++++ b/src/resolve/resolved-dns-search-domain.c
51+@@ -166,7 +166,7 @@ bool dns_search_domain_unlink_marked(DnsSearchDomain *first) {
52+ } else
53+ changed = false;
54+
55+- return changed || dns_search_domain_unlink_marked(next);
56++ return dns_search_domain_unlink_marked(next) || changed;
57+ }
58+
59+ void dns_search_domain_mark_all(DnsSearchDomain *first) {
60diff --git a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
61index 2b282d0..9331b73 100644
62--- a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
63+++ b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
64@@ -3,6 +3,14 @@ From: Alexander Graf <graf@amazon.com>
65 Date: Thu, 9 Jun 2022 16:20:43 +0200
66 Subject: [PATCH] pstore: Run after modules are loaded
67
68+Origin: upstream, https://github.com/systemd/systemd/commit/70e74a5997ae2ce7ba72a74ac949c3b2dad1a1d6
69+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1978079
70+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1981622
71+Last-Updated: 2022-07-22
72+
73+The original commit has been modified to not load mtdpstore.
74+
75+---
76 The systemd-pstore service takes pstore files on boot and transfers them
77 to disk. It only does it once on boot and only if it finds any. The typical
78 location of the pstore on modern systems is the UEFI variable store.
79@@ -34,8 +42,8 @@ index 848e311e9642..86de30ad4a72 100644
80 DefaultDependencies=no
81 Conflicts=shutdown.target
82 Before=sysinit.target shutdown.target
83-+After=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
84-+Wants=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
85++After=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
86++Wants=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
87
88 [Service]
89 Type=oneshot
90diff --git a/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
91new file mode 100644
92index 0000000..8641259
93--- /dev/null
94+++ b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
95@@ -0,0 +1,66 @@
96+From: Yu Watanabe <watanabe.yu+github@gmail.com>
97+Date: Mon, 31 Jan 2022 19:26:51 +0900
98+Subject: network: do not remove localhost address
99+
100+Origin: upstream, https://github.com/systemd/systemd/commit/b69bfa43052586cd6894c32d7d3d447195539ec5
101+Bug-Ubuntu: https://launchpad.net/bugs/1979951
102+
103+Managing loopback interfaces by networkd is not recommended, but supporeted.
104+Even such spurious situation, do not drop the localhost addresses.
105+---
106+ src/basic/in-addr-util.c | 13 +++++++++++++
107+ src/basic/in-addr-util.h | 1 +
108+ src/network/networkd-address.c | 4 ++++
109+ 3 files changed, 18 insertions(+)
110+
111+diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c
112+index 9cc92a1..ac51483 100644
113+--- a/src/basic/in-addr-util.c
114++++ b/src/basic/in-addr-util.c
115+@@ -121,6 +121,19 @@ int in_addr_is_localhost(int family, const union in_addr_union *u) {
116+ return -EAFNOSUPPORT;
117+ }
118+
119++int in_addr_is_localhost_one(int family, const union in_addr_union *u) {
120++ assert(u);
121++
122++ if (family == AF_INET)
123++ /* 127.0.0.1 */
124++ return be32toh(u->in.s_addr) == UINT32_C(0x7F000001);
125++
126++ if (family == AF_INET6)
127++ return IN6_IS_ADDR_LOOPBACK(&u->in6); /* lgtm [cpp/potentially-dangerous-function] */
128++
129++ return -EAFNOSUPPORT;
130++}
131++
132+ bool in6_addr_is_ipv4_mapped_address(const struct in6_addr *a) {
133+ return a->s6_addr32[0] == 0 &&
134+ a->s6_addr32[1] == 0 &&
135+diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h
136+index f3ead91..215aa95 100644
137+--- a/src/basic/in-addr-util.h
138++++ b/src/basic/in-addr-util.h
139+@@ -55,6 +55,7 @@ bool in6_addr_is_link_local_all_nodes(const struct in6_addr *a);
140+
141+ bool in4_addr_is_localhost(const struct in_addr *a);
142+ int in_addr_is_localhost(int family, const union in_addr_union *u);
143++int in_addr_is_localhost_one(int family, const union in_addr_union *u);
144+
145+ bool in4_addr_is_local_multicast(const struct in_addr *a);
146+ bool in4_addr_is_non_local(const struct in_addr *a);
147+diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
148+index 2f19a82..71329c6 100644
149+--- a/src/network/networkd-address.c
150++++ b/src/network/networkd-address.c
151+@@ -883,6 +883,10 @@ int link_drop_foreign_addresses(Link *link) {
152+ if (address->family == AF_INET6 && in6_addr_is_link_local(&address->in_addr.in6) == 1)
153+ continue;
154+
155++ /* Do not remove localhost address (127.0.0.1 and ::1) */
156++ if (link->flags & IFF_LOOPBACK && in_addr_is_localhost_one(address->family, &address->in_addr) > 0)
157++ continue;
158++
159+ if (link_address_is_dynamic(link, address)) {
160+ if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
161+ continue;
162diff --git a/debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch b/debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
163new file mode 100644
164index 0000000..7d64066
165--- /dev/null
166+++ b/debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
167@@ -0,0 +1,110 @@
168+Description: Workaround timezone issues cause by Ubuntu Core's read-only /etc
169+ This is another patch in a series of existing ones working around this issue
170+ on Ubuntu Core.
171+Author: Nick Rosbrook <nick.rosbrook@canonical.com>
172+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1981042
173+Bug-Ubuntu: https://bugs.launchpad.net/snappy/+bug/1953172
174+Forwarded: not-needed (part of read-only /etc workaround)
175+Last-Update: 2022-07-20
176+---
177+diff --git a/src/core/manager.c b/src/core/manager.c
178+index 296b759..230e5c8 100644
179+--- a/src/core/manager.c
180++++ b/src/core/manager.c
181+@@ -424,6 +424,25 @@ static int manager_setup_time_change(Manager *m) {
182+ return 0;
183+ }
184+
185++/* Hack for Ubuntu Phone/Core: check if path is an existing symlink to
186++ * /etc/writable; if it is, update that instead */
187++static const char* writable_filename(const char *path) {
188++ ssize_t r;
189++ static char realfile_buf[PATH_MAX];
190++ _cleanup_free_ char *realfile = NULL;
191++ const char *result = path;
192++ int orig_errno = errno;
193++
194++ r = readlink_and_make_absolute(path, &realfile);
195++ if (r >= 0 && startswith(realfile, "/etc/writable")) {
196++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile);
197++ result = realfile_buf;
198++ }
199++
200++ errno = orig_errno;
201++ return result;
202++}
203++
204+ static int manager_read_timezone_stat(Manager *m) {
205+ struct stat st;
206+ bool changed;
207+@@ -431,7 +450,7 @@ static int manager_read_timezone_stat(Manager *m) {
208+ assert(m);
209+
210+ /* Read the current stat() data of /etc/localtime so that we detect changes */
211+- if (lstat("/etc/localtime", &st) < 0) {
212++ if (lstat(writable_filename("/etc/localtime"), &st) < 0) {
213+ log_debug_errno(errno, "Failed to stat /etc/localtime, ignoring: %m");
214+ changed = m->etc_localtime_accessible;
215+ m->etc_localtime_accessible = false;
216+@@ -468,7 +487,7 @@ static int manager_setup_timezone_change(Manager *m) {
217+ * Note that we create the new event source first here, before releasing the old one. This should optimize
218+ * behaviour as this way sd-event can reuse the old watch in case the inode didn't change. */
219+
220+- r = sd_event_add_inotify(m->event, &new_event, "/etc/localtime",
221++ r = sd_event_add_inotify(m->event, &new_event, writable_filename("/etc/localtime"),
222+ IN_ATTRIB|IN_MOVE_SELF|IN_CLOSE_WRITE|IN_DONT_FOLLOW, manager_dispatch_timezone_change, m);
223+ if (r == -ENOENT) {
224+ /* If the file doesn't exist yet, subscribe to /etc instead, and wait until it is created either by
225+diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
226+index 3916018..9f2d178 100644
227+--- a/src/firstboot/firstboot.c
228++++ b/src/firstboot/firstboot.c
229+@@ -462,18 +462,37 @@ static int prompt_timezone(void) {
230+ return 0;
231+ }
232+
233++/* Hack for Ubuntu Phone/Core: check if path is an existing symlink to
234++ * /etc/writable; if it is, update that instead */
235++static const char* writable_filename(const char *path) {
236++ ssize_t r;
237++ static char realfile_buf[PATH_MAX];
238++ _cleanup_free_ char *realfile = NULL;
239++ const char *result = path;
240++ int orig_errno = errno;
241++
242++ r = readlink_and_make_absolute(path, &realfile);
243++ if (r >= 0 && startswith(realfile, "/etc/writable")) {
244++ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile);
245++ result = realfile_buf;
246++ }
247++
248++ errno = orig_errno;
249++ return result;
250++}
251++
252+ static int process_timezone(void) {
253+ const char *etc_localtime, *e;
254+ int r;
255+
256+- etc_localtime = prefix_roota(arg_root, "/etc/localtime");
257++ etc_localtime = prefix_roota(arg_root, writable_filename("/etc/localtime"));
258+ if (laccess(etc_localtime, F_OK) >= 0 && !arg_force)
259+ return 0;
260+
261+ if (arg_copy_timezone && arg_root) {
262+ _cleanup_free_ char *p = NULL;
263+
264+- r = readlink_malloc("/etc/localtime", &p);
265++ r = readlink_malloc(writable_filename("/etc/localtime"), &p);
266+ if (r != -ENOENT) {
267+ if (r < 0)
268+ return log_error_errno(r, "Failed to read host timezone: %m");
269+@@ -494,7 +513,7 @@ static int process_timezone(void) {
270+ if (isempty(arg_timezone))
271+ return 0;
272+
273+- e = strjoina("../usr/share/zoneinfo/", arg_timezone);
274++ e = strjoina("/usr/share/zoneinfo/", arg_timezone);
275+
276+ (void) mkdir_parents(etc_localtime, 0755);
277+ if (symlink(e, etc_localtime) < 0)
278diff --git a/debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch b/debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch
279new file mode 100644
280index 0000000..1acc21d
281--- /dev/null
282+++ b/debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch
283@@ -0,0 +1,33 @@
284+From: Alban Bedel <alban.bedel@aerq.com>
285+Date: Wed, 15 Jun 2022 13:12:46 +0200
286+Subject: units: remove the restart limit on the modprobe@.service
287+
288+Origin: upstream, https://github.com/systemd/systemd/commit/9625350e5381a68c1179ae4581e7586c206663e1
289+Bug-Ubuntu: https://launchpad.net/bugs/1982462
290+
291+They are various cases where the same module might be repeatedly
292+loaded in a short time frame, for example if a service depending on a
293+module keep restarting, or if many instances of such service get
294+started at the same time. If this happend the modprobe@.service
295+instance will be marked as failed because it hit the restart limit.
296+
297+Overall it doesn't seems to make much sense to have a restart limit on
298+the modprobe service so just disable it.
299+
300+Fixes: #23742
301+---
302+ units/modprobe@.service | 1 +
303+ 1 file changed, 1 insertion(+)
304+
305+diff --git a/units/modprobe@.service b/units/modprobe@.service
306+index cf8baf6..85a2c08 100644
307+--- a/units/modprobe@.service
308++++ b/units/modprobe@.service
309+@@ -13,6 +13,7 @@ DefaultDependencies=no
310+ Before=sysinit.target
311+ Documentation=man:modprobe(8)
312+ ConditionCapability=CAP_SYS_MODULE
313++StartLimitIntervalSec=0
314+
315+ [Service]
316+ Type=oneshot
317diff --git a/debian/patches/series b/debian/patches/series
318index 8dbcd40..3ac0c71 100644
319--- a/debian/patches/series
320+++ b/debian/patches/series
321@@ -89,3 +89,7 @@ lp1926860-hwdb-remove-the-tablet-pad-entry-for-the-UC-Logic-1060N.patch
322 hwdb-Add-mic-mute-key-mapping-for-HP-Elite-x360.patch
323 lp1964494-network-do-not-enable-IPv4-ACD-for-IPv4-link-local-a.patch
324 lp1978079-efi-pstore-not-cleared-on-boot.patch
325+lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
326+lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
327+lp1979951-network-do-not-remove-localhost-address.patch
328+lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch

Subscribers

People subscribed via source and target branches