From 2a1bdf7416391b4986fcc34c4de2b24d213948c1 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Mon, 28 Aug 2017 10:59:13 -0700 Subject: 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 Signed-off-by: Richard Purdie --- documentation/kernel-dev/kernel-dev-intro.xml | 206 +++++++++++++++++++++----- 1 file changed, 173 insertions(+), 33 deletions(-) (limited to 'documentation/kernel-dev/kernel-dev-intro.xml') diff --git a/documentation/kernel-dev/kernel-dev-intro.xml b/documentation/kernel-dev/kernel-dev-intro.xml index 56cf6bc7e2..a2644aaa13 100644 --- a/documentation/kernel-dev/kernel-dev-intro.xml +++ b/documentation/kernel-dev/kernel-dev-intro.xml @@ -120,52 +120,192 @@
Getting Ready to Develop using <filename>devtool</filename> - - Sections as follows: + + Follow these steps to prepare to update the kernel image using + devtool. + Completing this procedure leaves you with a clean kernel image + and ready to make modifications as described in the + "Using devtool to Patch the Kernel" + section: - - Source the oe-init-build-env script. - At this point, we assume the build host is set up and - poky repository has been cloned. + + Initialize the BitBake Environment: + Before building an extensible SDK, you need to + initialize the BitBake build environment by sourcing a + build environment script + (i.e. oe-init-build-env + or + oe-init-build-env-memres): + + $ cd ~/poky + $ source oe-init-build-env + + + The previous commands assume the + Source Repositories + (i.e. poky) have been cloned + using Git and the local repository is named + "poky". + - - Be sure your local.conf file has - the correct + + Prepare Your local.conf File: + By default, the MACHINE - variable set for the target hardware on which your - kernel image runs. - Also have the + variable is set to "qemux86", which is fine if you are + building for the QEMU emulator in 32-bit mode. + However, if you are not, you need to set the + MACHINE variable appropriately in + your local.conf file found in the + Build Directory + (i.e. ~/poky/build in this example). + + + Also, since you are preparing to work on the kernel + image, you need to set the MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS - variable set equal to "kernel-modules". + variable to include kernel modules. + + This example uses the default "qemux86" for the + MACHINE variable but needs to + add the "kernel-modules": + + MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules" + - - Create a layer for later that will contain your patches - (if any) to the kernel. + + Create a Layer for Patches: + You need to create a layer to hold patches created + for the kernel image. + You can use the yocto-layer command + as follows: + + $ 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). + + + + Inform the BitBake Build Environment About Your Layer: + As directed when you created your layer, you need to add + the layer to the + BBLAYERS + variable in the bblayers.conf file + as follows: + + $ cd ~/poky/build + $ bitbake-layers add-layer ../../meta-my-kernel + - - Build the extensible SDK. + + Build the Extensible SDK: + Use BitBake to build the extensible SDK specifically for + the Minnowboard: + + $ bitbake core-image-minimal -c populate_sdk_ext + + Once the build finishes, you can find the SDK installer + file (i.e. *.sh file) in the + following directory: + + ~/poky/build/tmp/deploy/sdk + + For this example, the installer file is named + poky-glibc-x86_64-core-image-minimal-i586-toolchain-ext-&DISTRO;.sh - - Install the extensible SDK. + + Install the Extensible SDK: + Use the following command to install the SDK. + For this example, install the SDK in the default + ~/poky_sdk directory: + + $ 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 + - - Set up the terminal so that you can work with the - extensible SDK. - This terminal is known as the "eSDK Terminal" unlike the - terminal that is set up to run BitBake, which is known - as the "BitBake Terminal". + + Set Up a New Terminal to Work With the Extensible SDK: + You must set up a new terminal to work with the SDK. + You cannot use the same BitBake shell used to build the + installer. + + After opening a new shell, run the SDK environment + setup script as directed by the output from installing + the SDK: + + $ 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. + + + 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. + - - Build the initial image using the extensible SDK. + + Build the Clean Image: + The final step in preparing to work on the kernel is to + build an initial image using devtool + in the new terminal you just set up and initialized for + SDK work: + + $ 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 + + If you were building for actual hardware and not for + emulation, you could flash the image to a USB stick + on /dev/sdd and boot your device. + Use a command similar to the following command to flash + the image: + + $ sudo dd if=tmp/deploy/images/architecture/core-image-minimal-architecture.wic of=/dev/sdd bs=1MB + $ sync + - - At this point, the user has enough stuff set up to work on the - kernel. - I will put a section in the "Common Tasks" area of this manual - that finished out how to make a modification to the kernel. + + At this point you have set up to start making modifications to the + kernel by using the extensible SDK. + For a continued example, see the + "Using devtool to Patch the Kernel" + section.
-- cgit v1.2.3-54-g00ecf