参考教程https://blog.csdn.net/thisway_diy/article/details/81327077
https://whycan.cn/t_711.html
mdev是busybox自带的一个简化版的udev
作用是在系统启动和热插拔 或动态加载驱动程序时,自动产生驱动程序所需的节点文件,在文件系统中的/dev目录下的设备节点都是由mdev创建的。
mdev扫描/sys/class和/sys/block中所有的类设备目录,如果在目录中含有名为"dev"的文件,且文件中包含的是设备号,则mdev就利用这些信息为这个设备在/dev下创建设备节点u盘自动挂载功能实现步骤如下:
1、配置内核
a)配置内核支持热插拔:
#cd linux.2.6.21
#vi .config
CONFIG_KALLSYMS=y
CONFIG_HOTPLUG=y //确保此项为y
CONFIG_PRINTK=y
CONFIG_NET=y //确保此项为y
确保以上两项均设置为y,否则/proc/sys/kernel/目录下不会出现huotplug文件。
b)配置内核支持
#make menuconfig
选择Device Drivers -->
USB support -->
<*> Support for Host-side USB
<*> OHIC HCD support
<*> UHCI HCD (most Intel and VIA) support
<*> SL811HS HCD support
<*> USB Mass Storage support2、配置busybox
#make menuconfig
选择Linux System Utilities --->
[ * ]mdev
[ * ] Support /etc/mdev.conf
[ * ] Support subdirs/symlinks
[ * ] Support regular expressions substitutions when renaming device
[ * ] Support command execution at device addition/removal
[ * ] Support loading of firmwares
但是我在buildroot里面的busybox里面没找到mdev选项.....
离线
mdev 在 busybox 吧
buildroot的target packages里面也有一个busybox,这2个不是同一个东西?
最近编辑记录 605364021 (2018-12-08 13:36:25)
离线
605364021 说:晕哥 说:mdev 在 busybox 吧
buildroot的target packages里面也有一个busybox,这2个不是同一个东西?
是同一个东西.
但是buildroot中的busybox里面没有mdev的选项....
离线
#!/bin/sh
if [ $ACTION = "add" ];
then
echo --------usb wifi connect--------- > /dev/console
hostapd -B /etc/hostapd.conf
ifconfig wlan0 192.168.2.1
dhcpd -cf /etc/dhcpcd.conf wlan0
else
echo --------usb wifi disconnect--------- > /dev/console
killall hostapd
killall dhcpd
fi
---------------------
#define CONFIG_BOOTARGS "console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0"
第一段代码是网上自启动脚本,第二段是v3s的启动bootagrs,请问一下shell脚本的中/dev/console 需要修改为/dev/mmcblk0p2吗?
离线
605364021 说:晕哥 说:是同一个东西.
但是buildroot中的busybox里面没有mdev的选项....
进 busybox 目录,直接修改 .config 文件, 然后 touch .config, 再进入buildroot执行 make 编译
buildroot的.config文件里面只有一个# BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV is not set
我不知道是不是同一个mdev....
离线
成功实现rtl8723bs AP模式自启动脚本
//在/sbin目录下新建auto_wifi_ap.sh文件
#!/bin/sh
#/sbin/auto_wifi_ap.sh
insmod /root/wifi/r8723bs.ko //r8723bs.ko的绝对路径
hostapd -B /etc/hostapd.conf
ifconfig wlan0 192.168.0.10 netmask 255.255.255.0
touch /var/lib/misc/udhcpd.leases
udhcpd /etc/udhcpd.conf
*******************************************
在/etc/init.d/目录下新建S80_auto_ap文件
#r8723bs wifi ap auto start
/sbin/auto_wifi_ap.sh
exit 0
可以自启动rtl8723bs网卡的AP模式,就是启动打印信息有点乱,有改进的方法吗?
[ 1.432794] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.441087] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.449440] devtmpfs: mounted
[ 1.453709] Freeing unused kernel memory: 1024K
[ 1.604690] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
Starting logging: OK
Initializing random number generator... done.
Starting network: OK
[ 1.864949] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.
[ 1.881710] RTL8723BS: module init start
[ 1.885653] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[ 1.892796] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[ 1.900508] pnetdev = c3ba2800
[ 1.935629] RTL8723BS: rtw_ndev_init(wlan0)
[ 1.941477] RTL8723BS: module init ret =0
Configuration file: /etc/hostapd.conf
[ 2.094646] rtl8723bs: acquire FW from file:rtlwifi/rtl8723bs_nic.bin
[ 2.767935] random: crng init done
rfkill: Cannot open RFKILL control device
Using interface wlan0 with hwaddr 8c:18:d9:34:1e:5a and ssid "licheepi "
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Only 0/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
[ 3.729227] RTL8723BS: rtw_cmd_thread(wlan0) pcmd->sctx
[ 3.734535] RTL8723BS: assoc success
wlan0: interface state UNINITIALIZED->ENABLED[ 3.743488] RTL8723BS: set group key camid:1, addr:00:00:00:00:00:00, kid:1, type:TKIP
wlan0: AP-ENABLED
udhcp server (v0.9.8) started
Welcome to Buildroot
buildroot login:
离线
这个log很正常,反正end user 又看不到他们.
现在手机可以连到 RTL8723BS 热点吗?
可以连到
离线
问个问题,为什么不能将rtl8723bs.ko模块直接编译进内核,要手动insmod rtl8723bs.ko模块
图1是内核.config文件,图二是内核menuconfig中的选项,
是因为CONFIG_RTL8723BS = m ?
离线