HOW I CAN TO BUILD A CUSTOM KERNEL?

I’d like to build a custom kernel for my OLIMEX AT91SAM9260 , on the guide provided with the kit they write:

Building a custom kernel

The recommended build method is to use a cross-compiler. Building

natively should also work but will be very time-consuming. At the moment

of writing, the current kernel version was 2.6.23, of which a tarball is

provided. You also need to apply the two patches in the linux directory -

the 2.6.23-rc3-at91.patch needs to be applied first. It adds general support

for at91-based boards to the kernel. The sam9_l9260.diff adds support for

the Olimex SAM9-L9260 board and should be applied second. After that,

you can build the default kernel by typing

$ make ARCH=arm CROSS_COMPILE=arm-linux- sam9_l9260_defconfig

$ make ARCH=arm CROSS_COMPILE=arm-linux- uImage

After the compilation, the kernel should be available at

arch/arm/boot/uImage

If the build process fails to detect the mkimage program, it is available in

the u-boot archive

The new kernel can be transferred to the board by various means - e.g. use

the board restoration process and change the kernel in there, tftpboot-ing

the board, etc.

I’ve extracted the linux-2.6.23.tar.gz archive in the /usr/src/linux-2.6.23 directory but I don’t know how to apply these two patch :

2.6.23-rc3-at91.patch

sam9_l9260.diff

please can somebody help me?

Thank you very much.

try

cd /usr/src/linux-2.6.23
patch -p1 --dry-run < somewhere/2.6.23-rc3-at91.patch

If there are no errors, repeat without --dry-run

I have the two files 2.6.23-rc3-at91.patch and sam9_l9260.diff in the /usr/src directory , so I have to give the two following command:

patch -p1 --dry-run < /usr/src/2.6.23-rc3-at91.patchls /usr/src

patch -p1 < /usr/src/2.6.23-rc3-at91.patchls /usr/src

Is it right?

And after?

Thank you.

Don’t know what you want to do with the ls /usr/src at the end of the line, but yeah.

Afterwards the same for the second patch

I give in sequence :

  1. “cd /usr/src/linux-2.6.23”

  2. “patch -p1 --dry-run < /usr/src/2.6.23-rc3-at91.patch”

  3. “patch -p1 < /usr/src/2.6.23-rc3-at91.patch”

  4. “patch -p1 --dry-run < /usr/src/sam9_l9260.diff”

  5. “patch -p1 < /usr/src/sam9_l9260.diff”

and now?

Thank You.