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.

Regarding OMAP3530: Rebuilding the Linux Kernel

Other Parts Discussed in Thread: OMAP3530

While running

make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules

i get this error,

I am using UBUNTU 9.04, and  ran the commands below  without an error message

Normal 0 false false false EN-US X-NONE X-NONE

 

================================================================================
host $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm omap3_evm_defconfig
host $ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm menuconfig
-=================================================================

but running the next command i get the below mention Errors

omap3530@omap3530-desktop:~/OMAP/workdir/opt/linux-03.00.00.05$ sudo make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules
make: arm-none-linux-gnueabi-gcc: Command not found
  CHK     include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-arm
  CC      kernel/bounds.s
/bin/sh: arm-none-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
omap3530@omap3530-desktop:~/OMAP/workdir/opt/linux-03.00.00.05$

 

=============================================================================

I have installed the codeSoucery and set the right Path, also set the path for the tool chain

Normal 0 false false false EN-US X-NONE X-NONE

export PATH=/home/omap3530/OMAP/toolchain/arm-2009q1/bin:$PATH
export PATH=/home/omap3530/OMAP/workdir/opt/u-boot-03.00.00.05/tools:$PATH

===================================================================

I would like to know, if there are any files ex makefile or or some scripts i need to make changes to the path
Also would like to know what the command
make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules

