summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCatalin Scrieciu <catalin.scrieciu@enea.com>2018-01-23 16:42:38 +0100
committerCatalin Scrieciu <catalin.scrieciu@enea.com>2018-01-23 16:42:38 +0100
commit42a31a57edf6b731f90a792d81d568435eecabb7 (patch)
tree588d516b05130a400718b39e0defe05ebe75fc50
parent991e53bce2c59ec2e3e29c4fb6983010ab5d88d6 (diff)
downloadel_releases-standard-42a31a57edf6b731f90a792d81d568435eecabb7.tar.gz
Restructuring Getting Started chapter in the User's Guide and fixing minor bugs in several other sections and documents
-rw-r--r--doc/book-enea-linux-release-info/doc/known_bugs_and_limitations.xml2
-rw-r--r--doc/book-enea-linux-user-guide/doc/application_development.xml2
-rw-r--r--doc/book-enea-linux-user-guide/doc/book.xml4
-rw-r--r--doc/book-enea-linux-user-guide/doc/getting_enea_linux.xml156
-rw-r--r--doc/book-enea-linux-user-guide/doc/prerequisites_and_requirements.xml101
-rw-r--r--doc/book-enea-linux-user-guide/doc/using_enea_linux.xml780
6 files changed, 1042 insertions, 3 deletions
diff --git a/doc/book-enea-linux-release-info/doc/known_bugs_and_limitations.xml b/doc/book-enea-linux-release-info/doc/known_bugs_and_limitations.xml
index 9fda0a9..2f7a41d 100644
--- a/doc/book-enea-linux-release-info/doc/known_bugs_and_limitations.xml
+++ b/doc/book-enea-linux-release-info/doc/known_bugs_and_limitations.xml
@@ -2,7 +2,7 @@
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> 3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<chapter id="bugs-limitations"> 4<chapter id="bugs-limitations">
5 <title>Known Problems in This Release</title> 5 <title>Known Problems in this Release</title>
6 6
7 <para>Open source projects are continuously working on correcting reported 7 <para>Open source projects are continuously working on correcting reported
8 problems. Corrections to bugs detected by Enea are submitted upstream, and 8 problems. Corrections to bugs detected by Enea are submitted upstream, and
diff --git a/doc/book-enea-linux-user-guide/doc/application_development.xml b/doc/book-enea-linux-user-guide/doc/application_development.xml
index c8ee28c..3458d39 100644
--- a/doc/book-enea-linux-user-guide/doc/application_development.xml
+++ b/doc/book-enea-linux-user-guide/doc/application_development.xml
@@ -15,7 +15,7 @@
15 applications as usual and get them compiled for your target. Below you see 15 applications as usual and get them compiled for your target. Below you see
16 how to cross-compile from the command line. If Eclipse is installed, you 16 how to cross-compile from the command line. If Eclipse is installed, you
17 can also cross-compile your code from the Eclipse IDE. For more details, 17 can also cross-compile your code from the Eclipse IDE. For more details,
18 see <xref linkend="enea-linux-eclipse-cross-compile" />.</para> 18 see <xref linkend="crosscomp" />.</para>
19 19
20 <orderedlist> 20 <orderedlist>
21 <listitem> 21 <listitem>
diff --git a/doc/book-enea-linux-user-guide/doc/book.xml b/doc/book-enea-linux-user-guide/doc/book.xml
index f449974..6e131b3 100644
--- a/doc/book-enea-linux-user-guide/doc/book.xml
+++ b/doc/book-enea-linux-user-guide/doc/book.xml
@@ -12,7 +12,9 @@
12 <xi:include href="../../s_docbuild/template/docsrc_common/bookinfo_userdoc.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 12 <xi:include href="../../s_docbuild/template/docsrc_common/bookinfo_userdoc.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
13 <xi:include href="preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 13 <xi:include href="preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
14 <xi:include href="introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 14 <xi:include href="introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
15 <xi:include href="getting_started.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 15 <xi:include href="prerequisites_and_requirements.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
16 <xi:include href="getting_enea_linux.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
17 <xi:include href="using_enea_linux.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
16 <xi:include href="application_development.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 18 <xi:include href="application_development.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
17 <xi:include href="using_eclipse.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 19 <xi:include href="using_eclipse.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
18 <xi:include href="troubleshooting.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /> 20 <xi:include href="troubleshooting.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
diff --git a/doc/book-enea-linux-user-guide/doc/getting_enea_linux.xml b/doc/book-enea-linux-user-guide/doc/getting_enea_linux.xml
new file mode 100644
index 0000000..772d8e3
--- /dev/null
+++ b/doc/book-enea-linux-user-guide/doc/getting_enea_linux.xml
@@ -0,0 +1,156 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<chapter>
3 <title id="gettingel">Getting Enea Linux</title>
4
5 <para>Enea Linux is available as both pre-built binary images and source
6 code. Both serve a specific purpose and each have their advantages. However,
7 using the pre-built binary images allows for getting up and running faster.
8 Please refer to the sections below for details on how to get Enea Linux as
9 pre-built binary images or source code.</para>
10
11 <section id="gettingbin">
12 <title>Getting Pre-Built Binaries</title>
13
14 <para>Enea Linux pre-built binaries are available for download on <ulink
15 url="https://portal.enea.com/login/?redirect_to=https%3A%2F%2Fportal.enea.com%2F">Enea
16 Download Portal</ulink>. Log in using the credentials provided. Using the
17 menu, browse to the <emphasis role="bold">Linux</emphasis> section. You
18 will now have access to the <emphasis role="bold">Files</emphasis> section
19 and the <emphasis role="bold">Online Documentation</emphasis>
20 section.</para>
21
22 <para>The Files section lists each Enea Linux distribution, one for each
23 version and profile, as a separate download package. Clicking on the name
24 of the distribution will open a new page, which presents further details
25 about the content of the release and a list of downloadable archives, one
26 for each hardware target included in the release. Each archive provides
27 the following content:</para>
28
29 <itemizedlist>
30 <listitem>
31 <para><emphasis>images</emphasis> directory - this directory includes
32 the binary image files needed to boot the target with Enea Linux. This
33 includes the kernel, the root file system, device tree, etc.</para>
34 </listitem>
35
36 <listitem>
37 <para><emphasis>sdk</emphasis> directory - this directory includes the
38 installer for the SDK.</para>
39 </listitem>
40
41 <listitem>
42 <para><emphasis>deb</emphasis> directory - this directory contains all
43 the packages included in the distribution in deb format, which can be
44 installed using the package manager.</para>
45 </listitem>
46 </itemizedlist>
47
48 <para>For faster downloads, each archive is mirrored in several places,
49 geographically. Choose the archive in the region closest to you.</para>
50
51 <para>The Documentation section lists all the documents delivered with the
52 release.</para>
53 </section>
54
55 <section id="gettingsources">
56 <title>Getting the Sources</title>
57
58 <para>Enea Linux sources are available for cloning from a set of Git
59 repositories on <ulink url="https://git.enea.com">git.enea.com</ulink>.
60 Since Enea Linux requires multiple repositories, Google Repo tool is used
61 in order to manage configurations and make the cloning step simpler.
62 Google Repo tool uses files, known as manifests, which store a list of
63 tuples (repository URL, version). The Repo tool is then used to traverse
64 the list of tuples in the manifest file and clone the specified versions
65 of each repository. See <ulink
66 url="https://code.google.com/p/git-repo/">https://code.google.com/p/git-repo/</ulink>
67 for more info.</para>
68
69 <section id="getting-source-code-step-one">
70 <title>Get access to git.enea.com</title>
71
72 <para>In order to get access to git.enea.com, a ssh key is required for
73 Git authentication. If you don't already have such a key, follow the
74 steps below to generate one:</para>
75
76 <orderedlist>
77 <listitem>
78 <para>Generate the ssh key pair:</para>
79
80 <programlisting>$ ssh-keygen -t rsa</programlisting>
81
82 <para>When asked for a password, just press Enter. This will create
83 two files in the .ssh directory in your home directory.</para>
84
85 <programlisting>id_rsa
86id_rsa.pub</programlisting>
87 </listitem>
88
89 <listitem>
90 <para>Copy the public key into an authorized_keys file:</para>
91
92 <programlisting>$ cat id_rsa.pub &gt;&gt; authorized_keys</programlisting>
93 </listitem>
94 </orderedlist>
95
96 <para>Once these steps are done and you have a valid ssh key pair, send
97 the public key, <emphasis>id_rsa.pub</emphasis>, via email to
98 <email>mailto:git_support@list.enea.se</email> in order to get access to
99 <ulink url="https://git.enea.com">git.enea.com</ulink>.</para>
100 </section>
101
102 <section id="getting-source-code-step-two">
103 <title>Get Sources</title>
104
105 <para>To use the Repo tool to download the sources for Enea Linux, do
106 the following:</para>
107
108 <orderedlist>
109 <listitem>
110 <para>Make sure that the repo tool is installed. If not, do the
111 following: <remark>Below is include of ID
112 "eltf-getting-repo-install-command" from
113 eltf_params_updated.xml</remark></para>
114
115 <xi:include href="../../book-enea-linux-release-info/doc/eltf_params_updated.xml"
116 xmlns:xi="http://www.w3.org/2001/XInclude"
117 xpointer="element(eltf-getting-repo-install-command/1)" />
118 </listitem>
119
120 <listitem>
121 <para>Define the <filename>MACHINE</filename> from one of the
122 targets listed here:<remark>Below is the "machine_list"
123 programlisting in machine_list_generated.xml created by the make
124 system by extracting from the manifest</remark><itemizedlist>
125 <listitem>
126 <para>raspberrypi3-64</para>
127 </listitem>
128 </itemizedlist></para>
129 </listitem>
130
131 <listitem>
132 <para>Then use the repo command below:</para>
133
134 <xi:include href="../../book-enea-linux-release-info/doc/eltf_params_updated.xml"
135 xmlns:xi="http://www.w3.org/2001/XInclude"
136 xpointer="element(eltf-repo-cloning-enea-linux/1)" />
137 </listitem>
138 </orderedlist>
139
140 <para>Once the source code is downloaded, the current directory will
141 contain a <filename>README</filename> file with instructions on how to
142 build the distro and boot the machine you choose. .</para>
143
144 <para>It's not necessary to explicitly clone the manifest repository
145 since that is done automatically by the repo tool. To see the current
146 manifest, use the following command:</para>
147
148 <programlisting>$ repo manifest</programlisting>
149
150 <remark>The UG should be updated with instructions on how to add
151 customizations. That section should also contain more info about the
152 manifest: the manifest templates, using a branch instead of the tag EL6,
153 etc. When this is done a reference from here should be added.</remark>
154 </section>
155 </section>
156</chapter> \ No newline at end of file
diff --git a/doc/book-enea-linux-user-guide/doc/prerequisites_and_requirements.xml b/doc/book-enea-linux-user-guide/doc/prerequisites_and_requirements.xml
new file mode 100644
index 0000000..d560eb6
--- /dev/null
+++ b/doc/book-enea-linux-user-guide/doc/prerequisites_and_requirements.xml
@@ -0,0 +1,101 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<chapter>
3 <title id="prereq">Prerequisites and Requirements</title>
4
5 <para>Building Enea Linux or compiling applications requires that your git
6 environment be setup properly and for certain packages to be installed on
7 your Linux development host. The following chapter details the
8 configurations needed on the build environment in order to properly use Enea
9 Linux.</para>
10
11 <section id="gitconfig">
12 <title>Git Configuration</title>
13
14 <para>If you intend to get Enea Linux sources and build Enea Linux
15 yourself, you will need Git installed in your build environemtn. Please
16 refer to <ulink
17 url="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup">Getting
18 Started - First-Time Git Setup</ulink>, for more details on how to set up
19 your git environment correctly, including how to set your identity using
20 the following commands:</para>
21
22 <programlisting>$ git config --global user.name "John Doe"
23$ git config --global user.email johndoe@example.com</programlisting>
24 </section>
25
26 <section id="hostpackages">
27 <title>Host Packages</title>
28
29 <para>In order to work with Enea Linux, you need a set of tools installed
30 on the build machine, depending on the scenario you use. The following
31 chapters will describe what tools to install on the build machine.</para>
32
33 <section id="prebuiltprereq">
34 <title>Using Pre-Build Binaries</title>
35
36 <para>Using the pre-built binaries, you can get up and running more
37 quickly. Since building is not required, there are not a lot of packaes
38 and tools that need to be installed but a few are still required:</para>
39
40 <itemizedlist>
41 <listitem>
42 <para>wget - for downloading the Enea Linux binaries</para>
43 </listitem>
44
45 <listitem>
46 <para>tar - for decompressing the Enea Linux release</para>
47 </listitem>
48
49 <listitem>
50 <para>tftpboot server - for deploying Enea Linux on target</para>
51 </listitem>
52
53 <listitem>
54 <para>NFS server - in case you want to mount the root file system
55 over NFS</para>
56 </listitem>
57 </itemizedlist>
58 </section>
59
60 <section id="hostprereqpackages">
61 <title>Required Packages for the Host Development System</title>
62
63 <para>Building Enea Linux requires a set of packages to be installed on
64 your Linux development host. The list of required packages is described
65 in the <ulink
66 url="https://www.yoctoproject.org/docs/2.3/ref-manual/ref-manual.html#required-packages-for-the-host-development-system">Yocto
67 Project reference manual</ulink>.</para>
68 </section>
69 </section>
70
71 <section id="sysshell_config">
72 <title>Default Shell Configuration</title>
73
74 <para>Before installing Enea Linux, make sure that
75 <filename>bash</filename> is the default shell.</para>
76
77 <para><emphasis role="bold">To verify the default system
78 shell</emphasis></para>
79
80 <itemizedlist>
81 <listitem>
82 <para>If your system runs Ubuntu, use list to verify if
83 <filename>/usr/bin</filename> is a symbolic link to <emphasis
84 role="bold">bash</emphasis>:</para>
85
86 <programlisting># ls -l /bin/sh
87lrwxrwxrwx 1 root root 4 2012-03-02 11:53 /bin/sh -&gt; bash</programlisting>
88 </listitem>
89
90 <listitem>
91 <para>Optionally, in case the link points to <literal>dash</literal>,
92 change it through the following steps:</para>
93
94 <programlisting># ls -l /bin/sh
95lrwxrwxrwx 1 root root 4 2012-03-02 11:53 /bin/sh -&gt; dash
96# sudo dpkg-reconfigure dash
97Use dash as the default system shell (/bin/sh)? No</programlisting>
98 </listitem>
99 </itemizedlist>
100 </section>
101</chapter> \ No newline at end of file
diff --git a/doc/book-enea-linux-user-guide/doc/using_enea_linux.xml b/doc/book-enea-linux-user-guide/doc/using_enea_linux.xml
new file mode 100644
index 0000000..a880500
--- /dev/null
+++ b/doc/book-enea-linux-user-guide/doc/using_enea_linux.xml
@@ -0,0 +1,780 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<chapter id="usingenealinux">
3 <title>Using Enea Linux</title>
4
5 <section id="buildingenealinux">
6 <title>Building Enea Linux</title>
7
8 <para>Enea Linux is made available as sources as well. This allows
9 building various Enea Linux artifacts and this is detailed in the
10 following sections:</para>
11
12 <section>
13 <title>Building the images</title>
14
15 <para>Build Enea Linux images using the following steps:</para>
16
17 <procedure>
18 <step>
19 <para>Clone Enea Linux sources using Repo tool. Please refer to
20 chapter 3.2 in the current documebt for more details on how to do
21 this.</para>
22
23 <programlisting>$ mkdir enea-linux
24$ cd enea-linux
25$ export MACHINE=&lt;machine&gt;
26$ repo init -u git@git.enea.com:linux/manifests/el_manifests-standard.git \
27 -b refs/tags/Enea_Linux_7.0 -m $MACHINE/default.xml
28$ repo sync</programlisting>
29 </step>
30
31 <step>
32 <para>Source the build environment</para>
33
34 <programlisting>$ cd poky
35$ TEMPLATECONF=meta-el-standard/conf/template.&lt;machine&gt; \
36. ./oe-init-build-env &lt;build_dir&gt;</programlisting>
37
38 <note>
39 <para>Sourcing the build environment is needed everytime a new
40 shell is used. However, sourcing using the
41 <literal>TEMPLATECONF</literal> is only needed the first time
42 around. Afterwards it is enough to source the build directory
43 created before.</para>
44 </note>
45
46 <note>
47 <para>The build directory may reside on an NFS mount, but the
48 <literal>TMPDIR</literal>
49 (<literal>&lt;build_dir&gt;/tmp</literal>) may not. Either build
50 all on a local disk, or update <literal>TMPDIR</literal> in
51 <literal>conf/local.conf</literal> to point to a local
52 disk.</para>
53 </note>
54 </step>
55
56 <step>
57 <para>Build Enea Linux image</para>
58
59 <programlisting># You have already initiated the build environment and are in the &lt;build_dir&gt;
60$ bitbake &lt;enea-image-name&gt;
61$ cd &lt;build_dir&gt;/tmp/deploy/images/&lt;target&gt;/ # Here are the build binaries</programlisting>
62
63 <note>
64 <para>Some builds have restrictions on the length of the path
65 name. If you get a build error indicating that the length is too
66 long, you need to move your build to obtain a shorter path.</para>
67 </note>
68
69 <para>Generated images are by default saved in
70 <literal><literal>&lt;build_dir&gt;/tmp/deploy/images/&lt;target&gt;</literal></literal>,
71 where <literal>&lt;build_dir&gt;</literal> by default is the current
72 working directory. Images are created for emulation on host or for
73 booting a physical target, according to how the build environment
74 was set up before running bitbake.</para>
75
76 <para>Depending on the number of processors and cores, the amount or
77 RAM, the speed of your Internet connection and other factors, the
78 build process can take several hours the first time you run it.
79 Subsequent builds run much faster since parts of the build are
80 cached.</para>
81
82 <note>
83 <para>Make sure that the user running the build has access to the
84 Git repositories on git.enea.com. The build process fetches
85 information from git.enea.com so the user running the build shall
86 have the ssh key properly configured. Please refer to <xref
87 linkend="gettingsources" /> for more details on how to get access
88 to Enea Linux sources.</para>
89 </note>
90 </step>
91 </procedure>
92 </section>
93
94 <section>
95 <title>Building the SDK</title>
96
97 <para>If you want to rebuild a cross-compilation toolchain to be used by
98 in application development, use the following steps:</para>
99
100 <procedure>
101 <step>
102 <para>Clone Enea Linux sources using Repo tool. Please refer to
103 <xref linkend="gettingsources" /> for more details on how to do
104 this.</para>
105
106 <programlisting>$ mkdir enea-linux
107$ cd enea-linux
108$ export MACHINE=&lt;machine&gt;
109$ repo init -u git@git.enea.com:linux/manifests/el_manifests-standard.git \
110 -b refs/tags/Enea_Linux_7.0 -m $MACHINE/default.xml
111$ repo sync</programlisting>
112 </step>
113
114 <step>
115 <para>Source the build environment</para>
116
117 <programlisting>$ cd poky
118$ TEMPLATECONF=meta-el-standard/conf/template.&lt;machine&gt; \
119. ./oe-init-build-env &lt;build_dir&gt;</programlisting>
120
121 <note>
122 <para>Sourcing the build environment is needed everytime a new
123 shell is used. However, sourcing using the
124 <literal>TEMPLATECONF</literal> is only needed the first time
125 around. Afterwards it is enough to source the build directory
126 created before.</para>
127 </note>
128
129 <note>
130 <para>The build directory may reside on an NFS mount, but the
131 <literal>TMPDIR</literal>
132 (<literal>&lt;build_dir&gt;/tmp</literal>) may not. Either build
133 all on a local disk, or update TMPDIR in conf/local.conf to point
134 to a local disk.</para>
135 </note>
136 </step>
137
138 <step>
139 <para>Build Enea Linux image</para>
140
141 <programlisting># You have already initiated the build environment and are in the &lt;build_dir&gt;
142$ bitbake &lt;enea-image-name&gt; -c populate_sdk_ext
143$ cd &lt;build_dir&gt;/tmp/deploy/sdk/ # Here is the SDK installer script</programlisting>
144
145 <note>
146 <para>Some builds have restrictions on the length of the path
147 name. If you get a build error indicating that the length is too
148 long, you need to move your build to obtain a shorter path.</para>
149 </note>
150
151 <para>Generated SDK installer script is by default saved in
152 <literal>&lt;build_dir&gt;/tmp/deploy/sdk</literal>, where
153 <literal>&lt;build_dir&gt;</literal> by default is the current
154 working directory.</para>
155
156 <para>Depending on the number of processors and cores, the amount or
157 RAM, the speed of your Internet connection and other factors, the
158 build process can take several hours the first time you run it.
159 Subsequent builds run much faster since parts of the build are
160 cached.</para>
161
162 <para>For more details on how to install and use the SDK, please
163 refer to <xref linkend="install_el_sdk" />.</para>
164 </step>
165 </procedure>
166 </section>
167 </section>
168
169 <section id="bootingenealinux">
170 <title>Booting Enea Linux</title>
171
172 <para>Regardless whether you decide to use the pre-built images or if you
173 choose to build your own, the end result should be similar. Once you have
174 the artifacts availalbe, you may proceed to booting Enea Linux on
175 target.</para>
176
177 <para>Enea Linux supports multiple booting methods so those will be
178 described in the following sections.</para>
179
180 <section>
181 <title>Boot from RAM</title>
182
183 <para>This example requires that a TFTP server is set up at IP address
184 <literal>&lt;tftp_server_ip&gt;</literal>, and that the server stores
185 the Enea Linux image files, kernel image, device tree blob and root
186 filesystem, in <literal>/tftpboot/&lt;download_directory&gt;.</literal>
187 Please refer to <xref linkend="prebuiltprereq" /> for more details on
188 how to install and configure the TFTP server.</para>
189
190 <para>Once you have that in place, run the following commands on the
191 target:</para>
192
193 <programlisting>## set tftp server IP
194U-Boot&gt; setenv serverip &lt;tftp_server_ip&gt;
195
196## tftp the image files on the target machine
197U-Boot&gt; tftpboot 0x01000000 Image
198U-Boot&gt; tftpboot 0x02000000 Image-bcm2837-rpi-3-b.dtb
199U-Boot&gt; tftpboot 0x03000000 enea-image-standard-raspberrypi3-64.ext2.gz.u-boot
200
201## add any other bootargs values if necessary
202U-Boot&gt; setenv bootargs "8250.nr_uarts=1 root=/dev/ram rw ramdisk_size=500000 ip=dhcp \
203console=ttyS0,115200"
204
205## Start boot sequence
206U-Boot&gt; booti 0x01000000 0x03000000 0x02000000</programlisting>
207 </section>
208
209 <section>
210 <title>Boot from SD card</title>
211
212 <para>Copy the
213 <filename>enea-image-standard-raspberrypi3-64.rpi-sdimg</filename> image
214 to the SD card using the Linux dd tool or Win32DiskImager in Windows,
215 and insert it into the RPi. The Raspberry Pi will not start without a
216 properly formatted SD Card, containing the bootloader, kernel image and
217 rootfs.</para>
218
219 <para>Below you can find two methods of how to format an SD Card:</para>
220
221 <itemizedlist>
222 <listitem>
223 <para><emphasis role="bold">Format and copy images to the SD card
224 using the Linux dd command line</emphasis></para>
225
226 <para>The <command>dd</command> command copies a file, converting
227 the format of the data in the process, according to the operands
228 specified:</para>
229
230 <programlisting>sudo dd bs=4M if=enea-image-standard-sdk-raspberrypi3-64.rpi-sdimg of=/dev/sdg</programlisting>
231
232 <note>
233 <para>Use <command>dd</command> cautiously - improper usage or
234 entering the wrong values could inadvertently wipe, destroy, or
235 overwrite the data on your hard drive.</para>
236 </note>
237 </listitem>
238
239 <listitem>
240 <para><emphasis role="bold">Format the SD card using the
241 Win32DiskImager program</emphasis></para>
242
243 <orderedlist>
244 <listitem>
245 <para>Download and unzip <ulink
246 url="https://sourceforge.net/projects/win32diskimager/">Win32DiskImager</ulink></para>
247 </listitem>
248
249 <listitem>
250 <para>Run <filename>Win32DiskImager.exe</filename></para>
251 </listitem>
252
253 <listitem>
254 <para>Select the drive of your SD card</para>
255 </listitem>
256
257 <listitem>
258 <para>Select the image
259 <filename><filename>enea-image-standard-raspberrypi3-64.rpi-sdimg</filename></filename></para>
260 </listitem>
261
262 <listitem>
263 <para>Click "Write" and wait for the write to complete</para>
264 </listitem>
265
266 <listitem>
267 <para>Exit the imager and eject the SD Card</para>
268 </listitem>
269
270 <listitem>
271 <para>Plug the card into your Raspberry Pi</para>
272 </listitem>
273 </orderedlist>
274
275 <note>
276 <para>Be careful to select the correct drive. If you choose the
277 wrong one you may destroy your HDD data. If you are using an SD
278 Card slot and can't see the drive in the Win32DiskImager window,
279 try using an affordable external adapter in a USB slot.</para>
280 </note>
281 </listitem>
282 </itemizedlist>
283 </section>
284 </section>
285
286 <section id="custom_enealinux">
287 <title>Customizing Enea Linux</title>
288
289 <section id="layers_adaptations">
290 <title>Layers and Adaptations</title>
291
292 <para>Bitbake allows a modular approach of Metadata, by building images
293 for the layers listed in the conf/bblayers.conf file from your build
294 directory.</para>
295
296 <para>To avoid polluting the build with unnecessary packages, before
297 adding a new layer, it is recommended to check if the Metadata you need
298 is already available in the enabled layers, in which case, for the
299 intended configuration, it may require less modification.</para>
300
301 <para>To ease further use of the layer, try to follow as many best
302 practices as possible when creating it:</para>
303
304 <itemizedlist>
305 <listitem>
306 <para>Use names starting with the meta prefix (although this is not
307 a requirement)</para>
308 </listitem>
309 </itemizedlist>
310
311 <itemizedlist>
312 <listitem>
313 <para>Place your layer under poky</para>
314 </listitem>
315 </itemizedlist>
316
317 <itemizedlist>
318 <listitem>
319 <para>Isolate different customizations by layer</para>
320 </listitem>
321 </itemizedlist>
322
323 <itemizedlist>
324 <listitem>
325 <para>Assign the layer to a repository (to easily have access to
326 maintenance)</para>
327 </listitem>
328 </itemizedlist>
329
330 <para>To enable a layer, its top path must be specified in the
331 <filename>BBLAYERS</filename> variable, as follows:</para>
332
333 <programlisting># POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
334# changes incompatibly
335POKY_BBLAYERS_CONF_VERSION = "2"
336
337BBPATH = "${TOPDIR}"
338BBFILES ?= ""
339
340BBLAYERS ?= " \
341 /path/to/poky/meta \
342 /path/to/poky/meta-el-common \
343 /path/to/poky/meta-el-standard \
344 /path/to/poky/meta-enea-bsp-common \
345 /path/to/poky/meta-enea-bsp-&lt;arch&gt; \
346 /path/to/poky/meta-fsl-&lt;arch&gt; \
347 /path/to/poky/meta-openembedded/meta-oe \
348 /path/to/poky/meta-openembedded/meta-networking \
349 /path/to/poky/meta-openembedded/meta-filesystems \
350 /path/to/poky/meta-openembedded/meta-python \
351 /path/to/poky/meta-poky \
352 /path/to/poky/meta-&lt;layer&gt; \
353 "</programlisting>
354
355 <para>Before adding an extra layer, please keep in mind that the order
356 of layers is important (due to BitBake parsing conf/layer.conf as
357 specified in <filename>BBLAYERS</filename>). To add an extra layer, you
358 can modify the <filename>build/conf/bblayers.conf</filename> file in the
359 source code editor you prefer, as described above, or use one of the
360 specially designed Yocto tools.</para>
361
362 <para>To do such, you can simply modify the build/conf/bblayers.conf
363 file in the source code editor you prefer, as described above, or use
364 one of the specially designed Yocto tools.</para>
365
366 <para>For instance, in addition to the above, the Yocto Bitbake layers
367 utility ensures a very useful checking of some basic layer requirements.
368 Bitbake layers are available, as most of the BitBake tools, when
369 sourcing oe-init-build-env. Therefore, to enable a custom meta layer,
370 you should simply run the following from the build directory:</para>
371
372 <programlisting>bitbake-layers add-layer &lt;meta-layer&gt;</programlisting>
373
374 <para>If the specified layer doesn't contain a
375 <filename>conf/layer.conf</filename> file, you should add one with the
376 needed configuration. Also, to make sure the layer insertion is done in
377 the right metadata, the utility looks for the bblayers.conf
378 configuration file in the corresponding path, which should be satisfied
379 if running the command from the generated build directory.</para>
380
381 <para>For further information on this or on other utilities belonging to
382 the same suite, run:</para>
383
384 <programlisting>bitbake-layers -h</programlisting>
385
386 <para>As a result, <filename>BBLAYERS</filename> shall be extended with
387 the bsp-layer/s layer for your target and any other additional layer/s.
388 For details on how to do this, see the <ulink
389 url="http://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#understanding-and-creating-layers">Yocto
390 2.3 Dev Manual, section &lt;Understanding and Creating
391 Layers&gt;</ulink> . If needed replace the Yocto version.</para>
392
393 <para>Layers can be added when you initialize the build environment. The
394 layers required for each target are specified in the build commands in
395 the Enea Linux distribution's Release Information.</para>
396
397 <para>Each Enea Linux customer is advised to add a custom layer for
398 customer-specific additions and customizations, instead of modifying
399 existing layers.</para>
400
401 <para>The recommended way to modify a package is to edit directly in the
402 recipe file. Utilizing the devshell, <literal>bitbake -c devshell
403 &lt;image_name&gt;</literal>, when constructing or modifying recipes is
404 really handy when experimenting, but do not forget to make the final
405 updates directly in the recipe file. It is difficult to keep track of
406 exactly what in the user environment is "dirty" and not in sync with
407 current recipes. Therefore, always make sure to <literal>bitbake -c
408 clean &lt;image_name&gt;</literal> after finishing up a devshell
409 session, and adapt recipes accordingly to ensure a shareable and
410 repeatable build environment.</para>
411 </section>
412
413 <section id="add_recipe">
414 <title>Adding a Recipe</title>
415
416 <para>Study the <ulink
417 url="https://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#new-recipe-single-c-file-package-hello-world"><ulink
418 url="https://www.yoctoproject.org/docs/2.3/dev-manual/dev-manual.html#new-recipe-single-c-file-package-hello-world">Hello
419 World recipe</ulink></ulink> in the Yocto Project Development Manual. If
420 needed replace the example version (2.3) with the Yocto version in your
421 Enea Linux distribution.</para>
422 </section>
423
424 <section id="config_pkg_recipes">
425 <title>Configuring Packages via Recipes</title>
426
427 <para>The default configuration produces a standard Linux installation,
428 but it is often desirable to configure specific packages in more detail.
429 Different packages implement their configuration in different ways, and
430 there is no single method that is valid for all packages. As always, in
431 a collaborative development environment, the developer should make sure
432 that the recipes in the custom layer are upgraded accordingly when a
433 reconfiguration of a specific package is done.</para>
434
435 <para>In subsequent sections you find examples on how to configure some
436 common packages.</para>
437
438 <section id="linux_kern">
439 <title>The Linux Kernel</title>
440
441 <para>The Linux kernel provides a vast array of configuration options,
442 managed using its own configuration system. The kernel package can be
443 supplied from different providers, and this example uses the
444 virtual/kernel package name to refer to the kernel used in the
445 build:</para>
446
447 <programlisting>$ bitbake -c menuconfig virtual/kernel</programlisting>
448
449 <note>
450 <para>menuconfig requires Ncurses. If the terminal that pops up
451 immediately closes instead of showing the menuconfig interface,
452 check that the Ncurses development library is installed.</para>
453 </note>
454
455 <para>First build the kernel:</para>
456
457 <programlisting>$ bitbake -f -c compile -c install -c deploy virtual/kernel</programlisting>
458
459 <para>Then build the whole distribution:</para>
460
461 <programlisting>$ bitbake enea-image-&lt;name&gt;</programlisting>
462 </section>
463
464 <section>
465 <title>Busybox</title>
466
467 <para>Busybox uses the same configuration system as the Linux kernel
468 and is therefore invoked similarly. In contrast to the kernel, there
469 is generally only one variant of busybox in a distribution and we can
470 therefore refer to it by the package name alone:</para>
471
472 <programlisting>$ bitbake -c menuconfig busybox</programlisting>
473 </section>
474 </section>
475
476 <section id="build_com_licenses">
477 <title>Building with Commercial Licenses</title>
478
479 <note>
480 <para>Adding commercial-licensed packages might pose distribution
481 problems due to license agreements or patents.</para>
482 </note>
483
484 <para>Commercial-licensed packages are not provided with Enea Linux.
485 Depending on your use case, you might need to extend the initial image
486 with more packages by adding recipes and updating the image definition,
487 always in accordance with the license conditions. To succeed with
488 building the customized image, you might need to solve dependencies by
489 adding even more packages.</para>
490
491 <para>Below is an example with steps on how to add a package with a
492 commercial license. The configuration is updated in two places and the
493 recipes are selected for the packages and any dependencies.</para>
494
495 <note>
496 <para>This is only an illustrating example, the exact configuration
497 may differ between different packages. Some packages could require
498 other defines added to local.conf and some packages might need an
499 added <filename>DEPENDS</filename> in the *.inc file, or other
500 particular changes.</para>
501 </note>
502
503 <itemizedlist>
504 <listitem>
505 <para>Append the package name to the
506 <filename>IMAGE_INSTALL</filename> definition, used in the recipe
507 corresponding to the image you will build, as in one of the examples
508 below:</para>
509
510 <orderedlist>
511 <listitem>
512 <para>If you need the package in a set of images, to avoid
513 defining it in each recipe, add the following line to
514 <filename>IMAGE_INSTALL</filename> in
515 <filename>meta-el-common/images/enea-image-common.inc</filename></para>
516
517 <programlisting> package_name \</programlisting>
518 </listitem>
519
520 <listitem>
521 <para>If you have specific images in which you need the package,
522 add the following line in the corresponding recipes in
523 meta-el-&lt;profile&gt;/images/enea-image-&lt;profile&gt;.bb</para>
524
525 <programlisting> IMAGE_INSTALL += " \
526 package_name \
527 "</programlisting>
528 </listitem>
529 </orderedlist>
530 </listitem>
531
532 <listitem>
533 <para>Add the required license to the
534 <filename>LICENSE_FLAGS_WHITELIST</filename> definition. This can be
535 done by adding script lines in the corresponding
536 scripts/conf_setup.sh file, which appends
537 <filename>LICENSE_FLAGS_WHITELIST +=
538 "&lt;suitable-license&gt;</filename> to
539 <filename>conf/local.conf.</filename></para>
540 </listitem>
541
542 <listitem>
543 <para>To mitigate the build errors caused by packages with
544 commercial licenses, you might also need to append the generic
545 license <filename>LICENSE_FLAGS_WHITELIST += "commercial"</filename>
546 in the same way as above.</para>
547 </listitem>
548
549 <listitem>
550 <para>Select the needed recipes for the packages and add these to
551 the build configuration.</para>
552 </listitem>
553
554 <listitem>
555 <para>Select the needed recipes to resolve dependencies for the new
556 packages and add these to the build configuration.</para>
557 </listitem>
558 </itemizedlist>
559
560 <para>More information about recipes can be found here:</para>
561
562 <itemizedlist>
563 <listitem>
564 <para><ulink
565 url="http://git.openembedded.org/">http://git.openembedded.org/</ulink></para>
566 </listitem>
567 </itemizedlist>
568
569 <itemizedlist>
570 <listitem>
571 <para><ulink
572 url="https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles">https://wiki.yoctoproject.org/wiki/Building_your_own_recipes_from_first_principles</ulink></para>
573 </listitem>
574 </itemizedlist>
575
576 <itemizedlist>
577 <listitem>
578 <para><ulink
579 url="http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#new-recipe-writing-a-new-recipe">http://www.yoctoproject.org/docs/current/dev-manual/dev-manual.html#new-recipe-writing-a-new-recipe</ulink></para>
580 </listitem>
581 </itemizedlist>
582 </section>
583 </section>
584
585 <section id="install_el_sdk">
586 <title>Installing the Enea Linux SDK</title>
587
588 <para>Before cross-compiling applications for your target, you need to
589 install the Software Development Kit (SDK) - which contains the
590 cross-compilation toolchain - and set up the cross-compilation environment
591 on your host. The toolchain for each supported target contains a 64-bit
592 library for gcc. The toolchain and the environment-setup script are
593 wrapped together inside a toolchain installer in the form of a shell
594 script.</para>
595
596 <para>The cross-compilation toolchain is packaged as follows:</para>
597
598 <itemizedlist>
599 <listitem>
600 <para>The &lt;target&gt; toolchain contains the lib64 (64-bit)
601 library.</para>
602 </listitem>
603
604 <listitem>
605 <para>The &lt;target&gt; installer has an environment-setup script
606 which will select the lib64 to be used by gcc. This way, a 64-bit
607 application can be cross-compiled.</para>
608 </listitem>
609 </itemizedlist>
610
611 <para>Do as in the example below to install the SDK and set up the
612 cross-compilation environment:</para>
613
614 <orderedlist>
615 <listitem>
616 <para>The fastest alternative is to use a precompiled
617 cross-compilation toolchain installer for your host and target.</para>
618
619 <para>Please refer to the Release Information document, in section 1.1
620 Provided Contents, for more details on where to find the pre-compiled
621 SDK installer.</para>
622 </listitem>
623
624 <listitem>
625 <para>Run the installer to unpack the cross-compilation toolchain and
626 the environment-setup script:</para>
627
628 <programlisting>$ chmod 770 enea-*-toolchain-&lt;version&gt;.sh
629$ ./enea-*-toolchain-&lt;version&gt;.sh</programlisting>
630
631 <para>When prompted, select to install the SDK in the desired
632 directory, referred to as &lt;sdkdir&gt;. The default path where the
633 SDK will be installed, will be shown in the prompt. The installer
634 unpacks the environment setup script in &lt;sdkdir&gt; and the
635 toolchain under &lt;sdkdir&gt;/sysroots.</para>
636
637 <note>
638 <para>Choose a unique directory for each toolchain. Installing a
639 second toolchain of any type (buildtools toolchain or
640 cross-compilation toolchain) in the same directory as a previously
641 installed one will break the $PATH variable of the first one.</para>
642 </note>
643 </listitem>
644
645 <listitem>
646 <para>Setup the toolchain environment for your target by sourcing the
647 environment-setup script:</para>
648
649 <programlisting>$ . &lt;sdkdir&gt;/environment-setup-&lt;arch&gt;-enea-linux</programlisting>
650
651 <para>Example:</para>
652
653 <programlisting>$ . /opt/enea/environment-setup-aarch64-enea-linux</programlisting>
654 </listitem>
655 </orderedlist>
656
657 <para>Once the cross-compilation toolchain is in place and the environment
658 set up, you can proceed with Cross-Compiling Applications from Command
659 Line (4.1) or, if Eclipse is installed, Cross-Compiling from Eclipse
660 (5.4.1).</para>
661 </section>
662
663 <section id="pkg_mg">
664 <title>Using Package Management</title>
665
666 <para>A Package Management System (PMS) can be used to customize your
667 image in a consistent way, e.g. to install, upgrade, or delete packages
668 considering the dependencies. The package management systems supported by
669 Enea Linux are described in this section. More information about PMS can
670 be found in the Yocto 2.3 document <ulink
671 url="http://www.yoctoproject.org/docs/2.3/mega-manual/mega-manual.html">Yocto
672 Project Mega Manual</ulink>. If needed replace the Yocto version in the
673 link.</para>
674
675 <section id="apt_pktmgmt">
676 <title>APT Package Management (DEB Packages)</title>
677
678 <para>Enea Linux provides DEB packages on <ulink
679 url="http://linux.enea.com/EneaLinux7.0/">linux.enea.com</ulink> site,
680 in directory
681 <literal><literal>&lt;release&gt;/&lt;target&gt;/deb</literal>/</literal>.</para>
682
683 <para>The application for performing runtime package management of DEB
684 packages on the target is called <filename>apt-get</filename>.</para>
685
686 <para>Use the <literal>apt-get</literal> command to install, upgrade, or
687 remove packages. Before using any apt-get options that require network
688 access, please check that the network is configured and working
689 properly.</para>
690
691 <para>The <literal>apt-get</literal> command is by default included in
692 Enea Linux images.</para>
693
694 <section id="apt_config">
695 <title>Configuring</title>
696
697 <para>APT relies on the concept of repositories in order to find
698 packages and resolve dependencies.</para>
699
700 <para>Any number of additional repositories can be added to APT's
701 configuration files (.list extension) located in sources.list.d
702 directory (e.g:
703 <filename>/etc/apt/sources.list.d/repos.list</filename>) and then be
704 queried by APT.</para>
705
706 <programlisting># touch /etc/apt/sources.list.d/repos.list
707# echo "deb [trusted=yes] http://server-address/path/to/the/package/directory ./" | \
708tee -a /etc/apt/sources.list.d/repos.list</programlisting>
709
710 <para>Run <literal>apt-get update</literal> to fetch information from
711 the new repository:</para>
712
713 <programlisting># apt-get update</programlisting>
714 </section>
715
716 <section id="apt_install">
717 <title>Installing</title>
718
719 <para>DEB packages typically have file names like
720 foo-1.0.1-r0.0_arm64.deb The file name includes the package name
721 (foo), version (1.0.1), revison (r0.0), and architecture (arm64). To
722 install a package, log in as root and type the following command at a
723 shell prompt:</para>
724
725 <programlisting># apt-get install foo</programlisting>
726
727 <para>The <literal>apt-get install</literal> command will install one
728 or more packages in the system.</para>
729 </section>
730
731 <section id="apt_upgrade">
732 <title>Upgrading</title>
733
734 <para>The <literal>apt-get upgrade</literal> command will upgrade one
735 or more packages which are currently installed in the system. If no
736 packages are given, all installed packages will be checked.</para>
737
738 <programlisting># apt-get upgrade foo</programlisting>
739 </section>
740
741 <section id="apt_rm">
742 <title>Removing</title>
743
744 <para>The <literal>apt-get remove</literal> command will remove one or
745 more packages which are currently installed in the system.
746 Example:</para>
747
748 <programlisting># apt-get remove ptest-runner
749Reading package lists... Done
750Building dependency tree
751Reading state information... Done
752The following packages were automatically installed and are no longer required:
753 libc6-dbg libc6-dev libc6-extra-nss libc6-thread-db libcidn1
754 linux-libc-headers-dev
755Use 'apt autoremove' to remove them.
756The following packages will be REMOVED:
757 ptest-runner
7580 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
759After this operation, 0 B of additional disk space will be used.
760Do you want to continue? [Y/n] y
761(Reading database ... 5766 files and directories currently installed.)
762Removing ptest-runner (2.0.2+git0+6d2872116c-r0.0) ...
763</programlisting>
764 </section>
765
766 <section id="pmsearching">
767 <title>Searching</title>
768
769 <para>The <literal>apt-cache search</literal> allows searching for the
770 given expressions in the name, summary and description of known
771 packages. Example:</para>
772
773 <programlisting># apt-cache search ptest-runner
774ptest-runner - A C program to run all installed ptests
775ptest-runner-dbg - A C program to run all installed ptests - Debugging files
776ptest-runner-dev - A C program to run all installed ptests - Development files</programlisting>
777 </section>
778 </section>
779 </section>
780</chapter> \ No newline at end of file