Mercurial > hg > aboriginal
comparison www/documentation.html @ 520:16adbffb58b0
More documentation tweaks, adding a new target section.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 02 Dec 2008 04:49:10 -0600 |
parents | f109c324cca4 |
children | ad14395e1f0c |
comparison
equal
deleted
inserted
replaced
519:1c36145a54d1 | 520:16adbffb58b0 |
---|---|
10 <li><a href="#what_is_it">What is Firmware Linux?</a></li> | 10 <li><a href="#what_is_it">What is Firmware Linux?</a></li> |
11 <li><a href="#how_system_image">How do I use system images?</a></li> | 11 <li><a href="#how_system_image">How do I use system images?</a></li> |
12 <li><a href="#how_build_source">How do I build my own customized system images from source code?</a></li> | 12 <li><a href="#how_build_source">How do I build my own customized system images from source code?</a></li> |
13 <li><a href="#how_implemented">How is Firmware Linux implemented?</a></li> | 13 <li><a href="#how_implemented">How is Firmware Linux implemented?</a></li> |
14 <li><a href="#why">Why do things this way?</a></li> | 14 <li><a href="#why">Why do things this way?</a></li> |
15 <li><a href="#new_platform">Adding a new target platform</a></li> | |
15 </ul> | 16 </ul> |
16 | 17 |
17 <hr /> | 18 <hr /> |
18 <a name="what_is_it"><h1>What is Firmware Linux?</h1></a> | 19 <a name="what_is_it"><h1>What is Firmware Linux?</h1></a> |
19 | 20 |
1648 | 1649 |
1649 <p>To use this emulated system as a native build environment, see | 1650 <p>To use this emulated system as a native build environment, see |
1650 <a href="#native_compiling">native compiling</a>.</p> | 1651 <a href="#native_compiling">native compiling</a>.</p> |
1651 | 1652 |
1652 | 1653 |
1653 <a name="new_platform"><h1>Setting up a new platform</h1></a> | 1654 <a name="new_platform"><h1>Adding a new target platform</h1></a> |
1654 | 1655 |
1655 <p>The differences between platforms are confined to a single directory, | 1656 <p>The differences between platforms are confined to a single directory, |
1656 sources/targets. Each subdirectory under that contains all the configuration | 1657 sources/targets. Each subdirectory under that contains all the configuration |
1657 information for a specific target platform FWL can produce system images | 1658 information for a specific target platform FWL can produce system images |
1658 for. The same scripts build the same packages for each platform, differing | 1659 for. The same scripts build the same packages for each platform, differing |
1749 | 1750 |
1750 <li><p><b>emulator_command</b> - Shell function run to generate the actual | 1751 <li><p><b>emulator_command</b> - Shell function run to generate the actual |
1751 emulator invocation at the end of the run-$ARCH.sh shell script in the system | 1752 emulator invocation at the end of the run-$ARCH.sh shell script in the system |
1752 image tarball.</p> | 1753 image tarball.</p> |
1753 | 1754 |
1754 <p>This is actually a shell function, not an environment variable. The | 1755 <p>This is actually a shell function, not an environment variable. It's |
1755 function should output an emulator command line to stdout (generally | 1756 called from package-mini-native.sh to output an emulator command line to |
1756 using "echo"). The function receives three arguments: $1 is the name of the | 1757 stdout (generally using "echo").<p> |
1757 ext2 image containing the root filesystem, $2 is the name of the kernel image, | 1758 |
1758 $3 is a set of | 1759 <p>The function receives two arguments: $1 is the name of the ext2 image |
1759 platform-independent kernel command line arguments (currently "rw | 1760 containing the root filesystem, and $2 is the name of the kernel image. |
1760 init=/tools/bin/sh panic=1 PATH=/tools/bin") to which emulator_command should | 1761 The function can also call another shell function, <b>qemu_defaults</b>, |
1761 append at least root= and console= arguments.</p> | 1762 which is defined in package-mini-native.sh and which provides most of |
1762 | 1763 the qemu command line. (If you use a different emulator, you don't have to |
1763 This function is called from | 1764 call this function, but if you use qemu it makes things a lot easier and |
1764 include.sh.</p> | 1765 more consistent.) The qemu_command function outputs $ROOT and $CONSOLE |
1765 | 1766 variables for its root= and console= kernel command line arguments, so |
1766 | 1767 set those before calling it.</p> |
1767 </ul> | 1768 </li> |
1768 | 1769 |
1769 <p>The <b>details</b> file also defines the shell function | 1770 </ul> |
1770 <b>emulator_command</b>, which is run to generate the actual emulator | 1771 |
1771 invocation at the end of the run-$ARCH.sh shell script in the system image | 1772 <a name="miniconfig"><h2>Miniconfig files</h2></a> |
1772 tarball. The function should | 1773 |
1773 output an emulator command line to stdout (generally using "echo"). The | 1774 <p>The expanded .config files used to build both Linux and uClibc are copied |
1774 function receives three arguments: $1 is the name of the ext2 image containing | 1775 into the /usr/src directory of mini-native filesystems during the build, |
1775 the root filesystem, $2 is the name of the kernel image, $3 is a set of | 1776 and kept for future reference.</p> |
1776 platform-independent kernel command line arguments (currently "rw | 1777 |
1777 init=/tools/bin/sh panic=1 PATH=/tools/bin") to which emulator_command should | 1778 <p>The Linux kernel and uClibc each need a configuration file to build. |
1778 append at least root= and console= arguments.</p> | 1779 Firmware Linux uses the "miniconfig" file format, which contains only the configuration |
1779 | |
1780 This function is called from | |
1781 include.sh.</p> | |
1782 | |
1783 <a name="miniconfig"><h2>miniconfig-linux</h2> | |
1784 <p>The Linux kernel needs a configuration file to build. Firmware Linux | |
1785 uses the "miniconfig" file format, which contains only the configuration | |
1786 symbols a user would have to switch on in menuconfig if they started from | 1780 symbols a user would have to switch on in menuconfig if they started from |
1787 allnoconfig.</p> | 1781 allnoconfig.</p> |
1788 | |
1789 <p>This file is written as a "here" document, ala:</p> | |
1790 <blockquote> | |
1791 <pre> | |
1792 cat > "${WORK}"/miniconfig-linux << 'EOF' | |
1793 [insert file contents here] | |
1794 EOF | |
1795 </pre> | |
1796 </blockquote> | |
1797 | 1782 |
1798 <p>To generate a miniconfig, first configure your kernel with menuconfig, | 1783 <p>To generate a miniconfig, first configure your kernel with menuconfig, |
1799 then copy the resulting .config file to a temporary filename (such as | 1784 then copy the resulting .config file to a temporary filename (such as |
1800 "tempfile"). Then run the miniconfig.sh script in the sources/toys directory | 1785 "tempfile"). Then run the miniconfig.sh script in the sources/toys directory |
1801 with the temporary file name as your argument and with the environment variable | 1786 with the temporary file name as your argument and with the environment variable |
1822 </pre> | 1807 </pre> |
1823 </blockquote> | 1808 </blockquote> |
1824 | 1809 |
1825 <p>Remember to supply an actual value for $KARCH.</p> | 1810 <p>Remember to supply an actual value for $KARCH.</p> |
1826 | 1811 |
1827 <h2>miniconfig-uClibc</h2> | 1812 <h2>$ARCH/miniconfig-linux</h2> |
1813 <p>This is the miniconfig file to build a Linux kernel for the appropriate | |
1814 target. This is usually aimed at booting under QEMU, but if you'd like | |
1815 to come up with your own configuration for actual target hardware, feel | |
1816 free.</p> | |
1817 | |
1818 <h2>$ARCH/miniconfig-uClibc</h2> | |
1828 | 1819 |
1829 <p>Just like the Linux kernel, uClibc needs a .config file to build, and | 1820 <p>Just like the Linux kernel, uClibc needs a .config file to build, and |
1830 so the Firmware Linux configuration file supplies a miniconfig. Note that | 1821 so the Firmware Linux configuration file supplies a miniconfig. Note that |
1831 uClibc doesn't require an ARCH= value, because all its architecture information | 1822 uClibc doesn't require an ARCH= value, because all its architecture information |
1832 is stored in the config file. Otherwise the procedure for creating and using | 1823 is stored in the config file. Otherwise the procedure for creating and using |
1833 it is the same as for the Linux kernel, just with a different filename and | 1824 it is the same as for the Linux kernel, just with a different filename and |
1834 contents.</p> | 1825 contents.</p> |
1835 | 1826 |
1836 <p>Note that Firmware Linux patches uClibc to work with miniconfig files, | 1827 <p>Most of each miniconfig-uClibc is identical from platform to platform. |
1837 the base uClibc 0.9.29 release doesn't support miniconfig files yet.</p> | 1828 At some point in the future this boilerplate might be factored out into |
1829 a common file, but so far removing the duplication hasn't been worth the | |
1830 extra complexity.</p> | |
1838 | 1831 |
1839 <hr> | 1832 <hr> |
1840 | 1833 |
1841 <!-- | 1834 <!-- |
1842 | 1835 |