/usr/share/doc/bilibop-rules/examples/90-internal-drives.rules is in bilibop-rules 0.4.20.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | # /usr/share/doc/bilibop-rules/examples/90-internal-drives.rules
┌───────────────────────────────────────────────────────────────┐
│ THIS FILE IS NOW OUT OF DATE. SEE 90-insidev.rules INSTEAD. │
└───────────────────────────────────────────────────────────────┘
# ==============================================================================
# 1. Filters:
# ========
SUBSYSTEM!="block", GOTO="end_internal-drives_rules"
KERNEL!="sd*", GOTO="end_internal-drives_rules"
SUBSYSTEMS=="usb|firewire", GOTO="end_internal-drives_rules"
# At this step, following rules should be applied only on block devices
# hosted by internal drives of the computer.
# Those internal drives cannot be removed:
KERNEL=="sd?", ACTION=="remove", GOTO="end_internal-drives_rules"
# If this rules file is orphaned, go away:
TEST!="/lib/udev/bilibop_disk", GOTO="end_internal-drives_rules"
# If bilibop-rules is installed on an internal drive, skip it too:
PROGRAM=="bilibop_disk --test $tempnode", GOTO="end_internal-drives_rules"
# ==============================================================================
# 2. Tag the device:
# ===============
# This is a convenient way to update its udev properties with:
# 'udevadm trigger --tag-match=INTERNAL --action=add'
# 'udevadm trigger --tag-match=INTERNAL --action=change'
# after this file has been modified.
TAG+="INTERNAL"
# ==============================================================================
# 3. Examples:
# =========
# Here are some examples of actions to perform, or properties to set.
# A. Uncomment the following line if you want to set the whole disk and
# each of its partitions as read-only. This can avoid big mistakes
# on your friend's computer.
#ACTION=="add|change", RUN+="/sbin/blockdev --setro $tempnode"
#
# This is a variant using a boot parameter: diskaccess. If this keyword
# IS NOT present in the boot commandline, devices are set readonly:
#ACTION=="add|change", PROGRAM!="/bin/grep -q '\sdiskaccess\(\s\|$$\)' /proc/cmdline", RUN+="/sbin/blockdev --setro $tempnode"
#
# This is a variant using a boot parameter: nodiskaccess. If this keyword
# IS present in the boot commandline, devices are set readonly:
#ACTION=="add|change", PROGRAM=="/bin/grep -q '\snodiskaccess\(\s\|$$\)' /proc/cmdline", RUN+="/sbin/blockdev --setro $tempnode"
# B. Uncomment the following line if you want the disk and its partitions
# to be hidden to the user (works only for udisks-based applications):
#ACTION=="add|change", TEST=="/lib/udev/rules.d/80-udisks.rules", ENV{UDISKS_PRESENTATION_HIDE}:="1"
# C. Uncomment the following line if you want that the user be able to
# mount the partitions. Dangerous: use with care.
#ACTION=="add|change", ATTR{partition}=="?*", TEST=="/lib/udev/rules.d/80-udisks.rules", ENV{UDISKS_SYSTEM_INTERNAL}:="0"
#
# This is a variant using a boot parameter (diskaccess):
#ACTION=="add|change", ATTR{partition}=="?*", PROGRAM=="/bin/grep -q '\sdiskaccess\(\s\|$$\)' /proc/cmdline", TEST=="/lib/udev/rules.d/80-udisks.rules", ENV{UDISKS_SYSTEM_INTERNAL}:="0"
# D. Uncomment the following lines if you want to automatically setup
# encrypted swap devices from internal partitions. Experimental: use
# with care.
#ACTION=="add", \
# PROGRAM!="/bin/grep -q '\sno\(diskaccess\|swap\)\(\s\|$\)' /proc/cmdline", \
# ENV{ID_FS_TYPE}=="swap", ENV{ID_PART_ENTRY_TYPE}=="0x82", \
# PROGRAM=="/sbin/blockdev --setrw $tempnode", \
# TEST!="%r/mapper/encswap_%k", \
# PROGRAM=="/sbin/cryptsetup --key-file=%r/urandom --offset=8 create encswap_%k $tempnode", \
# RUN+="/sbin/mkswap -f %r/mapper/encswap_%k", \
# RUN+="/sbin/swapon %r/mapper/encswap_%k"
LABEL="end_internal-drives_rules"
|