Changing the Kernel Configuration
- This example changes the default behavior, which is "off", of the Symmetric
- Multi-processing Support (CONFIG_SMP) to "on".
+ This example changes the default behavior, which is "on", of the Symmetric
+ Multi-processing Support (CONFIG_SMP) to "off".
It is a simple example that demonstrates how to reconfigure the kernel.
@@ -533,7 +533,7 @@
you can get them through tarball extraction or by
cloning the poky Git repository.
This example uses poky as the root directory of the
- local Yocto Project files Git repository.
+ local Yocto Project Files Git repository.
See the bulleted item
"Yocto Project Release"
for information on how to get these files.
@@ -616,11 +616,11 @@
Examining the Default CONFIG_SMP Behavior
- By default, CONFIG_SMP supports single processor machines.
+ By default, CONFIG_SMP supports multiple processor machines.
To see this default setting from within the QEMU emulator, boot your image using
the emulator as follows:
- $ runqemu qemux86 qemuparams="-smp 2"
+ $ runqemu qemux86 qemuparams="-smp 4"
@@ -628,11 +628,25 @@
Login to the machine using root with no password.
After logging in, enter the following command to see how many processors are
being supported in the emulator.
- The emulator reports support for a single processor:
+ The emulator reports support for the number of processors you specified using
+ the -smp option, four in this case:
# cat /proc/cpuinfo | grep processor
processor : 0
+ processor : 1
+ processor : 2
+ processor : 3
#
+
+ To check the setting for CONFIG_SMP, you can use the
+ following command:
+
+ zcat /proc/config.gz | grep CONFIG_SMP
+
+ The console returns the following showing that multi-processor machine support
+ is set:
+
+ CONFIG_SMP=y
Logout of the emulator using the exit command and
then close it down.
@@ -662,11 +676,21 @@
kernel.
The Yocto Project build environment recognizes this kernel as
linux-yocto.
- Thus, the following command from the shell in which you previously sourced the
- environment initialization script launches menuconfig:
+ Thus, the following commands from the shell in which you previously sourced the
+ environment initialization script cleans the shared state memory and the
+ WORKDIR
+ directory and then builds and launches menuconfig:
+ $ bitbake linux-yocto -c cleansstate
$ bitbake linux-yocto -c menuconfig
+
+ Due to a bug in the release, it is necessary to clean the shared state memory
+ in order for configurations made using menuconfig to take
+ effect.
+ For information on the bug, see
+
+
@@ -675,7 +699,7 @@
You can find it at Processor Type and Features.
The configuration selection is
Symmetric Multi-processing Support.
- After using the arrow keys to highlight this selection, press "y" to select it.
+ After using the arrow keys to highlight this selection, press "n" to turn it off.
Then, exit out and save your selections.
@@ -684,22 +708,25 @@
is updated.
This is the file that the build system uses to configure the Linux Yocto kernel
when it is built.
- You can find and examine this file in the Yocto Project files Git repository in
+ You can find and examine this file in the Yocto Project Files Git repository in
the build directory.
- This example uses the following.
- Note that this example directory is artificially split and many of the characters
- in the actually filename are omitted in order to make it more
- readable:
+ This example uses the following:
- ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-2.6.37+git1+84f...
- ...r20/linux-qemux86-standard-build
+ ~/poky/build/tmp/work/qemux86-poky-linux/linux-yocto-3.2.11+git1+84f...
+ ...656ed30-r1/linux-qemux86-standard-build
+
+ The previous example directory is artificially split and many of the characters
+ in the actual filename are omitted in order to make it more readable.
+ Also, depending on the kernel you are using, the exact pathname might differ
+ slightly.
+
Within the .config file, you can see the following setting:
- CONFIG_SMP=y
+ # CONFIG_SMP is not set
@@ -735,9 +762,9 @@
- Now run the QEMU emulator:
+ Now run the QEMU emulator and pass it the same multi-processor option as before:
- $ runqemu qemux86 qemuparams="-smp 2"
+ $ runqemu qemux86 qemuparams="-smp 4"
@@ -747,13 +774,22 @@
# cat /proc/cpuinfo | grep processor
processor : 0
- processor : 1
#
- From the output, you can see that you have successfully reconfigured the kernel.
+ From the output, you can see that the kernel no longer supports multi-processor systems.
+ The output indicates support for a single processor. You can verify the
+ CONFIG_SMP setting by using this command:
+
+ zcat /proc/config.gz | grep CONFIG_SMP
+
+ The console returns the following output:
+
+ # CONFIG_SMP is not set
+
+ You have successfully reconfigured the kernel.