Skip to content
jimix edited this page Dec 16, 2012 · 2 revisions

Obtain a compiler:

From the distribution at Argonne National Laboratory

You may obtain a compiler from the Argonne National Laboratory, here:

Select the latest release, currently V1R1M2, and grab the bgq-V1R1M2-toolchain.tar on that page.

Build your own

There are a few excellent tools to build your own cross compilers. One option is:

Select the A2 processor.

Building Linux

If you are cross compiling you will need to define that with CROSS_COMPILE.

  1. Get the source
    $ git clone git://github.com/jimix/linux-bgq.git
  2. Make a separate directory for building, we make two levels to accomodate modules below
    $ mkdir -p build/bgq
    $ cd build/bgq
  3. Start your initial configuration, here we define everything we need the first time
    $ make -C ../../linux-bgq.git ARCH=powerpc CROSS_COMPILE=<path to your cross compiler> bgq_defconfig
    $ make
  4. Then make the modules
    $ make INSTALL_MOD_PATH=../modules modules_install

When you are done you can copy the contents of build/modules into your root filesystem.
TIP: If you are using a cpio created ramdisk as a root file system you can cpio the modules directory and concat your original cpio with the modules cpio to create a single ramdisk with your modules in it. Example, I use LZMA for compression, but you can use gzip if you prefer:
$ cd build/modules
$ find . | cpio -o -H newc | lzma --stdout > ../modules.cpio.xz
$ cd ..
$ cat ramdisk-base.cpio.xz modules.cpio.xz > ramdisk.cpio.xz

You now have a ramdisk that has modules to the specific your new kernel without having to compress a single larger image.

Clone this wiki locally