1. 下载地址
https://www.kernel.org/pub/linux/utils/kernel/hotplug/
2. 遇到的问题
configure 配置问题:
1> configure: error: Package requirements (libkmod >= 5) were not met:No package 'libkmod' found
2> configure: error: Package requirements (blkid >= 2.20) were not met:No package 'blkid' found
3> configure: error: Package requirements (glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0) were not met: No package 'glib-2.0' found No package 'gobject-2.0' found
等等这类问题只需要安装这些库即可:sudo apt-get install libkmod-dev libblkid-dev libglib2.0-dev
4> configure: error: Package requirements (gobject-introspection-1.0 >= 0.6.2) were not met:No package 'gobject-introspection-1.0' found
查到对应安装:
Fedora, CentOS, RHEL, etc.: gobject-introspection-devel
Debian, Ubuntu, Mint, etc.: libgirepository1.0-dev
Arch: gobject-introspection
FreeBSD: gobject-introspection
Cygwin: libgirepository1.0-devel
msys2: mingw-w64-x86_64-gobject-introspection and/or mingw-w64-i686-gobject-introspection
5> configure: error: pci.ids not found, try --with-pci-ids-path=
解决该问题需要找到系统中的 pci.ids 然后指定
whereis pci.ids ---------------> 我们选定这个: /usr/share/misc/pci.ids
即为:CC=arm-linux-gnueabihf-gcc ./configure --prefix=/opt/embedded/platform/usr/ --host=arm-linux --with-pci-ids-path=/usr/share/misc/pci.ids
编译时出错:
6> GEN src/extras/keymap/keys-from-name.h (standard input): No keywords in input file!
添加:--disable-keymap
即为:CC=arm-linux-gnueabihf-gcc ./configure --prefix=/opt/embedded/platform/usr/ --host=arm-linux-gnu --with-pci-ids-path=/usr/share/misc/pci.ids --disable-keymap
注意:
这 udev 太多坑,太难搞,可以看到这个库在2012到2013年就停止更新了,主要原因是内核更改了设备插拔方式接口,用sysfs方式。最好使用 eudev 替代
eudev 下载地址:
https://github.com/gentoo/eudev
configure选项,我 --disable-blkid --disable-kmod 编译通过