User Tools

Site Tools


info:avr32_buildroot_patching

This is an old revision of the document!


Buildroot Patching

What I learned was that if you plan to do significant and exploratory kernel modification, buildroot is probably not what you want. But if you need to make a small change (such as adding support for more serial ports), buildroot will probably suffice.

As was mentioned in the above URL, you will find it easiest to patch setup.c using quilt. I present it here in a more general and complete form:

  1. Install quilt
  2. cd into the kernel source directory (e.g., <buildroot>/project_build_avr32/<projectname>/linux-2.6.nn.nn)
  3. Run “quilt new enable-two-usarts.patch”
  4. Run “quilt edit arch/avr32/boards/<board_name>/setup.c” and make the changes you need.
  5. Run “quilt refresh”
  6. cp patches/enable-two-usarts.patch <buildroot>/target/device/Atmel/<board_config_name>/kernel-patches/linux-2.6.nn.nn-<patch_number>, where patch_number is any number like “01”.
  7. cd to top of buildroot directory
  8. Run make

To make this work for me, I had to first delete the <buildroot>/project_build_avr32/<projectname> directory, but I think that may have been because I had left it in a mess after previously trying to do this the wrong way.

From another thread:
You can also just delete the .unpacked and .configured files inside project_build_avr32_nofpu/project/linux-2.6.xx

Place your patch inside target/device/Atmel/<your_board>/kernel-patches. Make sure that the filename starts with linux-2.6.xx-<patch order>. Then run make. I'm starting to become a bit of a buildroot maniac now Smile

Patch to Enable Multiple UARTS

Code:

   Index: linux-2.6.25.10/arch/avr32/boards/atngw100/setup.c
   ===================================================================
   --- linux-2.6.25.10.orig/arch/avr32/boards/atngw100/setup.c
   +++ linux-2.6.25.10/arch/avr32/boards/atngw100/setup.c
   @@ -112,6 +112,8 @@ static void __init set_hw_addr(struct pl
   void __init setup_board(void)
   {
       at32_map_usart(1, 0);   /* USART 1: /dev/ttyS0, DB9 */
   +at32_map_usart(0, 1);   // usart 0 as /dev/ttyS1 -mjj
   +at32_map_usart(2, 2);   // usart 2 as /dev/ttyS2 -mjj
       at32_setup_serial_console(0);
    }

@@ -166,6 +168,8 @@ static int __init atngw100_init(void)

       at32_add_system_devices();

at32_add_device_usart(0);

   +at32_add_device_usart(1);   // add usart1 -mjj
   +at32_add_device_usart(2);   // add usart1 -mjj

set_hw_addr(at32_add_device_eth(0, &eth_data[0]));

       set_hw_addr(at32_add_device_eth(1, &eth_data[1])); 
info/avr32_buildroot_patching.1221084601.txt.gz · Last modified: 2008/09/10 18:10 by tomgee