Browse Source

udev: Enhanced create_nodes.sh to handle commented and empty lines, delete type 's' files and print the name of nodes as created

early
Alejandro Mery 17 years ago
parent
commit
caf0499110
  1. 10
      filesystem/udev/create_nodes.sh

10
filesystem/udev/create_nodes.sh

@ -16,8 +16,11 @@
cd "${1:-.}" cd "${1:-.}"
while read type node mode uid gid data; do while read type node mode uid gid data; do
[ -n "$type" ] || continue
expr "$type" : '#' > /dev/null && continue
case "$type" in case "$type" in
c) c|s)
rm -f "$node" rm -f "$node"
;; ;;
esac esac
@ -30,11 +33,11 @@ while read type node mode uid gid data; do
ln -snvf "$data" "$node" ln -snvf "$data" "$node"
;; ;;
c) c)
echo "mknod: Creating $node c $data" echo "mknod: Creating $node c $data" >&2
mknod "$node" c $data mknod "$node" c $data
;; ;;
s) s)
echo "mkfifo: Creating $node" echo "mkfifo: Creating $node" >&2
mkfifo "$node" mkfifo "$node"
;; ;;
esac esac
@ -48,5 +51,6 @@ while read type node mode uid gid data; do
esac esac
chown "$uid:$gid" "$node" chown "$uid:$gid" "$node"
echo "$node"
done done

Loading…
Cancel
Save