zoukankan      html  css  js  c++  java
  • 未知设备号创建设备节点

    #!/bin/sh
    module="scull"
    device="scull"
    mode="664"
    # invoke insmod with all arguments we got
    # and use a pathname, as newer modutils don't look in . by default
    /sbin/insmod ./$module.ko $* || exit 1
    # remove stale nodes
    rm -f /dev/${device}[0-3]
    major=$(awk "\$2=="$module" {print \$1}" /proc/devices)
    mknod /dev/${device}0 c $major 0
    mknod /dev/${device}1 c $major 1
    mknod /dev/${device}2 c $major 2
    mknod /dev/${device}3 c $major 3
    # give appropriate group/permissions, and change the group.
    # Not all distributions have staff, some have "wheel" instead.
    group="staff"
    grep -q '^staff:' /etc/group || group="wheel"
    chgrp $group /dev/${device}[0-3]
    chmod $mode /dev/${device}[0-3]

  • 相关阅读:
    17_8_30 Mybatis 入门
    17_8_29 mysql 导入导出备份还原
    [iOS基础控件
    [iOS基础控件
    [iOS基础控件
    [MAC OSX
    [iOS基础控件
    [iOS基础控件
    [iOS基础控件
    [iOS基础控件
  • 原文地址:https://www.cnblogs.com/luxiaolai/p/5228072.html
Copyright © 2011-2022 走看看