Files
xen/tools/misc/xen-mkdevnodes
T
kaf24@scramble.cl.cam.ac.uk e10900c6da bitkeeper revision 1.505 (3f88123avJcxOfXCNp2EJ21JBegFRg)
xen-mkdevnodes:
  Create the xvd device nodes with permissions 600 to be totally sure we don't give users direct-access privilege.
2003-10-11 14:22:50 +00:00

22 lines
479 B
Bash
Executable File

#! /bin/bash
BASE=${1:?"base directory missing (eg. /dev)"}
rm -f ${BASE}/xvd[abcdefghijklmnop]*
# XLVIRT is 16 devices of 15 partitions
LETTERS="a b c d e f g h i j k l m n o p"
PARTITIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
j=0
for l in ${LETTERS}; do
mknod ${BASE}/xvd${l} b 125 ${j}
chmod 600 ${BASE}/xvd${l}
for i in ${PARTITIONS}; do
mknod ${BASE}/xvd${l}${i} b 125 $(($i+$j))
chmod 600 ${BASE}/xvd${l}${i}
done
j=$(($j+16))
done