Building Kernel Guide
This Guide will teach you how to compile the Wii-Linux kernel for Wii-Linux.
Requirements
- A PC
Setup and Compile
- Install Crosstool-NG via package manager or compile it by cloning
git clone https://github.com/crosstool-ng/crosstool-ng
. - Make a directory to have all the files/folders to be in
- In that directory clone the Wii-Linux-Toolchain
https://github.com/Wii-Linux/wii-linux-toolchain.git
. - cd into the wii-linux-toolchain folder and run
mv ct-ng.config .config
and runct-ng build
.- The process will take a while depending on how shit your computer is.
- 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
. - 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. - 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.
- 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
- The branch you clone is the kernel you are going to compile, the following kernel's are the ones currently supported.
- 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+
.
- Example:
- 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
.
- Example:
- After the loader is done go to your main directory and run
cp <kernedir>/arch/powerpc/boot/zImage . && mv zImage v<Kernel Version>.krn
andcp <kerneldir>/modules.tar.gz .
.- Example:
cp <kernedir>/arch/powerpc/boot/zImage . && mv zImage v4_19325.krn
andcp wii-linux-ngx/modules.tar.gz .
- Example:
- 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
.