udev-udisks-rules-rpi: Hide initial boot partition from udisks2

If I am not mistaken, many desktops (kde/lxqt/xfce..) use udisks2 to ask for
devices which can be mounted. Without this patch the initial boot partition
can be mounted by a single click on folder displayed on desktop or file manager.

Why it is suggested to add this recipe to an image:
* It removes annoying icon in desktop/file manager.
* The initial boot partition is vfat. Unpriviledged users can modify
  content. E.g by removing files accidently, images can be turned into
  non-booting condition easily. And from security point of view, it is a
  disaster.

FWIW: Have similar in all my BSPs vor very long time.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller 2018-04-02 23:53:38 +02:00 committed by Andrei Gherzan
parent 963761aac3
commit 4bf40b2d32
2 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,10 @@
##############################################################################################################
# Partitions which desktops should not display
#
# boot partition
ENV{ID_FS_TYPE}=="vfat", ENV{ID_FS_LABEL}=="raspberrypi", \
ENV{UDISKS_PRESENTATION_HIDE}="1", ENV{UDISKS_IGNORE}="1"
##############################################################################################################

View File

@ -0,0 +1,11 @@
DESCRIPTION = "add udisk/udev rule to hide boot partition from udev"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://80-udisks-rpi.rules"
do_install () {
install -d ${D}${base_libdir}/udev/rules.d
install -m 644 ${WORKDIR}/80-udisks-rpi.rules ${D}${base_libdir}/udev/rules.d
}
FILES_${PN} = "${base_libdir}/udev/rules.d"