Modifying Kernel using buildroot

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I know that you Linux gurus out there are going to think me a total nube, but I just can't figure this out...

Background: I built an expansion board for the NGW100 that plugs onto J5 J6. It has an RS232 driver on USART2 and an RS485 driver on USART3. I have a complete development environment with Fedora on a VM. I have successfully used buildroot to create an image to load on the target. I am booting off a 256M SD card and have a few different versions of the Linux uImage in the /boot directory. I can use u-boot to manually load and execute any one I choose.

Now my problem: I read here in another thread that to activate the additional USARTs that I had to modify the 'setup.c' file. Unfortunately there are zillions of setup.c files in the buildroot tree. I grep'ed for the one that contained 'at32_map_usart'. I found two. one was in...
buildroot-avr32/project_build_avr32/atngw100/linux-2-6.24/arch/boards/atngw100
the other was in..
buildroot-avr32/toolchain_build_avr32/linux-2.6.24/arc/boards/atngw100

I edited both files to add the additional lines for just USART2 for now. I did a...

>make clean
>make

It created a new uImage that was the identical size of the previous build that I did. I booted it anyway... no USART2.

So, within buildroot, when I want to edit a kernel C source file and then re-build a new kernel including my changes, where are the files that I should be editing?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Whoohoo success!

The trick ( if anyone cares to know ) is...

>make source

find the tar.bz linux kernel sources in the buildroot directories and expand it into a working directory. Edit the setup.c file to include the new serial ports. Re-tar.bz the working directory and put it back into the buildroot replacing the original

>make

Voila, the uImage created will contain the changes.

I only added the RS232 port and it seems to work O.K.. Next I will try the RS485; I've read in other topics about how to set it up for half duplex.