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.

Failures while trying to rebuild Arago Linux kernel

I've got a Beaglebone A3 setup to load the Arago kernel via TFTP and NFS-mounted root FS hosted from my Ubuntu 11.10 box.

When I ran the setup scripts for getting Code Composer and the other various environment stuff setup, the source code for Linux also got installed here:

~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk

While exploring around, I located an environment setup script in ~/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/environment-setup along with a readme indicating to run that script "sourced" in order to configure my shell for compiling ARM code, not native x86 code. So I did that and it changed my shell prompt, I guess to further indicate the environment was modified.

I also located 2 possible Makefile files that could be the one I need to run. The one I assumed I would need to run is the one right in the root of the Linux Source at:

~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk/Makefile

However when I run make from that directory (no arguments), I get to a point in the make script where I'm being asked to choose a processor, however all the processors listed are x86 Intel architecture processors, not ARM. Looking in the makefile, I see I need to add the ARCH= argument although I don't see any obvious build options using $(ARCH) that look like they would be for ARM. But I try it anyway, and no surprise I get:

[linux-devkit]:~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk> make ARCH=ARM
Makefile:567: /home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk/arch/ARM/Makefile: No such file or directory
make: *** No rule to make target `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk/arch/ARM/Makefile'.  Stop.



The other Makefile I found to try running is in the ~/ti-sdk-am335x-evm-05.03.00.00 directory. So I tried running it just to see what it did. Here is the results of its execution:
[linux-devkit]:~/ti-sdk-am335x-evm-05.03.00.00> make
=================================
Building the Linux Kernel
=================================
make -C /home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk ARCH=arm CROSS_COMPILE=/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/bin/arm-arago-linux-gnueabi- tisdk_am335x-evm_defconfig
make[1]: Entering directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
#
# configuration written to .config
#
make[1]: Leaving directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
make -C /home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk ARCH=arm CROSS_COMPILE=/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/linux-devkit/bin/arm-arago-linux-gnueabi- uImage
make[1]: Entering directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
scripts/kconfig/conf --silentoldconfig Kconfig
make[1]: Leaving directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
make[1]: Entering directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  MKELF   scripts/mod/elfconfig.h
scripts/mod/mk_elfconfig: 1: Syntax error: word unexpected (expecting ")")
make[3]: *** [scripts/mod/elfconfig.h] Error 2
make[2]: *** [scripts/mod] Error 2
make[1]: *** [scripts] Error 2
make[1]: Leaving directory `/home/cgrey/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk'
make: *** [linux] Error 2


Have I done something incorrect or out of order at this point? Or are there other arguments I need to be including to get this to build correctly?

Once I get this to compile correctly, I'm assuming I'll have a bin file that is the kernel that I will need to move to my /tftpboot directory. Where will that file reside? And is there a way to configure an install target to know to place that file automatically into the /tftpboot directly automagically?

  • Christopher,

    As I mentioned in your other thread, you should NOT source environment-setup when building the Linux kernel.  The main reason is that the kernel needs to compile some helper applications to run on your x86 host and since environment-setup has modified your CC variable those applications instead get compiled for the ARM.

    As for your specific issue above:

    1. If building the kernel from withing the linux source directory itself use ARCH=arm not ARM.  You can look at the Makefile in the root of the SDK directory.  Also see http://processors.wiki.ti.com/index.php/AMSDK_Linux_User%27s_Guide

    2. For using the top-level Makefile in the SDK do not source environment-setup.  The sub-component makefiles will source this as needed.  See http://processors.wiki.ti.com/index.php/Sitara_Linux_SDK_Top-Level_Makefile for how to use this Makefile

    Chase

  • I'll read those over. Hopefully the links explain the difference between them and when to run one vs the other.

  • Using the AMSDK Users Guide page, I'm still having some trouble. I get a successful clean, but I'm still getting an issue with the build.I tried both SDK and PSP builds:

    cgrey@cgrey-desktop:~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- mrproper
      CLEAN   .
      CLEAN   .tmp_versions
      CLEAN   scripts/basic
      CLEAN   scripts/genksyms
      CLEAN   scripts/kconfig
      CLEAN   scripts/mod
      CLEAN   include/config include/generated arch/arm/include/generated
      CLEAN   .config .config.old include/linux/version.h

    cgrey@cgrey-desktop:~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- am335x_evm_defconfig
      HOSTCC  scripts/basic/fixdep
    scripts/basic/fixdep: 1: Syntax error: word unexpected (expecting ")")
    make[1]: *** [scripts/basic/fixdep] Error 2
    make: *** [scripts_basic] Error 2


    cgrey@cgrey-desktop:~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- tisdk_am335x-evm_defconfig
      HOSTCC  scripts/basic/fixdep
    scripts/basic/fixdep: 1: Syntax error: word unexpected (expecting ")")
    make[1]: *** [scripts/basic/fixdep] Error 2
    make: *** [scripts_basic] Error 2
    cgrey@cgrey-desktop:~/ti-sdk-am335x-evm-05.03.00.00/board-support/linux-3.0+3.1-rc8-psp04.06.00.02.sdk-psp04.06.00.02.sdk$

    Any ideas what that might be?

  • Christopher,

    I noticed that you are using an older SDK.  Would you perhaps be willing to try the latest SDK with updated kernel sources?  You can download the SDK from http://software-dl.ti.com/dsps/dsps_public_sw/am_bu/sdk/AM335xSDK/latest/index_FDS.html

    Chase

  • Downloading now. It'll be tomorrow before I can get it installed and retry everything. Stay tuned...

  • The updated SDK builds Linux just fine using the top-level makefile and calling it with make linux. The resulting file is a vmlinux executable as I expected, although the size of the executable is significantly larger than the version in my /tftpboot folder. After renaming my existing uImage-am335x-evm.bin file to something else and replacing it with the new vmlinux file I just built, uboot loads up the much larger file and when I expect it to start executing it, instead I get an error:

    Wrong Image Format for bootm command

    ERROR: can't get kernel image!

    Searching around for Wrong Image Format for bootm command, I don't find anything helpful. There were 2 hits on this site, and as far as I could tell, neither were related to trying to boot from TFTP and NFS.

    Should I start this as a new thread or is there some issue with how I built the kernel or with my method of moving it to /tftpboot that explains the results?

  • Christopher,

    u-boot uses the uImage file type.  You should find this in the arch/arm/boot/ directory of the linux kernel sources.  The vmlinux is an different image type and is not signed and compressed as u-boot expects.

    Chase

  • I thought there was some kind of compression going on with the uImage. Good to know where that file is made at. Is it made any time the vmlinux file is made? Or do I have to call the makefile differently to get make to build a uImage version of the kernel? Looking at the date-stamp, it appears it made at near the same time the vmlinux file made. But I thought I'd ask just to be sure.

  • When building the Linux kernel to be used with u-boot you build the "uImage" target.  i.e. make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- uImage

    Check the linux target of the top-level SDK Makefile to see how it builds the Linux kernel and modules.

    Chase

  • Ok, that makes sense.

    At this point, I think I'm good with building Linux now. This SDK install seems to be working and building just fine. I have no clue what was wrong with the other one.

    Thanks for the help. Now I can get back to applying those patches from the AI thread.