前言
在使用 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
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |
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% |
Checking sstate mirror object availability: 100% |
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"
zzz@ubuntu-GCP1820-SS:xilinx$
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$ ls images/linux/ -lhtr
total 754M
-rw-r--r-- 1 zzz zzz 49M 4月 3 11:37 rootfs.cpio
-rw-r--r-- 1 zzz zzz 6.9M 4月 3 11:37 rootfs.cpio.gz
-rw-r--r-- 1 zzz zzz 6.9M 4月 3 11:37 rootfs.cpio.gz.u-boot
-rw-r--r-- 1 zzz zzz 12M 4月 3 11:37 rootfs.jffs2
-rw-r--r-- 1 zzz zzz 66M 4月 3 11:39 Image
-rw-r--r-- 1 zzz zzz 303M 4月 3 11:39 vmlinux
-rw-r--r-- 1 zzz zzz 3.3M 4月 3 11:39 System.map.linux
-rw-r--r-- 1 zzz zzz 25M 4月 3 11:39 image.ub
-rw-rw-r-- 1 zzz zzz 21M 4月 3 11:50 boot.bin
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$
zzz@ubuntu-GCP1820-SS:xilinx$ find . -name "one-wire.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
total 128K
-rw-r--r-- 1 zzz zzz 14K 3月 22 15:08 reserved-driver.ko
-rw-r--r-- 1 zzz zzz 25K 3月 22 15:08 multichan-axidma.ko
-rw-r--r-- 1 zzz zzz 15K 3月 22 15:08 ib-fwup.ko
-rw-r--r-- 1 zzz zzz 47K 3月 22 15:08 u-dma-buf.ko
-rw-r--r-- 1 zzz zzz 18K 3月 22 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
[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% |
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% |
Checking sstate mirror object availability: 100% |
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"
./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 4月 3 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$
zzz@ubuntu-GCP1820-SS:xilinx$
三、编译设备树和整个工程
zzz@ubuntu-GCP1820-SS:xilinx$ petalinux-build -c device-tree
[INFO] building device-tree
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake virtual/dtb
Loading cache: 100% |
Loaded 3987 entries from dependency cache.
Parsing recipes: 100% |
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% |
Checking sstate mirror object availability: 100% |
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 12月 5 2020 system.bit
drwxrwxr-x 2 zzz zzz 4.0K 3月 22 15:11 pxelinux.cfg/
drwxrwxr-x 3 zzz zzz 4.0K 3月 22 15:11 ../
-rwxr-xr-x 1 zzz zzz 176M 3月 26 18:54 sdk.sh*
drwxr-xr-x 17 zzz zzz 4.0K 3月 29 11:44 rootfs/
drwxrwxr-x 5 zzz zzz 4.0K 3月 29 14:30 .Xil/
-rw-rw-r-- 1 zzz zzz 21M 4月 3 11:50 boot.bin
-rw-r--r-- 1 zzz zzz 9.8K 4月 3 12:33 zynqmp-qemu-multiarch-pmu.dtb
-rw-r--r-- 1 zzz zzz 75K 4月 3 12:33 zynqmp-qemu-multiarch-arm.dtb
-rw-r--r-- 1 zzz zzz 66K 4月 3 12:33 zynqmp-qemu-arm.dtb
-rw-r--r-- 1 zzz zzz 66M 4月 3 12:33 Image
-rw-r--r-- 1 zzz zzz 303M 4月 3 12:33 vmlinux
-rw-r--r-- 1 zzz zzz 3.3M 4月 3 12:33 System.map.linux
-rw-r--r-- 1 zzz zzz 25M 4月 3 12:33 image.ub
-rw-r--r-- 1 zzz zzz 130K 4月 3 12:33 zynqmp_fsbl.elf
-rw-r--r-- 1 zzz zzz 665K 4月 3 12:33 u-boot.elf
-rw-r--r-- 1 zzz zzz 600K 4月 3 12:33 u-boot.bin
-rw-r--r-- 1 zzz zzz 34K 4月 3 12:33 system.dtb
-rw-r--r-- 1 zzz zzz 158K 4月 3 12:33 pmufw.elf
-rw-r--r-- 1 zzz zzz 150K 4月 3 12:33 bl31.elf
-rw-r--r-- 1 zzz zzz 50K 4月 3 12:33 bl31.bin
-rw-r--r-- 1 zzz zzz 598K 4月 3 13:03 rootfs.testdata.json
-rw-r--r-- 1 zzz zzz 9.2K 4月 3 13:03 rootfs.manifest
-rw-r--r-- 1 zzz zzz 6.9M 4月 3 13:03 rootfs.tar.gz
-rw-r--r-- 1 zzz zzz 49M 4月 3 13:03 rootfs.cpio
-rw-r--r-- 1 zzz zzz 6.9M 4月 3 13:03 rootfs.cpio.gz
-rw-r--r-- 1 zzz zzz 6.9M 4月 3 13:03 rootfs.cpio.gz.u-boot
-rw-r--r-- 1 zzz zzz 12M 4月 3 13:03 rootfs.jffs2
drwxrwxr-x 5 zzz zzz 4.0K 4月 3 13:07 ./
-rw-rw-r-- 1 zzz zzz 21M 4月 3 14:45 BOOT.BIN
zzz@ubuntu-GCP1820-SS:xilinx$
参考链接
|