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

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
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







Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].