Cannot Build Kernel for UDOO Quad

Discussion in 'Kernels' started by Tsi, Jun 22, 2015.

  1. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    Hello I'm new to the UDOO.
    I recently received my Quad Board and I would like to develop from it from scratch.
    That is, I would like to build my own UBOOT and Kernel from the available sources.
    I'm attempting to cross-compile under Ubuntu.
    I followed the instructions from:
    http://www.udoo.org/docs/Advanced_Setup/Create_A_Bootable_MicroSD_Card_From_Sources

    1. The cross-compiler was downloaded and built OK.

    2. The Kernel seems to have been downloaded OK. I wasn't able to see any errors.
    I used the following command:
    git clone http://github.com/UDOOboard/Kernel_Unico kernel

    3. I set the default Kernel configuration with the results as follows:
    tsi@tsi-VirtualBox:~/udoo-dev/kernel$ make ARCH=arm UDOO_defconfig
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/kconfig/conf.o
    SHIPPED scripts/kconfig/zconf.tab.c
    SHIPPED scripts/kconfig/lex.zconf.c
    SHIPPED scripts/kconfig/zconf.hash.c
    HOSTCC scripts/kconfig/zconf.tab.o
    HOSTLD scripts/kconfig/conf
    #
    # configuration written to .config
    #
    tsi@tsi-VirtualBox:~/udoo-dev/kernel$

    4. The next step in the instructions is to call:
    make ARCH=arm menuconfig
    This is supposed to allow me to edit the config file.
    When calling it, I get a character mode "Linux/arm 3.0.35 Kernel Configuration" application.
    Why would I want to edit the config file?
    Can I not use all the defaults?
    What are the actual settings that I should make?

    5. After performing the command at step (4) above, I ran the following command:
    make -j4 CROSS_COMPILE=../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-ARCH=arm uImage modules

    I then received a lot of options from the command line--too numerous to mention here.
    I chose the defaults for all of them.
    After that, I received the following error:
    /home/tsi/udoo-dev/kernel/scripts/gcc-version.sh: line 25: ../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-ARCH=armgcc: No such file or directory
    /home/tsi/udoo-dev/kernel/scripts/gcc-version.sh: line 26: ../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-ARCH=armgcc: No such file or directory
    /bin/sh: 1: ../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-ARCH=armgcc: not found
    make: *** No rule to make target `uImage'. Stop.

    Nothing was built.
    Please assist me with all of the proper setup to get a successful build.

    Thank You,
    Tsi
     
    Last edited: Jun 22, 2015
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there Tsi,
    you got an email to answer exactly this question, anyway I'll copy-pasted the mail below for all the other UDOOers:

    Hi Tsi,
    here is Andrea Rovai of the UDOO Team.
    Let's answer your questions:
    1) The part number 4 at the link you provided refers to an option you get. The guide says: "At this point, it is possible to edit the config". It means that you are allowed to, not that you are obliged to.
    2) The error you get depends on a mistake in the documentation. Thank you very much for having pointed it out!
    We have now fixed it: http://www.udoo.org/docs/Advanced_Setup/Create_A_Bootable_MicroSD_Card_From_Sources#
    Regarding the forum, the admin Matteo Del Balio has solved it yesterday, as you may see.
    Best regards,
    Andrea Rovai
    UDOO Team
     
  3. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    Hello,

    Thank you for the response.
    I'm still having problems building.
    With your revised command, the kernal fails to build.

    The new command is as follows:
    make -j4 CROSS_COMPILE=../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- ARCH=arm uImage modules

    I received the following error:
    LD arch/arm/boot/compressed/vmlinux
    OBJCOPY arch/arm/boot/zImage
    Kernel: arch/arm/boot/zImage is ready
    UIMAGE arch/arm/boot/uImage
    "mkimage" command not found - U-Boot images will not be built
    make[1]: *** [arch/arm/boot/uImage] Error 1
    make: *** [uImage] Error 2
    make: *** Waiting for unfinished jobs....

    I then tried again to get he U-BOOT mkimage by doing the following:
    tsi@tsi-VirtualBox:~/udoo-dev$ sudo apt-get install build-essential ncurses-dev uboot-mkimage git

    However, I received the following errors:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'libncurses5-dev' instead of 'ncurses-dev'
    Package uboot-mkimage is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    u-boot-tools
    E: Package 'uboot-mkimage' has no installation candidate


    Can you please assist me. I'm still unable to successfully build.
    What are the right commands to get the proper mkimage?

    Thanks,
    Tsi
     
    Last edited: Jun 23, 2015
  4. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    I finally got it to compile by first doing:

    tsi@tsi-VirtualBox:~/udoo-dev$ sudo apt-get install u-boot-tools git

    ...then going to kernel and compiling:
    make -j4 CROSS_COMPILE=../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- ARCH=arm uImage modules
     
    Last edited: Jun 23, 2015
  5. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    OK, I'm now stuck.
    All the builds seems to have been completed OK.
    Now the last set of the instructions I do not understand, which is:
    "Copy the files on the SD card File System"
    I was able to find "uImage" from the build.
    I cannot find "u-boot.bin".
    Where is the location of "u-boot.bin"? I did a find -iname u-boot.bin and no results came up.
    I assume that the build also built the TAR file system that the instructions are talking about, but I cannot find any such thing from the builds.

    Where can I find these last 2 files? Are they not part of the build?
     
  6. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there Tsi,
    we have made other corrections. The name of the file is u-boot.imx, not u-boot.bin
    Sorry for the inconvenience.
     
  7. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    Hello,
    I'm still having a lot of issues with the instructions.

    1. I cannot find any "*.imx" file.
    I did the following commands:

    tsi@tsi-VirtualBox:~/udoo-dev$ find -iname *.imx
    tsi@tsi-VirtualBox:~/udoo-dev$ find -iname u*boot*
    ./kernel/arch/avr32/boot/u-boot

    The other instructions have: "u-boot-q.imx".
    (sudo dd if=u-boot-q.imx of=/dev/sdX bs=512 seek=2)

    Where can I find these files?

    2. Where can I find the tar.gz file containing the file system?
    Was this not part of the kernel build that I did?
     
  8. Tsi

    Tsi New Member

    Joined:
    Jun 15, 2015
    Messages:
    6
    Likes Received:
    0
    OK Now...
    This is really frustrating--trying to build the UDOO binaries from the C/C++ sources without errors.
    In my opinion, this is something that should have taken a few hours but is now in its third week.

    I've followed the instructions verbatim, but I get errors every step of the way.

    The instructions on page:
    "http://www.udoo.org/docs/Advanced_Setup/Create_A_Bootable_MicroSD_Card_From_Sources"
    implies that I can build the kernel, uboot, and the file system from the "C/C++" sources; from scratch.

    1. Is this correct or false--can I build all of the aforementioned from the sources?
    Is the instructions only for building the kernel?

    I cannot find a uboot binary from the build. I can only find a uImage binary, which I suppose is only the kernel binary.
    Can someone please clarify this to me?

    I downloaded the UBOOT for the quad and its name is: "u-boot-q.imx" not u-boot.imx, as the documentation suggest.
    Again, I would like to build the UBOOT from its C/C++ sources as well.

    2. I copied the file system binaries for the UDOO quad board from the following URL:
    http://www.udoo.org/downloads/UDOObuntu_FS_v1.1.tar.gz

    I performed the following command on it:
    sudo tar -xzvpf UDOObuntu_FS_v1.1.tar.gz -C /media/tsi/d4406a38-f577-495f-829f-9a549eeccd32/

    Now I get the following errors:

    ./usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-RI.ttf
    tar: Skipping to next header
    tar: Exiting with failure status due to previous errors

    What is the cause of this error?

    3. Can I please get correct instructions to:
    3.1) Build the kernel from sources without errors?
    3.2) Build UBOOT from sources without errors?
    3.3) Build the file system from sources without errors?
    3.4) Prepare my flash card for booting without errors?


    Can someone please help me?


    Thank You,
    Tsi
     
  9. vpeter

    vpeter Active Member

    Joined:
    Nov 29, 2014
    Messages:
    303
    Likes Received:
    62
    1.) I don't think you can compile whole filesystem from scratch. And you don't want to do that anyway. Only kernel and u-boot.
    uImage is Linux kernel binary that has a U-Boot wrapper at start. Image is generic Linux kernel binary and zImage is a compressed version of the Linux kernel image that is self-extracting.
    U-boot binary is a u-boot-q.imx for Udoo quad and u-boot-d.imx for Udoo dual.

    2.) Seems some uploaded files are little corrupted (Andrea can you check this?). For me this one is ok http://download.udoo.org/files/UDOO_Unico/File_System/UDOObuntu_FS_v1.1.tar.gz

    3.1) Use the instructions under Compile the Kernel and the modules.
    3.2)
    git clone https://github.com/UDOOboard/U-Boot_Unico-2013.git
    cd U-Boot_Unico-2013
    make CROSS_COMPILE=$(pwd)/../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- ARCH=arm mrproper
    make CROSS_COMPILE=$(pwd)/../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- ARCH=arm udoo_quad_config
    make CROSS_COMPILE=$(pwd)/../arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi- ARCH=arm
    cp u-boot.imx ../u-boot-q.imx

    3.3) You can't build filesystem. Download and unpack.
    3.4) Use the instructions Preparing the partitions on the SD card or http://www.udoo.org/docs/Advanced_Setup/Create_A_Bootable_MicroSD_Card_From_Preinstalled_Binaries

    Or just write created image to SD card.

    If you think you can master this things in a few hours then you are very, very wrong. Ok, typing commands is fine but little common sense is always good. And if you want to learn this things then just try and experiment.
     
  10. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi Tsi,

    How to compile u-boot:
    Clone the repository of our sources of the u-boot this way:
    git clone https://github.com/UDOOboard/U-Boot_Unico-2013
    enter the folder and configure the compilation with
    make udoo_quad_config
    or, for the dual, with
    make udoo_dl_config
    Compile with
    make
    Now you should have in the folder a file named u-boot.imx you have to flash in the MicroSD with the command:
    sudo dd if=u-boot.imx if=/dev/etichetta_microsd bs=512 seek=2

    Actually there's not a guide to recompile the file system. You better decompress the tar.gz from our download page.
     

Share This Page