aboutsummaryrefslogtreecommitdiffstats
path: root/udev-lfs
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2012-10-13 16:14:09 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2012-10-13 16:14:09 +0000
commit12574f2c42069a8d63ebc3ae63b9db084536163a (patch)
tree480847ff8087b2242b9147e16526e9e59a154c3f /udev-lfs
parent5cef3143bf3c152b39cf3a38ea0b08f00b0596a9 (diff)
Add boot/shutdown script customization instructions
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10016 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'udev-lfs')
-rw-r--r--udev-lfs/55-lfs.txt (renamed from udev-lfs/doc/55-lfs.txt)0
-rw-r--r--udev-lfs/81-cdrom.rules3
-rw-r--r--udev-lfs/83-cdrom-symlinks.rules13
-rw-r--r--udev-lfs/Makefile.lfs7
-rw-r--r--udev-lfs/README4
-rw-r--r--udev-lfs/doc/README6
6 files changed, 21 insertions, 12 deletions
diff --git a/udev-lfs/doc/55-lfs.txt b/udev-lfs/55-lfs.txt
index 5f116f9b7..5f116f9b7 100644
--- a/udev-lfs/doc/55-lfs.txt
+++ b/udev-lfs/55-lfs.txt
diff --git a/udev-lfs/81-cdrom.rules b/udev-lfs/81-cdrom.rules
new file mode 100644
index 000000000..cb7ea5748
--- /dev/null
+++ b/udev-lfs/81-cdrom.rules
@@ -0,0 +1,3 @@
+# /etc/udev/rules.d/81-cdrom.rules: Set CD-ROM permissions and get device capabilities
+
+ACTION=="add", SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", IMPORT{program}="cdrom_id --export $tempnode", GROUP="cdrom"
diff --git a/udev-lfs/83-cdrom-symlinks.rules b/udev-lfs/83-cdrom-symlinks.rules
new file mode 100644
index 000000000..5d6b60078
--- /dev/null
+++ b/udev-lfs/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!="2", RUN+="/bin/false", GOTO="cd_aliases_generator_end"
+
+ENV{ID_CDROM}=="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
+
+LABEL="cd_aliases_generator_end"
diff --git a/udev-lfs/Makefile.lfs b/udev-lfs/Makefile.lfs
index 1bb8f1bf0..bda131402 100644
--- a/udev-lfs/Makefile.lfs
+++ b/udev-lfs/Makefile.lfs
@@ -278,13 +278,14 @@ install: udev
# Create null device and copy rules
@cp -v rules/* $(DESTDIR)/lib/udev/rules.d
@rm -v $(DESTDIR)/lib/udev/rules.d/99*
- @cp -v udev-lfs-$(VERSION)/*lfs.rules $(DESTDIR)/etc/udev/rules.d
+ @cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d
# Copy documentation
@cp -v man/udev.7 $(DESTDIR)/usr/share/man/man7
@cp -v man/udevadm.8 $(DESTDIR)/usr/share/man/man8
- @cp -v udev-lfs-$(VERSION)/udevd.8 $(DESTDIR)/usr/share/man/man8/udevd.8
- @cp -v udev-lfs-$(VERSION)/doc/* $(DESTDIR)/usr/share/doc/udev/lfs
+ @cp -v udev-lfs-$(VERSION)/udevd.8 $(DESTDIR)/usr/share/man/man8
+ @cp -v udev-lfs-$(VERSION)/README $(DESTDIR)/usr/share/doc/udev/lfs
+ @cp -v udev-lfs-$(VERSION)/*.txt $(DESTDIR)/usr/share/doc/udev/lfs
# Copy misc
@cp -v udev-lfs-$(VERSION)/init-net-rules.sh $(DESTDIR)/lib/udev
diff --git a/udev-lfs/README b/udev-lfs/README
index 18e3b881f..d9e39c159 100644
--- a/udev-lfs/README
+++ b/udev-lfs/README
@@ -29,9 +29,7 @@ write_net_rules - Scripts for LFS rules
write_cd_rules
rule_generator.functions
-doc - Documentation for LFS installed rules
-doc/55-lfs.txt
-doc/README
+55-lfs.txt - Documentation for LFS installed rules
cfg.h - Basic info needed for udev compilation
diff --git a/udev-lfs/doc/README b/udev-lfs/doc/README
deleted file mode 100644
index 01216694c..000000000
--- a/udev-lfs/doc/README
+++ /dev/null
@@ -1,6 +0,0 @@
-This directory contains documentation for each rule file used in LFS.
-
-Each .rules file should contain a corresponding .txt file in this directory,
-which explains both the overall purpose of the rules file, and each type of
-rule contained therein.
-