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
diff --git a/debian/changelog b/debian/changelog
index 95b5b03..2892adb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,24 @@
1systemd (249.11-0ubuntu3.5) UNRELEASED; urgency=medium
2
3 * Ensure dns_search_domain_unlink_marked removes all marked domains (LP: #1975667)
4 File: debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
5 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=919d5ddedd5bb8b45ab9437bf42d66c2821bb074
6 * core,firstboot: workaround timezone issues on Ubuntu Core (LP: #1981042)
7 Thanks to Robert Ancell for preparing the patch.
8 File: debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
9 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=b15546361b549217908fb6ca5d473be23d7fa757
10 * network: do not remove localhost address (LP: #1979951)
11 File: debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
12 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=2cd88391cce9fe95a486ae6dd214c12f236f3881
13 * units: remove the restart limit on the modprobe@.service (LP: #1982462)
14 File: debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch
15 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=8f0acd1b2fbb8eed1259c34963e5e9b201bef900
16 * pstore: do not try to load mtdpstore (LP: #1981622)
17 File: debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
18 https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd/commit/?id=15225032c3657f5906ee49d48929f9295a8664a0
19
20 -- Nick Rosbrook <nick.rosbrook@canonical.com> Fri, 22 Jul 2022 15:27:16 -0400
21
1systemd (249.11-0ubuntu3.4) jammy; urgency=medium22systemd (249.11-0ubuntu3.4) jammy; urgency=medium
223
3 [ Mustafa Kemal Gilor ]24 [ Mustafa Kemal Gilor ]
diff --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
4new file mode 10064425new file mode 100644
index 0000000..65668d7
--- /dev/null
+++ b/debian/patches/lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
@@ -0,0 +1,24 @@
1From: Ben Efros <befros@gmail.com>
2Date: Fri, 8 Apr 2022 15:31:09 -0700
3Subject: Ensure dns_search_domain_unlink_marked removes all marked domains
4
5Origin: upstream, https://github.com/systemd/systemd/commit/1196b6a2e61075c029cb959f1e866af04e01fbe4
6Bug-Ubuntu: https://launchpad.net/bugs/1975667
7
8---
9 src/resolve/resolved-dns-search-domain.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/src/resolve/resolved-dns-search-domain.c b/src/resolve/resolved-dns-search-domain.c
13index 94a4657..abfe4e5 100644
14--- a/src/resolve/resolved-dns-search-domain.c
15+++ b/src/resolve/resolved-dns-search-domain.c
16@@ -166,7 +166,7 @@ bool dns_search_domain_unlink_marked(DnsSearchDomain *first) {
17 } else
18 changed = false;
19
20- return changed || dns_search_domain_unlink_marked(next);
21+ return dns_search_domain_unlink_marked(next) || changed;
22 }
23
24 void dns_search_domain_mark_all(DnsSearchDomain *first) {
diff --git a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
index 2b282d0..9331b73 100644
--- a/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
+++ b/debian/patches/lp1978079-efi-pstore-not-cleared-on-boot.patch
@@ -3,6 +3,14 @@ From: Alexander Graf <graf@amazon.com>
3Date: Thu, 9 Jun 2022 16:20:43 +02003Date: Thu, 9 Jun 2022 16:20:43 +0200
4Subject: [PATCH] pstore: Run after modules are loaded4Subject: [PATCH] pstore: Run after modules are loaded
55
6Origin: upstream, https://github.com/systemd/systemd/commit/70e74a5997ae2ce7ba72a74ac949c3b2dad1a1d6
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1978079
8Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1981622
9Last-Updated: 2022-07-22
10
11The original commit has been modified to not load mtdpstore.
12
13---
6The systemd-pstore service takes pstore files on boot and transfers them14The systemd-pstore service takes pstore files on boot and transfers them
7to disk. It only does it once on boot and only if it finds any. The typical15to disk. It only does it once on boot and only if it finds any. The typical
8location of the pstore on modern systems is the UEFI variable store.16location of the pstore on modern systems is the UEFI variable store.
@@ -34,8 +42,8 @@ index 848e311e9642..86de30ad4a72 100644
34 DefaultDependencies=no42 DefaultDependencies=no
35 Conflicts=shutdown.target43 Conflicts=shutdown.target
36 Before=sysinit.target shutdown.target44 Before=sysinit.target shutdown.target
37+After=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service45+After=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
38+Wants=modprobe@efi_pstore.service modprobe@mtdpstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service46+Wants=modprobe@efi_pstore.service modprobe@chromeos_pstore.service modprobe@ramoops.service modprobe@pstore_zone.service modprobe@pstore_blk.service
39 47
40 [Service]48 [Service]
41 Type=oneshot49 Type=oneshot
diff --git a/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
42new file mode 10064450new file mode 100644
index 0000000..8641259
--- /dev/null
+++ b/debian/patches/lp1979951-network-do-not-remove-localhost-address.patch
@@ -0,0 +1,66 @@
1From: Yu Watanabe <watanabe.yu+github@gmail.com>
2Date: Mon, 31 Jan 2022 19:26:51 +0900
3Subject: network: do not remove localhost address
4
5Origin: upstream, https://github.com/systemd/systemd/commit/b69bfa43052586cd6894c32d7d3d447195539ec5
6Bug-Ubuntu: https://launchpad.net/bugs/1979951
7
8Managing loopback interfaces by networkd is not recommended, but supporeted.
9Even such spurious situation, do not drop the localhost addresses.
10---
11 src/basic/in-addr-util.c | 13 +++++++++++++
12 src/basic/in-addr-util.h | 1 +
13 src/network/networkd-address.c | 4 ++++
14 3 files changed, 18 insertions(+)
15
16diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c
17index 9cc92a1..ac51483 100644
18--- a/src/basic/in-addr-util.c
19+++ b/src/basic/in-addr-util.c
20@@ -121,6 +121,19 @@ int in_addr_is_localhost(int family, const union in_addr_union *u) {
21 return -EAFNOSUPPORT;
22 }
23
24+int in_addr_is_localhost_one(int family, const union in_addr_union *u) {
25+ assert(u);
26+
27+ if (family == AF_INET)
28+ /* 127.0.0.1 */
29+ return be32toh(u->in.s_addr) == UINT32_C(0x7F000001);
30+
31+ if (family == AF_INET6)
32+ return IN6_IS_ADDR_LOOPBACK(&u->in6); /* lgtm [cpp/potentially-dangerous-function] */
33+
34+ return -EAFNOSUPPORT;
35+}
36+
37 bool in6_addr_is_ipv4_mapped_address(const struct in6_addr *a) {
38 return a->s6_addr32[0] == 0 &&
39 a->s6_addr32[1] == 0 &&
40diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h
41index f3ead91..215aa95 100644
42--- a/src/basic/in-addr-util.h
43+++ b/src/basic/in-addr-util.h
44@@ -55,6 +55,7 @@ bool in6_addr_is_link_local_all_nodes(const struct in6_addr *a);
45
46 bool in4_addr_is_localhost(const struct in_addr *a);
47 int in_addr_is_localhost(int family, const union in_addr_union *u);
48+int in_addr_is_localhost_one(int family, const union in_addr_union *u);
49
50 bool in4_addr_is_local_multicast(const struct in_addr *a);
51 bool in4_addr_is_non_local(const struct in_addr *a);
52diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
53index 2f19a82..71329c6 100644
54--- a/src/network/networkd-address.c
55+++ b/src/network/networkd-address.c
56@@ -883,6 +883,10 @@ int link_drop_foreign_addresses(Link *link) {
57 if (address->family == AF_INET6 && in6_addr_is_link_local(&address->in_addr.in6) == 1)
58 continue;
59
60+ /* Do not remove localhost address (127.0.0.1 and ::1) */
61+ if (link->flags & IFF_LOOPBACK && in_addr_is_localhost_one(address->family, &address->in_addr) > 0)
62+ continue;
63+
64 if (link_address_is_dynamic(link, address)) {
65 if (link->network && FLAGS_SET(link->network->keep_configuration, KEEP_CONFIGURATION_DHCP))
66 continue;
diff --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
0new file mode 10064467new file mode 100644
index 0000000..7d64066
--- /dev/null
+++ b/debian/patches/lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
@@ -0,0 +1,110 @@
1Description: Workaround timezone issues cause by Ubuntu Core's read-only /etc
2 This is another patch in a series of existing ones working around this issue
3 on Ubuntu Core.
4Author: Nick Rosbrook <nick.rosbrook@canonical.com>
5Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1981042
6Bug-Ubuntu: https://bugs.launchpad.net/snappy/+bug/1953172
7Forwarded: not-needed (part of read-only /etc workaround)
8Last-Update: 2022-07-20
9---
10diff --git a/src/core/manager.c b/src/core/manager.c
11index 296b759..230e5c8 100644
12--- a/src/core/manager.c
13+++ b/src/core/manager.c
14@@ -424,6 +424,25 @@ static int manager_setup_time_change(Manager *m) {
15 return 0;
16 }
17
18+/* Hack for Ubuntu Phone/Core: check if path is an existing symlink to
19+ * /etc/writable; if it is, update that instead */
20+static const char* writable_filename(const char *path) {
21+ ssize_t r;
22+ static char realfile_buf[PATH_MAX];
23+ _cleanup_free_ char *realfile = NULL;
24+ const char *result = path;
25+ int orig_errno = errno;
26+
27+ r = readlink_and_make_absolute(path, &realfile);
28+ if (r >= 0 && startswith(realfile, "/etc/writable")) {
29+ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile);
30+ result = realfile_buf;
31+ }
32+
33+ errno = orig_errno;
34+ return result;
35+}
36+
37 static int manager_read_timezone_stat(Manager *m) {
38 struct stat st;
39 bool changed;
40@@ -431,7 +450,7 @@ static int manager_read_timezone_stat(Manager *m) {
41 assert(m);
42
43 /* Read the current stat() data of /etc/localtime so that we detect changes */
44- if (lstat("/etc/localtime", &st) < 0) {
45+ if (lstat(writable_filename("/etc/localtime"), &st) < 0) {
46 log_debug_errno(errno, "Failed to stat /etc/localtime, ignoring: %m");
47 changed = m->etc_localtime_accessible;
48 m->etc_localtime_accessible = false;
49@@ -468,7 +487,7 @@ static int manager_setup_timezone_change(Manager *m) {
50 * Note that we create the new event source first here, before releasing the old one. This should optimize
51 * behaviour as this way sd-event can reuse the old watch in case the inode didn't change. */
52
53- r = sd_event_add_inotify(m->event, &new_event, "/etc/localtime",
54+ r = sd_event_add_inotify(m->event, &new_event, writable_filename("/etc/localtime"),
55 IN_ATTRIB|IN_MOVE_SELF|IN_CLOSE_WRITE|IN_DONT_FOLLOW, manager_dispatch_timezone_change, m);
56 if (r == -ENOENT) {
57 /* If the file doesn't exist yet, subscribe to /etc instead, and wait until it is created either by
58diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
59index 3916018..9f2d178 100644
60--- a/src/firstboot/firstboot.c
61+++ b/src/firstboot/firstboot.c
62@@ -462,18 +462,37 @@ static int prompt_timezone(void) {
63 return 0;
64 }
65
66+/* Hack for Ubuntu Phone/Core: check if path is an existing symlink to
67+ * /etc/writable; if it is, update that instead */
68+static const char* writable_filename(const char *path) {
69+ ssize_t r;
70+ static char realfile_buf[PATH_MAX];
71+ _cleanup_free_ char *realfile = NULL;
72+ const char *result = path;
73+ int orig_errno = errno;
74+
75+ r = readlink_and_make_absolute(path, &realfile);
76+ if (r >= 0 && startswith(realfile, "/etc/writable")) {
77+ snprintf(realfile_buf, sizeof(realfile_buf), "%s", realfile);
78+ result = realfile_buf;
79+ }
80+
81+ errno = orig_errno;
82+ return result;
83+}
84+
85 static int process_timezone(void) {
86 const char *etc_localtime, *e;
87 int r;
88
89- etc_localtime = prefix_roota(arg_root, "/etc/localtime");
90+ etc_localtime = prefix_roota(arg_root, writable_filename("/etc/localtime"));
91 if (laccess(etc_localtime, F_OK) >= 0 && !arg_force)
92 return 0;
93
94 if (arg_copy_timezone && arg_root) {
95 _cleanup_free_ char *p = NULL;
96
97- r = readlink_malloc("/etc/localtime", &p);
98+ r = readlink_malloc(writable_filename("/etc/localtime"), &p);
99 if (r != -ENOENT) {
100 if (r < 0)
101 return log_error_errno(r, "Failed to read host timezone: %m");
102@@ -494,7 +513,7 @@ static int process_timezone(void) {
103 if (isempty(arg_timezone))
104 return 0;
105
106- e = strjoina("../usr/share/zoneinfo/", arg_timezone);
107+ e = strjoina("/usr/share/zoneinfo/", arg_timezone);
108
109 (void) mkdir_parents(etc_localtime, 0755);
110 if (symlink(e, etc_localtime) < 0)
diff --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
0new file mode 100644111new file mode 100644
index 0000000..1acc21d
--- /dev/null
+++ b/debian/patches/lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch
@@ -0,0 +1,33 @@
1From: Alban Bedel <alban.bedel@aerq.com>
2Date: Wed, 15 Jun 2022 13:12:46 +0200
3Subject: units: remove the restart limit on the modprobe@.service
4
5Origin: upstream, https://github.com/systemd/systemd/commit/9625350e5381a68c1179ae4581e7586c206663e1
6Bug-Ubuntu: https://launchpad.net/bugs/1982462
7
8They are various cases where the same module might be repeatedly
9loaded in a short time frame, for example if a service depending on a
10module keep restarting, or if many instances of such service get
11started at the same time. If this happend the modprobe@.service
12instance will be marked as failed because it hit the restart limit.
13
14Overall it doesn't seems to make much sense to have a restart limit on
15the modprobe service so just disable it.
16
17Fixes: #23742
18---
19 units/modprobe@.service | 1 +
20 1 file changed, 1 insertion(+)
21
22diff --git a/units/modprobe@.service b/units/modprobe@.service
23index cf8baf6..85a2c08 100644
24--- a/units/modprobe@.service
25+++ b/units/modprobe@.service
26@@ -13,6 +13,7 @@ DefaultDependencies=no
27 Before=sysinit.target
28 Documentation=man:modprobe(8)
29 ConditionCapability=CAP_SYS_MODULE
30+StartLimitIntervalSec=0
31
32 [Service]
33 Type=oneshot
diff --git a/debian/patches/series b/debian/patches/series
index 8dbcd40..3ac0c71 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -89,3 +89,7 @@ lp1926860-hwdb-remove-the-tablet-pad-entry-for-the-UC-Logic-1060N.patch
89hwdb-Add-mic-mute-key-mapping-for-HP-Elite-x360.patch89hwdb-Add-mic-mute-key-mapping-for-HP-Elite-x360.patch
90lp1964494-network-do-not-enable-IPv4-ACD-for-IPv4-link-local-a.patch90lp1964494-network-do-not-enable-IPv4-ACD-for-IPv4-link-local-a.patch
91lp1978079-efi-pstore-not-cleared-on-boot.patch91lp1978079-efi-pstore-not-cleared-on-boot.patch
92lp1975667-Ensure-dns_search_domain_unlink_marked-removes-all-marked.patch
93lp1981042-core-firstboot-workaround-timezone-issues-caused-by-Ubunt.patch
94lp1979951-network-do-not-remove-localhost-address.patch
95lp1982462-units-remove-the-restart-limit-on-the-modprobe-.service.patch

Subscribers

People subscribed via source and target branches