diff options
Diffstat (limited to 'docs/06-Optional-rootfs-build.txt')
-rw-r--r-- | docs/06-Optional-rootfs-build.txt | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/docs/06-Optional-rootfs-build.txt b/docs/06-Optional-rootfs-build.txt new file mode 100644 index 0000000..6e372ea --- /dev/null +++ b/docs/06-Optional-rootfs-build.txt @@ -0,0 +1,125 @@ +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_1-171111/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_1-171111.tar.bz2 + $ cd arm-virtualizer-v2_1-171111/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 + + Use of a comprehensive root filesystem as opposed to busybox + is known to be unstable on the current ARM FastModel release (Release + 6.2 Beta). Subsequent model releases shall contain appropriate fixes as + required). |