summaryrefslogtreecommitdiffstats
path: root/documentation/dev-manual/dev-manual-common-tasks.xml
diff options
context:
space:
mode:
authorScott Rifenbark <scott.m.rifenbark@intel.com>2013-04-05 11:14:12 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-10 16:20:54 +0100
commit482c6a71208410ab12fc528694d57248b972adfc (patch)
tree51e22d2d76270ff6979db02b519687033f6a56fb /documentation/dev-manual/dev-manual-common-tasks.xml
parent4be429fea591b77de75daaa9fd037f1a23ef7057 (diff)
downloadpoky-482c6a71208410ab12fc528694d57248b972adfc.tar.gz
dev-manual, ref-manual: Applied review comments for read-only-rootfs, etc.
1. Applied changes from Paul to the read-only-rootfs section. 2. Applied changes form Paul to the customizing images by using IMAGE_FEATURES and EXTRA_IMAGE_FEATURES variables. This was a simple rewrite of a sentence. 3. Updated the note in both the IMAGE_FEATURES and EXTRA_IMAGE_FEATURES glossary entries to specify inside of an image recipe (more specific). (From yocto-docs rev: 762b9e4d3b45a9602284cf4dd1ac281dcbbed7f5) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml')
-rw-r--r--documentation/dev-manual/dev-manual-common-tasks.xml112
1 files changed, 57 insertions, 55 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml
index 1b57e60d05..2d13038f41 100644
--- a/documentation/dev-manual/dev-manual-common-tasks.xml
+++ b/documentation/dev-manual/dev-manual-common-tasks.xml
@@ -611,11 +611,11 @@
611 <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink> 611 <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
612 and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink> 612 and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>
613 variables. 613 variables.
614 Although both variables function nearly equivalent, best 614 Although the functions for both variables are nearly equivalent,
615 practices dictate using <filename>IMAGE_FEATURES</filename> 615 best practices dictate using <filename>IMAGE_FEATURES</filename>
616 from within a recipe and using 616 from within a recipe and using
617 <filename>EXTRA_IMAGE_FEATURES</filename> from within 617 <filename>EXTRA_IMAGE_FEATURES</filename> from within
618 your <filename>local.conf</filename>, which is found in the 618 your <filename>local.conf</filename> file, which is found in the
619 <link linkend='build-directory'>Build Directory</link>. 619 <link linkend='build-directory'>Build Directory</link>.
620 </para> 620 </para>
621 621
@@ -1026,8 +1026,8 @@
1026 <title>Post-Installation Scripts</title> 1026 <title>Post-Installation Scripts</title>
1027 1027
1028 <para> 1028 <para>
1029 To add a post-installation (postinstall) script to a package, 1029 To add a post-installation script to a package, add a
1030 add a <filename>pkg_postinst_PACKAGENAME() 1030 <filename>pkg_postinst_PACKAGENAME()
1031 </filename> function to the <filename>.bb</filename> file and use 1031 </filename> function to the <filename>.bb</filename> file and use
1032 <filename>PACKAGENAME</filename> as the name of the package you want to attach to the 1032 <filename>PACKAGENAME</filename> as the name of the package you want to attach to the
1033 <filename>postinst</filename> script. 1033 <filename>postinst</filename> script.
@@ -3461,23 +3461,55 @@
3461 <note> 3461 <note>
3462 Supporting a read-only root filesystem requires that the system and 3462 Supporting a read-only root filesystem requires that the system and
3463 applications do not try to write to the root filesystem. 3463 applications do not try to write to the root filesystem.
3464 If writes are attempted, they need to gracefully fail. 3464 You must configure all parts of the target system to write
3465 elsewhere, or gracefully fail in the event of failing to
3466 write to the root filesystem.
3465 </note> 3467 </note>
3466 3468
3469 <section id='creating-the-root-filesystem'>
3470 <title>Creating the Root Filesystem</title>
3471
3472 <para>
3473 To create the read-only root filesystem, simply add the
3474 <filename>read-only-rootfs</filename> feature to your image.
3475 Using either of the following statements in your
3476 image recipe or from within the
3477 <filename>local.conf</filename> file found in the
3478 <link linkend='build-directory'>Build Directory</link>
3479 causes the build system to create a read-only root filesystem:
3480 <literallayout class='monospaced'>
3481 IMAGE_FEATURES = "read-only-rootfs"
3482 </literallayout>
3483 or
3484 <literallayout class='monospaced'>
3485 EXTRA_IMAGE_FEATURES = "read-only-rootfs"
3486 </literallayout>
3487 </para>
3488
3489 <para>
3490 For more information on how to use these variables, see the
3491 "<link linkend='usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></link>"
3492 section.
3493 For information on the variables, see
3494 <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
3495 and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>.
3496 </para>
3497 </section>
3498
3467 <section id='post-installation-scripts'> 3499 <section id='post-installation-scripts'>
3468 <title>Post-Installation Scripts</title> 3500 <title>Post-Installation Scripts</title>
3469 3501
3470 <para> 3502 <para>
3471 It is very important that you make sure all 3503 It is very important that you make sure all
3472 Post-Installation (postinstall) scripts 3504 post-Installation (<filename>pkg_postinst</filename>) scripts
3473 for packages that are installed into the image can be run 3505 for packages that are installed into the image can be run
3474 at the time when the root filesystem is created during the 3506 at the time when the root filesystem is created during the
3475 build on the host system. 3507 build on the host system.
3476 These scripts cannot attempt to run during first-boot on the 3508 These scripts cannot attempt to run during first-boot on the
3477 target device. 3509 target device.
3478 With the read-only root filesystem feature enabled, 3510 With the <filename>read-only-rootfs</filename> feature enabled,
3479 the build system checks during root filesystem creation to make 3511 the build system checks during root filesystem creation to make
3480 sure all postinstall scripts succeed. 3512 sure all post-installation scripts succeed.
3481 If any of these scripts still need to be run after the root 3513 If any of these scripts still need to be run after the root
3482 filesystem is created, the build immediately fails. 3514 filesystem is created, the build immediately fails.
3483 These checks during build time ensure that the build fails 3515 These checks during build time ensure that the build fails
@@ -3486,22 +3518,24 @@
3486 </para> 3518 </para>
3487 3519
3488 <para> 3520 <para>
3489 Most of the common postinstall scripts generated by the build 3521 Most of the common post-installation scripts generated by the
3490 system for the out-of-the-box Yocto Project are engineered 3522 build system for the out-of-the-box Yocto Project are engineered
3491 so that they can run during root filesystem creation 3523 so that they can run during root filesystem creation
3492 (e.g. postinstall scripts for caching fonts). 3524 (e.g. post-installation scripts for caching fonts).
3493 However, if you create and add custom scripts, you need 3525 However, if you create and add custom scripts, you need
3494 to be sure they can be run during file system creation. 3526 to be sure they can be run during file system creation.
3495 </para> 3527 </para>
3496 3528
3497 <para> 3529 <para>
3498 Here are some common problems that prevent postinstall 3530 Here are some common problems that prevent
3499 scripts from running during root filesystem creation: 3531 post-installation scripts from running during root filesystem
3532 creation:
3500 <itemizedlist> 3533 <itemizedlist>
3501 <listitem><para>Not using 3534 <listitem><para><emphasis>Not using
3502 <filename>$</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink> 3535 <filename>$</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-D'><filename>D</filename></ulink>
3503 in front of absolute paths. 3536 in front of absolute paths:</emphasis>
3504 The build system defines <filename>$D</filename>, and 3537 The build system defines <filename>$D</filename>
3538 at root filesystem creation time, and
3505 it is blank when run on the target device. 3539 it is blank when run on the target device.
3506 This implies two purposes for <filename>$D</filename>: 3540 This implies two purposes for <filename>$D</filename>:
3507 ensuring paths are valid in both the host and target 3541 ensuring paths are valid in both the host and target
@@ -3509,11 +3543,11 @@
3509 environment is being used as a method for taking 3543 environment is being used as a method for taking
3510 appropriate actions. 3544 appropriate actions.
3511 </para></listitem> 3545 </para></listitem>
3512 <listitem><para>Attempting to run processes that are 3546 <listitem><para><emphasis>Attempting to run processes that are
3513 specific to or dependent on the target 3547 specific to or dependent on the target
3514 architecture. 3548 architecture:</emphasis>
3515 You can work around these attempts by using native 3549 You can work around these attempts by using native
3516 tools to accomplish the same processes (tasks), or 3550 tools to accomplish the same tasks, or
3517 by alternatively running the processes under QEMU, 3551 by alternatively running the processes under QEMU,
3518 which has the <filename>qemu_run_binary</filename> 3552 which has the <filename>qemu_run_binary</filename>
3519 function. 3553 function.
@@ -3522,8 +3556,6 @@
3522 class in the 3556 class in the
3523 <link linkend='source-directory'>Source Directory</link>. 3557 <link linkend='source-directory'>Source Directory</link>.
3524 </para></listitem> 3558 </para></listitem>
3525 <listitem><para>Using hardware features specific to the machine.
3526 </para></listitem>
3527 </itemizedlist> 3559 </itemizedlist>
3528 </para> 3560 </para>
3529 </section> 3561 </section>
@@ -3532,45 +3564,15 @@
3532 <title>Areas With Write Access</title> 3564 <title>Areas With Write Access</title>
3533 3565
3534 <para> 3566 <para>
3535 With the read-only root filesystem feature enabled, any 3567 With the <filename>read-only-rootfs</filename> feature enabled,
3536 attempt by the target to write to the root filesystem at 3568 any attempt by the target to write to the root filesystem at
3537 runtime fails. 3569 runtime fails.
3538 Consequently, you must make sure that you configure processes 3570 Consequently, you must make sure that you configure processes
3539 and applications that attempt these types of writes do so 3571 and applications that attempt these types of writes do so
3540 to directories with write access (i.e. 3572 to directories with write access (e.g.
3541 <filename>/tmp</filename> or <filename>/var/run</filename>). 3573 <filename>/tmp</filename> or <filename>/var/run</filename>).
3542 </para> 3574 </para>
3543 </section> 3575 </section>
3544
3545 <section id='creating-the-root-filesystem'>
3546 <title>Creating the Root Filesystem</title>
3547
3548 <para>
3549 To create the read-only root filesystem, simply add the
3550 "read-only-rootfs" feature to your image.
3551 Using either of the following statements in your
3552 image recipe or from within the
3553 <filename>local.conf</filename> file found in the
3554 <link linkend='build-directory'>Build Directory</link>
3555 causes the build system to create a read-only root filesystem:
3556 <literallayout class='monospaced'>
3557 IMAGE_FEATURES = "read-only-rootfs"
3558 </literallayout>
3559 or
3560 <literallayout class='monospaced'>
3561 EXTRA_IMAGE_FEATURES = "read-only-rootfs"
3562 </literallayout>
3563 </para>
3564
3565 <para>
3566 For more information on how to use these variables, see the
3567 "<link linkend='usingpoky-extend-customimage-imagefeatures'>Customizing Images Using Custom <filename>IMAGE_FEATURES</filename> and <filename>EXTRA_IMAGE_FEATURES</filename></link>"
3568 section.
3569 For information on the variables, see
3570 <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></ulink>
3571 and <ulink url='&YOCTO_DOCS_REF_URL;#var-EXTRA_IMAGE_FEATURES'><filename>EXTRA_IMAGE_FEATURES</filename></ulink>.
3572 </para>
3573 </section>
3574 </section> 3576 </section>
3575 3577
3576 <section id="platdev-gdb-remotedebug"> 3578 <section id="platdev-gdb-remotedebug">