找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 3166|回复: 1

openwrt中/etc/hotplug.d/block/10-mount这个文件在源码的什么地方?

[复制链接]
我要实现U盘自动挂载功能,在网上查找资料发现可以在openwrt中/etc/hotplug.d/block/10-mount这个文件中写如下代码即可
  1. #!/bin/sh

  2.   case "$ACTION" in
  3.         add)
  4.                 for i in $(ls /dev/ | grep 'sd[a-z][1-9]')
  5.                    do
  6.                        mkdir -p /mnt/$i
  7.                        mount  -o iocharset=utf8,rw /dev/$i /mnt/$i
  8.                         if [ "$?" -ne 0 ];then
  9.                             mount -o rw /dev/$i /mnt/$i
  10.                         fi

  11.                   done
  12.              ;;
  13.       remove)
  14.                     MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'`

  15.                     for i in $MOUNT

  16.                     do
  17.                       umount $i
  18.                      
  19.                    done
  20.              ;;
  21. esac
复制代码


openwrt中/etc/hotplug.d/block/10-mount这个文件中原来的代码如下:
  1. /sbin/block hotplug
复制代码


现在我想将这个脚本添加到源码中编译出固件,但是openwrt源码中openwrt/package/base-files/files/etc/hotplug.d/下只有一个net/00-sysctl文件,里面内容如下,我要在什么地方添加我前面的脚本代码,编译出固件以后在/etc/hotplug.d/block/10-mount下才能看到我的脚本代码??
  1. #!/bin/sh

  2. if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then
  3.         sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \
  4.                 sysctl -e -p - | logger -t sysctl
  5. fi
复制代码

我的恩山、我的无线 The best wifi forum is right here.
/target/linux/xxx/xxx/base-files
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-28 05:12

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表