element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum BBB - Building the Linux Kernel
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Single-Board Computers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 29 replies
  • Subscribers 59 subscribers
  • Views 4191 views
  • Users 0 members are here
  • beaglebone_black
  • bbb
  • bb_black
  • beagle_bone_black
Related

BBB - Building the Linux Kernel

shabaz
shabaz over 12 years ago

Hi, I've added a step-by-step guide to building the Linux kernel for the BBB at the elinux wiki, so we can all edit it to improve the process. Particular thanks to Vlad Ungureanu for helping with debugging.

 

It took a while to get the steps ironed out. I still need to figure out how how to build the rest of the file system (there is a file system supplied

with TI's SDK) and getting it NFS-mounted.

 

These are the current steps documented (hopefully these links work):

 

  • 1 Beaglebone Black – Building Images
    • 1.1 Introduction
      • 1.1.1 Is it difficult?
      • 1.1.2 What is required?
      • 1.1.3 What steps are involved?
    • 1.2 Getting started - Folders
    • 1.3 Installing the build tools (toolchain)
      • 1.3.1 3. 1 Compile tools
      • 1.3.2 3.2 Some miscellaneous items
      • 1.3.3 3.3 U-boot
    • 1.4 Downloading and building the Linux Kernel
    • 1.5 Transferring the image to the BBB via TFTP
    • 1.6 Appendix: Installing and configuring the TFTP server
    • 1.7 Appendix: Installing and using Minicom
  • Sign in to reply
  • Cancel

Top Replies

  • bwelsby
    bwelsby over 12 years ago in reply to shabaz +1
    If you want a RHL/Centos style distro then you could try installing this root file system to go with your kernel from http://www.redsleeve.org/ no idea if it will work (in theory it should) but I will…
  • bwelsby
    bwelsby over 12 years ago in reply to shabaz +1
    Me too, when I was in gainfull employment I used nothing but Centos and RHEL. I only got into Debian and Ubuntu because of the R-Pi. It looks like a package repository is being built mainly for R-Pi but…
  • Former Member
    Former Member over 12 years ago in reply to shabaz +1
    shabaz wrote: ~/kernel/kernel$ make ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- INSTALL_MOD_PATH=$HOME/kernel/kernel/rootfs modules_install I'm not sure what it does, I'll try it. Does it create…
Parents
  • morgaine
    morgaine over 12 years ago

    That's excellent, shabaz!  I'll follow along on one of my Gentoo boxes and add any Gentoo-specific lines to the document.  I don't expect many differences.

     

    First of all I need to know the provinence of RHEL's ARM gcc variant.  Is it CodeSourcery, or is RedHat validating their own ARM compiler releases?  Gentoo has the following 3 ARM compiler  packages available in Portage, so if yours isn't one of these, Gentoo users will have to install a ggc-arm manually from some repo outside of Portage, not with the package manager:

     

    * dev-embedded/sgpp-lite-arm-eabi-bin
         Available versions:  (2010.09.51) ~2010.09.51
         Homepage:            http://www.codesourcery.com/sgpp/lite/arm
         Description:         regular, validated releases of the GNU Toolchain for arm processors by CodeSourcery

    * dev-embedded/sgpp-lite-arm-linux-bin
         Available versions:  (2010.09.50) ~2010.09.50
         Homepage:            http://www.codesourcery.com/sgpp/lite/arm
         Description:         regular, validated releases of the GNU Toolchain for arm processors by CodeSourcery

    * dev-embedded/sgpp-lite-arm-uclinux-bin
         Available versions:  (2010.09.58) ~2010.09.58
         Homepage:            http://www.codesourcery.com/sgpp/lite/arm
         Description:         regular, validated releases of the GNU Toolchain for arm processors by CodeSourcery

     

    PS. I sure hope the "2010" isn't a year, otherwise these ARM releases in Portage are clearly prehistoric. image  Gentoo's own ARM  installation procedure doesn't use the above, which hints that those 3 packages are a historical relic.

     

    Instead, Gentoo provides these instructions, specifically for BeagleBone, with cross tools installed using crossdev.

     

    Regarding the kernel, the above link advises to get the kernel using:

     

    git clone git://arago-project.org/git/projects/linux-am33x.git

     

    Is that kernel similar to yours in respect of version and patches?  Reading about the Arago Project, I'm a bit worried about kernel biodiversity creeping in here. image

     

    If your ARM compiler is maintained and validated by RedHat themselves, I suspect that for full compatibility with your steps, Gentoo users will have to grab your source RPM and unpack it directly.  If so, it would help if you could identify the actual package filepath that your commands install.

     

     

    [Fixed the almighty cocktail of compiler and kernel topics which made this post barely comprehensible.]

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 12 years ago in reply to morgaine

    Hi Morgaine,

     

    Morgaine Dinova wrote:

    I'll follow along on one of my Gentoo boxes and add any Gentoo-specific lines to the document.  I don't expect many differences.

    That's great! I hope the steps make sense, and it will be great to have them refined. I used RHEL for my Linux server, mainly because I'm not familiar with other variants, and the toolchain I used was one that was available pre-compiled via yum. But I did try CodeSourcery originally, and although it compiled the kernel, after TFTP'ing, it didn't work for me, but later I realized I was issuing the wrong u-boot parameters, so it's quite likely CodeSourcery is fine.  The CodeSourcery site (i.e. the Mentor Graphics site) did have much more recent toolchain dates, I had downloaded from there. In fact I've still got those steps because I was writing it as I went, I've pasted below. When it didn't work for me, I moved to the one via yum, and didn't get round to re-checking with CodeSourcery after I'd discovered the u-boot mistake I was making.

    From that arago-project, I had only downloaded some blob. The kernel was downloaded using git clone git://github.com/beagleboard/kernel.git

    That instruction was based on some websites that had instructions for Debian, but it seemed to work fine on my RHEL VM. I wish I knew how to get the exact tag for the releases though, because if I'm building the head of 3.8, then I'll never be sure what others may have checked-in I guess :-(

     

    ----------------------

    The compiler is Sourcery CodeBench Lite Edition for ARM GNU/Linux (2013.05-24 version) from Mentor Graphics’ website

    http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/lite/?cmpid=7108&lite=arm&target_os=GNU%2FLinux&target_arch=ARM&returnURL=https%253A%252F%252Fsourcery.mentor.com%252FGNUToolchain%252Fsubscription3057%253Flite%253Darm%2526cmpid%253D7108

    Note: the current toolchains from the Angstrom site and from TI’s SDK both had issues building the kernel.

    From that Mentor Graphics link, use the IA32 GNU/Linux TAR file rather than the installer

    The downloaded file was put in the toolchain folder and extracted (it created an arm-2013.05 folder). The folder /home/username/develop/toolchain/arm-2013.05/bin is important, it contains the compile tools. The PATH environment variable needs to be updated to prepend this: (assuming bash shell)

    PATH=/home/username/develop/toolchain/arm-2013.05/bin:$PATH

    Prepends the toolchain folder

    export PATH

    Sets the path for scripts to use

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 12 years ago in reply to shabaz

    Somehow I managed to conflate compiler and kernel provinence in my reply, so the combined post makes no sense at all. image  I'll fix it in a bit and separate the two parts.

     

    Meanwhile, I'm trying to aim for exact replication of your compiler and kernel, ie. specifically not doing your suggestion of using apt-get on a Debian/Ubuntu system for example, as that would produce a different end result.  Likewise, I'm trying to avoid installing the cross-compiler with Gentoo's "crossdev -S armv7a-hardfloat-linux-gnueabi" command, as that would likely be different.  (I might install it just to see where it comes from though.)

     

    To confirm, when you did a "yum install gcc-arm-linux-gnu", that installed Sourcery CodeBench Lite Edition for ARM GNU/Linux (2013.05-24 version) from Mentor Graphics’ website?

     

    The kernel part is clear, you got that from git://github.com/beagleboard/kernel.git

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 12 years ago in reply to morgaine

    Hi Morgaine,

     

    No, it was not the CodeSourcery version that got installed when I did the yum command, as far as I know.

    This is the information that gcc-v and yum info reports (my VM was 32-bit unfortunately, I had the wrong ISO and didn't re-download it):

     

    $ gcc -v

    Using built-in specs.

    Target: i686-redhat-linux

    Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux

    Thread model: posix

    gcc version 4.4.5 20110214 (Red Hat 4.4.5-6) (GCC)

    $


    # yum info gcc-arm-linux-gnu

    Loaded plugins: refresh-packagekit, security

    epel/metalink                                            |  19 kB     00:00    

    epel                                                     | 4.2 kB     00:00    

    epel/primary_db                                          | 4.4 MB     00:02    

    sl                                                       | 2.5 kB     00:00    

    sl-security                                              | 2.6 kB     00:00    

    Installed Packages

    Name        : gcc-arm-linux-gnu

    Arch        : i686

    Version     : 4.7.2

    Release     : 2.aa.20121114svn.el6.1

    Size        : 25 M

    Repo        : installed

    From repo   : epel

    Summary     : Cross-build binary utilities for arm-linux-gnu

    URL         : http://gcc.gnu.org

    License     : GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and

                : LGPLv2+ and BSD

    Description : Cross-build GNU C compiler.

                :

                : Only building kernels is currently supported.  Support for

                : cross-building user space programs is not currently provided as

                : that would massively multiply the number of packages.


    #

     

     

    However, some URLs were mentioning using different compilers such as gcc-4.7-arm-linux-gnueabi-base, and Vlad compiled using this one (he was going to try to TFTP it to his BBB last night, he is yet to report if it worked for him): apt-get install gcc-arm-linux-gnueabi

    So, it looks like this URL is for the compiler:

    http://pkgs.org/centos-6-rhel-6/epel-x86_64/gcc-arm-linux-gnu-4.7.2-2.aa.20121114svn.el6.1.x86_64.rpm.html (assuming RPM can work with Gentoo).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • morgaine
    morgaine over 12 years ago in reply to shabaz

    Ah, ok.  So, it seems the gcc-arm biodiversity explosion has already happened, and everyone will be using different versions, hehe.

     

    No worries, I might as well use Gentoo's crossdev then.  Hopefully we won't hit specific compiler version dependencies.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 12 years ago in reply to morgaine

    Ah, cool. I'll kick off a build using CodeSourcery too, so we can confirm if it really works or not. You're right, it would be nice for us all to use a consistent compiler. I'll know in an hour to two!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • shabaz
    shabaz over 12 years ago in reply to morgaine

    Ah, cool. I'll kick off a build using CodeSourcery too, so we can confirm if it really works or not. You're right, it would be nice for us all to use a consistent compiler. I'll know in an hour to two!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube