From cdbbb4e783c10488a7f8642f7562d8a855950be2 Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Thu, 27 Dec 2018 22:57:07 -0500 Subject: [PATCH] Add mountlist-ignore-snap-squashfs.patch: - Ignore snap mounts to keep them from showing in gnome-system-monitor LP: #1749007 Gbp-Dch: Full --- .../mountlist-ignore-snap-squashfs.patch | 50 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 51 insertions(+) create mode 100644 debian/patches/mountlist-ignore-snap-squashfs.patch diff --git a/debian/patches/mountlist-ignore-snap-squashfs.patch b/debian/patches/mountlist-ignore-snap-squashfs.patch new file mode 100644 index 00000000..a4ad1e7a --- /dev/null +++ b/debian/patches/mountlist-ignore-snap-squashfs.patch @@ -0,0 +1,50 @@ +From: Andrea Azzarone +Date: Thu, 19 Apr 2018 15:58:30 +0200 +Subject: mountlist: ignore snap squashfs + +Ignore squashfs mounted in snaps. This will make sure that snap fs +are not listed in gnome-system-monitor. + +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1749007 +Forwarded: not-needed +--- + sysdeps/linux/mountlist.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/sysdeps/linux/mountlist.c b/sysdeps/linux/mountlist.c +index 7c376fd..f36fc29 100644 +--- a/sysdeps/linux/mountlist.c ++++ b/sysdeps/linux/mountlist.c +@@ -84,7 +84,7 @@ ignore_list_has(IgnoreList* ig, const char* fs) + + + static gboolean +-ignore_fs(const char *fstype, IgnoreList** ig) ++ignore_fs(const char* mntdir, const char *fstype, IgnoreList** ig) + { + if (!*ig) { + FILE* fs; +@@ -106,10 +106,13 @@ ignore_fs(const char *fstype, IgnoreList** ig) + } + } + ++ /* ignore snap squashfs */ ++ if (!strcmp(fstype, "squashfs") && !strncmp(mntdir, "/snap/", 6)) ++ return TRUE; ++ + return ignore_list_has(*ig, fstype); + } + +- + glibtop_mountentry * + glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) + { +@@ -136,7 +139,7 @@ glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) + const char *devopt; + gsize len; + +- if (!all_fs && ignore_fs(mnt->mnt_type, &ig)) ++ if (!all_fs && ignore_fs(mnt->mnt_dir, mnt->mnt_type, &ig)) + continue; + + len = entries->len; diff --git a/debian/patches/series b/debian/patches/series index 211be6ae..9bbd722b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 03_kfreebsd_installdirs.patch 04_kfreebsd_version.patch +mountlist-ignore-snap-squashfs.patch