diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-08-02 10:38:02 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-12 23:11:28 +0100 |
commit | ea613c8f70d5e87a6327d52d935b8646a8fe3077 (patch) | |
tree | 015de6c5b2459fe8a2c11cb6dcea3ad14fca8c9f | |
parent | f7763317f8f9844e325101fde1eac6ecd8cfdbee (diff) | |
download | poky-ea613c8f70d5e87a6327d52d935b8646a8fe3077.tar.gz |
kernel-dev: working with kernel using devtool does not require building and installing eSDK
In fact, all the same tasks can be done directly from a Yocto build. Let's just
drop the steps to produce and install the eSDK - if someone wants it, the SDK
manual covers everything.
(From yocto-docs rev: 582aa6a8e461bbd698b121403dcd25ddb563a464)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | documentation/kernel-dev/common.rst | 84 | ||||
-rw-r--r-- | documentation/kernel-dev/intro.rst | 8 |
2 files changed, 16 insertions, 76 deletions
diff --git a/documentation/kernel-dev/common.rst b/documentation/kernel-dev/common.rst index dc3345a520..16ef6453bd 100644 --- a/documentation/kernel-dev/common.rst +++ b/documentation/kernel-dev/common.rst | |||
@@ -52,8 +52,8 @@ image and ready to make modifications as described in the | |||
52 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" | 52 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" |
53 | section: | 53 | section: |
54 | 54 | ||
55 | 1. *Initialize the BitBake Environment:* Before building an extensible | 55 | 1. *Initialize the BitBake Environment:* |
56 | SDK, you need to initialize the BitBake build environment by sourcing | 56 | you need to initialize the BitBake build environment by sourcing |
57 | the build environment script (i.e. :ref:`structure-core-script`):: | 57 | the build environment script (i.e. :ref:`structure-core-script`):: |
58 | 58 | ||
59 | $ cd poky | 59 | $ cd poky |
@@ -120,67 +120,10 @@ section: | |||
120 | NOTE: Starting bitbake server... | 120 | NOTE: Starting bitbake server... |
121 | $ | 121 | $ |
122 | 122 | ||
123 | 5. *Build the Extensible SDK:* Use BitBake to build the extensible SDK | 123 | 5. *Build the Clean Image:* The final step in preparing to work on the |
124 | specifically for use with images to be run using QEMU:: | 124 | kernel is to build an initial image using ``bitbake``:: |
125 | 125 | ||
126 | $ cd poky/build | 126 | $ bitbake core-image-minimal |
127 | $ bitbake core-image-minimal -c populate_sdk_ext | ||
128 | |||
129 | Once | ||
130 | the build finishes, you can find the SDK installer file (i.e. | ||
131 | ``*.sh`` file) in the following directory:: | ||
132 | |||
133 | poky/build/tmp/deploy/sdk | ||
134 | |||
135 | For this example, the installer file is named | ||
136 | ``poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh``. | ||
137 | |||
138 | 6. *Install the Extensible SDK:* Use the following command to install | ||
139 | the SDK. For this example, install the SDK in the default | ||
140 | ``poky_sdk`` directory:: | ||
141 | |||
142 | $ cd poky/build/tmp/deploy/sdk | ||
143 | $ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh | ||
144 | Poky (Yocto Project Reference Distro) Extensible SDK installer version &DISTRO; | ||
145 | ============================================================================ | ||
146 | Enter target directory for SDK (default: poky_sdk): | ||
147 | You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed [Y/n]? Y | ||
148 | Extracting SDK......................................done | ||
149 | Setting it up... | ||
150 | Extracting buildtools... | ||
151 | Preparing build system... | ||
152 | Parsing recipes: 100% |#################################################################| Time: 0:00:52 | ||
153 | Initializing tasks: 100% |############## ###############################################| Time: 0:00:04 | ||
154 | Checking sstate mirror object availability: 100% |######################################| Time: 0:00:00 | ||
155 | Parsing recipes: 100% |#################################################################| Time: 0:00:33 | ||
156 | Initializing tasks: 100% |##############################################################| Time: 0:00:00 | ||
157 | done | ||
158 | SDK has been successfully set up and is ready to be used. | ||
159 | Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g. | ||
160 | $ . /home/scottrif/poky_sdk/environment-setup-i586-poky-linux | ||
161 | |||
162 | |||
163 | 7. *Set Up a New Terminal to Work With the Extensible SDK:* You must set | ||
164 | up a new terminal to work with the SDK. You cannot use the same | ||
165 | BitBake shell used to build the installer. | ||
166 | |||
167 | After opening a new shell, run the SDK environment setup script as | ||
168 | directed by the output from installing the SDK:: | ||
169 | |||
170 | $ source poky_sdk/environment-setup-i586-poky-linux | ||
171 | "SDK environment now set up; additionally you may now run devtool to perform development tasks. | ||
172 | Run devtool --help for further details. | ||
173 | |||
174 | .. note:: | ||
175 | |||
176 | If you get a warning about attempting to use the extensible SDK in | ||
177 | an environment set up to run BitBake, you did not use a new shell. | ||
178 | |||
179 | 8. *Build the Clean Image:* The final step in preparing to work on the | ||
180 | kernel is to build an initial image using ``devtool`` in the new | ||
181 | terminal you just set up and initialized for SDK work:: | ||
182 | |||
183 | $ devtool build-image | ||
184 | Parsing recipes: 100% |##########################################| Time: 0:00:05 | 127 | Parsing recipes: 100% |##########################################| Time: 0:00:05 |
185 | Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors. | 128 | Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors. |
186 | WARNING: No packages to add, building image core-image-minimal unmodified | 129 | WARNING: No packages to add, building image core-image-minimal unmodified |
@@ -192,7 +135,6 @@ section: | |||
192 | NOTE: Executing SetScene Tasks | 135 | NOTE: Executing SetScene Tasks |
193 | NOTE: Executing RunQueue Tasks | 136 | NOTE: Executing RunQueue Tasks |
194 | NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need to be rerun and all succeeded. | 137 | NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need to be rerun and all succeeded. |
195 | NOTE: Successfully built core-image-minimal. You can find output files in /home/scottrif/poky_sdk/tmp/deploy/images/qemux86 | ||
196 | 138 | ||
197 | If you were | 139 | If you were |
198 | building for actual hardware and not for emulation, you could flash | 140 | building for actual hardware and not for emulation, you could flash |
@@ -202,7 +144,7 @@ section: | |||
202 | Wiki page. | 144 | Wiki page. |
203 | 145 | ||
204 | At this point you have set up to start making modifications to the | 146 | At this point you have set up to start making modifications to the |
205 | kernel by using the extensible SDK. For a continued example, see the | 147 | kernel. For a continued example, see the |
206 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" | 148 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" |
207 | section. | 149 | section. |
208 | 150 | ||
@@ -744,7 +686,7 @@ Using ``devtool`` to Patch the Kernel | |||
744 | ===================================== | 686 | ===================================== |
745 | 687 | ||
746 | The steps in this procedure show you how you can patch the kernel using | 688 | The steps in this procedure show you how you can patch the kernel using |
747 | the extensible SDK and ``devtool``. | 689 | ``devtool``. |
748 | 690 | ||
749 | .. note:: | 691 | .. note:: |
750 | 692 | ||
@@ -766,8 +708,7 @@ console. The example is a continuation of the setup procedure found in | |||
766 | the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Section. | 708 | the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Section. |
767 | 709 | ||
768 | 1. *Check Out the Kernel Source Files:* First you must use ``devtool`` | 710 | 1. *Check Out the Kernel Source Files:* First you must use ``devtool`` |
769 | to checkout the kernel source code in its workspace. Be sure you are | 711 | to checkout the kernel source code in its workspace. |
770 | in the terminal set up to do work with the extensible SDK. | ||
771 | 712 | ||
772 | .. note:: | 713 | .. note:: |
773 | 714 | ||
@@ -867,7 +808,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se | |||
867 | the results of your ``printk`` statements as part of the output | 808 | the results of your ``printk`` statements as part of the output |
868 | when you scroll down the console window. | 809 | when you scroll down the console window. |
869 | 810 | ||
870 | 6. *Stage and commit your changes*: Within your eSDK terminal, change | 811 | 6. *Stage and commit your changes*: Change |
871 | your working directory to where you modified the ``calibrate.c`` file | 812 | your working directory to where you modified the ``calibrate.c`` file |
872 | and use these Git commands to stage and commit your changes:: | 813 | and use these Git commands to stage and commit your changes:: |
873 | 814 | ||
@@ -878,8 +819,7 @@ the ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" Se | |||
878 | 819 | ||
879 | 7. *Export the Patches and Create an Append File:* To export your | 820 | 7. *Export the Patches and Create an Append File:* To export your |
880 | commits as patches and create a ``.bbappend`` file, use the following | 821 | commits as patches and create a ``.bbappend`` file, use the following |
881 | command in the terminal used to work with the extensible SDK. This | 822 | command. This example uses the previously established layer named ``meta-mylayer``. |
882 | example uses the previously established layer named ``meta-mylayer``. | ||
883 | :: | 823 | :: |
884 | 824 | ||
885 | $ devtool finish linux-yocto ~/meta-mylayer | 825 | $ devtool finish linux-yocto ~/meta-mylayer |
@@ -907,8 +847,8 @@ Using Traditional Kernel Development to Patch the Kernel | |||
907 | ======================================================== | 847 | ======================================================== |
908 | 848 | ||
909 | The steps in this procedure show you how you can patch the kernel using | 849 | The steps in this procedure show you how you can patch the kernel using |
910 | traditional kernel development (i.e. not using ``devtool`` and the | 850 | traditional kernel development (i.e. not using ``devtool`` |
911 | extensible SDK as described in the | 851 | as described in the |
912 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" | 852 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" |
913 | section). | 853 | section). |
914 | 854 | ||
diff --git a/documentation/kernel-dev/intro.rst b/documentation/kernel-dev/intro.rst index b9ce7f241c..4ff4dc7d35 100644 --- a/documentation/kernel-dev/intro.rst +++ b/documentation/kernel-dev/intro.rst | |||
@@ -114,13 +114,13 @@ general information and references for further information. | |||
114 | a build host ready to use the Yocto Project. | 114 | a build host ready to use the Yocto Project. |
115 | 115 | ||
116 | 2. *Set Up Your Host Development System for Kernel Development:* It is | 116 | 2. *Set Up Your Host Development System for Kernel Development:* It is |
117 | recommended that you use ``devtool`` and an extensible SDK for kernel | 117 | recommended that you use ``devtool`` for kernel |
118 | development. Alternatively, you can use traditional kernel | 118 | development. Alternatively, you can use traditional kernel |
119 | development methods with the Yocto Project. Either way, there are | 119 | development methods with the Yocto Project. Either way, there are |
120 | steps you need to take to get the development environment ready. | 120 | steps you need to take to get the development environment ready. |
121 | 121 | ||
122 | Using ``devtool`` and the eSDK requires that you have a clean build | 122 | Using ``devtool`` requires that you have a clean build |
123 | of the image and that you are set up with the appropriate eSDK. For | 123 | of the image. For |
124 | more information, see the | 124 | more information, see the |
125 | ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" | 125 | ":ref:`kernel-dev/common:getting ready to develop using \`\`devtool\`\``" |
126 | section. | 126 | section. |
@@ -134,7 +134,7 @@ general information and references for further information. | |||
134 | 3. *Make Changes to the Kernel Source Code if applicable:* Modifying the | 134 | 3. *Make Changes to the Kernel Source Code if applicable:* Modifying the |
135 | kernel does not always mean directly changing source files. However, | 135 | kernel does not always mean directly changing source files. However, |
136 | if you have to do this, you make the changes to the files in the | 136 | if you have to do this, you make the changes to the files in the |
137 | eSDK's Build Directory if you are using ``devtool``. For more | 137 | Yocto's Build Directory if you are using ``devtool``. For more |
138 | information, see the | 138 | information, see the |
139 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" | 139 | ":ref:`kernel-dev/common:using \`\`devtool\`\` to patch the kernel`" |
140 | section. | 140 | section. |