This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM335X: Yocto configuration

Part Number: PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

   I need to add an extra link name in yocto source for deploy/images/board. where can i add an extra link file to board images for debug image, root-fs image, zImage.


For example:

fms-debug-image-sfms.tar.xz
--> link name i.e. debug-image.tar.xz
<part> -rootfs-image-<board>.tar.xz
--> link name i.e. release-image.tar.xz
zImage-sfms- <board-name>.dtb
--> link name i.e. <our-board-name>.dtb
fms-debug-image-sfms.ubi
--> link name i.e. debug-image.ubi
fms-rootfs-image-sfms.ubi
--> link name i.e. release-image.ubi

Please help me to add link file to our board.

Regards,
SanthanaKumarS

  • Hello Santhana,

    santhana kumar s said:
    fms-debug-image-sfms.tar.xz --> link name i.e. debug-image.tar.xz <part> -rootfs-image-<board>.tar.xz --> link name i.e. release-image.tar.xz fms-debug-image-sfms.ubi --> link name i.e. debug-image.ubi fms-rootfs-image-sfms.ubi --> link name i.e. release-image.ubi

    You can see how the new image symlincs are created here by the create_symlinks function in <tisdk>/sources/oe-core/meta/classes/image.bbclass.

    #
    # Create symlinks to the newly created image
    #
    python create_symlinks() {

        deploy_dir = d.getVar('IMGDEPLOYDIR')
        img_name = d.getVar('IMAGE_NAME')
        link_name = d.getVar('IMAGE_LINK_NAME')
        manifest_name = d.getVar('IMAGE_MANIFEST')
        taskname = d.getVar("BB_CURRENTTASK")
        subimages = (d.getVarFlag("do_" + taskname, 'subimages', False) or "").split()
        imgsuffix = d.getVarFlag("do_" + taskname, 'imgsuffix') or d.expand("${IMAGE_NAME_SUFFIX}.")

        if not link_name:
            return
        for type in subimages:
            dst = os.path.join(deploy_dir, link_name + "." + type)
            src = img_name + imgsuffix + type
            if os.path.exists(os.path.join(deploy_dir, src)):
                bb.note("Creating symlink: %s -> %s" % (dst, src))
                if os.path.islink(dst):
                    os.remove(dst)
                os.symlink(src, dst)
            else:
                bb.note("Skipping symlink, source does not exist: %s -> %s" % (dst, src))
    }


    santhana kumar s said:
    zImage-sfms- <board-name>.dtb --> link name i.e. <our-board-name>.dtb

    You can see how the dtb symlincs are created here in <tisdk>/sources/oe-core/meta/classes/kernel-devicetree.bbclass file.

    do_deploy_append() {
        for DTB in ${KERNEL_DEVICETREE}; do
            DTB=`normalize_dtb "${DTB}"`
            DTB_EXT=${DTB##*.}
            DTB_BASE_NAME=`basename ${DTB} ."${DTB_EXT}"`
            for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
                base_name=${type}"-"${KERNEL_IMAGE_BASE_NAME}
                symlink_name=${type}"-"${KERNEL_IMAGE_SYMLINK_NAME}
                DTB_NAME=`echo ${base_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
                DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
                DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"`
                install -d ${DEPLOYDIR}
                install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}
                ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_SYMLINK_NAME}.${DTB_EXT}
                ln -sf ${DTB_NAME}.${DTB_EXT} ${DEPLOYDIR}/${DTB_BASE_NAME}.${DTB_EXT}

                if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
                    cat ${DEPLOYDIR}/$type \
                        ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
                        > ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT}.bin
                    ln -sf ${DTB_NAME}.${DTB_EXT}.bin ${DEPLOYDIR}/$type-${DTB_BASE_NAME}.${DTB_EXT}.bin

                    if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
                        cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
                            ${DEPLOYDIR}/${DTB_NAME}.${DTB_EXT} \
                            > ${DEPLOYDIR}/${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin
                        ln -sf ${type}-${INITRAMFS_BASE_NAME}-${DTB_BASE_NAME}.${DTB_EXT}.bin \
                               ${DEPLOYDIR}/${type}-initramfs-${DTB_BASE_NAME}.${DTB_EXT}-${MACHINE}.bin
                    fi
                fi
            done
        done
    }

    Edit these files and add the extra name in the way you want.

    Best regards,
    Kemal

  • Hi Kemal,

       Thanks for helping with a proper way, but where can i adding link file in deploy/images

       DTB_SYMLINK_NAME , IMAGE_LINK_NAME  those variables are getting link name to my deploy folder, But how can I add an extra link file to my deploy images.

    Regards,

    SanthanaKumarS

  • Hello Santhana,

    You can assign the fms-debug-image-sfms to link_name and  you will have the names you want.

        link_name = "fms-debug-image-sfms"

    You can call or copy this function with different link names to have the rest names.

    You can add IMAGE_NAME_SUFFIX = ".release-image" or IMAGE_NAME_SUFFIX = ".debug-image" to <tisdk>/build/conf/local.conf to change the image name or edit these recipe files to shape the naming you want.

    <tisdk>/sources/meta-arago/meta-arago-distro/classes/image_types_md5.bbclass
    <tisdk>/sources/oe-core/meta/classes/image_types.bbclass
    <tisdk>/sources/oe-core/meta/classes/image.bbclass

    Best regards,
    Kemal

  • Kemal,

                Thanks for replying my issues, but almost I solved that issue. to solve the issue by adding variable_name=<exporting my name> & used os.symlink to create my link file.

    Thanks & Regards,
    SanthanaKumarS