From 8f7df8648acf0ed2a5a8bdd01e327240b03f38e8 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Thu, 21 Sep 2017 16:55:18 -0700 Subject: kernel-dev: Edits to the devtool kernel development method. Changes based on a run through of the procedure. (From yocto-docs rev: 0a526bb15f597843d1e5da1eeca0a952c6c5016f) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/kernel-dev/kernel-dev-common.xml | 301 ++++++++++++------------- 1 file changed, 147 insertions(+), 154 deletions(-) (limited to 'documentation/kernel-dev/kernel-dev-common.xml') diff --git a/documentation/kernel-dev/kernel-dev-common.xml b/documentation/kernel-dev/kernel-dev-common.xml index 0f5e09cd47..28bedd1785 100644 --- a/documentation/kernel-dev/kernel-dev-common.xml +++ b/documentation/kernel-dev/kernel-dev-common.xml @@ -70,7 +70,7 @@ Initialize the BitBake Environment: Before building an extensible SDK, you need to - initialize the BitBake build environment by sourcing a + initialize the BitBake build environment by sourcing the build environment script (i.e. oe-init-build-env): @@ -155,8 +155,8 @@ Build the Extensible SDK: - Use BitBake to build the extensible SDK specifically for - the Minnowboard: + Use BitBake to build the extensible SDK specifically + for use with images to be run using QEMU: $ cd ~/poky/build $ bitbake core-image-minimal -c populate_sdk_ext @@ -280,7 +280,7 @@ Initialize the BitBake Environment: Before you can do anything using BitBake, you need to - initialize the BitBake build environment by sourcing a + initialize the BitBake build environment by sourcing the build environment script (i.e. oe-init-build-env). Also, for this example, be sure that the local branch @@ -1009,66 +1009,58 @@ "Getting Ready to Develop using devtool" Section. - - - - Also, for more information on patching the kernel, see the - "Applying Patches" - section. - - - - - Check Out the Kernel Source Files: - First you must use devtool to checkout - the kernel source code in its workspace. - Be sure you are in the terminal set up to do work - with the extensible SDK. - - See this - step - in the - "Getting Ready to Develop Using devtool" - section for more information. - - Use the following devtool command - to check out the code: - - $ devtool modify linux-yocto - - - During the checkout operation, a bug exists that could - cause errors such as the following to appear: + + + Check Out the Kernel Source Files: + First you must use devtool to checkout + the kernel source code in its workspace. + Be sure you are in the terminal set up to do work + with the extensible SDK. + + See this + step + in the + "Getting Ready to Develop Using devtool" + section for more information. + + Use the following devtool command + to check out the code: + $ devtool modify linux-yocto + + + During the checkout operation, a bug exists that could + cause errors such as the following to appear: + ERROR: Taskhash mismatch 2c793438c2d9f8c3681fd5f7bc819efa versus be3a89ce7c47178880ba7bf6293d7404 for /path/to/esdk/layers/poky/meta/recipes-kernel/linux/linux-yocto_4.10.bb.do_unpack - - You can safely ignore these messages. - The source code is correctly checked out. - - - - Edit the Source Files - Follow these steps to make some simple changes to the source - files: - - - Change the working directory: - In the previous step, the output noted where you can find - the source files (e.g. - ~/poky_sdk/workspace/sources/linux-yocto). - Change to where the kernel source code is before making - your edits to the calibrate.c file: - - $ cd ~/poky_sdk/workspace/sources/linux-yocto - - - Edit the source file: - Edit the init/calibrate.c file to have - the following changes: - + You can safely ignore these messages. + The source code is correctly checked out. + + + + Edit the Source Files + Follow these steps to make some simple changes to the source + files: + + + Change the working directory: + In the previous step, the output noted where you can find + the source files (e.g. + ~/poky_sdk/workspace/sources/linux-yocto). + Change to where the kernel source code is before making + your edits to the calibrate.c file: + + $ cd ~/poky_sdk/workspace/sources/linux-yocto + + + + Edit the source file: + Edit the init/calibrate.c file to have + the following changes: + void calibrate_delay(void) { unsigned long lpj; @@ -1085,110 +1077,111 @@ . . . - - - - - - Build the Updated Kernel Source: - To build the updated kernel source, use - devtool: - + + + + + + Build the Updated Kernel Source: + To build the updated kernel source, use + devtool: + $ devtool build linux-yocto - - - - Create the Image With the New Kernel: - Use the devtool build-image command - to create a new image that has the new kernel. - - If the image you originally created resulted in a Wic - file, you can use an alternate method to create the new - image with the updated kernel. - For an example, see the steps in the - TipsAndTricks/KernelDevelopmentWithEsdk - Wiki Page. - - + + + + Create the Image With the New Kernel: + Use the devtool build-image command + to create a new image that has the new kernel. + + If the image you originally created resulted in a Wic + file, you can use an alternate method to create the new + image with the updated kernel. + For an example, see the steps in the + TipsAndTricks/KernelDevelopmentWithEsdk + Wiki Page. + + $ cd ~ $ devtool build-image core-image-minimal - - - - Test the New Image: - For this example, you can run the new image using QEMU - to verify your changes: - - - Boot the image: - Boot the modified image in the QEMU emulator - using this command: - + + + + Test the New Image: + For this example, you can run the new image using QEMU + to verify your changes: + + + Boot the image: + Boot the modified image in the QEMU emulator + using this command: + $ runqemu qemux86 - - - - Verify the changes: - Log into the machine using root - with no password and then use the following shell - command to scroll through the console's boot output. - + + + + Verify the changes: + Log into the machine using root + with no password and then use the following shell + command to scroll through the console's boot output. + # dmesg | less - - You should see the results of your - printk statements - as part of the output when you scroll down the - console window. - - - - - Stage and commit your changes: - Within your eSDK terminal, change your working directory to - where you modified the calibrate.c - file and use these Git commands to stage and commit your - changes: - + + You should see the results of your + printk statements + as part of the output when you scroll down the + console window. + + + + + Stage and commit your changes: + Within your eSDK terminal, change your working directory to + where you modified the calibrate.c + file and use these Git commands to stage and commit your + changes: + $ cd ~/poky_sdk/workspace/sources/linux-yocto $ git status $ git add init/calibrate.c $ git commit -m "calibrate: Add printk example" - - - - Export the Patches and Create a .bbappend: - To export your commits as patches and create a - .bbappend file, use the following - command in the terminal used to work with the extensible - SDK. - This example uses the previously established layer named - meta-mylayer. - - See Step 3 of the - "Getting Ready to Develop using devtool" - section for information on setting up this layer. - - - $ devtool finish linux-yocto /path/to/meta-mylayer - - Once the command finishes, the patches and the - .bbappend file are located in the - ~/meta-mylayer/recipes-kernel/linux - directory. - - - Build the Image With Your Modified Kernel: - You can now build an image that includes your kernel - patches. - Execute the following command from your - Build Directory - in the terminal set up to run BitBake: - + + + + Export the Patches and Create an Append File: + To export your commits as patches and create a + .bbappend file, use the following + command in the terminal used to work with the extensible + SDK. + This example uses the previously established layer named + meta-mylayer. + + See Step 3 of the + "Getting Ready to Develop using devtool" + section for information on setting up this layer. + + + $ devtool finish linux-yocto ~/meta-mylayer + + Once the command finishes, the patches and the + .bbappend file are located in the + ~/meta-mylayer/recipes-kernel/linux + directory. + + + Build the Image With Your Modified Kernel: + You can now build an image that includes your kernel + patches. + Execute the following command from your + Build Directory + in the terminal set up to run BitBake: + $ cd ~/poky/build $ bitbake core-image-minimal - - - + + + +
@@ -1441,8 +1434,8 @@ following sequence of commands: $ cd ~/poky/build - $ cd bitbake -c cleanall yocto-linux - $ cd bitbake core-image-minimal -c cleanall + $ bitbake -c cleanall yocto-linux + $ bitbake core-image-minimal -c cleanall $ bitbake core-image-minimal $ runqemu qemux86 -- cgit v1.2.3-54-g00ecf