File: emsetup.1.xml

package info (click to toggle)
emdebian-tools 1.4.3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,112 kB
  • ctags: 274
  • sloc: perl: 6,297; xml: 4,828; sh: 1,902; php: 406; ansic: 189; makefile: 15
file content (321 lines) | stat: -rw-r--r-- 14,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<?xml version="1.0" encoding="UTF-8"?>
<refentry id="emsetup">
  <refentryinfo>
    <productname>emsetup</productname>
    <productnumber>1</productnumber>
  </refentryinfo>
  <refmeta>
    <refentrytitle>emsetup</refentrytitle>
    <manvolnum>1</manvolnum>
    <refmiscinfo class="source">EMDEBIAN-TOOLS</refmiscinfo>
    <refmiscinfo class="manual">EMDEBIAN-TOOLS</refmiscinfo>
  </refmeta>
  <refnamediv id="name">
    <refname>emsetup</refname>
    <refpurpose>Check your system for Emdebian cross-build support.</refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>emsetup</command>
      <group>
        <arg>-a</arg>
        <arg>--arch</arg>
        <replaceable> ARCH</replaceable>
      </group>
      <group>
        <arg>-s</arg>
        <arg>--simulate</arg>
      </group>
      <group>
        <arg>-y</arg>
        <arg>--yes</arg>
      </group>
      <group>
        <arg>-v</arg>
        <arg>--verbose</arg>
      </group>
      <group>
        <arg>-q</arg>
        <arg>--quiet</arg>
      </group>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>emsetup</command>
      <group>
        <arg>-a</arg>
        <arg>--arch</arg>
        <replaceable> ARCH</replaceable>
      </group>
      <arg>--report</arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>emsetup</command>
      <group>
        <arg>-a</arg>
        <arg>--arch</arg>
        <replaceable> ARCH</replaceable>
      </group>
      <arg>--download
      </arg>
      <replaceable> VERSION</replaceable>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>emsetup</command>
      <group>
        <arg>-h</arg>
        <arg>--help</arg>
      </group>
      <group>
        <arg>--version</arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1 id="description">
    <title>DESCRIPTION</title>
    <para><command>emsetup</command> checks your system for Emdebian compatible
    cross-build support and determines some defaults for other emdebian-tools
    scripts. Run this before other emdebian-tools scripts, using the simulate option
    to see what changes may be needed. If a usable toolchain is already installed,
    <command>emsetup</command> exits without making any changes.
    </para>
    <para><command>emsetup</command> uses <filename>apt-cross</filename> to
    determine the latest versions of toolchain packages.</para>
    <para>Use <option>--report</option> to see the package names that
    <command>emsetup</command> has checked or installed for the default or
    specified architecture.
    </para>
    <para>If <command>emsetup</command> identifies that a suitable toolchain exists
    in Emdebian but is not installed, <command>edos-debcheck</command> can be
    used to check that the toolchain packages are installable by calling
    <command>emsetup</command> with the <option>--report</option> option.
    </para>
  </refsect1>
  <refsect1 id="options">
    <title>OPTIONS</title>
    <variablelist remap="TP">
      <varlistentry>
        <term><option>-a</option>|<option>--arch</option> ARCH</term>
        <listitem>
          <para>Override the <filename>dpkg-cross</filename> default
            architecture.</para>
          <para><command>emsetup</command> tries to determine the current default
            architecture setting of <command>dpkg-cross</command> - managed
            by <command>debconf</command> in <command>dpkg-cross</command> (&gt;= 1.33).
            Prior to version 1.33, <filename>dpkg-cross</filename> used
            <filename>~/.dpkg-cross/cross-compile</filename>, copied
            from <filename>/etc/dpkg-cross/cross-compile</filename> and
            manually edited to update the default_arch:
