IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 系统运维 -> petalinux 无法生成自定义.ko文件 -> 正文阅读

[系统运维]petalinux 无法生成自定义.ko文件

前言

在使用 petalinux 修改并生成最新的.ko驱动模块时,发现并没有生成当前时间下的最新.ko文件。如下图:

zzz@ubuntu-GCP1820-SS:xilinx$ sptl   #设置环境变量
PetaLinux environment set to '/home/zzz/opt/pkg/petalinux/2019.2'
WARNING: /bin/sh is not bash! 
bash is PetaLinux recommended shell. Please set your default shell to bash.
INFO: Checking free disk space
INFO: Checking installed tools
INFO: Checking installed development libraries
INFO: Checking network and other services
WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build  #编译整个 Petalinux 工程                                                                           
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |################################################################################################################################| Time: 0:00:00
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |##############################################################################################################################| Time: 0:00:04
Parsing of 2901 .bb files complete (2899 cached, 2 parsed). 3988 targets, 155 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |################################################################################################################################| Time: 0:00:02
Checking sstate mirror object availability: 100% |########################################################################################################| Time: 0:00:00
Sstate summary: Wanted 124 Found 22 Missed 204 Current 862 (17% match, 89% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3478 tasks of which 3470 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
[Errno 13] Permission denied: '/tftpboot/Image'
NOTE: Successfully copied built images to tftp dir: /tftpboot
[INFO] successfully built project
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ find . -name "one-wire.ko"  # 查找自定义的.ko文件,查找不到                                                                           
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-package --boot --format BIN --fsbl --pmufw  --fpga  --u-boot --output  boot.bin --force #打包生成 BOOT 文件
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/zynqmp_fsbl.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/pmufw.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/project-spec/hw-description/evt2_shireA_V11_000017.bit"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/bl31.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/u-boot.elf"
INFO: Generating zynqmp binary package boot.bin...


****** Xilinx Bootgen v2019.2
  **** Build date : Oct 23 2019-22:59:42
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

INFO: Binary is ready.
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ ls images/linux/ -lhtr
total 754M
-rw-r--r--  1 zzz zzz  49M 43 11:37 rootfs.cpio
-rw-r--r--  1 zzz zzz 6.9M 43 11:37 rootfs.cpio.gz
-rw-r--r--  1 zzz zzz 6.9M 43 11:37 rootfs.cpio.gz.u-boot
-rw-r--r--  1 zzz zzz  12M 43 11:37 rootfs.jffs2
-rw-r--r--  1 zzz zzz  66M 43 11:39 Image
-rw-r--r--  1 zzz zzz 303M 43 11:39 vmlinux
-rw-r--r--  1 zzz zzz 3.3M 43 11:39 System.map.linux
-rw-r--r--  1 zzz zzz  25M 43 11:39 image.ub
-rw-rw-r--  1 zzz zzz  21M 43 11:50 boot.bin
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ find . -name "one-wire.ko"    # 查找自定义的.ko文件,查找不到                                                                       
zzz@ubuntu-GCP1820-SS:xilinx$ find . -name "*one-wire*"
./project-spec/meta-user/recipes-modules/one-wire
./project-spec/meta-user/recipes-modules/one-wire/one-wire.bb
./project-spec/meta-user/recipes-modules/one-wire/files/one-wire.c-original
./project-spec/meta-user/recipes-modules/one-wire/files/one-wire.c
...
./build/tmp/work/plnx_zynqmp-xilinx-linux/one-wire/1.0-r0/.tmp_versions/one-wire.mod
./build/tmp/stamps/plnx_zynqmp-xilinx-linux/one-wire
./images/linux/rootfs/usr/share/licenses/one-wire
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ ls  ./images/linux/rootfs/lib/modules/4.19.0-xilinx-v2019.2/extra/ -lhtr  # 查找自定义的.ko文件,查找不到   
total 128K
-rw-r--r-- 1 zzz zzz 14K 322 15:08 reserved-driver.ko
-rw-r--r-- 1 zzz zzz 25K 322 15:08 multichan-axidma.ko
-rw-r--r-- 1 zzz zzz 15K 322 15:08 ib-fwup.ko
-rw-r--r-- 1 zzz zzz 47K 322 15:08 u-dma-buf.ko
-rw-r--r-- 1 zzz zzz 18K 322 15:08 oob-fwup.ko

可以看到, build 目录下有相关的one-wire文件。可能是旧的文件导致make没有生成当前时间下最新的.ko文件。


一、删除旧的 build 目录

zzz@ubuntu-GCP1820-SS:xilinx$ rm build/ -rf
zzz@ubuntu-GCP1820-SS:xilinx$ 

二、编译内核模块

zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build -c one-wire     #only for one-wire moudule                   
[INFO] building one-wire
[INFO] generating Kconfig for project
[INFO] silentconfig project
[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
[INFO] generating machine configuration
[INFO] generating bbappends for project . This may take time ! 
[INFO] generating u-boot configuration files
[INFO] generating kernel configuration files
[INFO] generating user layers
[INFO] generating workspace directory
[INFO] generating kconfig for Rootfs
[INFO] silentconfig rootfs
[INFO] generating petalinux-user-image.bb
INFO: bitbake one-wire
Parsing recipes: 100% |####################################################################################################################################| Time: 0:01:11
Parsing of 2901 .bb files complete (0 cached, 2901 parsed). 3988 targets, 155 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |#################################################################################################################################| Time: 0:00:04
Checking sstate mirror object availability: 100% |#########################################################################################################| Time: 0:00:03
Sstate summary: Wanted 923 Found 678 Missed 490 Current 0 (73% match, 0% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2759 tasks of which 2338 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
[Errno 13] Permission denied: '/tftpboot/Image'
NOTE: Successfully copied built images to tftp dir: /tftpboot
[INFO] successfully built one-wire
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ find . -name "one-wire.ko" #已找到 one-wire 模块
./build/tmp/sysroots-components/plnx_zynqmp/one-wire/lib/modules/4.19.0-xilinx-v2019.2/extra/one-wire.ko
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ ll ./build/tmp/sysroots-components/plnx_zynqmp/one-wire/lib/modules/4.19.0-xilinx-v2019.2/extra/one-wire.ko
-rw-r--r-- 1 zzz zzz 12880 43 12:16 ./build/tmp/sysroots-components/plnx_zynqmp/one-wire/lib/modules/4.19.0-xilinx-v2019.2/extra/one-wire.ko
zzz@ubuntu-GCP1820-SS:xilinx$  # 当前是最新编译出来的 one-wire 模块 
zzz@ubuntu-GCP1820-SS:xilinx$

三、编译设备树和整个工程

zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build -c device-tree  #only for device-tree
[INFO] building device-tree
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake virtual/dtb
Loading cache: 100% |###########################################################################################################################################| Time: 0:00:00
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |#########################################################################################################################################| Time: 0:00:04
Parsing of 2901 .bb files complete (2899 cached, 2 parsed). 3988 targets, 155 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |######################################################################################################################################| Time: 0:00:02
Checking sstate mirror object availability: 100% |##############################################################################################################| Time: 0:00:00
Sstate summary: Wanted 168 Found 65 Missed 206 Current 754 (38% match, 88% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 2762 tasks of which 2752 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
[Errno 13] Permission denied: '/tftpboot/Image'
NOTE: Successfully copied built images to tftp dir: /tftpboot
[INFO] successfully built device-tree
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build   #for all
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |###########################################################################################################################################| Time: 0:00:00
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |#########################################################################################################################################| Time: 0:00:04
Parsing of 2901 .bb files complete (2899 cached, 2 parsed). 3988 targets, 155 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |######################################################################################################################################| Time: 0:00:03
Checking sstate mirror object availability: 100% |##############################################################################################################| Time: 0:00:00
Sstate summary: Wanted 233 Found 107 Missed 252 Current 753 (45% match, 87% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 3478 tasks of which 2800 didn't need to be rerun and all succeeded.
INFO: Copying Images from deploy to images
[Errno 13] Permission denied: '/tftpboot/Image'
NOTE: Successfully copied built images to tftp dir: /tftpboot
[INFO] successfully built project
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ 

四、制作 BOOT.BIN 文件

zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-package --boot --format BIN --fsbl --pmufw  --fpga  --u-boot --output  BOOT.BIN --force              
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/zynqmp_fsbl.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/pmufw.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/project-spec/hw-description/evt2_shireA_V11_000017.bit"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/bl31.elf"
INFO: File in BOOT BIN: "/home/zzz/petalinux/xilinx/images/linux/u-boot.elf"
INFO: Generating zynqmp binary package BOOT.BIN...


****** Xilinx Bootgen v2019.2
  **** Build date : Oct 23 2019-22:59:42
    ** Copyright 1986-2019 Xilinx, Inc. All Rights Reserved.

INFO: Binary is ready.
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ 
zzz@ubuntu-GCP1820-SS:xilinx$ ll images/linux/ -htr
total 714M
-rw-r--r--  1 zzz zzz  20M 125  2020 system.bit
drwxrwxr-x  2 zzz zzz 4.0K 322 15:11 pxelinux.cfg/
drwxrwxr-x  3 zzz zzz 4.0K 322 15:11 ../
-rwxr-xr-x  1 zzz zzz 176M 326 18:54 sdk.sh*
drwxr-xr-x 17 zzz zzz 4.0K 329 11:44 rootfs/
drwxrwxr-x  5 zzz zzz 4.0K 329 14:30 .Xil/
-rw-rw-r--  1 zzz zzz  21M 43 11:50 boot.bin
-rw-r--r--  1 zzz zzz 9.8K 43 12:33 zynqmp-qemu-multiarch-pmu.dtb
-rw-r--r--  1 zzz zzz  75K 43 12:33 zynqmp-qemu-multiarch-arm.dtb
-rw-r--r--  1 zzz zzz  66K 43 12:33 zynqmp-qemu-arm.dtb
-rw-r--r--  1 zzz zzz  66M 43 12:33 Image
-rw-r--r--  1 zzz zzz 303M 43 12:33 vmlinux
-rw-r--r--  1 zzz zzz 3.3M 43 12:33 System.map.linux
-rw-r--r--  1 zzz zzz  25M 43 12:33 image.ub
-rw-r--r--  1 zzz zzz 130K 43 12:33 zynqmp_fsbl.elf
-rw-r--r--  1 zzz zzz 665K 43 12:33 u-boot.elf
-rw-r--r--  1 zzz zzz 600K 43 12:33 u-boot.bin
-rw-r--r--  1 zzz zzz  34K 43 12:33 system.dtb
-rw-r--r--  1 zzz zzz 158K 43 12:33 pmufw.elf
-rw-r--r--  1 zzz zzz 150K 43 12:33 bl31.elf
-rw-r--r--  1 zzz zzz  50K 43 12:33 bl31.bin
-rw-r--r--  1 zzz zzz 598K 43 13:03 rootfs.testdata.json
-rw-r--r--  1 zzz zzz 9.2K 43 13:03 rootfs.manifest
-rw-r--r--  1 zzz zzz 6.9M 43 13:03 rootfs.tar.gz
-rw-r--r--  1 zzz zzz  49M 43 13:03 rootfs.cpio
-rw-r--r--  1 zzz zzz 6.9M 43 13:03 rootfs.cpio.gz
-rw-r--r--  1 zzz zzz 6.9M 43 13:03 rootfs.cpio.gz.u-boot
-rw-r--r--  1 zzz zzz  12M 43 13:03 rootfs.jffs2
drwxrwxr-x  5 zzz zzz 4.0K 43 13:07 ./
-rw-rw-r--  1 zzz zzz  21M 43 14:45 BOOT.BIN
zzz@ubuntu-GCP1820-SS:xilinx$ 

参考链接

  系统运维 最新文章
配置小型公司网络WLAN基本业务(AC通过三层
如何在交付运维过程中建立风险底线意识,提
快速传输大文件,怎么通过网络传大文件给对
从游戏服务端角度分析移动同步(状态同步)
MySQL使用MyCat实现分库分表
如何用DWDM射频光纤技术实现200公里外的站点
国内顺畅下载k8s.gcr.io的镜像
自动化测试appium
ctfshow ssrf
Linux操作系统学习之实用指令(Centos7/8均
上一篇文章      下一篇文章      查看所有文章
加:2022-04-04 12:51:11  更:2022-04-04 12:53:10 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 22:24:07-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码