Difference between revisions of "Kernel Reconfiguration"

From Gumstix User Wiki
Jump to: navigation, search
(Added overo instructions.)
m (Formatting of commands)
Line 47: Line 47:
 
These instructions assume you are using the default gumstix-oe kernel as defined here
 
These instructions assume you are using the default gumstix-oe kernel as defined here
 
    
 
    
  $ cd $OVEROTOP
+
$ cd $OVEROTOP
  $ grep linux org.openembedded/conf/machine/overo.conf
+
$ grep linux org.openembedded/conf/machine/overo.conf
  PREFERRED_PROVIDER_virtual/kernel = "linux-omap3"
+
PREFERRED_PROVIDER_virtual/kernel = "linux-omap3"
  
 
And the current revision as defined here
 
And the current revision as defined here
  
  $ bitbake --show-versions | grep linux-omap3
+
$ bitbake --show-versions | grep linux-omap3
  linux-omap3                            0:2.6.32-r51
+
linux-omap3                            0:2.6.32-r51
  
 
So the rest of the example will assume linux-omap3-2.6.32 revision 51.  
 
So the rest of the example will assume linux-omap3-2.6.32 revision 51.  
Line 65: Line 65:
 
If not run this command
 
If not run this command
  
  $ bitbake linux-omap3-2.6.32
+
$ bitbake linux-omap3-2.6.32
  
 
This will create a source directory in the ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi directory.
 
This will create a source directory in the ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi directory.
 
In this case it will be  
 
In this case it will be  
  
  ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51
