Highlighted
New Member
Posts: 7
Registered: ‎01-10-2017
Kudos: 10

Compiling ERlite kernel

[ Edited ]

For those interesed; it is possible to compile the ERLite kernel manually using the GPL sources provided for download by Ubiquiti. Other insturctions on this forum require the download of the Cavium SDK, but this is not needed. The offloading modules are proprietary, but as suggested here, the offloading kernel modules provided by the normal firmware can be used with a self compiled kernel.

  • Download Ubiquiti GPL Archive for the erlite
  • Extract the GPL archive
  • Extract the kernel tar
  • Extract the cavm-executive tar
  • Extract the binutils tar and apply the diff (available in archive)
  • Download the saa instructions for the assembler (as): here, and apply the patch
  • Extract the gcc tar and apply the diff (available in archive)
  • Compile the crosscompilers from binutils and gcc -  for instructions: here
    • binutils:
      • ../../extract/binutils-2.22/configure --prefix=/usr/src/erlite/cross --target mips64-octeon-linux-gnu --disable-multilib --disable-werror
      • make -j4
      • make install
    • gcc:
      • ../../extract/gcc-4.7.2/configure --prefix=/usr/src/erlite/cross --target mips64-octeon-linux-gnu --enable-languages=c --disable-multilib
      • make -j4 all-gcc
      • Apply this patch
      • make install-gcc
  • Prepare and compile the kernel
    • Download and copy octeon_switch.S to arch/mips/kernel (some new compiler instuctions the old binutils isn't aware off)
    • Symlink the octeon executive files, for example using: 
      find /usr/src/erlite/kernel -xtype l \
       | while read l ; \
        do \
            p=$(readlink ${l}); \
            p=$(basename ${p}); \
            p=$(readlink -f /usr/src/erlite/extract/executive/${p}); \
            ln -sf ${p} ${l}; \
        done
    • Complete the normal kernel compile dance:
      • export PATH=/usr/src/erlite/cross/bin:${PATH} 
      • make ARCH=mips menuconfig
      • make ARCH=mips -j4
      • make ARCH=mips  -j4 modules_install

I have been automating this process for DebWrt; if I missed anything, it should be available here.

Member
Posts: 291
Registered: ‎06-13-2018
Kudos: 67
Solutions: 8

Re: Compiling ERlite kernel

Reviving an old thread that received no love.

 

Does anyone know if the steps outlined are still valid now that 2.0 GPL sources have been released?

 

Haven't built a kernel since the Slackware 8 days, need all the help I can get.  Interested in patching for SFE.

Member
Posts: 245
Registered: ‎11-01-2015
Kudos: 112
Solutions: 6

Re: Compiling ERlite kernel

@andybgrant

The easiest is to use Cavium's SDK. If you prefer to build your toolchains from source, they do publish the sources on GitHub.

 

If you need some pointers on how to build the toolchain, you can have a look at the script I use for my Docker image here. The Jenkinsfile for my kernel builds are available here.

Member
Posts: 291
Registered: ‎06-13-2018
Kudos: 67
Solutions: 8

Re: Compiling ERlite kernel

Thanks for taking the time to respond @Lochnair, I will take a look.