<programlisting>
# default architecture for dpkg-cross (to avoid always typing the -a option
# if you do cross installations only for one architecture)
# default_arch =
</programlisting>
            </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-s</option>|<option>--simulate</option></term>
        <listitem>
          <para>Summarise the changes required to enable
            cross-building for your selected architecture on this system
            without making any changes, then exit. <command>emsetup</command>
            will run through each of the checks and determine if you need an
            additional source in <filename>/etc/apt/sources.list</filename>.
            If you choose to add this source manually, ensure you run
            <computeroutput>'sudo apt-get update'</computeroutput> before
            restarting <command>emsetup</command>. Next,
            <command>emsetup</command> will output a list of toolchain
            packages that are needed to build your chosen architecture on
            this system. If these packages are not available in the current
            emdebian toolchain repository, <command>emsetup</command> will
            output a hint about using <command>emchain</command>. Packages
            that are available but not installed can be checked for installability
            using the <option>--report</option> option to <command>emsetup</command>.
            </para>
          <para><option>-s</option> is ignored if <option>--report</option>
            is used.
            </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-y</option>|<option>--yes</option></term>
        <listitem>
          <para>Proceed with the toolchain installation without getting a
          prompt from the apt-agent (either apt-get or aptitude according to
          debconf or <filename>~/.apt-cross/emsource</filename> preferences).
          </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <option>--report</option>
        </term>
        <listitem>
          <para>View the status of packages that <command>emsetup</command>
        has either installed or checked to support cross-building for the default
        or specified architecture. If the required packages are not installed,
        <command>emsetup</command> prints a list of the package names that were
        checked and runs <command>edos-debcheck</command> to test that the toolchain
        packages are installable on your system. If <command>edos-debcheck</command>
        reports that any toolchain packages fail, please ask for help on the
        <emphasis>debian-embedded</emphasis> mailing list:
        <link href="http://lists.debian.org/debian-embedded/">http://lists.debian.org/debian-embedded/</link>
        <email>debian-embedded@lists.debian.org</email>, attaching the
        <command>emsetup</command> report.
        </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>
          <option>--download</option>
          <userinput>VERSION</userinput>
        </term>
        <listitem>
          <para>Sometimes, the Emdebian toolchains get behind the version of gcc
        in Debian itself and problems in the later version of gcc could mean that
        it does not build cleanly so <command>emchain</command> cannot fill the gap.
        In this situation, there will be a delay in providing
        an updated Emdebian toolchain for the new version but <command>emsetup</command>
        will not be able to install the old one on new installations. This can be a
        complicated situation but it may be possible to <emphasis>force</emphasis> the
        installation of the toolchain using <command>dpkg --force-depends</command>.
        </para>
          <para>Download tries to help you, a little bit. <userinput>VERSION</userinput>
        specifies the version of gcc that you want to be able to use, e.g. for gcc-4.2,
        specify <userinput>4.2</userinput>. The relevant gcc packages for your selected
        architecture are downloaded from the Emdebian repository. Supporting packages
        are downloaded using <command>apt-cross</command>. Packages that are already
        installed are omitted.
        </para>
          <para>With the necessary files available, <command>emsetup</command> can do no
        more for you - see <command>dpkg-cross</command> (1) for information on how
        to build suitable cross packages from the foreign binaries. Use
        <command>dpkg --force-depends</command> on the packages that have the correct
        architecture. (e.g. to build for ARM on amd64, use <command>dpkg-cross</command>
        on the ARM packages and <command>dpkg --force-depends</command> on the amd64
        packages.)
        </para>
          <para>It is best to use <command>dpkg-cross</command> <option>-b</option>
        <emphasis>not</emphasis> <command>dpkg-cross</command> <option>-i</option>
        because it is very likely that you will need to use <command>sudo dpkg</command>
        <option>--force-depends -i</option> to actually install most (all?) of the
        toolchain packages. This part of the process needs to be done manually
        because if an automated method was likely to work, <option>--download</option>
        would be unnecessary. Other packages may also be necessary, these should be
        downloaded using <command>apt-cross</command>, using <option>--force</option>
        if an old version is already installed.
        </para>
          <para>If this method still fails, ensure that you use:
        </para>
          <programlisting>
