Editing
Building Kernel Guide
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This Guide will teach you how to cross-compile the [[Wii-Linux]] kernel and supporting elements. == Requirements == * An x86 or AArch64 device running GNU/Linux == Setup and Compile== # Install Crosstool-NG via package manager or compile it by cloning <code>git clone https://github.com/crosstool-ng/crosstool-ng</code>. # Make a directory to have all the files/folders to be in # In that directory clone the Wii-Linux-Toolchain <code>https://github.com/Wii-Linux/wii-linux-toolchain</code>. # cd into the wii-linux-toolchain folder and run <code>mv ct-ng.config .config</code> and run <code>ct-ng build</code>. #* The process will take a while depending on how bad your computer is. # Once it's installed, it should make a directory in your home folder called <code>x-tools</code>. #* You can optionally move this directory elsewhere first, if you don't find <code>x-tools</code> appealing. # You must now add it to your PATH. This varies per shell, and based on where you put it, but as an example: #* for bash: <code>echo 'PATH="$PATH:~/<path to ct-ng output>/powerpc-unknown-linux-gnu/bin"' >> ~/.bashrc && source ~/.bashrc</code>. # After you have added it to your path, go back to the main directory and run <code>git clone https://github.com/Wii-Linux/build-stack && cd build-stack</code>. # Once you're in the build-stack folder, run <code>./setup.sh</code> and follow it's instructions, to make sure that you have all the necessary requirements installed. If it asks to clone and build various requirements, answer Yes unless you have a very specific reason not to. # After setup.sh finishes successfully, go back to the main directory, and now finally run <code>https://github.com/Wii-Linux/wii-linux-ngx -b <Branch You want></code>. #* The branch you clone is the source code to the kernel branch you are going to compile (this could be specialized kernels (like for [[OpenWRT]], or just various versions of the main one). The following kernel branches are the ones currently supported: #** <code>wii-v4.5</code> #** <code>wii-v4.14-openwrt</code> #** <code>wii-v4.19</code> # After you cloned the kernel that you want to build go back into <code>build-stack</code> and run <code>./build-kernel.sh [name of your kernel directory]</code>. #* Example: <code>./build-kernel.sh wii-linux-ngx</code>. #* The <code>--standalone</code> argument can be used to build a kernel that doesn't require a loader, <code>arch/powerpc/boot/dts/wii.dts</code> needs to be edited accordingly with the boot device that will be used. # After the kernel compiles, you have to build the loader (small squashfs that the kernel boots, provides the boot menu). In the build-stack run <code>./build-loader.sh ../v<kernel version short>.ldr</code>. #* Example: <code>./build-loader.sh ../v4_19325.ldr</code>. # After the loader is done, you need to go install it. This consists of 2 parts: #* '''Installing the kernel+loader'''. A script has been provided to make this easier, <code>build-stack/copy-ssh.sh</code>. This provides an easy way to copy the kernel+loader to a remote machine in any directory. This could even be a Wii-Linux install. #** Example 1 (copy to local machine's SD Card on /mnt): <code>./copy-ssh.sh root@localhost /mnt v4_19325 4.19.325-wii+ kernel v4_19325.ldr</code> #** Example 2 (copy to Wii with SD Card on /boot): <code>./copy-ssh.sh root@wii.local /boot v4_19325 4.19.325-wii+ kernel v4_19325.ldr</code> #* ''''Installing the kernel modules''. The kernel modules are output as <code>modules.tar.gz</code> in your kernel directory. You will need to safely extract these to your Wii-Linux distro's rootfs. ''WARNING'': Extracting directly to the rootfs '''''WILL HOSE YOUR PERMISSIONS - DO NOT DO THAT'''''. It will set the UID/HID of the root directory, and /usr, and /usr/lib, to the UID/GID of the user who built the kernel. Instead, you can extract it to a temporary directory, then <code>mv</code> or <code>cp -r</code> the modules (<code>temp_dir/usr/lib/modules/[kernel version]-wii+</code> into your rootfs.
Summary:
Please note that all contributions to Wii-Linux Wiki are considered to be released under the CC BY-SA 4.0 (see
Wii-Linux Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Wii-Linux Discord Server
Installation Guide
Recent changes
Random page
Help about MediaWiki
Special pages
Tools
What links here
Related changes
Page information