</para>
</section>
+ <section id='fakeroot-and-pseudo'>
+ <title>Fakeroot and Pseudo</title>
+
+ <para>
+ Some tasks are easier to implement when allowed to perform certain
+ operations that are normally reserved for the root user.
+ For example, the
+ <ulink url='&YOCTO_DOCS_REF_URL;#ref-tasks-install'><filename>do_install</filename></ulink>
+ task benefits from being able to set the UID and GID of installed
+ files to arbitrary values.
+ </para>
+
+ <para>
+ One approach to allowing tasks to perform root-only operations
+ would be to require BitBake to run as root.
+ However, this method is cumbersome and has security issues.
+ The approach that is actually used is to run tasks that benefit
+ from root privileges in a "fake" root environment.
+ Within this environment, the task and its child processes believe
+ that they are running as the root user, and see an internally
+ consistent view of the filesystem.
+ As long as generating the final output (e.g. a package or an image)
+ does not require root privileges, the fact that some earlier
+ steps ran in a fake root environment does not cause problems.
+ </para>
+
+ <para>
+ The capability to run tasks in a fake root environment is known as
+ "fakeroot", which is derived from the BitBake keyword/variable
+ flag that requests a fake root environment for a task.
+ In current versions of the OpenEmbedded build system,
+ the program that implements fakeroot is known as Pseudo.
+ </para>
+
+ <para>
+ Pseudo overrides system calls through the
+ <filename>LD_PRELOAD</filename> mechanism to give the
+ illusion of running as root.
+ To keep track of "fake" file ownership and permissions resulting
+ from operations that require root permissions, an sqlite3
+ database is used.
+ This database is stored in
+ <filename>${</filename><ulink url='&YOCTO_DOCS_REF_URL;#var-WORKDIR'><filename>WORKDIR</filename></ulink><filename>}/pseudo/files.db</filename>
+ for individual recipes.
+ Storing the database in a file as opposed to in memory
+ gives persistence between tasks, and even between builds.
+ <note><title>Caution</title>
+ If you add your own task that manipulates the same files or
+ directories as a fakeroot task, then that task should also run
+ under fakeroot.
+ Otherwise, the task will not be able to run root-only
+ operations, and will not see the fake file ownership and
+ permissions set by the other task.
+ You should also add a dependency on
+ <filename>virtual/fakeroot-native:do_populate_sysroot</filename>,
+ giving the following:
+ <literallayout class='monospaced'>
+ fakeroot do_mytask () {
+ ...
+ }
+ do_mytask[depends] += "virtual/fakeroot-native:do_populate_sysroot"
+ </literallayout>
+ </note>
+ For more information, see the
+ <ulink url='&YOCTO_DOCS_BB_URL;#var-FAKEROOT'><filename>FAKEROOT*</filename></ulink>
+ variables in the BitBake User Manual.
+ You can also reference this
+ <ulink url='http://www.ibm.com/developerworks/opensource/library/os-aapseudo1/index.html'>Pseudo</ulink>
+ article.
+ </para>
+ </section>
+
<section id='x32'>
<title>x32 psABI</title>
and
<link linkend='ref-tasks-rootfs'><filename>do_rootfs</filename></link>),
run under
- <link linkend='fakeroot-and-pseudo'>fakeroot</link>.
+ <ulink url='&YOCTO_DOCS_OVERVIEW_URL;#fakeroot-and-pseudo'>fakeroot</ulink>.
<note>
<title>Caution</title>
<note><title>Caution</title>
Tasks that read from or write to this directory should
run under
- <link linkend='fakeroot-and-pseudo'>fakeroot</link>.
+ <ulink url='&YOCTO_DOCS_OVERVIEW_URL;#fakeroot-and-pseudo'>fakeroot</ulink>.
</note>
</para>
</glossdef>
x32, Wayland support, and Licenses.
</para>
-<section id='fakeroot-and-pseudo'>
- <title>Fakeroot and Pseudo</title>
-
- <para>
- Some tasks are easier to implement when allowed to perform certain
- operations that are normally reserved for the root user.
- For example, the
- <link linkend='ref-tasks-install'><filename>do_install</filename></link>
- task benefits from being able to set the UID and GID of installed files
- to arbitrary values.
- </para>
-
- <para>
- One approach to allowing tasks to perform root-only operations
- would be to require BitBake to run as root.
- However, this method is cumbersome and has security issues.
- The approach that is actually used is to run tasks that benefit from
- root privileges in a "fake" root environment.
- Within this environment, the task and its child processes believe that
- they are running as the root user, and see an internally consistent
- view of the filesystem.
- As long as generating the final output (e.g. a package or an image)
- does not require root privileges, the fact that some earlier steps ran
- in a fake root environment does not cause problems.
- </para>
-
- <para>
- The capability to run tasks in a fake root environment is known as
- "fakeroot", which is derived from the BitBake keyword/variable
- flag that requests a fake root environment for a task.
- In current versions of the OpenEmbedded build system,
- the program that implements fakeroot is known as Pseudo.
- </para>
-
- <para>
- Pseudo overrides system calls through the
- <filename>LD_PRELOAD</filename> mechanism to give the
- illusion of running as root.
- To keep track of "fake" file ownership and permissions resulting from
- operations that require root permissions, an sqlite3
- database is used.
- This database is stored in
- <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}/pseudo/files.db</filename>
- for individual recipes.
- Storing the database in a file as opposed to in memory
- gives persistence between tasks, and even between builds.
- <note><title>Caution</title>
- If you add your own task that manipulates the same files or
- directories as a fakeroot task, then that task should also run
- under fakeroot.
- Otherwise, the task will not be able to run root-only operations,
- and will not see the fake file ownership and permissions set by the
- other task.
- You should also add a dependency on
- <filename>virtual/fakeroot-native:do_populate_sysroot</filename>,
- giving the following:
- <literallayout class='monospaced'>
- fakeroot do_mytask () {
- ...
- }
- do_mytask[depends] += "virtual/fakeroot-native:do_populate_sysroot"
- </literallayout>
- </note>
- For more information, see the
- <ulink url='&YOCTO_DOCS_BB_URL;#var-FAKEROOT'><filename>FAKEROOT*</filename></ulink>
- variables in the BitBake User Manual.
- You can also reference this
- <ulink url='http://www.ibm.com/developerworks/opensource/library/os-aapseudo1/index.html'>Pseudo</ulink>
- article.
- </para>
-</section>
-
<section id="wayland">
<title>Wayland</title>
I don't have much on this in the manual set.
Is there any more information we can leverage?
For information on Fakeroot and Pseudo, see the
- "<ulink url='&YOCTO_DOCS_REF_URL;#fakeroot-and-pseudo'>Fakeroot and Pseudo</ulink>"
- section in the Yocto Project Reference Manual.
+ "<ulink url='&YOCTO_DOCS_OVERVIEW_URL;#fakeroot-and-pseudo'>Fakeroot and Pseudo</ulink>"
+ section in the Yocto Project Overview Manual.
</para></listitem>
<listitem><para role='writernotes'>
<emphasis>OPKG:</emphasis>