Building Kernel Guide

From Wii-Linux Wiki
Revision as of 18:16, 18 May 2025 by Selimgozel1 (talk | contribs) (A semi-simple guide to help compile wii-linux kernel's)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This Guide will teach you how to compile the Wii-Linux kernel for Wii-Linux.

Requirements

  • A PC


Setup and Compile

  1. Install Crosstool-NG via package manager or compile it by cloning git clone https://github.com/crosstool-ng/crosstool-ng.
  2. Make a directory to have all the files/folders to be in
  3. In that directory clone the Wii-Linux-Toolchain https://github.com/Wii-Linux/wii-linux-toolchain.git.
  4. cd into the wii-linux-toolchain folder and run mv ct-ng.config .config and run ct-ng build.
    • The process will take a while depending on how shit your computer is.
  5. Once it's installed it should make a directory in your home folder called x-tools run echo 'PATH="$PATH:~/x-tools/powerpc-unknown-linux-gnu/bin"' >> ~/.bashrc && source ~/.bashrc.
  6. After you ran the previous command go back to the main directory folder and run git clone https://github.com/Wii-Linux/build-stack and cd into it.
  7. Once your in the build-stack folder run setup.sh and follow its instructions and make sure you have all the things u have installed, and if it asks to clone and build stuff always answer with Y.
  8. After setup.sh finishes successfully go back to the main directory and now finally run https://github.com/Wii-Linux/wii-linux-ngx.git --branch <Branch You want>.
    • The branch you clone is the kernel you are going to compile, the following kernel's are the ones currently supported.
      • wii-v4.5
      • wii-v4.6
      • wii-v4.9
      • wii-v4.14
      • wii-v4.19
  9. After you cloned the kernel you want to build go back into build-stack and run ./build-kernel.sh [name of your kernel directory will most likely be wii-linux-ngx if you kept it default] <kernelversion>-wii+.
    • Example: ./build-kernel.sh wii-linux-ngx 4.19.325-wii+.
  10. After the Kernel compiles you have to build the loader in order to run your kernel so in the build-stack run ./build-loader.sh ../v<Kernel Version>.ldr.
    • Example: ./build-loader.sh ../v4_19_325.ldr.
  11. After the loader is done go to your main directory and run cp <kernedir>/arch/powerpc/boot/zImage . && mv zImage v<Kernel Version>.krn and cp <kerneldir>/modules.tar.gz ..
    • Example: cp <kernedir>/arch/powerpc/boot/zImage . && mv zImage v4_19325.krn and cp wii-linux-ngx/modules.tar.gz .
  12. Finally after all of that in your main directory you should have 1 ldr file, 1 krn file, and modules.tar.gz file, put the ldr and krn file in the wiilinux folder in your sd card (preassumed that u had the sd card files/folders zip already in there extracted) and extract the modules.tar.gz onto your rootfs under lib/modules.