https://mediawiki.compulab.com/w/index.php?title=Linux:_Development_for_ARM_modules&feed=atom&action=history
Linux: Development for ARM modules - Revision history
2024-03-28T09:53:29Z
Revision history for this page on the wiki
MediaWiki 1.31.0
https://mediawiki.compulab.com/w/index.php?title=Linux:_Development_for_ARM_modules&diff=1320&oldid=prev
Grinberg: /* Networked Root Filesystem */
2012-08-16T09:11:35Z
<p><span dir="auto"><span class="autocomment">Networked Root Filesystem</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:11, 16 August 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l96" >Line 96:</td>
<td colspan="2" class="diff-lineno">Line 96:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>After the NFS tools are installed on the host workstation, you can use {{filename|1=images/Angstrom-image.tar.bz2}} from [http://<del class="diffchange diffchange-inline">www.</del>compulab.co.il/<del class="diffchange diffchange-inline">t3530</del>/<del class="diffchange diffchange-inline">download</del>/t3530<del class="diffchange diffchange-inline">-linux.zip </del>CM-T3530 <del class="diffchange diffchange-inline">Linux package</del>], {{filename|1=images/angstrom-em-x270.tar.bz2}} from [http://<del class="diffchange diffchange-inline">www.</del>compulab.co.il/<del class="diffchange diffchange-inline">x270em</del>/<del class="diffchange diffchange-inline">download</del>/<del class="diffchange diffchange-inline">x270-</del>em-<del class="diffchange diffchange-inline">linux.zip </del>EM-X270 Linux package] and {{filename|1=debian-image.tar.bz2}} from [http://<del class="diffchange diffchange-inline">www.</del>compulab.co.il/<del class="diffchange diffchange-inline">x270cm</del>/<del class="diffchange diffchange-inline">download</del>/x270<del class="diffchange diffchange-inline">-linux-img.zip </del>CM-X270 Linux package] or [http://<del class="diffchange diffchange-inline">www.</del>compulab.co.il/<del class="diffchange diffchange-inline">x270cm</del>/<del class="diffchange diffchange-inline">download</del>/x300<del class="diffchange diffchange-inline">-linux.zip </del>CM-X300 Linux package] for networked root</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>After the NFS tools are installed on the host workstation, you can use</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>filesystem. Extract the filesystem archive to some directory:</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{filename|1=images/Angstrom-image.tar.bz2}} from [http://compulab.co.il/<ins class="diffchange diffchange-inline">products</ins>/<ins class="diffchange diffchange-inline">computer-on-modules</ins>/<ins class="diffchange diffchange-inline">cm-</ins>t3530<ins class="diffchange diffchange-inline">/#devres Linux package for </ins>CM-T3530],</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{filename|1=images/angstrom-em-x270.tar.bz2}} from [http://compulab.co.il/<ins class="diffchange diffchange-inline">products</ins>/<ins class="diffchange diffchange-inline">handheld-computers</ins>/em-<ins class="diffchange diffchange-inline">x270/#devres </ins>EM-X270 Linux package]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>and</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>{{filename|1=debian-image.tar.bz2}} from [http://compulab.co.il/<ins class="diffchange diffchange-inline">products</ins>/<ins class="diffchange diffchange-inline">computer-on-modules</ins>/<ins class="diffchange diffchange-inline">cm-</ins>x270<ins class="diffchange diffchange-inline">/#devres </ins>CM-X270 Linux package]<ins class="diffchange diffchange-inline">, </ins>or</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[http://compulab.co.il/<ins class="diffchange diffchange-inline">products</ins>/<ins class="diffchange diffchange-inline">computer-on-modules</ins>/<ins class="diffchange diffchange-inline">cm-</ins>x300<ins class="diffchange diffchange-inline">/#devres </ins>CM-X300 Linux package]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>for networked root filesystem. Extract the filesystem archive to some directory:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><pre></div></td></tr>
</table>
Grinberg
https://mediawiki.compulab.com/w/index.php?title=Linux:_Development_for_ARM_modules&diff=1294&oldid=prev
Grinberg: /* UBIFS images */
2010-12-31T09:10:11Z
<p><span dir="auto"><span class="autocomment">UBIFS images</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 09:10, 31 December 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l301" >Line 301:</td>
<td colspan="2" class="diff-lineno">Line 301:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>mkfs.ubifs --root=/home/development/cm-x300/rootfs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=4094 \</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>mkfs.ubifs --root=/home/development/cm-x300/rootfs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=4094 \</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           --output=/path/to/tmp_image.ubifs</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           --output=/path/to/tmp_image.ubifs</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>ubinize --output=image.ubi --min-io-size=2048 --peb-size=128KiB image.cfg</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>ubinize --output=image.ubi --min-io-size<ins class="diffchange diffchange-inline">=2048 --vid-hdr-offset</ins>=2048 --peb-size=128KiB image.cfg</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The {{filename|image.ubi}} is ready to be transferred to the device NAND flash using {{cmd|ubiformat}} command.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The {{filename|image.ubi}} is ready to be transferred to the device NAND flash using {{cmd|ubiformat}} command.</div></td></tr>
</table>
Grinberg
https://mediawiki.compulab.com/w/index.php?title=Linux:_Development_for_ARM_modules&diff=983&oldid=prev
Mike: /* Chroot with QEMU */
2010-06-01T07:56:41Z
<p><span dir="auto"><span class="autocomment">Chroot with QEMU</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 07:56, 1 June 2010</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l18" >Line 18:</td>
<td colspan="2" class="diff-lineno">Line 18:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ELDK ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== ELDK ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Embedded Linux Development Kit (ELDK) is a collection of GNU cross development tools, such as compilers, binutils, gdb, etc., and a number of pre-built target tools and libraries necessary to provide some functionality on the target system. It is not full-featured cross-development environment like Scratchbox, OpenEmbedded, or Poky, but it is known to have stable and reliable cross compilation tools.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Embedded Linux Development Kit (ELDK) is a collection of GNU cross development tools, such as compilers, binutils, gdb, etc., and a number of pre-built target tools and libraries necessary to provide some functionality on the target system. It is not full-featured cross-development environment like Scratchbox, OpenEmbedded, or Poky, but it is known to have stable and reliable cross compilation tools.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">== Chroot with QEMU ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Cross-compilation is the fastest way to build applications for ARM platforms. However, cross-compilation environment setup is relatively difficult even with advanced frameworks such as Scratchbox and OpenEmbedded. [http://www.qemu.org/ QEMU] emulator allows development of ARM applications on x86 and x86-64 desktop system '''without''' setup of cross-compilation environment. It is possible to use statically build QEMU and Linux kernel binfmt capabilities to [http://linux.die.net/man/2/chroot chroot] into ARM root filesystem on the host workstation.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">CompuLab provides [[Linux: Debian: Minimal ARM filesystem|minimal Debian filesystem]] that can be used as a basis for custom filesystem creation.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=== Binfmt_misc ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">The {{cmd|binfmt_misc}} Linux kernel feature allows running of different binary formats provided existence of appropriate interpreter. In conjunction with statically built {{cmd|qemu-arm}} or {{cmd|qemu-armeb}} the {{cmd|binfmt_misc}} provides ability to run ARM binaries on x86 systems.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{Note|Most modern Linux distributions enable the {{cmd|binfmt_misc}} support by default}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">The {{cmd|binfmt_misc}} should be enabled in the Linux kernel configuration in {{parameter|"Executable file formats / Emulations"}} menu:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> .config - Linux Kernel v2.6.27-gentoo-r8 Configuration</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> ──────────────────────────────────────────────────────────────────────────────</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  ┌───────────────── Executable file formats / Emulations ──────────────────┐</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │  Arrow keys navigate the menu.  <Enter> selects submenus --->.          │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >      │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ ┌─────────────────────────────────────────────────────────────────────┐ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │    [*] Kernel support for ELF binaries                              │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │    <M> Kernel support for MISC binaries                            │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │    [*] IA32 Emulation                                              │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │    < >  IA32 a.out support                                        │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ │                                                                    │ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │ └─────────────────────────────────────────────────────────────────────┘ │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  ├─────────────────────────────────────────────────────────────────────────┤</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  │                    <Select>    < Exit >    < Help >                    │</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  └─────────────────────────────────────────────────────────────────────────┘</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">=== QEMU ===</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Statically build QEMU ARM emulator should reside in the target (ARM) filesystem to allow invocation of ARM binaries on x86 system using {{cmd|binfmt_misc}}. </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{Note|Ubuntu Karmic Koala, Debian Sid and Squeeze and probably other Linux distributions provide pre-built packages for static QEMU}}</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">If the binary package is not available in your distribution, building static version of QEMU is straightforward:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> wget http://download.savannah.gnu.org/releases/qemu/qemu-0.11.1.tar.gz</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> tar xzf qemu-0.11.1.tar.gz</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> cd qemu-0.11.1</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> ./configure --static --target-list="armeb-linux-user arm-linux-user"</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> make</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> cp arm-linux-user/qemu-arm armeb-linux-user/qemu-armeb /path/to/target/rootfs/user/local/bin</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{cmd|qemu-arm}} and {{cmd|qemu-armeb}} have to be registered with {{cmd|binfmt_misc}} as ARM binary interpreters:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> echo ":qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:\</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> /usr/local/bin/qemu-arm:" > /proc/sys/fs/binfmt_misc/register</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> echo ":qemu-armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:\</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> /usr/local/bin/qemu-armeb:" > /proc/sys/fs/binfmt_misc/register</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">After the above setup is complete it is possible to execute</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> chroot /path/to/target/rootfs /bin/sh</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">and use the chroot'ed filesystem for application development</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Networked Root Filesystem ==</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>== Networked Root Filesystem ==</div></td></tr>
</table>
Mike
https://mediawiki.compulab.com/w/index.php?title=Linux:_Development_for_ARM_modules&diff=563&oldid=prev
Mike at 08:09, 23 December 2009
2009-12-23T08:09:27Z
<p></p>
<p><b>New page</b></p><div>== Cross-Compilation ==<br />
<br />
In the embedded world, software development is almost always done on a system other than the one on which the software will eventually run. It is common nowadays to use x86 desktop workstations to develop software for ARM-based embedded products. Such an approach requires cross-compilation tools and environment.<br />
<br />
Building a cross compiler became recently relatively simple thanks to such tools as [http://www.kegel.com/crosstool/ crosstool] and [http://ymorin.is-a-geek.org/projects/crosstool crosstool-ng]. But working cross-compiler is not enough. Modern applications rely on variety of libraries, frameworks and utilities. All these has to be cross-compiled also. Most Linux and Open Source software projects use a {{cmd|1=configure}} script to configure their software for compilation. Configure is meant to ease configuring the software for compilation and its default assumption is that the software will be run in the same environment and processor in which it was compiled and run from the place in which it was installed. The second problem of many configure scripts, is that most application developers don't take cross-compilation into account, so {{cmd|1=configure}} ends up cross-compiling test code and trying to run it on the build host, which breaks the configuration. Thus, cross compilation tools are not enough for embedded application development and complete cross-development environment is required.<br />
<br />
Nowadays, there are several popular cross-development environments: [http://www.scratchbox.org Scratchbox], [http://www.openembedded.org OpenEmbedded], it's spin-off [http://www.pokylinux.org/ Poky Linux], and [http://www.denx.de/wiki/DULG/ELDK Embedded Linux Development Kit].<br />
<br />
=== Scratchbox ===<br />
Scratchbox is a chrooted cross-compilation environment. This means one has to log into the Scratchbox like one would log into a real machine. Once you logged in, you develop your application as if you were developing it on native ARM machine, but with computational power of modern x86 workstation.<br />
<br />
=== OpenEmbedded ===<br />
OpenEmbedded is a development environment allowing users to target a wide variety of devices and configurations. OpenEmbedded enables you to build an entire Linux distribution optimized for specific device needs. Additionally, it includes [http://www.openembedded.org/user-manual&dpage=usage_devshell devshell] addon that provides you with an interactive shell with all the appropriate variables set for cross-compiling.<br />
<br />
=== Poky Linux ===<br />
Poky is an embedded Linux build system, distribution and developer environment which builds upon OpenEmbedded technologies. It is less generic than OpenEmbedded, but on the other side, you may find it more tuned and optimized for such devices as PDAs and smartphones.<br />
<br />
=== ELDK ===<br />
Embedded Linux Development Kit (ELDK) is a collection of GNU cross development tools, such as compilers, binutils, gdb, etc., and a number of pre-built target tools and libraries necessary to provide some functionality on the target system. It is not full-featured cross-development environment like Scratchbox, OpenEmbedded, or Poky, but it is known to have stable and reliable cross compilation tools.<br />
<br />
== Networked Root Filesystem ==<br />
It is convenient to use the same filesystem on host workstation and target device. Because the filesystem exists on the workstation, it is easy to use it for cross-development. And because the workspace is mounted on the target device also, we can test code developed on the host by running it on the target device.<br />
<br />
The host workstation need to have NFS server packages installed. The package name depends on the distribution you use: <br />
<br />
'''Ubuntu/Debian'''<br />
<pre><br />
apt-get install nfs-kernel-server nfs-common portmap<br />
</pre><br />
<br />
'''Fedora Core'''<br />
<pre><br />
yum install nfs-utils<br />
</pre><br />
<br />
'''Gentoo'''<br />
<pre><br />
emerge -av nfs-utils<br />
</pre><br />
<br />
After the NFS tools are installed on the host workstation, you can use {{filename|1=images/Angstrom-image.tar.bz2}} from [http://www.compulab.co.il/t3530/download/t3530-linux.zip CM-T3530 Linux package], {{filename|1=images/angstrom-em-x270.tar.bz2}} from [http://www.compulab.co.il/x270em/download/x270-em-linux.zip EM-X270 Linux package] and {{filename|1=debian-image.tar.bz2}} from [http://www.compulab.co.il/x270cm/download/x270-linux-img.zip CM-X270 Linux package] or [http://www.compulab.co.il/x270cm/download/x300-linux.zip CM-X300 Linux package] for networked root<br />
filesystem. Extract the filesystem archive to some directory:<br />
<br />
<pre><br />
mkdir /home/development/module/rootfs<br />
cd /home/development/module/rootfs<br />
</pre><br />
<br />
For CM-T3530:<br />
<pre><br />
tar xjf /path/to/cm-t3530-package/images/Angstrom-image.tar.bz2<br />
</pre><br />
<br />
For EM-X270:<br />
<pre><br />
tar xjf /path/to/em-x270-package/images/angstrom-em-x270.tar.bz2<br />
</pre><br />
<br />
For CM-X300:<br />
<br />
<pre><br />
tar xjf /path/to/cm-x300-package/images/debian-image.tar.bz2<br />
</pre><br />
<br />
And for CM-X270:<br />
<br />
<pre><br />
tar xjf /path/to/cm-x270-package/debian-image.tar.bz2<br />
</pre><br />
<br />
Afterwards add this directory to {{filename|1=/etc/exports}}:<br />
<pre><br />
/home/development/module/rootfs \<br />
192.168.0.0/255.255.255.0(no_root_squash,sync,rw)<br />
</pre><br />
<br />
and make the NFS server export this directory:<br />
<br />
<pre><br />
/usr/sbin/exportfs -a<br />
</pre><br />
<br />
Linux kernel has '''Root on NFS''' feature, allowing mounting root filesystem form a server rather than from local storage device. Default kernels shipped by CompuLab have this feature built in. If you are planing to use custom kernel you can enable '''Root on NFS''' as follows: in the kernel configuration choose '''"Networking -> Networking Options"''' menu and enable '''"IP: kernel level autoconfiguration"'''<br />
<br />
<pre><br />
+-------------------------- Networking options ---------------------------+<br />
| Arrow keys navigate the menu. <Enter> selects submenus --->. |<br />
| Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, |<br />
| <M> modularizes features. Press <Esc><Esc> to exit, <|> for Help, </> |<br />
| for Search. Legend: [*] built-in [ ] excluded <M> module < > |<br />
| +---------------------------------------------------------------------+ |<br />
| | [ ] Network packet debugging | |<br />
| | <*> Packet socket | |<br />
| | [ ] Packet socket: mmapped IO | |<br />
| | <*> Unix domain sockets | |<br />
| | < > Transformation user configuration interface | |<br />
| | [ ] Transformation sub policy support (EXPERIMENTAL) | |<br />
| | < > PF_KEY sockets | |<br />
| | [*] TCP/IP networking | |<br />
| | [ ] IP: multicasting | |<br />
| | [ ] IP: advanced router | |<br />
| | [*] IP: kernel level autoconfiguration | |<br />
| | [*] IP: DHCP support (NEW) | |<br />
| | [*] IP: BOOTP support (NEW) | |<br />
| | [ ] IP: RARP support (NEW) | |<br />
| | < > IP: tunneling | |<br />
| | < > IP: GRE tunnels over IP | |<br />
| | [ ] IP: ARP daemon support (EXPERIMENTAL) | |<br />
| | [ ] IP: TCP syncookie support (disabled per default) | |<br />
| +----v(+)-------------------------------------------------------------+ |<br />
+-------------------------------------------------------------------------+<br />
| <Select> < Exit > < Help > |<br />
+-------------------------------------------------------------------------+<br />
</pre><br />
<br />
Afterwards choose '''"File Systems -> Network File Systems"''' menu and enable NFS options:<br />
<pre><br />
+------------------------- Network File Systems --------------------------+<br />
| Arrow keys navigate the menu. <Enter> selects submenus --->. |<br />
| Highlighted letters are hotkeys. Pressing <Y> includes, <N> excludes, |<br />
| <M> modularizes features. Press <Esc><Esc> to exit, <|> for Help, </> |<br />
| for Search. Legend: [*] built-in [ ] excluded <M> module < > |<br />
| +---------------------------------------------------------------------+ |<br />
| | <*> NFS file system support | |<br />
| | [*] Provide NFSv3 client support | |<br />
| | [ ] Provide client support for the NFSv3 ACL protocol extensi| |<br />
| | [ ] Provide NFSv4 client support (EXPERIMENTAL) | |<br />
| | [*] Allow direct I/O on NFS files | |<br />
| | <M> NFS server support | |<br />
| | [*] Provide NFSv3 server support | |<br />
| | [ ] Provide server support for the NFSv3 ACL protocol extensi| |<br />
| | [ ] Provide NFSv4 server support (EXPERIMENTAL) | |<br />
| | [*] Provide NFS server over TCP support | |<br />
│ │ [*] Root file system on NFS │ │<br />
| +----v(+)-------------------------------------------------------------+ |<br />
+-------------------------------------------------------------------------+<br />
| <Select> < Exit > < Help > |<br />
+-------------------------------------------------------------------------+<br />
</pre><br />
<br />
After the kernel is built it can be loaded with <br />
<br />
<pre><br />
root=/dev/nfs nfsroot=<serverip>:/path/to/nfsroot<br />
</pre><br />
<br />
options and access the filesystem on the host workstation and used for software development.<br />
More information about how to use NFS root can be found in {{filename|1=Documentation/filesystems/nfsroot.txt}} in the Linux kernel source tree.<br />
{{note|If you use Angstrom Linux distribution, you need to make sure that startup scripts do not change primary Ethernet interface configuration as set up by the Linux kernel. Possible way to achieve this would be to set eth0 configuration to 'manual'<br />
<pre><br />
iface eth0 inet manual<br />
</pre><br />
in {{filename|/etc/network/interfaces}} on the target filesystem}}<br />
<br />
== Building the Linux kernel for XScale modules ==<br />
There may be cases when default kernel for device does not fit your system requirements and you would like to build your own kernel. Both EM-X270 and CM-X270 platforms are supported by vanilla kernel starting from version 2.6.23 and 2.6.24 respectively. Yet, the support present there is incomplete and does not include several features. This features can be enabled if you apply EM-X270 (or CM-X270) patchset to vanilla kernel and make proper kernel configuration.<br />
<br />
Keep in mind that to build Linux kernel for CM-X270 and EM-X270 you need cross-compilation toolchain and for EM-X270 you will also need {{cmd|1=mkimage}} utility from [http://www.denx.de/wiki/UBoot/WebHome U-Boot].<br />
<br />
Below is a brief description of Linux kernel build process for CompuLab Xscale modules along with an example commands sequence.<br />
<br />
* Download Linux kernel source from preferred mirror<br />
* Unpack it to some directory<br />
* Apply EM-X270 or CM-X270 patchset<br />
* Set environment variables ARCH, and CROSS_COMPILE so that kernel build system cross compile the kernel<br />
* Build the kernel, and modules<br />
* Install the modules<br />
<br />
=== Building the Linux kernel for EM-X270 ===<br />
<br />
<pre><br />
mkdir /home/development/em-x270/kernel<br />
cd /home/development/em-x270/kernel<br />
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2<br />
tar xjf linux-2.6.23.tar.bz2<br />
cd linux-2.6.23<br />
cat /path/to/x270em-linux-img/kernel/linux-2.6.23-em-x270.patch | patch -p1<br />
export ARCH=arm<br />
export CROSS_COMPILE=arm-linux-<br />
make em_x270_defconfig<br />
make menuconfig<br />
make && make uImage && \<br />
INSTALL_MOD_PATH=/home/development/em-x270/rootfs make modules_install<br />
</pre><br />
<br />
In the above example, the Linux kernel image ({{filename|1=uImage}}) will be created in {{filename|1=/home/development/em-x270/kernel/linux-2.6.23/arch/arm/boot}}, and the loadable kernel modules will be installed into the {{filename|1=/home/development/em-x270/rootfs/lib/modules}} directory.<br />
<br />
Now, if you boot EM-X270 with newly created kernel image and with networked root filesysem at {{filename|1=/home/development/em-x270/rootfs/}} the system will be able to properly load kernel modules and you avoid modules versioning problems.<br />
<br />
=== Building the Linux kernel for CM-X270 ===<br />
<br />
<pre><br />
mkdir /home/development/cm-x270/kernel<br />
cd /home/development/cm-x270/kernel<br />
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2<br />
tar xjf linux-2.6.24.tar.bz2<br />
cd linux-2.6.24<br />
cat /path/to/x270cm-linux-drv/2.6.24/linux-2.6.24-cm-x270.patch | patch -p1<br />
export ARCH=arm<br />
export CROSS_COMPILE=arm-linux-<br />
make cm_x270_defconfig<br />
make menuconfig<br />
make && \<br />
INSTALL_MOD_PATH=/home/development/cm-x270/rootfs make modules_install<br />
</pre><br />
<br />
In the above example, the Linux kernel image ({{filename|1=zImage}}) will be created in {{filename|1=/home/development/cm-x270/kernel/linux-2.6.24/arch/arm/boot}}, and the loadable kernel modules will be installed into the {{filename|1=/home/development/cm-x270/rootfs/lib/modules}} directory.<br />
<br />
Now, if you boot CM-X270 with newly created kernel image and with networked root filesysem at {{filename|1=/home/development/cm-x270/rootfs/}} the system will be able to properly load kernel modules and you avoid modules versioning problems.<br />
<br />
== Creating NAND flash images ==<br />
<br />
=== MTD utils ===<br />
<br />
For NAND flash images management, you will need to have MTD utilities installed on your host workstation and on any root filesystem, used to boot the CompuLab XScale modules. MTD utilities are available as binary package in [http://packages.debian.org/stable/utils/mtd-tools Debian]/[http://packages.ubuntu.com/search?keywords=mtd-tools Ubuntu] and probably other distributions, or can be downloaded directly from [http://www.linux-mtd.infradead.org/ MTD website] or [http://git.infradead.org/mtd-utils.git MTD utils repository].<br />
{{note|If you want to use mtd-utils package from MTD utils repository, you may need to install some development libraries as described in [http://www.linux-mtd.infradead.org/faq/general.html#L_compile_mtd MTD's official FAQ].}}<br />
After the MTD utilities are set up, proceed to [[Linux_Development_for_XScale_modules#UBIFS_images|UBIFS images]] or [[Linux_Development_for_XScale_modules#JFFS2_images|JFFS2 images]] creation guides.<br />
<br />
=== UBIFS images ===<br />
<br />
This guide describes procedure for creating default UBIFS and UBI volume images for CM-X300 with 512MB NAND flash. For installation instructions, please see the "[[Getting started with Linux on CM-X300]]" article. For more information and custom image creation, please see the UBI/UBIFS official documentation and FAQ links [[Linux_Development_for_XScale_modules#See_also|below]].<br />
<br />
UBIFS image creation could be split into two parts: UBIFS filesystem image creation and UBI volume image creation.<br />
UBIFS filesystem image can be used with {{cmd|ubiupdatevol}} utility for existing UBI volume updates.<br />
UBI volume image can be put onto the MTD partition using the {{cmd|ubiformat}} utility.<br />
<br />
UBIFS filesystem image creation is done with {{cmd|mkfs.ubifs}} utility. The resulting image file is passed to {{cmd|ubinize}} utility along with {{filename|image.cfg}} configuration file.<br />
The {{cmd|ubinize}} utility converts the UBIFS filesystem image to UBI volume image.<br />
<br />
Typical {{filename|image.cfg}} file contains:<br />
<pre><br />
[ubi-image]<br />
mode=ubi<br />
image=tmp_image.ubifs<br />
vol_id=0<br />
vol_size=450MiB<br />
vol_type=dynamic<br />
vol_name=ubi-image<br />
vol_flags=autoresize<br />
</pre><br />
<br />
The following command sequence is used to create UBI volume image for CM-X300 module:<br />
<pre><br />
mkfs.ubifs --root=/home/development/cm-x300/rootfs --min-io-size=2048 --leb-size=126976 --max-leb-cnt=4094 \<br />
--output=/path/to/tmp_image.ubifs<br />
ubinize --output=image.ubi --min-io-size=2048 --peb-size=128KiB image.cfg<br />
</pre><br />
The {{filename|image.ubi}} is ready to be transferred to the device NAND flash using {{cmd|ubiformat}} command.<br />
{{Important|{{parameter|min-io-size}} parameter has to be the NAND page size.}}<br />
<br />
=== JFFS2 images ===<br />
<br />
The following command sequence is used to create JFFS2 filesystem image:<br />
<pre><br />
mkfs.jffs2 --no-cleanmarkers --pad --eraseblock=0x20000 --root=/home/development/cm-x270/rootfs --output=/path/to/tmp_image.jffs2<br />
sumtool --no-cleanmarkers --pad --eraseblock=0x20000 --input=/path/to/tmp_image.jffs2 --output=/path/to/image.jffs2<br />
</pre><br />
{{Important|Here {{parameter|eraseblock}} parameter may vary depending on your NAND flash and the layer used, for example: default CM-X300 kernel configuration enables UBI volumes on the NAND flash. To use the JFFS2 image on top of UBI volume the {{parameter|eraseblock}} size parameter should be set to {{parameter|0x1f000}}. More information on this could be found at [[JFFS2_images_over_UBI_layer|JFFS2 images over UBI layer]] page.}}<br />
<br />
The {{filename|image.jffs2}} is ready to be transferred to the device NAND flash.<br />
<br />
=== CM-X270 Legacy images ===<br />
<br />
<pre><br />
cd /path/to/new/image/<br />
<br />
# Create temporary directories<br />
mkdir –p /tmp/destimg<br />
<br />
# Create a placeholder for the new image<br />
# Make image ~500 MB to fit it to NAND devices with bad blocks<br />
dd if=/dev/zero of=512mb.img count=500 bs=1024k<br />
<br />
# Format it using ext3 file system<br />
mke2fs –F -j 512mb.img<br />
<br />
# mount the new (empty) image<br />
mount –t ext3 -o loop 512mb.img /tmp/destimg<br />
<br />
# copy files preserving device nodes, ownership, permissions and<br />
# symbolic links<br />
cp -a /home/development/cm-x270/rootfs/* /tmp/destimg<br />
<br />
# unmount the image<br />
umount /tmp/destimg<br />
<br />
# flush disk caches to the physical storage <br />
sync<br />
<br />
# clean up<br />
rm -rf /tmp/destimg <br />
</pre><br />
<br />
After running this script, the image ''/path/to/new/image/512mb.img'' will contain a file system suitable for a 512 MB NAND flash. This image can be installed on the CM-X270 using the procedure described in the [[Getting_started_with_Linux_on_CM-X270#Legacy_image_installation|Legacy image installation]] section of "Getting started with Linux on CM-X270" article.<br />
<br />
== See also ==<br />
<br />
* [[Getting started with Linux on CM-X270]]<br />
* [[Getting started with Linux on CM-X300]]<br />
* [[Getting started with Linux on EM-X270]]<br />
* [[Linux Kernel for CM-X270]]<br />
* [[Linux Kernel for CM-X300]]<br />
* [[Linux kernel for Exeda]]<br />
* [[Angstrom Linux for EM-X270]]<br />
* [[CM-X270: Linux: Debian|Debian Linux for CM-X270]]<br />
* [[CM-X300: Linux: Debian|Debian Linux for CM-X300]]<br />
* [[Linux MTD drivers on CM-X270]]<br />
* [[JFFS2 images over UBI layer]]<br />
* [[U-Boot images]]<br />
* [http://www.linux-mtd.infradead.org/doc/ubi.html UBI official documentation]<br />
* [http://www.linux-mtd.infradead.org/faq/ubi.html UBI official FAQ and HOWTO]<br />
* [http://www.linux-mtd.infradead.org/doc/ubifs.html UBIFS official documentation]<br />
* [http://www.linux-mtd.infradead.org/faq/ubifs.html UBIFS official FAQ and HOWTO]<br />
<br />
[[Category:Linux|Development for ARM modules]]</div>
Mike