Really means and which installation file /*.sh  i need to see, what command are being run

Also wanted to know, why is that i have to run the make scripts in sudo command as they would not work if i discard sudo

 

  • UWM_res said:

    omap3530@omap3530-desktop:~/OMAP/workdir/opt/linux-03.00.00.05$ sudo make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules
    make: arm-none-linux-gnueabi-gcc: Command not found
      CHK     include/linux/version.h
    make[1]: `include/asm-arm/mach-types.h' is up to date.
      CHK     include/linux/utsrelease.h
      SYMLINK include/asm -> include/asm-arm
      CC      kernel/bounds.s
    /bin/sh: arm-none-linux-gnueabi-gcc: not found
    make[1]: *** [kernel/bounds.s] Error 127
    make: *** [prepare0] Error 2
    omap3530@omap3530-desktop:~/OMAP/workdir/opt/linux-03.00.00.05$

    The error you are getting does indicate a failure to locate your tool chain, so something is wrong with your path. To test this out try typing in the compiler command arm-none-linux-gnueabi-gcc --help on your host terminal, if you don't get the help output of the ARM GCC compiler than you will need to check your PATH variable and make sure it is pointing to a valid Code Sourcery install.

    One thing to note is that the root user (even on a Ubuntu box with no obvious root user) has a different PATH from your own user. I think this is your problem, as since you are trying to build the kernel with sudo you are using the root user's PATH and not your own as the 'omap3530' user. As a follow on to the test above, try running that same command only with sudo, i.e. sudo arm-none-linux-gnueabi-gcc --help. Chances are this will fail and give you the 'Command not found' error just like the kernel build is.

    UWM_res said:
    Also wanted to know, why is that i have to run the make scripts in sudo command as they would not work if i discard sudo

    You should not have to run your builds with sudo, this seems to be your problem at least for this case mentioned above.

    What sort of errors are you getting when you try to run the make command without sudo?The first thing that comes to mind would be if you have permissions problems on the kernel tree directories, which you could fix with a sudo chown -R omap3530 /home/omap3530/OMAP/workdir/opt/linux-03.00.00.05 or something similar.

    UWM_res said:
    Also would like to know what the command
    make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules

    The make command just the make utility, it will attempt to process whatever Makefile it finds in the present working directory, the real functional part of the build is all within the Makefile and what it includes. The Makefile is right there in the directory if you want to dig into it, but it can be rather daunting if you are just getting into Makefiles to start with the kernel Makefile. In general you should not have to modify this Makefile (I never have had to). 

    The CROSS_COMPILE and ARCH values are simply setting environment variables to be used during the build process, CROSS_COMPILE is providing what tool chain to be used (in this case cross compiling for ARM using Code Sourcery) and the ARCH value defines the architecture, which in this case is ARM.

    The uImage and modules values are the commands that are actually being run out of the Makefile, uImage is telling it to build a particular format of Linux kernel image (the actual uImage file), and the modules command is telling it to build the loadable kernel modules (the various .ko files you may have selected).

  •  

    Bernie Thompson said:

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

    The error you are getting does indicate a failure to locate your tool chain, so something is wrong with your path. To test this out try typing in the compiler command arm-none-linux-gnueabi-gcc --help  

    omap3530@omap3530-desktop:~$ arm-none-linux-gnueabi-gcc --help
    Usage: arm-none-linux-gnueabi-gcc [options] file...
    Options:
      -pass-exit-codes         Exit with highest error code from a phase
      --help                   Display this information
      --target-help            Display target specific command line options
      --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
                               Display specific types of command line options
      (Use '-v --help' to display command line options of sub-processes)
      -dumpspecs               Display all of the built in spec strings
      -dumpversion             Display the version of the compiler
      -dumpmachine             Display the compiler's target processor
      -print-search-dirs       Display the directories in the compiler's search path
      -print-libgcc-file-name  Display the name of the compiler's companion library
      -print-file-name=<lib>   Display the full path to library <lib>
      -print-prog-name=<prog>  Display the full path to compiler component <prog>
      -print-multi-directory   Display the root directory for versions of libgcc
      -print-multi-lib         Display the mapping between command line options and
                               multiple library search directories
      -print-multi-os-directory Display the relative path to OS libraries
      -print-sysroot           Display the target libraries directory
      -print-sysroot-headers-suffix Display the sysroot suffix used to find headers
      -Wa,<options>            Pass comma-separated <options> on to the assembler
      -Wp,<options>            Pass comma-separated <options> on to the preprocessor
      -Wl,<options>            Pass comma-separated <options> on to the linker
      -Xassembler <arg>        Pass <arg> on to the assembler
      -Xpreprocessor <arg>     Pass <arg> on to the preprocessor
      -Xlinker <arg>           Pass <arg> on to the linker
      -combine                 Pass multiple source files to compiler at once
      -save-temps              Do not delete intermediate files
      -pipe                    Use pipes rather than intermediate files
      -time                    Time the execution of each subprocess
      -specs=<file>            Override built-in specs with the contents of <file>
      -std=<standard>          Assume that the input sources are for <standard>
      --sysroot=<directory>    Use <directory> as the root directory for headers
                               and libraries
      -B <directory>           Add <directory> to the compiler's search paths
      -b <machine>             Run gcc for target <machine>, if installed
      -V <version>             Run gcc version number <version>, if installed
      -v                       Display the programs invoked by the compiler
      -###                     Like -v but options quoted and commands not executed
      -E                       Preprocess only; do not compile, assemble or link
      -S                       Compile only; do not assemble or link
      -c                       Compile and assemble, but do not link
      -o <file>                Place the output into <file>
      -x <language>            Specify the language of the following input files
                               Permissible languages include: c c++ assembler none
                               'none' means revert to the default behavior of
                               guessing the language based on the file's extension

    Options starting with -g, -f, -m, -O, -W, or --param are automatically
     passed on to the various sub-processes invoked by arm-none-linux-gnueabi-gcc.  In order to pass
     other options on to these processes the -W<letter> options must be used.

    For bug reporting instructions, please see:
    <https://support.codesourcery.com/GNUToolchain/>.

    Bernie Thompson said:
    As a follow on to the test above, try running that same command only with sudo, i.e. sudo arm-none-linux-gnueabi-gcc --help. Chances are this will fail and give you the 'Command not found' error just like the kernel build is. 

     

    omap3530@omap3530-desktop:~$ sudo arm-none-linux-gnueabi-gcc --help
    [sudo] password for omap3530:
    sudo: arm-none-linux-gnueabi-gcc: command not found
    omap3530@omap3530-desktop:~$ sudo arm-none-linux-gnueabi-gcc --help
    sudo: arm-none-linux-gnueabi-gcc: command not found

    Bernie Thompson said:
    You should not have to run your builds with sudo, this seems to be your problem at least for this case mentioned above. What sort of errors are you getting when you try to run the make command without sudo?
    The first thing that comes to mind would be if you have permissions problems on the kernel tree directories, which you could fix with a sudo chown -R omap3530 /home/omap3530/OMAP/workdir/opt/linux-03.00.00.05 or something similar.

    omap3530@omap3530-desktop:~/OMAP/workdir/opt/linux-03.00.00.05$ make CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm uImage modules
      CHK     include/linux/version.h
    /bin/sh: cannot create include/linux/version.h.tmp: Permission denied
      UPD     include/linux/version.h
    mv: cannot stat `include/linux/version.h.tmp': No such file or directory
    make: *** [include/linux/version.h] Error 1

     

    Bernie Thompson said:
     
    The first thing that comes to mind would be if you have permissions problems on the kernel tree directories, which you could fix with a sudo chown -R omap3530 /home/omap3530/OMAP/workdir/opt/linux-03.00.00.05 or something similar.

    omap3530@omap3530-desktop:~/OMAP$ sudo chown -R omap /home/omap3530/OMAP/workdir
    omap3530@omap3530-desktop:~/OMAP$ ls -gh
    total 807M
    drwxr-xr-x 8 omap3530 4.0K 2010-03-19 09:40 AM35x-OMAP35x-PSP-SDK-03.00.00.05
    -rwxrwxrwx 1 omap3530 350M 2010-09-07 18:02 data_dvsdk_3_01_00_06.tar.gz
    drwxr-xr-x 3 omap3530 4.0K 2010-09-07 21:04 dvsdk
    -rwxrwxrwx 1 omap3530 354M 2010-09-07 18:02 overlay_dvsdk_3_01_00_06.tar.gz
    -rwxrwxrwx 1 omap3530  37M 2010-09-07 18:01 powerdemos_setupLinux_3_01_00_05.bin
    -rwxrwxrwx 1 omap3530  65M 2010-09-07 18:00 rootfs_dvsdk_3_01_00_06.jffs2
    drwxr-xr-x 3 omap3530 4.0K 2010-09-07 21:25 toolchain
    -rwxrwxrwx 1 omap3530 821K 2010-09-07 18:00 u-boot-omap35x-evm.bin
    -rwxrwxrwx 1 omap3530 2.3M 2010-09-07 18:00 uImage-omap35x-evm.bin
    drwxr-xr-x 4 omap3530 4.0K 2010-09-10 20:10 workdir

    Bernie Thompson said:
    The make command just the make utility, it will attempt to process whatever Makefile it finds in the present working directory

    There are make files in every folder of Linux folder, which are used in the rebuilding, which file should i see to see if the path has been set correctly. I do remember in installation od dvsdk package , on has to set his/her makefile to correct installation folder, this was said in the user guide 

    http://processors.wiki.ti.com/index.php/GSG:_OMAP35x_DVEVM_Software_Setup#Installing_the_Target_Linux_Software



    Bernie Thompson i appreciate your reply, 

    i did change the ownership of the file and see that workdir is set at x for all user , still i get sudo error and as you stated, i feel it might be one of the problems...

    where does cross_complier get it's commands...

     

     

     


  • Thanks i solved the problem, the error was simple...:(

    I changed changed the own to someone else.. bad of me...

    it created a uImage..

    thanks for the suggestions

  • Normal 0 false false false EN-US X-NONE X-NONE

    Once the kernel image uImage will be placed under arch/arm/boot and is ready to be loaded on the target., do we have to do the below steps, why?

    Once the modules are built they must be installed on the target file system in order to be used. The following command will install the modules to the target file system and create the modules dependency file.

    host  $ su root
    host $ make CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=<target filesys dir> modules_install

  • UWM_res said:

    Once the kernel image uImage will be placed under arch/arm/boot and is ready to be loaded on the target., do we have to do the below steps, why?

    Once the modules are built they must be installed on the target file system in order to be used. The following command will install the modules to the target file system and create the modules dependency file.

    host  $ su root
    host $ make CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=<target filesys dir> modules_install

    That modules_install command will install any kernel modules you have built into the target file system, so you would only need to do it if you have important kernel code built as modules, if you have no kernel modules than this command is unnecessary. For the default out of the box kernel build, this is probably not necessary, as all the important kernel code should be built statically into the kernel image already.

  • Bernie Thompson said:

     

    host  $ su root
    host $ make CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=<target filesys dir> modules_install

    That modules_install command will install any kernel modules you have built into the target file system, so you would only need to do it if you have important kernel code built as modules, if you have no kernel modules than this command is unnecessary. For the default out of the box kernel build, this is probably not necessary, as all the important kernel code should be built statically into the kernel image already.

    I had a feeling that it was un necessary after i ran the command, it was an half an hour y/n/ or some random nos that had to be input.. :(

     

    Thanks Bernie

  • bumping this thread, as i just ran into this exact issue...

    if you man sudo you find out that it's a security feature that it wipes the environment.

    but, chowning your new filesystem's root is a hack - clearly could lead to all kinds of security issues with your embedded device.

    the solution above of 'su root' only works if your root environment (.bashrc, .profile, or whatever) is setup with the proper path settings (unlikely and probably not recommended that root would have a path pointing into some user's directory...)

    try this:

    sudo PATH=$PATH sh -c 'make modules_install INSTALL_MOD_PATH=/media/ROOTFS ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-'

    (note the single quotes)