about summary refs log tree commit diff
path: root/debian/patches
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-02-17 10:26:22 +0100
committerSebastien Bacher <seb128@ubuntu.com>2021-02-17 10:26:22 +0100
commit5ea8cd99d9111af42cd60f00cb92bd3ab74fe163 (patch)
tree5996fa818ade2aaed15dc86fa9902b6f97554417 /debian/patches
parentd146a0c31be889a6062220c285a2defa5811b8cc (diff)
* debian/patches/ubuntu_revert_systemd.patch:
  - temporarly revert an upstream commit that made udev enabled under lxc,
    the new systemd doesn't work there (lp: #1914062)
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/ubuntu_revert_systemd.patch48
2 files changed, 49 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series
index 0980b69a..6e85d4f0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ Force-online-state-with-unmanaged-devices.patch
 Provide-access-to-some-of-NM-s-interfaces-to-whoopsie.patch
 Update-dnsmasq-parameters.patch
 systemd-basic-missing_syscall-fix-syscall-numbers-for-x32.patch
+ubuntu_revert_systemd.patch
diff --git a/debian/patches/ubuntu_revert_systemd.patch b/debian/patches/ubuntu_revert_systemd.patch
new file mode 100644
index 00000000..e6482f5b
--- /dev/null
+++ b/debian/patches/ubuntu_revert_systemd.patch
@@ -0,0 +1,48 @@
+diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
+index b377c85e..ab4f8305 100644
+--- a/src/platform/nm-linux-platform.c
++++ b/src/platform/nm-linux-platform.c
+@@ -26,7 +26,6 @@
+ #include <poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+-#include <sys/statvfs.h>
+ #include <unistd.h>
+ 
+ #include "nm-std-aux/unaligned.h"
+@@ -9528,34 +9527,12 @@ constructed(GObject *_object)
+     }
+ }
+ 
+-/* Similar to systemd's path_is_read_only_fs(), at
+- * https://github.com/systemd/systemd/blob/v246/src/basic/stat-util.c#L132 */
+-static int
+-path_is_read_only_fs(const char *path)
+-{
+-    struct statvfs st;
+-
+-    if (statvfs(path, &st) < 0)
+-        return -errno;
+-
+-    if (st.f_flag & ST_RDONLY)
+-        return TRUE;
+-
+-    /* On NFS, statvfs() might not reflect whether we can actually
+-	 * write to the remote share. Let's try again with
+-	 * access(W_OK) which is more reliable, at least sometimes. */
+-    if (access(path, W_OK) < 0 && errno == EROFS)
+-        return TRUE;
+-
+-    return FALSE;
+-}
+-
+ NMPlatform *
+ nm_linux_platform_new(gboolean log_with_ptr, gboolean netns_support)
+ {
+     gboolean use_udev = FALSE;
+ 
+-    if (nmp_netns_is_initial() && path_is_read_only_fs("/sys") == FALSE)
++    if (nmp_netns_is_initial() && access("/sys", W_OK) == 0)
+         use_udev = TRUE;
+ 
+     return g_object_new(NM_TYPE_LINUX_PLATFORM,