1.Default Build Parameters Configuration
- open /meta-alb/nxp-setup-alb.sh
MACHINE="s32r45evb"can set the machine defaultSOURCESDIR="NXP_R45_meta_test"can set the default user meta layerLAYER_LIST="meta-test"can add your own meta layer into yocto project- you can replace
DOWNLOADS="$ROOTDIR/downloads"to/home/user/resource/yocto/bsp37/downloadscan set the download dependency resources(linux,bsp,and so on)
F2.loder Introduction and common methods to add hello.ko into image
1 | rsdk-yocto-build-32 tree |
layer.conf
1 | # add next into layer.conf |
packagegroup-test-drivers.bb
1 | # add next into packagegroup-test-drivers.bb |
fsl-image-auto.bbappend
1 | # add next into fsl-image-auto.bbappend |
bitbake hello-test can test the .bb file
basic command:
source nxp-setup-alb.shwill check the and generate the default build folder and enterbuild_test.-doption will generate new build folder and enter it.-boption will choose the special build folder and enter it.bitbake fsl-image-autowill build the u-boot,kernel,rootfs,generate sd/flash image automatic.- u-boot and kernel compiler steps:
- configure cross compile
- excute
make xx_menuconfig,Configure u-boot/kernel - excute
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-,Build u-boot/kernel
3.For example add a new Fdma driver into yocto project
| |–meta-test
| | |–conf
| | | |–layer.conf
| | |–packagegroups
| | | |–packagegroup-test-drivers.bb
| | |–recipes-core
| | | |–packagegroup
| | | | |–fsl-image-auto.bbappend
| | | |–rsdk_env.inc
| | |–recipes-kernel
| | | |–fdma
| | | | |–fdma-driver.bb
| | | |–rsdk - will be add into .bbappend
| | | | |–files
| | | | | |–fdma_driver.patch - and you can generate the patch for osal-kernel-lib.bbappend
| | | | |–osal-kernel-lib.bbappend
| | | | |–rsdk_kmod.inc
| | | |–hello
| | | | |–files
| | | | | |–testhello.c
| | | | | |–Makefile
| | | | | |–COPYING
| | | | |–hello-test.bb
| | |–COPYING.MIT
| | |–README.md
- add your
fdma_driver.patchintoosal-kernel-lib.bbappend - add your
fdma-driver.bbintopackagegroup-test-drivers.bb - add your
packagegroup-test-drivers.bbintofsl-image-auto.bbappend
above all, and you can generate/add a new driver into your yocto image and path is rootfs(lib/modules/xxx/extra/fdma-driver.ko)
if you want to debug your change ,you did not need to rebuild all the sd card image,and just compiler linux image and dtb, and then replace it in sd card
bitbake linux-s32to generate the linux resources and you can add your changed into this,and if the debug is ok ,you can generate the patchbitbake linux-s32 -c do_compile -fwill generate the linux image and dtb only, and the image and the dtb the path isbuild/tmp/work/s32r45evb-fsl-linux/linux-s32/5.15.96-r0/build/arch/arm64/boot/Imageand thebuild/tmp/work/s32r45evb-fsl-linux/linux-s32/5.15.96-r0/build/arch/arm64/boot/dts/freesacle/s32r45-evb.dtb- when you want to generate a patch by Yocto, i suggest you
git add -allthe patch apply changes andgit commit -m "xxx"first, and then add your change into the resources.
Add a compressed package to Yocto’s rootfs
- add
recipes-testintometa-test1
2
3
4
5|--meta-test
| |--recipes-test
| | |--files
| | | |--test.zip
| | |--ziptest.bb1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32// ziptest.bb
SUMMARY = "ziptest application"
LICENSE = "CLOSED"
SRC_URI = "file://test.zip"
SRC_URI[md5sum] = "1234567890abcdef1234567890abcdef"
S = "${WORKDIR}"
do_fetch() {
echo "--- file is in ${WORKDIR} during fetch ---"
ls ${WORKDIR}
echo "--- start load the file to ${WORKDIR} ---"
cp ${FILE_DIRNAME}/files/test.zip ${WORKDIR}
}
do_unpack() {
:
}
do_patch() {
:
}
do_configure() {
:
}
do_compile() {
:
}
// the `etc` is user setting under `/`
do_install() {
install -d ${D}/etc
install -m 0644 ${WORKDIR}/test.zip ${D}/etc
}
Add a file to Yocto’s rootfs
1 | // 0644 used for data file(only read/write) 0755 used for execute file(execute) |
1 | SUMMARY = "txttest application" |