The purpose of the Midori build system is to construct a bootable Flash ROM image of Midori from source code and a small number of binary objects. This bootable Flash ROM image can then be loaded into Flash ROM and executed on a prototype device.
This chapter describes the Midori build system: its requirements, organization and procedures as well as the organization of the software modules on the target system.
Note: Midori is built with software development tools from the GNU project. The Midori build system includes specific versions of the GCC compiler and binutils tools and then depends on your native development environment for the rest of its build tools. You build ("bootstrap") the Midori build system once with your system's native compiler and thereafter the Midori build system uses these internal build tools. These bundled tools increase the reliability and consistency of the Midori build system.
In addition to needing a host development environment for building Midori, you will also need a mechanism for formatting and downloading Flash ROM images of Midori. Usually, this is includes a serial interface to your development board and a Flash ROM burner (we use a Sandisk ImageMate USB SDDR-31).
Note: You need root permission to perform a software build for Midori.
Note: It's much faster to perform a software build on a local filesystem.
Makefile top-level make(1) description file README description of Midori software release VERSION software release version number
The following sections describe the basic procedures for the Midori build system:
Configuring the Midori build system is a multi-step process:
After configuring the Midori build system, you're ready to build Midori.
Note: The first time you build Midori, it will compile a large number of packages, including the compiler used by the build system. This will take over an hour for most systems. Subsequent builds should be much faster.
The table below shows the other common make targets for the Midori build system.
images all default build target webconfig generate the Web-based config files clean deletes root tree cleanimage delete cramfs images, packed cramfs images forces a check to get all packages if you do an update distclean clean everything including tools install install to Flash ROM or local hard disk install_zero zero flash or local hard disk, then install install_new install only stuff that changed upgrade run simple-minded http update server
The final disk images are put in cache/image. The directory cache/root contains the root filesystem used to build the Flash ROM image.
The layout of the software modules in the target Flash ROM is divided into 4 partitions. The first ("root") partition contains the kernel image and everything necessary to perform a software upgrade over a network connection. The second partition is a duplicate root partition. The third partition contains configuration data like network configuration data, timezone and personalization data. The freeze utility can be used to save state in Flash ROM. The last partition contains the applications, /usr and everything else.
The final Flash ROM image files are:
root.img.cram primary root partition contains a cramfs filesystem (contains the kernel image) config.img.packed configuration data in /config main.img.packed main partition containing the /usr directory on a cramfs filesystem mbr.img 512-byte master boot record
Note: This process will destroy data in the target device.
Note: You must specify the Flash writer installation device in the INSTALL_DEVICE parameter of the mlinstall configuration panel. For example, if you're using a SanDisk USB Flash writer, then set INSTALL_DEVICE to the last SCSI device. On a machine with two SCSI drives, the first would be named /dev/sda and the second /dev/sdb. The USB Flash writer would then be /dev/sdc.After the build completes, the Flash ROM in the writer should contain a bootable Flash ROM image of Midori.