Merge ~enr0n/ubuntu/+source/systemd:ubuntu-focal-sru into ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal
- Git
- lp:~enr0n/ubuntu/+source/systemd
- ubuntu-focal-sru
- Merge into ubuntu-focal
Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 686564df37e347d9e381d246404bc80f37618523 | ||||||||||||
Proposed branch: | ~enr0n/ubuntu/+source/systemd:ubuntu-focal-sru | ||||||||||||
Merge into: | ~ubuntu-core-dev/ubuntu/+source/systemd:ubuntu-focal | ||||||||||||
Diff against target: |
409 lines (+346/-0) 9 files modified
debian/changelog (+20/-0) debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch (+25/-0) debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch (+50/-0) debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch (+102/-0) debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch (+64/-0) debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch (+38/-0) debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch (+36/-0) debian/patches/series (+6/-0) debian/tests/boot-and-services (+5/-0) |
||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukas Märdian | Approve | ||
Review via email: mp+437809@code.launchpad.net |
Commit message
Description of the change
SRU to fix a couple bugs in Focal. We may be adding a third bug if we can get a reproducer soon. I have requested autopkgtest runs for the package build in my PPA (https:/
Nick Rosbrook (enr0n) wrote : | # |
Nick Rosbrook (enr0n) wrote : | # |
autopkgtest on most arches is looking good. The failure on amd64 is one of the usual flaky tests in upstream tests (TEST-36-
systemd 245.4-4ubuntu3.
systemd 245.4-4ubuntu3.
systemd 245.4-4ubuntu3.
systemd 245.4-4ubuntu3.
On armhf, we are hitting LP: #1991285, and the flaky test-execute. I think we need to work around LP: #1991285 though. It would not actually be considered a regression to britney, but I don't think we want to leave that hanging around.
Nick Rosbrook (enr0n) wrote : | # |
Here's an armhf run with the workaround in place:
systemd 245.4-4ubuntu3.
Lukas Märdian (slyon) wrote : | # |
We didn't get a reproducer for https:/
Thanks for the test build and autopkgtest pre-testing + analysis, this is very helpful!
We have 3 LP bugs listed in d/changelog here, autopkgtest fixes do not necessarily need to be tracked through the SRU process, but I see all three have the SRU template already prepared, so this is even better and more transparent! Kudos.
Wrt bug #2002445: we need to make sure to also land it for Jammy (and Kinetic), so we won't regress people when upgrading from Focal to Jammy. I guess this will be a SRU team requirement before this can be landed in focal-updates.
There's also a little nitpick inline, but I don't think we need another iteration for that.
Lukas Märdian (slyon) wrote : | # |
Ah! Another quick note for future work:
We could be using the "Gbp-Pq: Topic lpXXXXX" pseudo header, to sort corresponding patches into a single debian/
Nick Rosbrook (enr0n) wrote : | # |
Thanks for reviewing! And thanks for the Gbp-Pq: Topic tip, I will use that next time.
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index e6aa745..0edd425 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,23 @@ |
6 | +systemd (245.4-4ubuntu3.20) focal; urgency=medium |
7 | + |
8 | + * udev: avoid NIC renaming race with kernel (LP: #2002445) |
9 | + Files: |
10 | + - debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch |
11 | + - debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch |
12 | + - debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch |
13 | + - debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch |
14 | + - debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch |
15 | + https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=e34409f9d68a15220aa36cbae219d4f4987e5207 |
16 | + * test-seccomp: accept ENOSYS from sysctl(2) too (LP: #1933090) |
17 | + Thanks to Roxana Nicolescu |
18 | + File: debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch |
19 | + https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=706f2e0c787cade9609d0f2b37634d7eb4517beb |
20 | + * debian/test: ignore systemd-remount-fs.service failure on armhf (LP: #1991285) |
21 | + File: debian/tests/boot-and-services |
22 | + https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=cddc66ef6ecfb555dfd38c5f5fe8572efb424114 |
23 | + |
24 | + -- Nick Rosbrook <nick.rosbrook@canonical.com> Mon, 27 Feb 2023 10:11:13 -0500 |
25 | + |
26 | systemd (245.4-4ubuntu3.19) focal; urgency=medium |
27 | |
28 | [ dann frazier ] |
29 | diff --git a/debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch b/debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch |
30 | new file mode 100644 |
31 | index 0000000..21a975d |
32 | --- /dev/null |
33 | +++ b/debian/patches/lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch |
34 | @@ -0,0 +1,25 @@ |
35 | +From: =?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> |
36 | +Date: Tue, 22 Sep 2020 19:05:17 +0200 |
37 | +Subject: test-seccomp: accept ENOSYS from sysctl(2) too |
38 | + |
39 | +Origin: upstream, https://github.com/systemd/systemd/commit/0af05e485a3a88f454c714901eb6109307dc893e |
40 | +Bug-Ubuntu: https://launchpad.net/bugs/1933090 |
41 | + |
42 | +It seems that kernel 5.9 started returning that. |
43 | +--- |
44 | + src/test/test-seccomp.c | 2 +- |
45 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
46 | + |
47 | +diff --git a/src/test/test-seccomp.c b/src/test/test-seccomp.c |
48 | +index 22953a2..9c37655 100644 |
49 | +--- a/src/test/test-seccomp.c |
50 | ++++ b/src/test/test-seccomp.c |
51 | +@@ -308,7 +308,7 @@ static void test_protect_sysctl(void) { |
52 | + if (pid == 0) { |
53 | + #if defined __NR__sysctl && __NR__sysctl >= 0 |
54 | + assert_se(syscall(__NR__sysctl, NULL) < 0); |
55 | +- assert_se(errno == EFAULT); |
56 | ++ assert_se(IN_SET(errno, EFAULT, ENOSYS)); |
57 | + #endif |
58 | + |
59 | + assert_se(seccomp_protect_sysctl() >= 0); |
60 | diff --git a/debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch b/debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch |
61 | new file mode 100644 |
62 | index 0000000..505976d |
63 | --- /dev/null |
64 | +++ b/debian/patches/lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch |
65 | @@ -0,0 +1,50 @@ |
66 | +From: Yu Watanabe <watanabe.yu+github@gmail.com> |
67 | +Date: Fri, 17 Jul 2020 21:31:24 +0900 |
68 | +Subject: netlink: do not fail when new interface name is already used as an |
69 | + alternative name |
70 | + |
71 | +Origin: upstream, https://github.com/systemd/systemd/commit/434a34838034347f45fb9a47df55b1a36e5addfd |
72 | +Bug-Ubuntu: https://launchpad.net/bugs/2002445 |
73 | + |
74 | +When renaming a network interface, the new name may be used as an |
75 | +alternative name. In that case, let's swap the current name and the |
76 | +alternative name. That is, first drop the new name from the list of |
77 | +alternative names, then rename the interface, finally set the old name |
78 | +as an alternative name. |
79 | + |
80 | +(partial backport with 080afbb57c4b2d592c5cf77ab10c6e0be74f0732 amended) |
81 | +--- |
82 | + src/libsystemd/sd-netlink/netlink-util.c | 13 +++++++++++++ |
83 | + 1 file changed, 13 insertions(+) |
84 | + |
85 | +diff --git a/src/libsystemd/sd-netlink/netlink-util.c b/src/libsystemd/sd-netlink/netlink-util.c |
86 | +index 83f2a9b..7e3ec53 100644 |
87 | +--- a/src/libsystemd/sd-netlink/netlink-util.c |
88 | ++++ b/src/libsystemd/sd-netlink/netlink-util.c |
89 | +@@ -9,6 +9,7 @@ |
90 | + |
91 | + int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { |
92 | + _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL; |
93 | ++ _cleanup_strv_free_ char **alternative_names = NULL; |
94 | + int r; |
95 | + |
96 | + assert(rtnl); |
97 | +@@ -24,6 +25,18 @@ int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { |
98 | + return r; |
99 | + } |
100 | + |
101 | ++ r = rtnl_get_link_alternative_names(rtnl, ifindex, &alternative_names); |
102 | ++ if (r < 0) |
103 | ++ log_debug_errno(r, "Failed to get alternative names on network interface %i, ignoring: %m", |
104 | ++ ifindex); |
105 | ++ |
106 | ++ if (strv_contains(alternative_names, name)) { |
107 | ++ r = rtnl_delete_link_alternative_names(rtnl, ifindex, STRV_MAKE(name)); |
108 | ++ if (r < 0) |
109 | ++ return log_debug_errno(r, "Failed to remove '%s' from alternative names on network interface %i: %m", |
110 | ++ name, ifindex); |
111 | ++ } |
112 | ++ |
113 | + r = sd_rtnl_message_new_link(*rtnl, &message, RTM_SETLINK, ifindex); |
114 | + if (r < 0) |
115 | + return r; |
116 | diff --git a/debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch b/debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch |
117 | new file mode 100644 |
118 | index 0000000..93094eb |
119 | --- /dev/null |
120 | +++ b/debian/patches/lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch |
121 | @@ -0,0 +1,102 @@ |
122 | +From: Yu Watanabe <watanabe.yu+github@gmail.com> |
123 | +Date: Fri, 17 Jul 2020 21:29:13 +0900 |
124 | +Subject: netlink: introduce rtnl_get/delete_link_alternative_names() |
125 | + |
126 | +Origin: upstream, https://github.com/systemd/systemd/commit/14982526145de84201c7e3b4fc6be6aa5e9a08f7 |
127 | +Bug-Ubuntu: https://launchpad.net/bugs/2002445 |
128 | + |
129 | +--- |
130 | + src/libsystemd/sd-netlink/netlink-util.c | 45 ++++++++++++++++++++++++++++++-- |
131 | + src/libsystemd/sd-netlink/netlink-util.h | 2 ++ |
132 | + 2 files changed, 45 insertions(+), 2 deletions(-) |
133 | + |
134 | +diff --git a/src/libsystemd/sd-netlink/netlink-util.c b/src/libsystemd/sd-netlink/netlink-util.c |
135 | +index 7387cff..83f2a9b 100644 |
136 | +--- a/src/libsystemd/sd-netlink/netlink-util.c |
137 | ++++ b/src/libsystemd/sd-netlink/netlink-util.c |
138 | +@@ -85,12 +85,45 @@ int rtnl_set_link_properties(sd_netlink **rtnl, int ifindex, const char *alias, |
139 | + return 0; |
140 | + } |
141 | + |
142 | +-int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names) { |
143 | ++int rtnl_get_link_alternative_names(sd_netlink **rtnl, int ifindex, char ***ret) { |
144 | ++ _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL, *reply = NULL; |
145 | ++ _cleanup_strv_free_ char **names = NULL; |
146 | ++ int r; |
147 | ++ |
148 | ++ assert(rtnl); |
149 | ++ assert(ifindex > 0); |
150 | ++ assert(ret); |
151 | ++ |
152 | ++ if (!*rtnl) { |
153 | ++ r = sd_netlink_open(rtnl); |
154 | ++ if (r < 0) |
155 | ++ return r; |
156 | ++ } |
157 | ++ |
158 | ++ r = sd_rtnl_message_new_link(*rtnl, &message, RTM_GETLINK, ifindex); |
159 | ++ if (r < 0) |
160 | ++ return r; |
161 | ++ |
162 | ++ r = sd_netlink_call(*rtnl, message, 0, &reply); |
163 | ++ if (r < 0) |
164 | ++ return r; |
165 | ++ |
166 | ++ r = sd_netlink_message_read_strv(reply, IFLA_PROP_LIST, IFLA_ALT_IFNAME, &names); |
167 | ++ if (r < 0 && r != -ENODATA) |
168 | ++ return r; |
169 | ++ |
170 | ++ *ret = TAKE_PTR(names); |
171 | ++ |
172 | ++ return 0; |
173 | ++} |
174 | ++ |
175 | ++static int rtnl_update_link_alternative_names(sd_netlink **rtnl, uint16_t nlmsg_type, int ifindex, char * const *alternative_names) { |
176 | + _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL; |
177 | + int r; |
178 | + |
179 | + assert(rtnl); |
180 | + assert(ifindex > 0); |
181 | ++ assert(IN_SET(nlmsg_type, RTM_NEWLINKPROP, RTM_DELLINKPROP)); |
182 | + |
183 | + if (strv_isempty(alternative_names)) |
184 | + return 0; |
185 | +@@ -101,7 +134,7 @@ int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const |
186 | + return r; |
187 | + } |
188 | + |
189 | +- r = sd_rtnl_message_new_link(*rtnl, &message, RTM_NEWLINKPROP, ifindex); |
190 | ++ r = sd_rtnl_message_new_link(*rtnl, &message, nlmsg_type, ifindex); |
191 | + if (r < 0) |
192 | + return r; |
193 | + |
194 | +@@ -124,6 +157,14 @@ int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const |
195 | + return 0; |
196 | + } |
197 | + |
198 | ++int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names) { |
199 | ++ return rtnl_update_link_alternative_names(rtnl, RTM_NEWLINKPROP, ifindex, alternative_names); |
200 | ++} |
201 | ++ |
202 | ++int rtnl_delete_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names) { |
203 | ++ return rtnl_update_link_alternative_names(rtnl, RTM_DELLINKPROP, ifindex, alternative_names); |
204 | ++} |
205 | ++ |
206 | + int rtnl_set_link_alternative_names_by_ifname(sd_netlink **rtnl, const char *ifname, char * const *alternative_names) { |
207 | + _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL; |
208 | + int r; |
209 | +diff --git a/src/libsystemd/sd-netlink/netlink-util.h b/src/libsystemd/sd-netlink/netlink-util.h |
210 | +index d2d8334..33f36ec 100644 |
211 | +--- a/src/libsystemd/sd-netlink/netlink-util.h |
212 | ++++ b/src/libsystemd/sd-netlink/netlink-util.h |
213 | +@@ -49,8 +49,10 @@ static inline bool rtnl_message_type_is_qdisc(uint16_t type) { |
214 | + |
215 | + int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name); |
216 | + int rtnl_set_link_properties(sd_netlink **rtnl, int ifindex, const char *alias, const struct ether_addr *mac, uint32_t mtu); |
217 | ++int rtnl_get_link_alternative_names(sd_netlink **rtnl, int ifindex, char ***ret); |
218 | + int rtnl_set_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names); |
219 | + int rtnl_set_link_alternative_names_by_ifname(sd_netlink **rtnl, const char *ifname, char * const *alternative_names); |
220 | ++int rtnl_delete_link_alternative_names(sd_netlink **rtnl, int ifindex, char * const *alternative_names); |
221 | + int rtnl_resolve_link_alternative_name(sd_netlink **rtnl, const char *name); |
222 | + int rtnl_get_link_iftype(sd_netlink **rtnl, int ifindex, unsigned short *ret); |
223 | + |
224 | diff --git a/debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch b/debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch |
225 | new file mode 100644 |
226 | index 0000000..baca7b2 |
227 | --- /dev/null |
228 | +++ b/debian/patches/lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch |
229 | @@ -0,0 +1,64 @@ |
230 | +From: Nick Rosbrook <nick.rosbrook@canonical.com> |
231 | +Date: Wed, 2 Nov 2022 05:36:14 -0400 |
232 | +Subject: sd-netlink: restore altname on error in rtnl_set_link_name |
233 | + |
234 | +Origin: upstream, https://github.com/systemd/systemd/commit/4d600667f8 |
235 | +Bug-Ubuntu: https://launchpad.net/bugs/2002445 |
236 | + |
237 | +If a current alternative name is to be used to rename a network |
238 | +interface, the alternative name must be removed first. If interface |
239 | +renaming fails, restore the alternative name that was deleted if |
240 | +necessary. |
241 | +--- |
242 | + src/libsystemd/sd-netlink/netlink-util.c | 19 ++++++++++++++++--- |
243 | + 1 file changed, 16 insertions(+), 3 deletions(-) |
244 | + |
245 | +diff --git a/src/libsystemd/sd-netlink/netlink-util.c b/src/libsystemd/sd-netlink/netlink-util.c |
246 | +index 502ea41..828203b 100644 |
247 | +--- a/src/libsystemd/sd-netlink/netlink-util.c |
248 | ++++ b/src/libsystemd/sd-netlink/netlink-util.c |
249 | +@@ -10,6 +10,7 @@ |
250 | + int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { |
251 | + _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL; |
252 | + _cleanup_strv_free_ char **alternative_names = NULL; |
253 | ++ bool altname_deleted = false; |
254 | + int r; |
255 | + |
256 | + assert(rtnl); |
257 | +@@ -29,21 +30,33 @@ int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) { |
258 | + if (r < 0) |
259 | + return log_debug_errno(r, "Failed to remove '%s' from alternative names on network interface %i: %m", |
260 | + name, ifindex); |
261 | ++ |
262 | ++ altname_deleted = true; |
263 | + } |
264 | + |
265 | + r = sd_rtnl_message_new_link(*rtnl, &message, RTM_SETLINK, ifindex); |
266 | + if (r < 0) |
267 | +- return r; |
268 | ++ goto fail; |
269 | + |
270 | + r = sd_netlink_message_append_string(message, IFLA_IFNAME, name); |
271 | + if (r < 0) |
272 | +- return r; |
273 | ++ goto fail; |
274 | + |
275 | + r = sd_netlink_call(*rtnl, message, 0, NULL); |
276 | + if (r < 0) |
277 | +- return r; |
278 | ++ goto fail; |
279 | + |
280 | + return 0; |
281 | ++ |
282 | ++fail: |
283 | ++ if (altname_deleted) { |
284 | ++ int q = rtnl_set_link_alternative_names(rtnl, ifindex, STRV_MAKE(name)); |
285 | ++ if (q < 0) |
286 | ++ log_debug_errno(q, "Failed to restore '%s' as an alternative name on network interface %i, ignoring: %m", |
287 | ++ name, ifindex); |
288 | ++ } |
289 | ++ |
290 | ++ return r; |
291 | + } |
292 | + |
293 | + int rtnl_set_link_properties(sd_netlink **rtnl, int ifindex, const char *alias, |
294 | diff --git a/debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch b/debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch |
295 | new file mode 100644 |
296 | index 0000000..5f74018 |
297 | --- /dev/null |
298 | +++ b/debian/patches/lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch |
299 | @@ -0,0 +1,38 @@ |
300 | +From: Nick Rosbrook <nick.rosbrook@canonical.com> |
301 | +Date: Tue, 14 Feb 2023 15:56:38 -0500 |
302 | +Subject: udev: attempt device rename even if interface is up |
303 | + |
304 | +Origin: upstream, https://github.com/systemd/systemd/commit/53584e7b61 |
305 | +Bug-Ubuntu: https://launchpad.net/bugs/2002445 |
306 | + |
307 | +Currently rename_netif() will not attempt to rename a device if it is |
308 | +already up, because the kernel will return -EBUSY unless live renaming |
309 | +is allowed on the device. This restriction will be removed in a future |
310 | +kernel version [1]. |
311 | + |
312 | +To cover both cases, always attempt to rename the interface and return 0 |
313 | +if we get -EBUSY. |
314 | + |
315 | +[1] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=bd039b5ea2a9 |
316 | + |
317 | +(modified to apply to v245.4) |
318 | +--- |
319 | + src/udev/udev-event.c | 5 +++++ |
320 | + 1 file changed, 5 insertions(+) |
321 | + |
322 | +diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c |
323 | +index eb51139..dae485b 100644 |
324 | +--- a/src/udev/udev-event.c |
325 | ++++ b/src/udev/udev-event.c |
326 | +@@ -835,6 +835,11 @@ static int rename_netif(UdevEvent *event) { |
327 | + return log_device_error_errno(dev, r, "Failed to get ifindex: %m"); |
328 | + |
329 | + r = rtnl_set_link_name(&event->rtnl, ifindex, event->name); |
330 | ++ if (r == -EBUSY) { |
331 | ++ log_device_info(dev, "Network interface '%s' is already up, cannot rename to '%s'.", |
332 | ++ oldname, event->name); |
333 | ++ return 0; |
334 | ++ } |
335 | + if (r < 0) |
336 | + return log_device_error_errno(dev, r, "Failed to rename network interface %i from '%s' to '%s': %m", |
337 | + ifindex, oldname, event->name); |
338 | diff --git a/debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch b/debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch |
339 | new file mode 100644 |
340 | index 0000000..a1aa00a |
341 | --- /dev/null |
342 | +++ b/debian/patches/lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch |
343 | @@ -0,0 +1,36 @@ |
344 | +From: Nick Rosbrook <nick.rosbrook@canonical.com> |
345 | +Date: Wed, 2 Nov 2022 11:05:01 -0400 |
346 | +Subject: udev/net: allow new link name as an altname before renaming happens |
347 | + |
348 | +Origin: upstream, https://github.com/systemd/systemd/commit/d0b31efc1a |
349 | +Bug-Ubuntu: https://launchpad.net/bugs/2002445 |
350 | + |
351 | +When configuring a link's alternative names, the link's new name to-be |
352 | +is not allowed to be included because interface renaming will fail if |
353 | +the new name is already present as an alternative name. However, |
354 | +rtnl_set_link_name will delete the conflicting alternative name before |
355 | +renaming the device, if necessary. |
356 | + |
357 | +Allow the new link name to be set as an alternative name before the |
358 | +device is renamed. This means that if the rename is later skipped (i.e. |
359 | +because the link is already up), then the name can at least still be |
360 | +present as an alternative name. |
361 | + |
362 | +(modified to apply to v245.5) |
363 | +--- |
364 | + src/udev/net/link-config.c | 2 -- |
365 | + 1 file changed, 2 deletions(-) |
366 | + |
367 | +diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c |
368 | +index 4d08bce..26c4a02 100644 |
369 | +--- a/src/udev/net/link-config.c |
370 | ++++ b/src/udev/net/link-config.c |
371 | +@@ -536,8 +536,6 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, |
372 | + } |
373 | + } |
374 | + |
375 | +- if (new_name) |
376 | +- strv_remove(altnames, new_name); |
377 | + strv_remove(altnames, old_name); |
378 | + strv_uniq(altnames); |
379 | + strv_sort(altnames); |
380 | diff --git a/debian/patches/series b/debian/patches/series |
381 | index 75dbc03..bae1736 100644 |
382 | --- a/debian/patches/series |
383 | +++ b/debian/patches/series |
384 | @@ -185,3 +185,9 @@ lp1945225/0001-udev-net_id-parse-_SUN-ACPI-index-as-a-signed-intege.patch |
385 | lp1945225/0002-udev-net_id-don-t-generate-slot-based-names-if-multi.patch |
386 | lp1945225/0003-net_id-fix-newly-added-naming-scheme-name.patch |
387 | lp1945225/0004-Add-remaining-supported-schemes-as-options-for-defau.patch |
388 | +lp2002445-udev-net-allow-new-link-name-as-an-altname-before-renamin.patch |
389 | +lp2002445-netlink-introduce-rtnl_get-delete_link_alternative_names.patch |
390 | +lp2002445-netlink-do-not-fail-when-new-interface-name-is-already-us.patch |
391 | +lp2002445-sd-netlink-restore-altname-on-error-in-rtnl_set_link_name.patch |
392 | +lp2002445-udev-attempt-device-rename-even-if-interface-is-up.patch |
393 | +lp1933090-test-seccomp-accept-ENOSYS-from-sysctl-2-too.patch |
394 | diff --git a/debian/tests/boot-and-services b/debian/tests/boot-and-services |
395 | index d78a055..6090569 100755 |
396 | --- a/debian/tests/boot-and-services |
397 | +++ b/debian/tests/boot-and-services |
398 | @@ -59,6 +59,11 @@ class ServicesTest(unittest.TestCase): |
399 | # https://bugs.debian.org/926138 |
400 | if is_container: |
401 | failed = [f for f in failed if 'e2scrub_reap.service' not in f] |
402 | + # LP: #1991285 |
403 | + arch = subprocess.check_output(['dpkg', '--print-architecture']) |
404 | + arch = arch.decode('utf-8').strip() |
405 | + if arch == 'armhf': |
406 | + failed = [f for f in failed if 'systemd-remount-fs.service' not in f] |
407 | if failed: |
408 | for f in failed: |
409 | f = f.split()[0] |
It looks like the test beds for focal do not support link alternative names, so I will just drop the tests that rely on that.