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/AM4377: Minimal rootfs for 64MB QSPI flash

Part Number: AM4377

Tool/software: Linux

Dear Sir:

  I want to build a minial rootfs for AM4377 with a QSPI flash 64MB, which branch should I fetch from TI web server?  I want to remove some files from the pre-build rootfs, 

And I am not sure which need to remove or which need to keep. If some important files removed, the system maybe can not work. So I want to keep the most important which related boot up.

Could u please help to tell me which branch should be build?

Looking forward to your replying.

Thanks

  • Hello rance,

    Please, refer to this post.

    $ sudo apt-get install git build-essential python diffstat texinfo gawk chrpath dos2unix wget unzip socat doxygen libc6:i386 libncurses5:i386 libstdc++6:i386 libz1:i386

    $ sudo dpkg-reconfigure dash
    #Select "No" when prompted.

    $ wget https://releases.linaro.org/components/toolchain/binaries/6.2-2016.11/arm-linux-gnueabihf/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz
    $ tar -Jxvf gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf.tar.xz -C $HOME

    $ git clone git://arago-project.org/git/projects/oe-layersetup.git tisdk
    $ cd tisdk
    $ ./oe-layertool-setup.sh -f configs/processor-sdk/processor-sdk-04.03.00.05-config.txt

    Modify <tisdk>/sources/meta-arago/meta-arago-distro/recipes-core/images/arago-base-tisdk-image.bb file like below.
    ----------------------------------------------------------------------------------------
    # Arago TI SDK base image with test tools
    # Suitable for initramfs

    require arago-image.inc
    IMAGE_FSTYPES += "cpio.xz"
    IMAGE_INSTALL += "\
    packagegroup-arago-base-tisdk \
    ${VIRTUAL-RUNTIME_initramfs} \
    "
    export IMAGE_BASENAME = "arago-base-tisdk-image"
    ----------------------------------------------------------------------------------------

    $ cd build
    $ cat >> ./conf/local.conf << 'EOF'

    TI_MIRROR = "http://software-dl.ti.com/processor-sdk-mirror/sources/"
    MIRRORS += " \
    bzr://.*/.*      ${TI_MIRROR} \n \
    cvs://.*/.*      ${TI_MIRROR} \n \
    git://.*/.*      ${TI_MIRROR} \n \
    gitsm://.*/.*    ${TI_MIRROR} \n \
    hg://.*/.*       ${TI_MIRROR} \n \
    osc://.*/.*      ${TI_MIRROR} \n \
    p4://.*/.*       ${TI_MIRROR} \n \
    npm://.*/.*      ${TI_MIRROR} \n \
    ftp://.*/.*      ${TI_MIRROR} \n \
    https?$://.*/.*  ${TI_MIRROR} \n \
    svn://.*/.*      ${TI_MIRROR} \n \
    "
    EOF
    $ . conf/setenv
    $ export PATH=$HOME/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin:$PATH
    $ MACHINE=am437x-evm bitbake arago-base-tisdk-image

    Check the size, flash it to your board and boot.

    Customize the image by adding IMAGE_INSTALL_append = " package1 package2 package3" to <tisdk>/build/conf/local.conf file.

    Please, check this page out for more details.

    Best regards,
    Kemal

  • How to deal with the following error?
    rance@rance-desktop:~/tisdk/build$ MACHINE=am437x-evm bitbake arago-base-tisdk-image
    ERROR: Only one copy of bitbake should be run against a build directory
  • Try not running two bitbake commands one over another.

  • Hi Kemal:
    If I want to remove all the QT package of the build in "packagegroup-arago-tisdk-qte.bb" and "packagegroup-arago-tisdk-qte-sdk-host.bb", How to do that ? I don't want to add them one by one in the build file, such as the qtwebbrowser, qtwebengine-examples, etc.
    How to add it in the local build config file and can remove all the following? (remove all the qt, hmi, graphics,multimedia, connectivity,etc, in the directory "sources/meta-arago/meta-arago-distro/recipes-core/packagegroups"),
    because our QSPI flash only 64MB, I just want to keep the most important which related the boot up.
    Thanks
  • Just build arago-base-tisdk-image target without modifying anything, this is the base target which doesn't contain any graphics.
  • Yes, I following your instructions above you mentioned, I just choose the arago-base-tisdk-image when I do build, but the images of rootfs is more than about 156M for the .tar.xz. I want to optimize it to about no more than 50M.
    Does anything else also no need to build and can be optimized ?
  • Sorry kemal, I made a mistake, the size is about 16M of rootfs.
    Thanks very much!
  • Beside <tisdk>/sources/meta-arago/meta-arago-distro/recipes-core/images/arago-base-tisdk-image.bb, If you also modify <tisdk>/sources/meta-arago/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-base-tisdk.bb like below and fall back to the SystemV service manager by adding ARAGO_SYSVINIT = "1" in <tisdk>/build/conf/local.conf file, you will get 13.9Mb arago-base-tisdk-image-am437x-evm-<date-time>.rootfs.ubi image.
    ----------------------------------------------------------------------------------------
    DESCRIPTION = "Additional packages beyond console packages shared by TI SDKs"
    LICENSE = "MIT"
    PR = "r19"

    PACKAGE_ARCH = "${MACHINE_ARCH}"

    inherit packagegroup

    OPTEE_PKGS = " \
    optee-os \
    optee-client \
    optee-test \
    "

    RDEPENDS_${PN} = "\
    cifs-utils \
    ${@base_conditional('OPTEEMACHINE', 'ti', "${OPTEE_PKGS}", "", d)} \
    "
    ----------------------------------------------------------------------------------------

  • Hi kemal:

       Thanks for your help,  the arago-base-tisdk-image.tar.xz is about 16M after compressed, but after it write to flash, the total size will more than 64M after decompressed, And I will try the way which you mentioned this this item. And try to optimize it again for the rootfs.

  • Hi kemal:

           After I recompile the project,  I got a 7.5M arago-base-tisdk-image-am437x-evm.tar.xz, But this arago-base-tisdk-image-am437x-evm.tar.xz put it in SDcard,  it seems that it can not boot up fully.

    Please check the log file,  I think that there maybe some config files missing lead to it can not boot up successfully.

    rootfs.txt
    Fullscreen
    1
    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
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    U-Boot SPL 2017.01-00458-gfd06b46-dirty (May 10 2018 - 15:30:44)
    Trying to boot from MMC1
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    reading u-boot.img
    U-Boot 2017.01-00458-gfd06b46-dirty (May 10 2018 - 15:30:44 +0800)
    CPU : AM437X-GP rev 1.2
    Model: TI AM437x SK EVM
    DRAM: 1 GiB
    PMIC: TPS65218
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0
    reading uboot.env
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    3639552 bytes read in 937 ms (3.7 MiB/s)
    51067 bytes read in 44 ms (1.1 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff0000, end 8ffff77a ... OK
    Starting kernel ...
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.9.69-g9ce43c71ae (shang@ubuntu) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #11 PREEMPT Mon May 28 15:32:22 CST 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt:Machine model: TI AM437x SK EVM
    [ 0.000000] efi: Getting EFI parameters from FDT:
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] cma: Reserved 48 MiB at 0xbd000000
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM437x ES1.2 (neon)
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 260416
    [ 0.000000] Kernel command line: console=ttyO3,115200n8 root=PARTUUID=dd75ad75-02 rw rootfstype=ext4 rootwait
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Memory: 977292K/1048576K available (7168K kernel code, 292K rwdata, 2384K rodata, 1024K init, 281K bss, 22132K reserved, 49152K cma-reserved, 212992K highmem)
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
    [ 0.000000] vmalloc : 0xf0800000 - 0xff800000 ( 240 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xf0000000 ( 768 MB)
    [ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Move back the removed lines from the recipes and see which config will make your board bootable.