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.

AM4376: Linux 5.4 rootfs and kernel image size restriction

Part Number: AM4376

Hi,

I am porting TI Linux kernel from 4.4 to 5.4, how ever I am facing an issue with the kernel image size.

We had added our customer kernel configuration file to enable/disable configuration, I am trying to remove unwanted modules from the list.

How ever during the process and build, I see that specific driver is removed but my overall rootfs.img file and zImage size is increasing more than 9 MB.

Please let us know how to debug further on this problem

  • Before config change

    prvelpur123@prvelpur123-Virtual-Machine:~/5.4_project/msocs-rackmanager-bsp/yoctoBuilds/images/qspi$ ls -lrt
    total 54400
    -rw-r--r-- 1 prvelpur123 prvelpur123 41754624 Sep 21 12:09 rootfs.img
    -rw------- 1 prvelpur123 prvelpur123 331776 Sep 21 12:09 rootfs.verity
    -rw-rw-r-- 1 prvelpur123 prvelpur123 419 Sep 21 12:09 verity.hash
    -rw-rw-r-- 1 prvelpur123 prvelpur123 13155510 Sep 21 12:10 kernel.img
    -rw-rw-r-- 1 prvelpur123 prvelpur123 451364 Sep 21 12:10 u-boot.bin
    -rw-rw-r-- 1 prvelpur123 prvelpur123 213 Sep 21 12:10 pkg.manifest

    prvelpur123@prvelpur123-Virtual-Machine:~/5.4_project/msocs-rackmanager-bsp/yoctoBuilds/tmp/work/ocs_am437x-poky-linux-gnueabi/linux-ti-staging/5.4.28+gitAUTOINC+6f3bf13d53-r3a/image/boot$ ls -lrt
    total 22604
    -rw-r--r-- 1 prvelpur123 prvelpur123 4354560 Sep 21 12:14 zImage-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    lrwxrwxrwx 1 prvelpur123 prvelpur123 47 Sep 21 12:14 zImage -> zImage-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 2375357 Sep 21 12:14 System.map-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 144986 Sep 21 12:14 config-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 15744368 Sep 21 12:14 vmlinux-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 610908 Sep 21 12:14 Module.symvers-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 71014 Sep 21 12:14 am437x-ms-ocs.dtb
    prvelpur123@prvelpur123-Virtual-Machine:~/5.4_project/msocs-rackmanager-bsp/yoctoB


    ============================> After config change

    prvelpur123@prvelpur123-Virtual-Machine:~/5.4_project/msocs-rackmanager-bsp/yoctoBuilds/tmp/work/ocs_am437x-poky-linux-gnueabi/linux-ti-staging/5.4.28+gitAUTOINC+6f3bf13d53-r3a/image/boot$ ls -lrt
    total 22280
    -rw-r--r-- 1 prvelpur123 prvelpur123 4301312 Sep 21 00:40 zImage-5.4.28-g6f3bf13d53
    lrwxrwxrwx 1 prvelpur123 prvelpur123 25 Sep 21 00:40 zImage -> zImage-5.4.28-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 2348013 Sep 21 00:40 System.map-5.4.28-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 127468 Sep 21 00:40 config-5.4.28-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 15573416 Sep 21 00:40 vmlinux-5.4.28-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 568995 Sep 21 00:40 Module.symvers-5.4.28-g6f3bf13d53
    -rw-r--r-- 1 prvelpur123 prvelpur123 71014 Sep 21 00:40 am437x-ms-ocs.dtb

    prvelpur123@prvelpur123-Virtual-Machine:~/5.4_project/msocs-rackmanager-bsp/yoctoBuilds/images/qspi$ ls -lrt
    total 57552
    -rw-r--r-- 1 prvelpur123 prvelpur123 45015040 Sep 21 00:34 rootfs.img
    -rw------- 1 prvelpur123 prvelpur123 356352 Sep 21 00:34 rootfs.verity
    -rw-rw-r-- 1 prvelpur123 prvelpur123 419 Sep 21 00:34 verity.hash
    -rw-rw-r-- 1 prvelpur123 prvelpur123 13098182 Sep 21 00:36 kernel.img
    -rw-rw-r-- 1 prvelpur123 prvelpur123 451364 Sep 21 00:36 u-boot.bin
    -rw-rw-r-- 1 prvelpur123 prvelpur123 213 Sep 21 00:36 pkg.manifest

  • Hi,

    What is there a reason for the concern on a size increase?

    I am not sure I am following the size increase except in the rootfs.img file. Assuming the config distinction in the previous post is about removing unwanted modules, both the zImage and the kernel.img file went down in size. 

    4354560 Sep 21 12:14 zImage-5.4.28-MS_OCS_RM_101.1.18.37-g6f3bf13d53

    13155510 Sep 21 12:10 kernel.img

    ============================> After config change

    4301312 Sep 21 00:40 zImage-5.4.28-g6f3bf13d53

    13098182 Sep 21 00:36 kernel.img

    To understand the cause of the increase in rootfs.img you will need to analyze the source of the increase by perhaps reviewing the rootfs tarball to see where the size increase is coming from.

    Best Regards,

    Schuyler

  • Yes,  we have 64MB QSPI limitation where both rootfs and kernel image gets copied. I am porting linux-ti-staging from 4.4 to 5.4 version.

    I see that after disabling modules, I see the linux-ti-staging build folder with size reduction how ever overall zimage size get's bumped up.

    Yes, from rootfs image both kernel modules and python is increasing.

  • Hi,

    I misunderstood the order the you presented the builds in. I took the after config change as the second builds, these were the smaller files.

    Unfortunately we are not going to be able to help with why Python is increasing in size. 

    Looking at the difference in the kernel, the zImage size about 53K and the vmlinux size of about 171K. Ideally I would agree that the overall kernel size should have gone down. But the only things I can suggest at the moment is to check is the following:

    - Is the previous 4.4 kernel modules (/lib/modules/4.4. ) still in the rootfs image that is being built?  There should only be /lib/modules/5.4. It would be good to check the size of this 5.4 directory in addition before and after the config change, if less modules are being built this directory should go down in number and size of modules.

    - Does a manual build outside of Yocto show a similar kernel size and module size?

    TI can only provide assistance if one the TI drivers is impacting the operation of the kernel. Overall kernel configuration or build size TI support will be limited here.

    Best Regards,

    Schuyler