Difference between revisions of "Build a new kernel (and kernel modules) for the LinkStation"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
 
m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<font color=red>PowerPC Only | This method only works for the powerpc-hdhlan and powerpc-hdhglan LinkStations.</font>
+
{{Template:Articles}}
 
+
''<font color=red><small>
 
+
This article Based on work by frontalot, and timtimred.
 +
Originally by timtimred.
 +
at Linkstationwiki.org
 +
</small></font>''<br>
 +
{{Postit|PowerPC Only | This method only works for the powerpc-hdhlan and powerpc-hdhglan LinkStations}}
 
== Abstract ==
 
== Abstract ==
 
 
 
This article is for people that want to build a new kernel for the LinkStation. We will use the powerpc-hdhglan LinkStation for our example.
 
This article is for people that want to build a new kernel for the LinkStation. We will use the powerpc-hdhglan LinkStation for our example.
 
 
 
== Prerequisites ==
 
== Prerequisites ==
 
+
This article assumes that you have installed [[Projects/OpenLink]] or [[Projects/FreeLink]] and the appropriate development tools. You also will need the kernel source code, a working kernel .config, and any applicable patches. You may download them from [[http://downloads.nas-central.org here]].
 
+
This article assumes that you have installed [[Projects/OpenLink]] or [[Projects/FreeLink]] and the appropriate development tools. You also will need the kernel source code, a working kernel .config, and any applicable patches. You may download them from [[http://downloads.linkstationwiki.net here]].
+
  
 
Cross-Toolchain | You can build the kernel and kernel modules much, much faster by using a [[Projects/CrossToolchains|cross-toolchain]].:)
 
Cross-Toolchain | You can build the kernel and kernel modules much, much faster by using a [[Projects/CrossToolchains|cross-toolchain]].:)
 
 
 
== Method ==
 
== Method ==
 +
* Extract the kernel source code somewhere sensible. Mine lives in /mnt/ somewhere with an alias to it from /usr/src/linux to keep it off the tiny system partition:
 +
tar -xvzf linux-sources-2.4.20-lsw-ppc-hg1.tgz
 +
mkdir /usr/src
 +
ln -s /path/to/kernel/directory /usr/src/linux
 +
cd /usr/src/linux
  
 +
* Copy the kernel .config to the kernel source directory then run:
 +
make menuconfig
  
# Extract the kernel source code somewhere sensible. Mine lives in /mnt/ somewhere with an alias to it from /usr/src/linux to keep it off the tiny system partition:
+
* You can add/remove features to/from the kernel. Note that the supplied kernel .config will build properly so any errors when compiling are most likely due to your modifications.
<tt>tar -xvzf linux-sources-2.4.20-lsw-ppc-hg1.tgz</tt>
+
<tt>mkdir /usr/src</tt>
+
<tt>ln -s /path/to/kernel/directory /usr/src/linux</tt>
+
<tt>cd /usr/src/linux</tt>
+
  
# Copy the kernel .config to the kernel source directory then run:
+
* Compile the kernel. Make sure you have something else to amuse you because this takes a while:
<tt>make menuconfig</tt>
+
 
+
# You can add/remove features to/from the kernel. Note that the supplied kernel .config will build properly so any errors when compiling are most likely due to your modifications.
+
 
+
# Compile the kernel. Make sure you have something else to amuse you because this takes a while:
+
 
  make oldconfig
 
  make oldconfig
 
  make dep
 
  make dep
Line 36: Line 30:
 
  objcopy -O binary vmlinux
 
  objcopy -O binary vmlinux
  
# Compile the kernel modules. This step may take some time depending on the modules you selected:
+
* Compile the kernel modules. This step may take some time depending on the modules you selected:
 
  make modules
 
  make modules
 
  make modules_install
 
  make modules_install
  
# Now copy the kernel modules to the correct place:  
+
* Now copy the kernel modules to the correct place:  
 
  cp -r release_modules/lib/modules/2.4.20_mvl31-linkstationwiki-hg1/ /lib/modules/
 
  cp -r release_modules/lib/modules/2.4.20_mvl31-linkstationwiki-hg1/ /lib/modules/
  
# Load your new kernel using the [[Articles/GeneralKernelLoader|kernel loader how-to]]. Then build the kernel module dependencies:  
+
* Load your new kernel using the [[Articles/GeneralKernelLoader|kernel loader how-to]]. Then build the kernel module dependencies:  
 
  depmod -a
 
  depmod -a
  
# You should now have a working kernel replacement and be able to load some shiny new kernel modules!
+
* You should now have a working kernel replacement and be able to load some shiny new kernel modules!
  
  
 
== References ==
 
== References ==
 
 
 
Jochang included some useful information in his [[http://jan.csie.ntu.edu.tw/~jo/kuro/loader/README loader how-to]]. Also  
 
Jochang included some useful information in his [[http://jan.csie.ntu.edu.tw/~jo/kuro/loader/README loader how-to]]. Also  
 
Trevor Powdrell from the Kuro forums wrote a [[http://webpages.charter.net/trevorpowdrell/kuroboxhg.patch patch]] that allows the powerpc-hdhglan kernel to compile under GCC 3.3/3.4.
 
Trevor Powdrell from the Kuro forums wrote a [[http://webpages.charter.net/trevorpowdrell/kuroboxhg.patch patch]] that allows the powerpc-hdhglan kernel to compile under GCC 3.3/3.4.
 +
 +
[[category:General]]
 +
[[Category:LS1]]
 +
[[Category:HG]]
 +
[[Category:Kernel]]

Latest revision as of 02:03, 11 September 2007

This article Based on work by frontalot, and timtimred. Originally by timtimred. at Linkstationwiki.org

PowerPC Only
Bar.png
This method only works for the powerpc-hdhlan and powerpc-hdhglan LinkStations


Contents

Abstract

This article is for people that want to build a new kernel for the LinkStation. We will use the powerpc-hdhglan LinkStation for our example.

Prerequisites

This article assumes that you have installed Projects/OpenLink or Projects/FreeLink and the appropriate development tools. You also will need the kernel source code, a working kernel .config, and any applicable patches. You may download them from [here].

Cross-Toolchain | You can build the kernel and kernel modules much, much faster by using a cross-toolchain.:)

Method

  • Extract the kernel source code somewhere sensible. Mine lives in /mnt/ somewhere with an alias to it from /usr/src/linux to keep it off the tiny system partition:
tar -xvzf linux-sources-2.4.20-lsw-ppc-hg1.tgz
mkdir /usr/src
ln -s /path/to/kernel/directory /usr/src/linux
cd /usr/src/linux
  • Copy the kernel .config to the kernel source directory then run:
make menuconfig
  • You can add/remove features to/from the kernel. Note that the supplied kernel .config will build properly so any errors when compiling are most likely due to your modifications.
  • Compile the kernel. Make sure you have something else to amuse you because this takes a while:
make oldconfig
make dep
make
objcopy -O binary vmlinux
  • Compile the kernel modules. This step may take some time depending on the modules you selected:
make modules
make modules_install
  • Now copy the kernel modules to the correct place:
cp -r release_modules/lib/modules/2.4.20_mvl31-linkstationwiki-hg1/ /lib/modules/
depmod -a
  • You should now have a working kernel replacement and be able to load some shiny new kernel modules!


References

Jochang included some useful information in his [loader how-to]. Also Trevor Powdrell from the Kuro forums wrote a [patch] that allows the powerpc-hdhglan kernel to compile under GCC 3.3/3.4.