diff options
Diffstat (limited to 'documentation/ref-manual/technical-details.xml')
-rw-r--r-- | documentation/ref-manual/technical-details.xml | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/documentation/ref-manual/technical-details.xml b/documentation/ref-manual/technical-details.xml index b30dfe8597..2b4f2d933c 100644 --- a/documentation/ref-manual/technical-details.xml +++ b/documentation/ref-manual/technical-details.xml | |||
@@ -13,78 +13,6 @@ | |||
13 | x32, Wayland support, and Licenses. | 13 | x32, Wayland support, and Licenses. |
14 | </para> | 14 | </para> |
15 | 15 | ||
16 | <section id='fakeroot-and-pseudo'> | ||
17 | <title>Fakeroot and Pseudo</title> | ||
18 | |||
19 | <para> | ||
20 | Some tasks are easier to implement when allowed to perform certain | ||
21 | operations that are normally reserved for the root user. | ||
22 | For example, the | ||
23 | <link linkend='ref-tasks-install'><filename>do_install</filename></link> | ||
24 | task benefits from being able to set the UID and GID of installed files | ||
25 | to arbitrary values. | ||
26 | </para> | ||
27 | |||
28 | <para> | ||
29 | One approach to allowing tasks to perform root-only operations | ||
30 | would be to require BitBake to run as root. | ||
31 | However, this method is cumbersome and has security issues. | ||
32 | The approach that is actually used is to run tasks that benefit from | ||
33 | root privileges in a "fake" root environment. | ||
34 | Within this environment, the task and its child processes believe that | ||
35 | they are running as the root user, and see an internally consistent | ||
36 | view of the filesystem. | ||
37 | As long as generating the final output (e.g. a package or an image) | ||
38 | does not require root privileges, the fact that some earlier steps ran | ||
39 | in a fake root environment does not cause problems. | ||
40 | </para> | ||
41 | |||
42 | <para> | ||
43 | The capability to run tasks in a fake root environment is known as | ||
44 | "fakeroot", which is derived from the BitBake keyword/variable | ||
45 | flag that requests a fake root environment for a task. | ||
46 | In current versions of the OpenEmbedded build system, | ||
47 | the program that implements fakeroot is known as Pseudo. | ||
48 | </para> | ||
49 | |||
50 | <para> | ||
51 | Pseudo overrides system calls through the | ||
52 | <filename>LD_PRELOAD</filename> mechanism to give the | ||
53 | illusion of running as root. | ||
54 | To keep track of "fake" file ownership and permissions resulting from | ||
55 | operations that require root permissions, an sqlite3 | ||
56 | database is used. | ||
57 | This database is stored in | ||
58 | <filename>${</filename><link linkend='var-WORKDIR'><filename>WORKDIR</filename></link><filename>}/pseudo/files.db</filename> | ||
59 | for individual recipes. | ||
60 | Storing the database in a file as opposed to in memory | ||
61 | gives persistence between tasks, and even between builds. | ||
62 | <note><title>Caution</title> | ||
63 | If you add your own task that manipulates the same files or | ||
64 | directories as a fakeroot task, then that task should also run | ||
65 | under fakeroot. | ||
66 | Otherwise, the task will not be able to run root-only operations, | ||
67 | and will not see the fake file ownership and permissions set by the | ||
68 | other task. | ||
69 | You should also add a dependency on | ||
70 | <filename>virtual/fakeroot-native:do_populate_sysroot</filename>, | ||
71 | giving the following: | ||
72 | <literallayout class='monospaced'> | ||
73 | fakeroot do_mytask () { | ||
74 | ... | ||
75 | } | ||
76 | do_mytask[depends] += "virtual/fakeroot-native:do_populate_sysroot" | ||
77 | </literallayout> | ||
78 | </note> | ||
79 | For more information, see the | ||
80 | <ulink url='&YOCTO_DOCS_BB_URL;#var-FAKEROOT'><filename>FAKEROOT*</filename></ulink> | ||
81 | variables in the BitBake User Manual. | ||
82 | You can also reference this | ||
83 | <ulink url='http://www.ibm.com/developerworks/opensource/library/os-aapseudo1/index.html'>Pseudo</ulink> | ||
84 | article. | ||
85 | </para> | ||
86 | </section> | ||
87 | |||
88 | <section id="wayland"> | 16 | <section id="wayland"> |
89 | <title>Wayland</title> | 17 | <title>Wayland</title> |
90 | 18 | ||