Template:H3-KernelHeaderFile/zh

From FriendlyELEC WiKi
Revision as of 07:26, 19 March 2022 by Tzs (Talk | contribs) (updated by API)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

1 编译内核头文件安装包

1.1 在开发板上操作

以下操作在在开发板上进行:

1.1.1 安装所需软件包

sudo apt-get update
sudo apt-get install dpkg-dev libarchive-tools

1.1.2 制作内核头文件安装包

git clone https://github.com/friendlyarm/linux -b sunxi-4.14.y --depth 1 kernel-h3
cd kernel-h3
rm -rf .git
make distclean
touch .scmversion
make CROSS_COMPILE= ARCH=arm sunxi_defconfig
alias tar=bsdtar
make CROSS_COMPILE= ARCH=arm bindeb-pkg -j4

显示如下信息表示成功:

dpkg-deb: building package 'linux-headers-4.14.111' in '../linux-headers-4.14.111_4.14.111-1_armhf.deb'.
dpkg-deb: building package 'linux-libc-dev' in '../linux-libc-dev_4.14.111-1_armhf.deb'.
dpkg-deb: building package 'linux-image-4.14.111' in '../linux-image-4.14.111_4.14.111-1_armhf.deb'.
dpkg-genchanges: warning: substitution variable ${kernel:debarch} used, but is not defined
dpkg-genchanges: info: binary-only upload (no source code included)

1.1.3 安装

sudo dpkg -i ../linux-headers-4.14.111_4.14.111-1_armhf.deb

1.1.4 测试

以编译pf_ring模块为例, 参考文档 https://www.ntop.org/guides/pf_ring/get_started/git_installation.html.

git clone https://github.com/ntop/PF_RING.git
cd PF_RING/kernel/
make

编译完成后, 使用insmod尝试加载模块:

sudo insmod ./pf_ring.ko