mirror of
https://git.yoctoproject.org/poky
synced 2026-06-04 14:09:47 +00:00
dev-manual: Added "next steps" for setting up a native linux host
The end of this section did not direct the user to the next logical step for preparing a development host. I added a paragraph to guide the user to the next area they would need to read based on their development methods. (From yocto-docs rev: 4a1aa7800e7bca82dddef0ed83e14e075b3aa9f2) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4925a29322
commit
2a1bdf7416
@@ -120,52 +120,192 @@
|
|||||||
<section id='getting-ready-to-develop-using-devtool'>
|
<section id='getting-ready-to-develop-using-devtool'>
|
||||||
<title>Getting Ready to Develop using <filename>devtool</filename></title>
|
<title>Getting Ready to Develop using <filename>devtool</filename></title>
|
||||||
|
|
||||||
<para role='writernotes'>
|
<para>
|
||||||
Sections as follows:
|
Follow these steps to prepare to update the kernel image using
|
||||||
|
<filename>devtool</filename>.
|
||||||
|
Completing this procedure leaves you with a clean kernel image
|
||||||
|
and ready to make modifications as described in the
|
||||||
|
"<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
|
||||||
|
section:
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Source the oe-init-build-env script.
|
<emphasis>Initialize the BitBake Environment:</emphasis>
|
||||||
At this point, we assume the build host is set up and
|
Before building an extensible SDK, you need to
|
||||||
<filename>poky</filename> repository has been cloned.
|
initialize the BitBake build environment by sourcing a
|
||||||
|
build environment script
|
||||||
|
(i.e. <ulink url='&YOCTO_DOCS_REF_URL;#structure-core-script'><filename>oe-init-build-env</filename></ulink>
|
||||||
|
or
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#structure-memres-core-script'><filename>oe-init-build-env-memres</filename></ulink>):
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ cd ~/poky
|
||||||
|
$ source oe-init-build-env
|
||||||
|
</literallayout>
|
||||||
|
<note>
|
||||||
|
The previous commands assume the
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#source-repositories'>Source Repositories</ulink>
|
||||||
|
(i.e. <filename>poky</filename>) have been cloned
|
||||||
|
using Git and the local repository is named
|
||||||
|
"poky".
|
||||||
|
</note>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Be sure your <filename>local.conf</filename> file has
|
<emphasis>Prepare Your <filename>local.conf</filename> File:</emphasis>
|
||||||
the correct
|
By default, the
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
|
||||||
variable set for the target hardware on which your
|
variable is set to "qemux86", which is fine if you are
|
||||||
kernel image runs.
|
building for the QEMU emulator in 32-bit mode.
|
||||||
Also have the
|
However, if you are not, you need to set the
|
||||||
|
<filename>MACHINE</filename> variable appropriately in
|
||||||
|
your <filename>local.conf</filename> file found in the
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
|
||||||
|
(i.e. <filename>~/poky/build</filename> in this example).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>Also, since you are preparing to work on the kernel
|
||||||
|
image, you need to set the
|
||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS'><filename>MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS</filename></ulink>
|
||||||
variable set equal to "kernel-modules".
|
variable to include kernel modules.</para>
|
||||||
|
|
||||||
|
<para>This example uses the default "qemux86" for the
|
||||||
|
<filename>MACHINE</filename> variable but needs to
|
||||||
|
add the "kernel-modules":
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"
|
||||||
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Create a layer for later that will contain your patches
|
<emphasis>Create a Layer for Patches:</emphasis>
|
||||||
(if any) to the kernel.
|
You need to create a layer to hold patches created
|
||||||
|
for the kernel image.
|
||||||
|
You can use the <filename>yocto-layer</filename> command
|
||||||
|
as follows:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ cd ~/poky
|
||||||
|
$ yocto-layer create my-kernel -o ../meta-my-kernel
|
||||||
|
Please enter the layer priority you'd like to use for the layer: [default: 6]
|
||||||
|
Would you like to have an example recipe created? (y/n) [default: n]
|
||||||
|
Would you like to have an example bbappend file created? (y/n) [default: n]
|
||||||
|
|
||||||
|
New layer created in ../meta-my-kernel.
|
||||||
|
|
||||||
|
Don't forget to add it to your BBLAYERS (for details see ../meta-my-kernel/README).
|
||||||
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Build the extensible SDK.
|
<emphasis>Inform the BitBake Build Environment About Your Layer:</emphasis>
|
||||||
|
As directed when you created your layer, you need to add
|
||||||
|
the layer to the
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-BBLAYERS'><filename>BBLAYERS</filename></ulink>
|
||||||
|
variable in the <filename>bblayers.conf</filename> file
|
||||||
|
as follows:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ cd ~/poky/build
|
||||||
|
$ bitbake-layers add-layer ../../meta-my-kernel
|
||||||
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Install the extensible SDK.
|
<emphasis>Build the Extensible SDK:</emphasis>
|
||||||
|
Use BitBake to build the extensible SDK specifically for
|
||||||
|
the Minnowboard:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ bitbake core-image-minimal -c populate_sdk_ext
|
||||||
|
</literallayout>
|
||||||
|
Once the build finishes, you can find the SDK installer
|
||||||
|
file (i.e. <filename>*.sh</filename> file) in the
|
||||||
|
following directory:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
~/poky/build/tmp/deploy/sdk
|
||||||
|
</literallayout>
|
||||||
|
For this example, the installer file is named
|
||||||
|
<filename>poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh</filename>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para>
|
||||||
Set up the terminal so that you can work with the
|
<emphasis>Install the Extensible SDK:</emphasis>
|
||||||
extensible SDK.
|
Use the following command to install the SDK.
|
||||||
This terminal is known as the "eSDK Terminal" unlike the
|
For this example, install the SDK in the default
|
||||||
terminal that is set up to run BitBake, which is known
|
<filename>~/poky_sdk</filename> directory:
|
||||||
as the "BitBake Terminal".
|
<literallayout class='monospaced'>
|
||||||
|
$ cd ~/poky/build/tmp/deploy/sdk
|
||||||
|
$ ./poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh
|
||||||
|
Poky (Yocto Project Reference Distro) Extensible SDK installer version &DISTRO;
|
||||||
|
============================================================================
|
||||||
|
Enter target directory for SDK (default: ~/poky_sdk):
|
||||||
|
You are about to install the SDK to "/home/scottrif/poky_sdk". Proceed[Y/n]? Y
|
||||||
|
Extracting SDK......................................done
|
||||||
|
Setting it up...
|
||||||
|
Extracting buildtools...
|
||||||
|
Preparing build system...
|
||||||
|
Parsing recipes: 100% |#################################################################| Time: 0:00:52
|
||||||
|
Initializing tasks: 100% |############## ###############################################| Time: 0:00:04
|
||||||
|
Checking sstate mirror object availability: 100% |######################################| Time: 0:00:00
|
||||||
|
Parsing recipes: 100% |#################################################################| Time: 0:00:33
|
||||||
|
Initializing tasks: 100% |##############################################################| Time: 0:00:00
|
||||||
|
done
|
||||||
|
SDK has been successfully set up and is ready to be used.
|
||||||
|
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
|
||||||
|
$ . /home/scottrif/poky_sdk/environment-setup-i586-poky-linux
|
||||||
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para role='writernotes'>
|
<listitem><para id='setting-up-the-esdk-terminal'>
|
||||||
Build the initial image using the extensible SDK.
|
<emphasis>Set Up a New Terminal to Work With the Extensible SDK:</emphasis>
|
||||||
|
You must set up a new terminal to work with the SDK.
|
||||||
|
You cannot use the same BitBake shell used to build the
|
||||||
|
installer.</para>
|
||||||
|
|
||||||
|
<para>After opening a new shell, run the SDK environment
|
||||||
|
setup script as directed by the output from installing
|
||||||
|
the SDK:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ source ~/poky_sdk/environment-setup-i586-poky-linux
|
||||||
|
"SDK environment now set up; additionally you may now run devtool to perform development tasks.
|
||||||
|
Run devtool --help for further details.
|
||||||
|
</literallayout>
|
||||||
|
<note>
|
||||||
|
If you get a warning about attempting to use the
|
||||||
|
extensible SDK in an environment set up to run
|
||||||
|
BitBake, you did not use a new shell.
|
||||||
|
</note>
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
<emphasis>Build the Clean Image:</emphasis>
|
||||||
|
The final step in preparing to work on the kernel is to
|
||||||
|
build an initial image using <filename>devtool</filename>
|
||||||
|
in the new terminal you just set up and initialized for
|
||||||
|
SDK work:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ devtool build-image
|
||||||
|
Parsing recipes: 100% |##########################################| Time: 0:00:05
|
||||||
|
Parsing of 830 .bb files complete (0 cached, 830 parsed). 1299 targets, 47 skipped, 0 masked, 0 errors.
|
||||||
|
WARNING: No packages to add, building image core-image-minimal unmodified
|
||||||
|
Loading cache: 100% |############################################| Time: 0:00:00
|
||||||
|
Loaded 1299 entries from dependency cache.
|
||||||
|
NOTE: Resolving any missing task queue dependencies
|
||||||
|
Initializing tasks: 100% |#######################################| Time: 0:00:07
|
||||||
|
Checking sstate mirror object availability: 100% |###############| Time: 0:00:00
|
||||||
|
NOTE: Executing SetScene Tasks
|
||||||
|
NOTE: Executing RunQueue Tasks
|
||||||
|
NOTE: Tasks Summary: Attempted 2866 tasks of which 2604 didn't need to be rerun and all succeeded.
|
||||||
|
NOTE: Successfully built core-image-minimal. You can find output files in /home/scottrif/poky_sdk/tmp/deploy/images/qemux86
|
||||||
|
</literallayout>
|
||||||
|
If you were building for actual hardware and not for
|
||||||
|
emulation, you could flash the image to a USB stick
|
||||||
|
on <filename>/dev/sdd</filename> and boot your device.
|
||||||
|
Use a command similar to the following command to flash
|
||||||
|
the image:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ sudo dd if=tmp/deploy/images/<replaceable>architecture</replaceable>/core-image-minimal-<replaceable>architecture</replaceable>.wic of=/dev/sdd bs=1MB
|
||||||
|
$ sync
|
||||||
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</orderedlist>
|
</orderedlist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para role='writernotes'>
|
<para>
|
||||||
At this point, the user has enough stuff set up to work on the
|
At this point you have set up to start making modifications to the
|
||||||
kernel.
|
kernel by using the extensible SDK.
|
||||||
I will put a section in the "Common Tasks" area of this manual
|
For a continued example, see the
|
||||||
that finished out how to make a modification to the kernel.
|
"<link linkend='using-devtool-to-patch-the-kernel'>Using <filename>devtool</filename> to Patch the Kernel</link>"
|
||||||
|
section.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user