This is a tutorial on how to use the minifs build system to create a fully working boot-loader, kernel and rootfs image for running linux on a parrot DF3120 bluetooth enabled digital photoframe. Apart from the boot loader the entire system runs from an SD card whilst leaving the original firmware intact should you wish to retain the original functionality of the frame.
The standard instructions for installing the toolchain, minifs and all support packages is this:
Suggested to use minifs as this builds toolchain, kernel and rootfs all in one go. You will need to install lzop, uboot-mkimage, libelf-dev, libncurses-dev, checkinstall and any other tools requested. You don't need to be root to run any of this.
% git clone http://oomz.net/git/minifs.git minifs
Once you've built the rootfs, you'll need to copy it to the one and only partition on an SD card, e.g.:
% dd if=build-df3120/minifs-full-ext.img of=/dev/sdb1
Add the toolchain bin directory to your path before compiling anything, e.g.:
% export PATH=$PATH:~/minifs/toolchain/arm-v4t-linux-uclibcgnueabi/bin
If you've already got an > 8bit embedded build system on your machine its quite likely that the above instructions will work for you without issue, if you haven't run a build system before or you are getting issues then read on.
Installing the the libs and tools necessary to build minifs
If this is the first time you've used the minifs build system (or any build system for that matter) you will have to install a number of extra packages, some but not all are listed above, lets run through what you will need to do to get your system in a state thats ready for minifs.
As you can see the list of necessary apps. and libraries is a bit bigger than those listed above, the good news is they're very easy to install
This is absolutely essential, if you don't install this you won't be able to pull the source files necessary to build minifs. install it on your system using the following command:
sudo apt-get install git-core
tig is a nice front end that makes using git a lot friendlier
sudo apt-get install tig
This is necessary for compression throughout the build system and is used extensively by linux apps. Same install procedure:
sudo apt-get install lzop
host tool for producing uboot binary/script images. Same installation procedure
sudo apt-get install uboot-mkimage
libelf-dev is used to produce the binaries for the apps that are installed and run on your final linux rootfs.
sudo apt-get install libelf-dev
libncurses is used for menuconfig style tools for configuring things like the kernel and busybox
sudo apt-get install libncurses-dev
gtk-doc-tools is needed by libglib, if you don't install it, the minifs install process will get quite a way through and then fail.
sudo apt-get install gtk-doc-tools
check-install is used by minifs to keep track of the apps. that are built, this is then used to be able to uninstall and clean up after itself if necessary
reported to be needed on debian systems, use if e2fsprogs doesn't provide it or you prefer to just use genext2fs
e2fsprogs is a collection of tools used to generate the filesystem for the rootfs image file, should contain genext2fs, if it doesn't then install genext2fs
sudo apt-get install e2fsprogs
Pretty important this one :D GLib is a library containing many useful C routines for things such as trees, hashes, lists, and strings. It is a useful general-purpose C library used by projects such as GTK+, GIMP, and GNOME, install via the usual method:
sudo apt-get install libglib2.0-dev
this is needed by btscanner but will be useful for other apps in the future and is most likely already used throughout the build system and the actual rootfs.
sudo apt-get install libxml2-dev
these will all use the standard install instructions of:
sudo apt-get install <package name>
Making and using a script for useful environment variables
Once you have everything installed you're almost done, I found it useful to setup a small script so that my env vars are setup and the system is made aware of the path to the toolchain binaries, copy and paste the following into a text file called setenv.sh:
chmod a+xrw setenv.sh
now each time you start a new terminal to do some work on minifs at the prompt do:
Installing minifs for the first time
Now on to installing minifs for real, the install at the moment of writing requires 1.3GB of hdd space, this will undoubtedly grow, so give yourself 2-3GB of space to be on the safe side for now. Once you are in the folder where you would like to install minifs to from the terminal do:
git clone http://oomz.net/git/minifs.git minifs
git clone will create a folder called minifs and download the latest version of minifs from Buserror's git repo, once its finished you should have all the necessary files to build a complete toolchain and rootfs for the parrot, if we installed everything correctly above you should be able to start the build system, go and have a coffee (and a danish if you've got a slow PC) and when you get back you should have a minifs-full-ext.img waiting for you. To kickstart the build system after you've cloned it, from the terminal do:
The first time you run the minifs_build.sh script it will take a while, its got to download, configure and compile *everything* necessary for the final .img file that you will use to boot the frame into linux. that means its got to download the toolchain (the compiler and support apps. to actually write arm and arm-linux binaries), its also got to download,configure and compile the linux kernel source files, as well as the packages and support files necessary to run all of the standard apps (via busybox) that you enjoy on a normal linux system + all supporting libraries for the various hardware/software subsystems on the frame. It can take an hour or more on some systems.
Once you've built it for the first time any subsequent rebuilds will generally only require you rebuilding the parrot software (minifs/build-df3120), which is a lot quicker as its generally just the kernel and any files that might need recompiling:)
Thats about it for installing your own toolchain and building a linux rootfs image to run on the frame. Check the main page for more tutorials on advanced techniques for using the build system and configuring the the kernel/busybox as well as adding your own packages to be automatically installed in the final .img file.
rebuilding the kernel/packages
if you want to rebuild a particular package then you can delete its log files with the following command (assuming you are in the /minifs/ folder):
you should then be able to run:
minifs will then compile the kernel and reconfigure,compile, install/deploy the package and then deploy everything else that has already been compiled into a final minifs rootfs image file for you.
if you want to do a rebuild of the whole rootfs image then simply do:
and again, run:
In general if the build system fails at any point it will give you some information about where it failed in the form of a .log file, here is the last few lines of a failed build as an example:
Simply open the file in your favorite text editor to see the details of why it failed. Please refer to the #df3120 IRC channel on freenode if you have any other issues.
you will find in each sub folder in build-df3120 a number of .log files, they will have the format ._logtype_packagename.log, the logtype can be:
conf - this is the minifs log file that was created when minifs configured the package, if there was an error it should show up here, if you get compile log errors then you will probably want to look in the conf log file too as any package that has made it into the minifs build scripts in general should work and it will be a configuration issue of some sort causing the problem. consider checking configure.log if minifs conf log doesn't give up much information.
compile - this is the logtype that minifs produces when it is attempting to compile the package, you will probably want to check the conf and configure.log files!!
install - this logtype will tell you where it put files once it has compiled, *note* this is *NOT* the final destination for your files, see the deploy log file for that.
deploy - this log file tells you where your files got installed to in the final rootfs .img file, if they didn't go where you expected then there is something wrong with the packages deploy stage in the minifs/conf/packages/thepackage script file.
dist - unsure, haven't had to use it but I'm sure BusError will know :D