Differences
This shows you the differences between the selected revision and the current version of the page.
howto:kernel_build 2006/12/09 21:09 | howto:kernel_build 2017/09/06 17:34 current | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Build the Linux Kernel ====== | ====== Build the Linux Kernel ====== | ||
- | To buld a new kernel, source for the kernel and build tools needs to be obtained. These sources are available from a number of places. The sources for the individual packages are available from [[ftp://ftp.dlink.com/GPL/dsmg600_reB/]] | + | This procedure was develped under Ubuntu Dapper, but it is believed to work on most Linux distributions. |
+ | |||
+ | To build a new kernel, source for the kernel and build tools needs to be obtained. These sources are available from a number of places. The sources for the individual packages are available from [[ftp://ftp.dlink.com/GPL/DSM-G600_reB/]] | ||
. The sources are also available at [[http://tsd.dlink.com.tw/GPL.asp]] as a single file containing all the released sources, though you need do a little navigation to get them. | . The sources are also available at [[http://tsd.dlink.com.tw/GPL.asp]] as a single file containing all the released sources, though you need do a little navigation to get them. | ||
Line 64: | Line 66: | ||
ifneq ($(filter $(TARGETS),kernel-headers),) | ifneq ($(filter $(TARGETS),kernel-headers),) | ||
- | LINUX_SITE:=http://www.uclibc.org/downloads/toolchain | + | -LINUX_SITE:=http://www.uclibc.org/downloads/toolchain |
+ | +LINUX_SITE:=http://www.uclibc.org/downloads/old-releases/toolchain/ | ||
-LINUX_SOURCE:=kernel-headers-2.4.21.tar.bz2 | -LINUX_SOURCE:=kernel-headers-2.4.21.tar.bz2 | ||
+LINUX_SOURCE:=kernel-headers-2.4.25.tar.bz2 | +LINUX_SOURCE:=kernel-headers-2.4.25.tar.bz2 | ||
Line 119: | Line 122: | ||
#include <stdlib.h> | #include <stdlib.h> | ||
- | run ''"make"'', if successful ''"mkdir -p /opt/uclibc-powerpc/; cp -r toolchain_powerpc /opt/uclibc-powerpc/gcc-2.95"'' | + | run |
+ | make | ||
+ | |||
+ | if successful | ||
+ | mkdir -p /opt/uclibc-powerpc/; cp -r toolchain_powerpc /opt/uclibc-powerpc/gcc-2.95 | ||
===== Build mkimage ===== | ===== Build mkimage ===== | ||
Line 148: | Line 156: | ||
make Sandpoint8245_config;make all | make Sandpoint8245_config;make all | ||
cp tools/mkimage /opt/uclibc-powerpc/gcc-2.95/bin/ | cp tools/mkimage /opt/uclibc-powerpc/gcc-2.95/bin/ | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== Kernel Build ===== | ===== Kernel Build ===== | ||
Verify your path, execute the following command: | Verify your path, execute the following command: | ||
powerpc-linux-uclibc-gcc --version | powerpc-linux-uclibc-gcc --version | ||
- | this should print ''"2.95.4"'' if the correct compiler is in your path. If it prints some number that does not begin with ''2.95'' you will need to figure out how to remove the extra dircetory from your path, if it prints ''"command not found"'' run: | + | this should print ''"2.95.4"'' if the correct compiler is in your path. If it prints some number that does not begin with ''2.95'' you will need to figure out how to remove the extra directory from your path, if it prints ''"command not found"'' run: |
export PATH=$PATH:/opt/uclibc-powerpc/gcc-2.95/bin | export PATH=$PATH:/opt/uclibc-powerpc/gcc-2.95/bin | ||
- | Make sure that the directory /tftpboot exists and is writable, then in the directory containing the source tarfiles: | + | Make sure that the directory /tftpboot exists and is writeable, then in the directory containing the source tarfiles: |
tar zxvf ppclinux.tar.gz;cd ppclinux | tar zxvf ppclinux.tar.gz;cd ppclinux | ||
Run the D-Link provided script | Run the D-Link provided script | ||
Line 161: | Line 173: | ||
And Build the kernel | And Build the kernel | ||
make oldconfig;make clean;make dep;make pImage | make oldconfig;make clean;make dep;make pImage | ||
- | At this point, there should be a file names ''pImage'' in the directory ''/tftpboot'', this is a u-boot-able kernel image. | + | At this point, there should be a file named ''pImage'' in the directory ''/tftpboot'', this is a u-boot-able kernel image. |
+ | |||
+ | For a loader.o loadable kernel, the build procedure is slightly different. First, check [[howto:hdd_boot|How to install a root file system to a Hard Disk]] for some additional kernel patches. Then, | ||
+ | make oldconfig;make clean;make dep;make | ||
+ | powerpc-linux-objcopy -O binary vmlinux | ||
+ | The file 'vmlinux' in the kernel build directory is your loader.o-able kernel. | ||
+ | |||
+ | You could also build the modules, because the default .config specifies modular USB support among other items: | ||
+ | make modules | ||
+ | make modules_install INSTALL_MOD_PATH=/tftpboot | ||
+ | The installation command will "fail" because it will attempt to use your buildhost's 'depmod' utility to construct a modules.dep file. However, the modules themselves will be installed into /tftpboot/lib/modules/2.4.21-pre4/. Also, do not be surprised that the default .config builds several inappropriate wireless drivers (orinoco, hermes): these can't be used by the dsmg600 (unless you happen to have a miniPCI card supported by those drivers, and swap out the shipped Ralink RT2560). | ||
+ | ---- | ||
+ | ====== Related Forum Threads ====== | ||
+ | http://dns323.kood.org/forum/t46-linux-kernel.html | ||
+ |