Specifications

We recommend to store settings of brightness and contrast in U-Boot environment variables that
can be shared between U-Boot and Linux. This way it is possible (assuming adequate driver support)
to adjust the display settings correctly already in U-Boot and thus to avoid any flicker of the display
when Linux takes over control.
9.5. Root File System: Design and Building
It is not an easy task to design the root file system for an embedded system. There are three major problems to
be solved:
what to put in it1.
which file system type to use2.
where to store and how to boot it3.
For now we will assume that the contents of the root file system is aready known; for example, it is given to
us as a directory tree or a tarball which contains all the required files.
We will also assume that our system is a typical resource-limited embedded system so we will especially look
for solutions where the root file system can be stored on on-board flash memory or other flash memory based
devices like CompactFlash or SD cards, MMC or USB memory sticks.
A widespread approach to build a root file system is to use some Linux distribution (like the ELDK) and to
remove things not needed. This approach may be pretty common, but it is almost always terribly wrong. You
also don't build a family home by taking a skyscraper and removing parts. Like a house, a root file system
should be built bottom up, starting from scratch and adding things you know you need. Never add anything
where you don't exactly know what it's needed for.
But our focus here is on the second item: the options we have for chosing a file system type and the
consequences this has.
In all cases we will base our experiments on the same content of the root filesystem; we use the images of the
SELF (Simple Embedded Linux Framework) that come with the ELDK. In a first step we will transform the
SELF images into a tarball to meet the requirements mentioned above:
In a ELDK installation, the SELF images can be found in the /opt/eldk/<architecture>/images/
directory. There is already a compressed ramdisk image in this directory, which we will use
(ramdisk_image.gz):
Uncompress ramdisk image:
bash$ gzip -d -c -v /opt/eldk/ppc_8xx/images/ramdisk_image.gz >/tmp/ramdisk_image
/opt/eldk/ppc_8xx/images/ramdisk_image.gz: 61.4%
Note: The following steps require root permissions!
1.
Mount ramdisk image:
bash# mount -o loop /tmp/ramdisk_image /mnt/tmp
2.
Create tarball; to avoid the need for root permissions in the following steps we don't include the
device files in our tarball:
bash# cd /mnt/tmp
bash# tar -zc --exclude='dev/*' -f /tmp/rootfs.tar.gz *
3.
9.5. Root File System: Design and Building 111