$ sudo apt-get -f install
        </programlisting>
          <para>to try to tidy up the mess left behind.
        </para>
          <para>Even if the installation succeeds, it is worth checking the installation
        with the above command or you may come up against problems with installing other
        packages.
        </para>
          <note>
            <title>Consquences of forced toolchain installation</title>
            <para><command>empdebuild</command> will not be able to use the same method
          (without an amount of manual hacking of an existing empdebuild chroot). This is
          not really a problem - forced toolchain installations are intended to be the
          exception, not the rule. The lack of clean chroot build support should act as
          a disincentive to upload cross built packages to repositories, until such a time
          as a full Emdebian toolchain becomes installable.
          </para>
          </note>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-v</option>|<option>--verbose</option></term>
        <listitem>
          <para>be verbose. <option>-v</option> can be repeated to increase verbosity,
              up to a maximum of three times. When running <command>emsetup</command>
              directly, it is recommended to use at least one <option>-v</option> option.
              </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>-q</option>|<option>--quiet</option></term>
        <listitem>
          <para>be quiet (default) - can also be used to reduce verbosity set
              using <option>-v</option>.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1 id="hostname">
    <title>HOST CONFIGURATION</title>
    <para>In some circumstances (e.g. inside a chroot), <filename>hostname</filename>
    <option>-f</option> fails and <command>emsetup</command> reports an error
    about being unable to determine the fully qualified hostname. This usually
    occurs because of an old <filename>/etc/hosts</filename> file.
    </para>
    <example id="hostname">
      <title>Fixing hostname for mybox.mydomain</title>
      <para>The typical fix is to add an extra line to fix the <filename>hostname</filename>
    configuration. Substitute <userinput>mybox</userinput> with your short hostname
    (use <filename>hostname</filename> <option>-s</option>). If you have a local
    domain, specify it instead of <userinput>mydomain</userinput>. If you have no
    local domain, use <userinput>localdomain</userinput>:
    </para>
      <programlisting>
127.0.1.1 mybox.mydomain mybox
    </programlisting>
    </example>
  </refsect1>
  <refsect1 id="notoolchain">
    <title>AMD64 vs i386</title>
    <para><command>emsetup</command> checks to see if a toolchain is necessary by comparing
    the requested cross build architecture against the host architecture. If the two are the
    same, no toolchain is necessary and <command>emsetup</command> does the other tasks and
    simply exits.
    </para>
    <para><userinput>i386</userinput> and <userinput>amd64</userinput> are a special case
    where it is possible to prepare an i386 chroot on amd64 (and vice versa) and build
    within that chroot using a normal toolchain. How to set up such a chroot is beyond the
    scope of this manpage but feel free to add to the <ulink url="http://wiki.debian.org/Embedded_Debian">
    Emdebian Wiki</ulink> content.
    </para>
  </refsect1>
  <refsect1 id="chroots">
    <title>Setting up a Debian chroot</title>
    <para>You will need the <command>deboostrap</command> utility and at least 250Mb
    of free space (not including the builds that you want to do inside the chroot).
    Create a new directory that is writable by a normal user:
    </para>
    <programlisting>
$ mkdir ./debian-chroot
    </programlisting>
    <para>Download a minimal Debian setup: (can take a bit of time)</para>
    <programlisting>
$ sudo debootstrap sid ./debian-chroot http://ftp.fr.debian.org/debian
    </programlisting>
    <para>Change into the chroot and install emdebian-tools:</para>
    <programlisting>
$ sudo chroot ./debian-chroot
sh # apt-get update
sh # apt-get dist-upgrade
sh # apt-get install emdebian-tools
    </programlisting>
    <para>Now continue with <command>emsetup</command> as before.</para>
  </refsect1>
  <refsect1>
    <title>Author</title>
    <para><command>emsetup</command> was written
      by Neil Williams <email>codehelp@debian.org</email>.
    </para>
    <para>This  manual  page  was  written by Neil Williams
      <email>codehelp@debian.org</email>
    </para>
  </refsect1>
  <refsect1 id="emsetupseealso">
    <title>SEE ALSO</title>
    <para>See also <filename>apt-cross</filename> (1),
        <filename>dpkg-cross</filename> (1), <filename>em_make</filename> (1),
        <emphasis>emdebian-tools</emphasis> (1).
        </para>
  </refsect1>
</refentry>