Patch for Bug #227013 - /boot not mounted
[moblin-image-creator.eeepc.git] / README
blobe2993aa5ddef757676fc39fe31907af6ba7b9a05
1 Introduction
2 ------------
4 Moblin-Image-Creator, or Image-Creator for short, is a tool aimed at
5 making life easier for the mobile and embedded developer.  The tools
6 is designed to be extremely flexible with platform specific knowledge
7 isolated to a platform definition.  Initial focus is on a new class of
8 devices known as Mobile Internet Devices (MID's), but the design of
9 image-creator is not MID specific and talk is already in progress to
10 add new platform definitions to build Consumer Electronics stacks such
11 as TV set-top boxes.
13 There are three fundamental features that image-creator provides:
14 * creation of a platform specific build environment
15 * creation of platform specific target file-systems
16 * providing user selectable "feature sets" (or fsets) to install 
17   bundles of packages that provide some high-level functionality
19 In addition to this there are many other smaller features to simplify life
20 for the developer, like:
21 * the choice of a fully functional graphical user interface or a purely
22   command line interface
23 * wrappers for chrooting into a buildroot or target file-system
24   (i.e. bind mounting important system directories and copying over network
25    configuration files)
26 * wrappers for opening Xephyr windows for testing target file-systems
27 * utilities for creating live USB images of target file-systems for easy
28   testing of multiple target file-systems
30 Installation
31 ------------
33 It needs below packages that install Image-Creator.
34 autoconf, automake, intltool
36 $ ./autogen.sh
37 $ sudo make install
39 Running
40 -------
42 You must be root in order to run image-creator.  You can either start
43 image-creator via the desktop menu, in which case image-creator will
44 automatically run as root (after asking for the root password), or you can
45 run image-creator from the command-line using sudo.
47 Also... image-creator can run as a GUI or via the command line. To run the
48 GUI just start image-creator with no command line arguments:
50 $ sudo image-creator
52 To see the available list of command-line arguments:
54 $ sudo image-creator --help
56 HINT: image-creator installs a bash completion configuration file, so
57       if you are using bash then you can hit tab after typing a few letters
58       of a given command line argument and bash will auto-complete or provide
59       a list of possible completions. 
61 Creating a new project from the command line
62 --------------------------------------------
64 $ sudo image-creator -c create-project \
65                       --platform-name mccaslin-lpia \
66                       --project-name "MyProject" \
67                       --project-path "/usr/src/myproject" \
68                       --project-description "My Samsung Q1 Ultra project" 
70 The above command will extract the buildroot rootstrap in the
71 /usr/src/myproject directory, and then use that new file-system to install
72 additionally needed build packages into.
74 Once the project is created you can use image-creator to chroot into
75 the new buildroot via:
77 $ sudo image-creator -c chroot-project --project-name "MyProject"
79 Creating a new target from the command line
80 -------------------------------------------
82 $ sudo image-creator -c create-target \
83                       --project-name "MyProject" \
84                       --target-name "target1"
86 Multiple target file-systems can be created from a single project.  The above
87 command will generate a new target file-system inside the buildroot at
88 BUILDROOT/targets/target1/fs/.  You can chroot inside the target file-system
89 via:
91 $ sudo image-creator -c chroot-target \
92                       --project-name "MyProject" \
93                       --target-name "target1"
95 Installing Target Feature Sets from the command-line
96 ----------------------------------------------------
98 In image-creator, the platform defines bundles of packages as a fset, where
99 fsets can have dependencies on other fsets, and installing an fset will
100 automatically install dependent fsets.
102 After installing image-creator, you can see an example of an fset
103 configuration file by looking at: 
104 /usr/share/sdk/platforms/mccaslin-lpia/fsets/base.fset
106 <snip>
108 [Core]
109 DESC=Fundamental fset that provides a root filesystem
110 PKGS=linux-image-386
111 DEBUG_PKGS=gdb man-db manpages
112 DEPS=
115 [Hildon-Application-Framework]
116 DESC=Hildon Application Framework for enabling Mobile Applications
117 PKGS=ubuntu-mobile sdk-default-icons
118 DEBUG_PKGS=
119 DEPS=core
121 </snip>
123 From the above snippet you can see two fsets, the "core" fset the provides
124 additional packages to make it possible to boot a target filesystem
125 and get to a command line prompt, and a "hildon-application-framework"
126 fset that will install additional package (on top of core) to enable 
127 running a Hildon desktop.
129 To install all needed fsets to boot a Samsung Q1 Ultra and show the current
130 Hildon Desktop, run:
132 $ sudo image-creator -c install-fset \
133                       --project-name MyProject \
134                       --target-name target1 \
135                       --fset-name "full-mobile-stack"
137 Creating a Live USB image of the new target filesystem from the command-line
138 ----------------------------------------------------------------------------
140 $ sudo image-creator -c create-live-usb \
141                       --project-name MyProject \
142                       --target-name target1 \
143                       --image-name live-usb.img
145 Image files for a given target are created in the
146 BUILDROOT/targets/TARGETNAME/image directory.
148 These image files need to be directly written to a usb key with a tool like dd.
149 For example:
150 $ sudo dd if=/usr/src/myproject/targets/target1/image/live-usb.img of=/dev/sdb
152 WARNING: The above command is only an example!  You must determine what the
153          correct device node is for you system.  If you run this command
154          with your HD device file then you will trash your installation.
156 Testing Applications from a Target Filesystem
157 ---------------------------------------------
159 There a few options for running a virtual target X session inside your 
160 existing X session running on your workstation.  One popular tool for doing
161 this is something called Xephyr.  Most modern distributions provide a 
162 Xephyr package to make using the tool extremely easy.
164 On Ubuntu you can install Xephyr by running:
165 $ apt-get install xserver-xephyr
167 To start a virtual Xsession run:
168 $ Xephyr :2 -host-cursor -screen 800x480x16 -dpi 96 -ac
170 This will open a new window that is of size 800x480 and has access controls
171 turned off.  Any application on your workstation can display inside this
172 window (as if the window were a new display) by setting the environment 
173 variable DISPLAY to ":2":
174 $ export DISPLAY=:2
176 To run applications from the target filesystem you must first chroot
177 into the target, then set the DISPLAY and run the application.
179 $ sudo image-creator -c chroot-target \
180                       --project-name MyProject \
181                       --target-name target1
182 # export DISPLAY=:2
183 # run-my-application
185 Getting the Source
186 ------------------
188 The image-creator source is contained in a git source repository.  You can
189 either view the source on-line via:
191 http://www.moblin.org/repos/tools/moblin-image-creator.git
193 ...or you can clone the git tree via:
195 $ git clone rsync://moblin.org/repos/tools/moblin-image-creator.git
197 NOTE: To install git from Ubuntu, run "sudo apt-get install git-core"
199 FAQ's
200 -----
203 Why bother with buildroot environment?  Why can't I just install Ubuntu
204 Gutsy and build my mobile apps directly on my workstation?
207 Using a buildroot allows the user to isolate the build machine dependencies
208 from that of the host workstation (or build server.)  Today all MID work
209 is focused on Gutsy, so using Gutsy on your workstation and then installing
210 all the needed build dependencies will work, but one of the goals of 
211 image-creator is to provide a build environment that will continue to work
212 for a given product long after the product's base distribution has fallen
213 out of fashion.
216 In order to use image-creator to I have to install Ubuntu on my workstation?
219 When run on an Ubuntu (or any debian derivative distro), it is possible to 
220 generate RPM packages that work on various RPM based distributions, so while
221 building image-creator is not supported on a non-debian system, there are
222 a few pre-built RPM's available on the project download page.
224 The list of available RPM packages will change over time (depending on demand).
227 Why is the image-creator dependent on debian packaging?  Why not use RPM's?
230 Initial prototyping was actually based on Fedora RPM's using yum to
231 auto-resolve dependencies in the same way we use apt today.  From day one
232 the use of yum has proven itself to be less then ideal for the way we wanted
233 to use it, while at the same time the number of base Fedora package that
234 we needed to touch were quickly taking us to the point of maintaining a full
235 distribution.
237 By moving image-creator to a debian package / apt based implementation and
238 joining the Ubuntu-Mobile team, we were able to gain advantage from both 
239 the richer set of debian technologies while at the same time push all of 
240 our distribution requirements into the upcoming Ubuntu Gutsy repository.
243 How does cross compiling work?
246 Since the initial targets for image-creator are all x86 based, then we
247 are able to simplify the build by just using the native compiler either
248 installed in the buildroot or installed on the host workstation (if the
249 workstation is running the same base as the target.)
251 Regardless of this, one of the advantages of making image-creator debian
252 based is that there is a rich set of cross-compiling packages for just
253 about any architecture.  There shouldn't be any problem in creating a new
254 platform definition that pulls from an apt database of packages built for
255 the target architecture, and that build additional packages using existing
256 cross-compiling technologies.
258 --------------------------------------------------------------------------
260 Speeding Up Image-Creator by using a local mirror server
262 Here is some info on how to speed up image creator. This information has been
263 updated for LPIA (Low Power Intel Architecture) based builds.
265 ** In order to use this, you must have a local mirror of LPIA Ubuntu Gutsy.
266 debmirror is a useful command for mirroring a Debian type archive **
268 If you don't have a mirror server or don't want to set one up, then the next
269 best thing would probably be to setup a caching proxy server.  This is left as
270 an exercise for the reader.
272 Setup root strap mirror servers:
274     Create a directory ~/.image-creator/
276     Create a file called ~/.image-creator/image-creator.cfg:
277     --------------------------------
278     [platform]
279     buildroot_mirror = http://<path_to_a_local_mirror_of_ubuntu_for_lpia>/
280     target_mirror = http://<path_to_a_local_mirror_of_ubuntu_for_lpia>/
281     --------------------------------
283     You can look at the file: /usr/share/pdk/default_config/defaults.cfg for more
284     info on what can go in the: ~/.image-creator/image-creator.cfg file.
286 Setup sources.list* rewrite rules:
288     Create a file called ~/.image-creator/sources_cfg (and sources_cfg is NOT a
289     typo, it is an underscore):
290     --------------------------------
291     sources_regex = [
292         # For the Ubuntu LPIA binaries
293         # NOTE: The trailing spaces in the strings is important!!
294         (r'http://ports.ubuntu.com/ubuntu-ports ', 'http://<path_to_a_local_mirror_of_ubuntu_gutsy_for_lpia>/ '),
295         # For the Ubuntu sources, since they are not at ports.ubuntu.com
296         (r'http://archive.ubuntu.com/ubuntu ', 'http://<path_to_a_local_mirror_of_ubuntu_gutsy>/ '),
297         # For the Moblin.org files
298         (r'http://www.moblin.org/apt ', 'http://<path_to_a_local_mirror_of_moblin.org>/ '),
299     ]
300     --------------------------------
302     The purpose of this file is to rewrite the sources.list and
303     sources.list.d/* files while they are being copied into the rootstrap. It
304     will replace the search expression with the replacement expression.
306 Delete current rootstraps:
308     You have to delete your current rootstraps for this to take affect.
310     sudo image-creator --command clear-rootstraps
312 Caveats:
314     This will only affect new projects and new targets. If you do NOT delete
315     your rootstraps after doing the above then it will NOT take affect.