summaryrefslogtreecommitdiff
path: root/docs/06-Optional-rootfs-build.txt
blob: 6dd9d624925ec06b17491d7dbe35024935712dc2 (plain)
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
Optional Root filesystem build and use instructions
===================================================

A   Introduction

    This note describes ways to build Linux user-land
    filesystems of varying complexity for use with the
    virtualizer. Note that there are several ways to create
    filesystems and this note doesn't cover all possibilities.

    The default virtualizer release contains an empty filesystem
    stub located at:

    arm-virtualizer-v2_2-160212/bootwrapper/payload/fsimg

    A build using this stub doesn't contain a functional
    filesytem that the Linux kernel image can use. fsimg can be
    replaced with a suitable filesystem image but with the
    following constraints:

    1.  Compressed or uncompressed cpio archives are supported.

    2.  The image size is limited to ~200 MB.

    The size restriction implies that only very 'lean'
    filesystems such as busybox <http://www.busybox.net/> may be
    used. While busybox presents a minimal but robust command
    line environment, quite often a more conventional desktop
    like environment with window management on top of an X
    server is required in order to run web browsers etc.

    In this note, we illustrate a method to use a larger (~2GB) filesystem image
    that can be used with the ARM FastModels MMC emulation. Note that the MMC
    emulations only supports images that are just under 2GB in size.

    Note that if the MMC route is used, the bootwrapper/payload/fsimg filesystem
    image will be suppressed and ignored.

    Locating a root filesystem on the MMC emulation allows the Linux kernel to
    access and use this filesystem.  This is facilitated by indicating the
    filesystem location to the kernel via the kernel command-line arguments by
    appending 'root=/dev/mmcblk0' (for a single partition MMC image) to the
    argument list.

    Note that when using this technique, the fsimg file is ignored.

B   Building and installing a Linux kernel

    A suitable Linux kernel image for use with the virtualizer
    can be built as follows:

    $ tar -jxf arm-virtualizer-v2_2-160212.tar.bz2
    $ cd arm-virtualizer-v2_2-160212/bootwrapper
    $ make clean
    $ pushd /tmp
    $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/maz/ael-kernel.git ael-kernel.git
    $ cd ael-kernel.git
    $ git checkout -b ael-11.06 origin/ael-11.06
    $ yes | make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- vexpress-new_defconfig
    $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4
    $ popd
    $ cp $OLDPWD/arch/arm/boot/Image payload/kernel

    Note that the using the vexpress-new_defconfig configuration
    ensures that the kernel is built with MMC support.

C   Building a suitable root filesystem

    A suitable root filesystem can be built using Ubuntu Linux's rootstock utility
    <https://wiki.ubuntu.com/ARM/RootfsFromScratch> as follows:

    $ sudo apt-get install rootstock
    $ sudo rootstock --fqdn ubuntu --login ubuntu --password ubuntu --imagesize 2040M --seed lxde,gdm --notarball
    $ mv qemu-armel-*.img mmc.img

    Note that the complete filesystem build will take ~30
    minutes. On boot, the username and password is 'ubuntu'.

    The rootstock invocation above will produce a rootfilesystem containing an
    LXDE desktop <http://lxde.org/> that has a firefox browser.

D   Modifying the kernel command line to support the MMC image.

    The virtualizer build system and the mxscripts that are used for launching
    the ARM FastModel require modifications to support the MMC image.

    The build system modification is to change the Linux kernel command line
    arguments to make the kernel aware of the location of the root filesystem.
    The command line should contain the string 'root=/dev/mmcblk0'.

    To make this modification, edit the file bootwrapper/Makefile and change the
    BOOTARGS specification on line 42 from:

    BOOTARGS=mem=255M console=ttyAMA0,115200 migration_cost=500
    cachepolicy=writealloc

    to

    BOOTARGS=root=/dev/mmcblk0 mem=255M console=ttyAMA0,115200
    migration_cost=500 cachepolicy=writealloc

    The ARM FastModel mxscript modification is to get the FastModel to use the
    mmc.img file created in step C above with the MMC emulation.

    To make this modification uncomment the 'string mmcimage=' line (line 42)
    and provide the complete path to the mmc.img file generated in step C above.

E   Building the virtualizer

    $ cd bootwrapper
    $ make clean && make

F   Launching the ARM FastModel

    $ modeldebugger -s big-little-MP<x>.mxscript

    .. where x is 1 or 4 as the case may be (MP1 build or MP4
    build).

G   Known limitations

    None.