Hide block devices in GNOME Disks

This commit is contained in:
Bruce Leidl 2021-11-30 15:50:37 -05:00
parent eb148b10fe
commit fdb103be41
4 changed files with 33 additions and 1 deletions

View File

@ -25,6 +25,7 @@ SYSCTL_CONFIG = "\
UDEV_RULES = "\ UDEV_RULES = "\
file://udev/citadel-network.rules \ file://udev/citadel-network.rules \
file://udev/pci-pm.rules \ file://udev/pci-pm.rules \
file://udev/udisks2-hide.rules \
" "
DEFAULT_PASSWORD = "\ DEFAULT_PASSWORD = "\
file://citadel-setpassword.sh \ file://citadel-setpassword.sh \
@ -143,6 +144,7 @@ do_install() {
install -m 0755 ${WORKDIR}/citadel-ifconfig.sh ${D}${libexecdir} install -m 0755 ${WORKDIR}/citadel-ifconfig.sh ${D}${libexecdir}
install -m 0644 ${WORKDIR}/udev/pci-pm.rules ${D}${sysconfdir}/udev/rules.d/ install -m 0644 ${WORKDIR}/udev/pci-pm.rules ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${WORKDIR}/udev/udisks2-hide.rules ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${WORKDIR}/citadel-installer.session ${D}${datadir}/gnome-session/sessions/ install -m 0644 ${WORKDIR}/citadel-installer.session ${D}${datadir}/gnome-session/sessions/
install -m 0644 ${WORKDIR}/citadel-installer.json ${D}${datadir}/gnome-shell/modes/ install -m 0644 ${WORKDIR}/citadel-installer.json ${D}${datadir}/gnome-shell/modes/

View File

@ -0,0 +1,5 @@
KERNEL=="nbd*", ENV{UDISKS_IGNORE}="1"
KERNEL=="loop*", ENV{UDISKS_IGNORE}="1"
SYMLINK=="citadel/*", ENV{UDISKS_IGNORE}="1"
SYMLINK=="mapper/verity-*", ENV{UDISKS_IGNORE}="1"
SYMLINK=="mapper/rootfs", ENV{UDISKS_IGNORE}="1"

View File

@ -0,0 +1,23 @@
From b881ec38ee4e844a8bff836b0283ecac0655f6ee Mon Sep 17 00:00:00 2001
From: Bruce Leidl <bruce@subgraph.com>
Date: Tue, 30 Nov 2021 15:47:31 -0500
Subject: [PATCH] Don't display ignored disks
---
src/disks/gdudevicetreemodel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/disks/gdudevicetreemodel.c b/src/disks/gdudevicetreemodel.c
index 2157276..ee7d910 100644
--- a/src/disks/gdudevicetreemodel.c
+++ b/src/disks/gdudevicetreemodel.c
@@ -1196,6 +1196,9 @@ should_include_block (UDisksObject *object)
partition = udisks_object_peek_partition (object);
loop = udisks_object_peek_loop (object);
+ if (udisks_block_get_hint_ignore (block))
+ goto out;
+
if (gdu_utils_has_userspace_mount_option (block, "x-gdu.hide"))
goto out;

View File

@ -32,7 +32,9 @@ EXTRA_OEMESON += "-Dman=false"
def gnome_verdir(v): def gnome_verdir(v):
return oe.utils.trim_version(v, 1) return oe.utils.trim_version(v, 1)
SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive" SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive \
file://0001-Don-t-display-ignored-disks.patch \
"
SRC_URI[archive.sha256sum] = "8743c98fd656062ef862933efe30c5be4c6b322ec02eee154ec70d08ed0895df" SRC_URI[archive.sha256sum] = "8743c98fd656062ef862933efe30c5be4c6b322ec02eee154ec70d08ed0895df"
FILES_${PN} += " \ FILES_${PN} += " \