Plan 9 from Bell Labs’s /n/sources/contrib/aganti/capDevice/src/cap_load

Copyright © 2009 Alcatel-Lucent.
Distributed under the Lucent Public License version 1.02.
Download the Plan 9 distribution.


#!/bin/sh
module="cap"
device="cap"
mode="666"

if grep -q '^staff:' /etc/group; then
    group="staff"
else
    group="wheel"
fi

/sbin/insmod ./$module.ko $* || exit 1
major=$(awk "\$2==\"$module\" {print \$1}" /proc/devices)

# Remove stale nodes and replace them, then give gid and perms
rm -f /dev/${device}hash
rm -f /dev/${device}use
mknod /dev/${device}hash c $major 0
mknod /dev/${device}use c $major 1
chgrp $group /dev/${device}hash
chgrp $group /dev/${device}use
chmod $mode  /dev/${device}hash
chmod $mode  /dev/${device}use







(This is a user-contributed directory and
should not be interpreted as statement by Alcatel-Lucent.)

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2009 Alcatel-Lucent. All Rights Reserved.
Comments to webmaster@plan9.bell-labs.com.