diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2012-08-31 16:42:52 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2012-08-31 16:42:52 +0000 |
commit | ed992fbc68220ed47d3d20f3f2a3d7f1e92288cb (patch) | |
tree | c8931304d1991e9e3d0ee69a649824b9640113d2 /udev-config/contrib | |
parent | 4afbb4a75a924c2edb72d68ea76ccbb4eea868b0 (diff) |
Minor typos in bootscripts.
Remove obsolete udev-config directory.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9970 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'udev-config/contrib')
-rw-r--r-- | udev-config/contrib/debian/81-cdrom.rules | 3 | ||||
-rw-r--r-- | udev-config/contrib/debian/83-cdrom-symlinks.rules | 12 | ||||
-rw-r--r-- | udev-config/contrib/debian/write_cd_aliases | 111 |
3 files changed, 0 insertions, 126 deletions
diff --git a/udev-config/contrib/debian/81-cdrom.rules b/udev-config/contrib/debian/81-cdrom.rules deleted file mode 100644 index cb7ea5748..000000000 --- a/udev-config/contrib/debian/81-cdrom.rules +++ /dev/null @@ -1,3 +0,0 @@ -# /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-config/contrib/debian/83-cdrom-symlinks.rules b/udev-config/contrib/debian/83-cdrom-symlinks.rules deleted file mode 100644 index 4713c0b92..000000000 --- a/udev-config/contrib/debian/83-cdrom-symlinks.rules +++ /dev/null @@ -1,12 +0,0 @@ -# /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_aliases", SYMLINK+="%c" - -LABEL="cd_aliases_generator_end" diff --git a/udev-config/contrib/debian/write_cd_aliases b/udev-config/contrib/debian/write_cd_aliases deleted file mode 100644 index 6443b6dcf..000000000 --- a/udev-config/contrib/debian/write_cd_aliases +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/sh -e - -RULES_FILE="/etc/udev/rules.d/82-persistent-cd.rules" - -############################################################################## -lock_rules_file() { - RULES_LOCK="/dev/.udev/.lock-${RULES_FILE##*/}" - - retry=30 - while ! mkdir $RULES_LOCK 2> /dev/null; do - if [ $retry -eq 0 ]; then - echo "Cannot lock $RULES_FILE!" >&2 - exit 2 - fi - sleep 1 - retry=$(($retry - 1)) - done -} - -unlock_rules_file() { - rmdir $RULES_LOCK || true -} - -############################################################################## -find_next_available() { - # use echo to convert newlines to spaces - local links=`echo $(find_all_symlinks $1)` - local basename=${links%%[ 0-9]*} - local max=-1 - for name in $links; do - local num=${name#$basename} - [ "$num" ] || num=0 - [ $num -gt $max ] && max=$num - done - - max=$(($max + 1)) - # "name0" actually is just "name" - [ $max -eq 0 ] && return - echo "$max" -} - -find_all_symlinks() { - local linkre="$1" - local match="$2" - - [ -e $RULES_FILE ] || return - - local search='.*[[:space:],]SYMLINK+="\('"$linkre"'\)"[[:space:]]*\(,.*\|\\\|\)$' - - sed -n -e "${match}s/${search}/\1/p" $RULES_FILE -} - -write_rule() { - local match="$1" - local link="$2" - local comment="$3" - - [ -e "$RULES_FILE" ] || PRINT_HEADER=1 - { - if [ "$PRINT_HEADER" ]; then - PRINT_HEADER= - echo "# This file was automatically generated by the $0" - echo "# program, probably run by the 83-cdrom.rules rules file." - echo "#" - echo "# You can modify it, as long as you keep each rule on a single line" - echo "# and set the \$GENERATED variable." - echo "" - fi - - [ "$comment" ] && echo "# $comment" - echo "ACTION==\"add\", SUBSYSTEM==\"block\", $match, ENV{ID_CDROM}==\"1\", SYMLINK+=\"$link\", ENV{GENERATED}=\"1\"" - } >> $RULES_FILE - SYMLINKS="$SYMLINKS $link" -} - -############################################################################## -if [ -z "$DEVPATH" ]; then - echo "Missing \$DEVPATH." >&2 - exit 1 -fi -if [ -z "$ID_CDROM" ]; then - echo "$DEVPATH is not a CD reader." >&2 - exit 1 -fi - -# Prevent parallel processes from modifying the file at the same time. -lock_rules_file - -link_num=$(find_next_available 'cdrom[0-9]*') - -#match="ENV{ID_PATH}==\"$ID_PATH\"" - -#kernel=${DEVPATH##*/} -#match="KERNEL==\"$kernel\"" - -id=${PHYSDEVPATH##*/} -match="BUS==\"$PHYSDEVBUS\", ID==\"$id\"" - -comment="$ID_MODEL ($ID_PATH)" - - write_rule "$match" "cdrom$link_num" "$comment" -[ "$ID_CDROM_CD_RW" ] && write_rule "$match" "cdrw$link_num" -[ "$ID_CDROM_DVD" ] && write_rule "$match" "dvd$link_num" -[ "$ID_CDROM_DVD_RW" ] && write_rule "$match" "dvdrw$link_num" - -unlock_rules_file - -echo $SYMLINKS - -exit 0 - |