From dffbbe56d3f9f17da0244f75b352b87bc0e244df Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 14 Mar 2022 00:14:26 +0000 Subject: added udev --- udev/83-cdrom-symlinks.rules | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 udev/83-cdrom-symlinks.rules (limited to 'udev/83-cdrom-symlinks.rules') diff --git a/udev/83-cdrom-symlinks.rules b/udev/83-cdrom-symlinks.rules new file mode 100644 index 0000000..1a21a06 --- /dev/null +++ b/udev/83-cdrom-symlinks.rules @@ -0,0 +1,13 @@ +# /etc/udev/rules.d/83-cdrom-symlinks.rules: Determine CD drive capability. + +ACTION!="add", GOTO="cd_aliases_generator_end" +SUBSYSTEM!="block", GOTO="cd_aliases_generator_end" +ENV{GENERATED}=="?*", GOTO="cd_aliases_generator_end" + +# Fail the uevent if the autogenerated rules cannot be saved +ENV{ID_CDROM}=="?*", PROGRAM="/bin/grep -c ' / [^[:space:]]* rw' /proc/mounts", \ + RESULT!="1", RUN+="/bin/false", GOTO="cd_aliases_generator_end" + +ENV{ID_CDROM}=="?*", PROGRAM="write_cd_rules", SYMLINK+="%c" + +LABEL="cd_aliases_generator_end" -- cgit v1.2.1