bitbake -vDDD your-recipe
bitbake -s
bitbake -c listtasks recipe
bitbake -c your-task your-recipe
bitbake world
bitbake-layers -h
bitbake-layers add-layer
bitbake-layers remove-layer
bitbake-layers show-layers
bitbake-layers show-recipes
cat build_directory/tmp/work/machine_toolchain/package_name/package_version/temp/log.task_order
First list all tasks of a recipe using:
bitbake -c listtasks recipe
Then add your task where you prefer by adding another task in your recipe:
OUT = "${TOPDIR}/tmp/deploy/images/board-name" do_copy_example() { cp ${WORKDIR}/example.txt ${OUT}/example.txt } do_copy_example[doc] = "Task added in Recipe" addtask do_copy_example after task1 before task2
Then run your task using:
bitbake -c do_copy_example recipe-name
DESCRIPTION = "Install file into rootfs" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" #take file from files directory SRC_URI += "\ file://file1 \ file://file2 \ " #specify where to get the files S = "${WORKDIR}" do_install_append() { #create custom dir into rootfs install -d ${D}/path/to/dir/on/fs #copy files inside install -m 0644 ${WORKDIR}/file1 ${D}/path/to/dir/on/fs install -m 0644 ${WORKDIR}/file2 ${D}/path/to/dir/on/fs } FILES_${PN} += "/path/to/dir/on/fs"
DESCRIPTION = "Install SECO boot tool and uuu-tool" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" UUU_TOOL_BINARY_SRC ?= "git://git.example.com/project.git;" PROTOCOL ?= "protocol=ssh;" REPO_USER ?= "" SRCBRANCH = "master" SRCREV ="0b47efdb976eeae09e23b077928bdbcc483be80f" SRC_URI = "${UUU_TOOL_BINARY_SRC}branch=${SRCBRANCH};${PROTOCOL}${REPO_USER}" S = "${WORKDIR}" do_install() { #create directory install -d ${DEPLOY_DIR_IMAGE}/folder1 #copy file cp -r ${WORKDIR}/git/* ${DEPLOY_DIR_IMAGE}/folder1 #create link if [ ! -L ${DEPLOY_DIR_IMAGE}/link ]; then ln -s ${DEPLOY_DIR_IMAGE}/folder1/file1 ${DEPLOY_DIR_IMAGE}/file1 fi }
For example setting the RootFS to 2GB would require the following addition to the local.conf file:
IMAGE_ROOTFS_SIZE = “2097152” IMAGE_OVERHEAD_FACTOR = “1.0”
$ ps -ef|grep bitbake $ kill -9 [PPID] $ ps -ef| grep bitbake |awk '{print $2}' | xargs kill -9
# short-description: Create SD card image with a boot partition # long-description: # Create an image that can be written onto a SD card using dd for use # with i.MX SoC family. # It uses SPL and u-boot # # The disk layout used is: # - ----- --------- --------- -------------- # | | SPL | u-boot | /boot | rootfs | # - ----- --------- --------- -------------- # ^ ^ ^ ^ ^ ^ # | | | | | | # 0 1kiB 69kiB 4MiB 4MiB + 8MiB 4MiB + 8Mib + rootfs + IMAGE_EXTRA_SPACE (default 10MiB) # part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1 part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 69 part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 8M --extra-space 0 part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096 References: https://docs.yoctoproject.org/ref-manual/kickstart.html References: https://github.com/Freescale/meta-fsl-arm/blob/master/scripts/lib/image/canned-wks/imx-uboot-spl.wks
IMAGE_INSTALL += ${@'linux-firmware imx-gpu-viv kernel-module-imx-gpu-viv' if \
(d.getVar('MACHINEOVERRIDES') == 'True') else ''}
inherit ${@'flatpak-image-variants' if \
(d.getVar('HAVE_META_FLATPAK') == 'True' and \
'flatpak' in d.getVar('DISTRO_FEATURES')) else ''}
inherit ${@'flatpak-repository' if \
(d.getVar('HAVE_META_FLATPAK') == 'True' and \
'flatpak' in d.getVar('DISTRO_FEATURES')) else ''}
IMAGE_INSTALL += "${@ 'linux-firmware imx-gpu-viv kernel-module-imx-gpu-viv' if \
(d.getVar('MACHINE_SOCARCH_SUFFIX') == '-imx6sx') else ''}"
IMAGE_INSTALL += "${@bb.utils.contains("MACHINE_SOCARCH_SUFFIX", "imx6", "linux-firmware imx-gpu-viv kernel-module-imx-gpu-viv", "", d)}"
Reference: https://github.com/openembedded/bitbake/blob/master/lib/bb/utils.py#L974
core-image-minimal.bbappend
do_image_complete() {
cd ${DEPLOY_DIR_IMAGE}
dd if=/dev/zero of=boot.img bs=1M count=50
mkfs.vfat boot.img
mcopy -i boot.img file.dtb ::file.dtb
mcopy -i boot.img Image ::Image
mcopy -i boot.img boot.scr ::boot.scr
}
References: https://stackoverflow.com/questions/22385189/add-files-to-vfat-image-without-mounting
core-image-minimal.bbappend
do_image_complete() {
# Create etc.ext4 part
dd if=/dev/zero of="${WORKDIR}/etc.ext4" bs=1M count=${ETC_PART_SIZE_MB};
mke2fs -d ${IMAGE_ROOTFS}/etc -t ext4 -L etc_image ${WORKDIR}/etc.ext4;
cp -rf ${WORKDIR}/etc.ext4 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.etc.ext4;
ln -sfn "${IMAGE_NAME}.etc.ext4" "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.etc.ext4";
# Create boot.vfat part
cd ${DEPLOY_DIR_IMAGE}
dd if=/dev/zero of=${IMAGE_BASENAME}-${MACHINE}.boot.vfat bs=1M count=${BOOT_PART_SIZE_MB};
mkfs.vfat ${IMAGE_BASENAME}-${MACHINE}.boot.vfat
mcopy -i ${IMAGE_BASENAME}-${MACHINE}.boot.vfat file.dtb ::file.dtb
mcopy -i ${IMAGE_BASENAME}-${MACHINE}.boot.vfat Image ::Image
ln -sfn "${IMAGE_NAME}.boot.vfat" "${IMAGE_BASENAME}-${MACHINE}.boot.vfat";
}
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
DEPENDS += "gdk-pixbuf-native"
PRINC = "8"
SRC_URI += "file://psplash-colors.h \
file://psplash-bar-img.png"
# NB: this is only for the main logo image; if you add multiple images here,
# poky will build multiple psplash packages with 'outsuffix' in name for
# each of these ...
SPLASH_IMAGES = "file://psplash-poky-img.png;outsuffix=default"
# The core psplash recipe is only designed to deal with modifications to the
# 'logo' image; we need to change the bar image too, since we are changing
# colors
do_configure_append () {
cd ${S}
cp ../psplash-colors.h ./
# strip the -img suffix from the bar png -- we could just store the
# file under that suffix-less name, but that would make it confusing
# for anyone updating the assets
cp ../psplash-bar-img.png ./psplash-bar.png
./make-image-header.sh ./psplash-bar.png BAR
}
References:
❤️