+
${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51
  
 
To modify the kernel configuration, run menuconfig via bitbake. Make your changes and save the configuration.
 
To modify the kernel configuration, run menuconfig via bitbake. Make your changes and save the configuration.
  
  cd $OVEROTOP
+
$ cd $OVEROTOP
  bitbake -c menuconfig linux-omap3-2.6.32
+
$ bitbake -c menuconfig linux-omap3-2.6.32
  
 
The new kernel configuration file you created can be found here.
 
The new kernel configuration file you created can be found here.
  
  ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51/git/.config
+
${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51/git/.config
  
 
Copy that file to where the bitbake recipe for the kernel will use it.
 
Copy that file to where the bitbake recipe for the kernel will use it.
  
  cp ${OVEROTOP}/tmp/work/overo-angstrom-linux/gnueabi/linux-omap3-2.6.32-r51/git/.config \
+
$ cp ${OVEROTOP}/tmp/work/overo-angstrom-linux/gnueabi/linux-omap3-2.6.32-r51/git/.config \
 
     ${OVEROTOP}/org.openembedded.dev/recipes/linux/linux-omap3-2.6.32/overo/defconfig
 
     ${OVEROTOP}/org.openembedded.dev/recipes/linux/linux-omap3-2.6.32/overo/defconfig
  
 
Then rebuild the kernel.
 
Then rebuild the kernel.
  
  bitbake -c clean linux-omap3-2.6.32
+
$ bitbake -c clean linux-omap3-2.6.32
  bitbake -c rebuild linux-omap3-2.6.32
+
$ bitbake -c rebuild linux-omap3-2.6.32
  
 
Then rebuild the rootfs to get the modules installed correctly.  
 
Then rebuild the rootfs to get the modules installed correctly.  
Line 95: Line 95:
 
Substitute the image you are using, the example assumes the omap3-console-image.
 
Substitute the image you are using, the example assumes the omap3-console-image.
  
  bitbake omap3-console-image
+
$ bitbake omap3-console-image
  
 
Finally, install the new kernel and rootfs the way you normally would using either a  
 
Finally, install the new kernel and rootfs the way you normally would using either a  
 
[http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Creating-a-bootable-microSD-card/111.html microSD card]  
 
[http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Creating-a-bootable-microSD-card/111.html microSD card]  
 
or by copying to [http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Writing-images-to-onboard-nand/111.html onboard nand].
 
or by copying to [http://www.gumstix.net/Setup-and-Programming/view/Overo-Setup-and-Programming/Writing-images-to-onboard-nand/111.html onboard nand].

Revision as of 03:04, 19 January 2010

Verdex

To reconfigure the kernel with the current state of Gumstix's OE things, you will need gnome-terminal. Run this command: bitbake gumstix-kernel -c menuconfig

NOTE: You have to have ncurses and ncurses-dev installed in order for the MENUCONFIG to actually work.
NOTE: If a screen flashes infront of you and dissapears edit $OE_HOME/org.openembedded.snapshot/conf/bitbake.conf to the following

-GNOME_TERMCMDRUN = '${GNOME_TERMCMD} -x ${SHELLRCCMD}'
+GNOME_TERMCMDRUN = '${GNOME_TERMCMD} -x ${SHELLCMDS}'

NOTE: If you don't have gnome-terminal installed and wish to use xterm instead, use:

-GNOME_TERMCMD = 'gnome-terminal --disable-factory -t "$TERMWINDOWTITLE"'
-GNOME_TERMCMDRUN = '${GNOME_TERMCMD} -x ${SHELLRCCMD}'
+GNOME_TERMCMD = 'xterm -title "$TERMWINDOWTITLE"'
+GNOME_TERMCMDRUN = '${GNOME_TERMCMD} -e ${SHELLCMDS}'

The kernel config information is kept in
$OE_HOME/com.gumstix.collection/packages/linux/gumstix-kernel-2.6.XX/gumstix-custom-YYYYY/defconfig
where XX is the current default kernel version for your bitbake environment. That nugget is set in the $OE_HOME/com.gumstix.collection/conf/machine/include/gumstix.inc file, under the PREFERRED_VERSION_gumstix-kernel and YYYYY is usually one of connex/basix/verdex. That nugget comes from
$OE_HOME/build/conf/auto.conf

After running menuconfig, running "bitbake -c rebuild gumstix-kernel" will blow away the customizations just made. There is probably a better way to do this, but in order to preserve the customizations, you can copy the new config file and replace the default config. For example, to preserve a verdex board's config, do:

cp \
 $OE_HOME/tmp/work/gumstix-custom-verdex-angstrom-linux-gnueabi/gumstix-kernel-2.6.21-r1/linux-2.6.21/.config \
 $OE_HOME/com.gumstix.collection/packages/linux/gumstix-kernel-2.6.21/gumstix-custom-verdex/defconfig

Now that you have replaced the default config, the following commands will rebuild and repackage the new kernel and create new images for you:

bitbake -c rebuild gumstix-kernel
bitbake -c rebuild task-base-gumstix
bitbake gumstix-basic-image

Overo

These instructions assume you are using the default gumstix-oe kernel as defined here

$ cd $OVEROTOP
$ grep linux org.openembedded/conf/machine/overo.conf
PREFERRED_PROVIDER_virtual/kernel = "linux-omap3"

And the current revision as defined here

$ bitbake --show-versions | grep linux-omap3
linux-omap3                            0:2.6.32-r51

So the rest of the example will assume linux-omap3-2.6.32 revision 51.

Substitute the kernel version and revision your system is using in the following steps.


First build the kernel normally with bitbake. If you have built an image, then it's already done.

If not run this command

$ bitbake linux-omap3-2.6.32

This will create a source directory in the ${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi directory. In this case it will be

${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51

To modify the kernel configuration, run menuconfig via bitbake. Make your changes and save the configuration.

$ cd $OVEROTOP
$ bitbake -c menuconfig linux-omap3-2.6.32

The new kernel configuration file you created can be found here.

${OVEROTOP}/tmp/work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.32-r51/git/.config

Copy that file to where the bitbake recipe for the kernel will use it.

$ cp ${OVEROTOP}/tmp/work/overo-angstrom-linux/gnueabi/linux-omap3-2.6.32-r51/git/.config \
   ${OVEROTOP}/org.openembedded.dev/recipes/linux/linux-omap3-2.6.32/overo/defconfig

Then rebuild the kernel.

$ bitbake -c clean linux-omap3-2.6.32
$ bitbake -c rebuild linux-omap3-2.6.32

Then rebuild the rootfs to get the modules installed correctly.

Substitute the image you are using, the example assumes the omap3-console-image.

$ bitbake omap3-console-image

Finally, install the new kernel and rootfs the way you normally would using either a microSD card or by copying to onboard nand.