ia64/xen-unstable

view tools/misc/xen-mkdevnodes @ 820:f8c20f68e4d5

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.
author kaf24@scramble.cl.cam.ac.uk
date Sat Oct 11 14:22:50 2003 +0000 (2003-10-11)
parents f6f2a326ccaa
children
line source
1 #! /bin/bash
3 BASE=${1:?"base directory missing (eg. /dev)"}
5 rm -f ${BASE}/xvd[abcdefghijklmnop]*
7 # XLVIRT is 16 devices of 15 partitions
9 LETTERS="a b c d e f g h i j k l m n o p"
10 PARTITIONS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
12 j=0
13 for l in ${LETTERS}; do
14 mknod ${BASE}/xvd${l} b 125 ${j}
15 chmod 600 ${BASE}/xvd${l}
16 for i in ${PARTITIONS}; do
17 mknod ${BASE}/xvd${l}${i} b 125 $(($i+$j))
18 chmod 600 ${BASE}/xvd${l}${i}
19 done
20 j=$(($j+16))
21 done