Difference between revisions of "Kernel-cross-compile-kurobox-pro"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (fixed a few acknowledgements)
(now on the kurobox side)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Articles|KuroboxPro|FreeLink|Debian|Kernel}}
 
{{Articles|KuroboxPro|FreeLink|Debian|Kernel}}
  
 
+
=Background=
 
I searched for long time about how to compile a kernel for the kurobox pro, and here are my results
 
I searched for long time about how to compile a kernel for the kurobox pro, and here are my results
  
I have a [[kurobox-pro]], on which I installed Debian using instructions at:
+
I have a [[:Category:KuroboxPro|kurobox-pro]], on which I installed [[:Category:Debian|Debian]] using instructions at:
 
[[Armel Debian for the Kurobox Pro - Manual install]]
 
[[Armel Debian for the Kurobox Pro - Manual install]]
  
Line 24: Line 24:
  
 
==now the kernel==
 
==now the kernel==
 +
first we set some variables:
 +
<pre>
 +
  export ARCH=arm
 +
  export CROSS_COMPILE=arm-none-eabi-
 +
  export PATH=~/kuro/arm-2007q3/bin/:${PATH}
 +
</pre>
 +
 +
we must choose between a vanilla kernel from kernel.org, or the orion development repository
 +
(both worked for me, though kernel.org version couldn't poweroff the box)
 +
 +
either from kernel.org:
 
<pre>
 
<pre>
 
   cd ~/kuro
 
   cd ~/kuro
Line 31: Line 42:
 
   cd linux-${kernver}
 
   cd linux-${kernver}
 
   make mrproper
 
   make mrproper
  export ARCH=arm
 
  export CROSS_COMPILE=arm-none-eabi-
 
 
   wget 'http://buffalo.nas-central.org/download/Users/davy_gravy/defconfig-2.6.25.6-debian%20current%20OK' -O .config
 
   wget 'http://buffalo.nas-central.org/download/Users/davy_gravy/defconfig-2.6.25.6-debian%20current%20OK' -O .config
 +
</pre>
 +
 +
or from orion development repository:
 +
<pre>
 +
  cd ~/kuro
 +
  git clone git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion.git
 +
  cd orion
 +
  make mrproper
 +
  make orion5x_defconfig
 +
</pre>
 +
 +
for both:
 +
<pre>
 
   make menuconfig # if needed
 
   make menuconfig # if needed
  export PATH=~/kuro/arm-2007q3/bin/:${PATH}
 
 
   make zImage  
 
   make zImage  
 
   devio > foo 'wl 0xe3a01c05,4' 'wl 0xe38110e5,4' # For kuropro/lspro
 
   devio > foo 'wl 0xe3a01c05,4' 'wl 0xe38110e5,4' # For kuropro/lspro
Line 59: Line 80:
 
<pre>
 
<pre>
 
   ssh kuro
 
   ssh kuro
 +
  cd /
 +
  tar xzvf /tmp/modules.tgz
 
   mount /dev/sda1 /mnt/sda1
 
   mount /dev/sda1 /mnt/sda1
 
   cd /mnt/sda1
 
   cd /mnt/sda1
   VER=2.6.25.9
+
   VER=`tar tzvf /tmp/modules.tgz |grep 'lib/modules/2'|head -1|sed 's/^.* lib\/modules\///;s/\/.*//'`
 +
# or VER=2.6.25.9
 
   mv /tmp/uImage  uImage-$VER
 
   mv /tmp/uImage  uImage-$VER
 
   rm uImage
 
   rm uImage
 
   ln -s uImage-$VER uImage
 
   ln -s uImage-$VER uImage
  cd /
 
  tar xzvf /tmp/modules.tgz
 
 
   rm /tmp/uImage /tmp/modules.tgz
 
   rm /tmp/uImage /tmp/modules.tgz
 
</pre>
 
</pre>
  
 
==Afterward==
 
==Afterward==
worked for me on kernel ver  2.6.25.9, use at your on risk !!!
+
worked for me on kernel ver  2.6.25.9, use at your own risk !!!
  
 
kudos to [[User:Davy gravy|Davy gravy]], [[User:Bbradley|Bbradley]] and others
 
kudos to [[User:Davy gravy|Davy gravy]], [[User:Bbradley|Bbradley]] and others

Latest revision as of 14:20, 6 July 2008


Contents

Background

I searched for long time about how to compile a kernel for the kurobox pro, and here are my results

I have a kurobox-pro, on which I installed Debian using instructions at: Armel Debian for the Kurobox Pro - Manual install

I had some modules missing. So here is how I compiled a new kernel with whatever modules I like ... ---Erez 08:24, 3 July 2008 (BST)


Here is how is done

first we need a cross compiler toolchain

  mkdir -p ~/kuro
  cd ~/kuro
  wget 'http://buffalo.nas-central.org/download/LSPro_ARM9/DevelopmentTools/CrossToolchains/CodeSourcery/arm-2007q3-53-arm-none-eabi-i686-pc-linux-gnu.tar.bz2'
  tar xjvf arm-2007q3-53-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
  cd arm-2007q3/bin/
  wget 'http://downloads.nas-central.org/LSPro_ARM9/DevelopmentTools/CrossToolchains/mkimage'
  chmod +x mkimage

now the kernel

first we set some variables:

  export ARCH=arm
  export CROSS_COMPILE=arm-none-eabi-
  export PATH=~/kuro/arm-2007q3/bin/:${PATH}

we must choose between a vanilla kernel from kernel.org, or the orion development repository (both worked for me, though kernel.org version couldn't poweroff the box)

either from kernel.org:

  cd ~/kuro
  export kernver=2.6.25.9
  wget "http://www.kernel.org/pub/linux/kernel/v2.6/linux-${kernver}.tar.bz2"
  tar xjvf linux-${kernver}.tar.bz2
  cd linux-${kernver}
  make mrproper
  wget 'http://buffalo.nas-central.org/download/Users/davy_gravy/defconfig-2.6.25.6-debian%20current%20OK' -O .config

or from orion development repository:

  cd ~/kuro
  git clone git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion.git
  cd orion
  make mrproper
  make orion5x_defconfig

for both:

  make menuconfig # if needed
  make zImage 
  devio > foo 'wl 0xe3a01c05,4' 'wl 0xe38110e5,4' # For kuropro/lspro
  cat foo arch/arm/boot/zImage > zImage.new
  mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'linux' -d zImage.new uImage
  scp uImage kuro:/tmp/
  rm foo zImage.new

and modules

  make modules
  export INSTALL_MOD_PATH=/tmp/kuro
  make modules_install
  cd $INSTALL_MOD_PATH
  tar czf modules.tgz lib
  scp modules.tgz kuro:/tmp/
  cd /
  rm -rf /tmp/kuro

now on the kurobox side

  ssh kuro
  cd /
  tar xzvf /tmp/modules.tgz
  mount /dev/sda1 /mnt/sda1
  cd /mnt/sda1
  VER=`tar tzvf /tmp/modules.tgz |grep 'lib/modules/2'|head -1|sed 's/^.* lib\/modules\///;s/\/.*//'`
# or VER=2.6.25.9
  mv /tmp/uImage  uImage-$VER
  rm uImage
  ln -s uImage-$VER uImage
  rm /tmp/uImage /tmp/modules.tgz

Afterward

worked for me on kernel ver 2.6.25.9, use at your own risk !!!

kudos to Davy gravy, Bbradley and others

cheers, Erez