~ubuntu-installer/ubiquity/trunk

1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
1
Ubiquity
2
========
3
4
This is a graphical installer for Ubuntu, written largely in Python, using
5
d-i as a backend for many of its functions. The authors are indebted to the
6
efforts of the Guadalinex project in developing the original
7
"ubuntu-express" code used as a basis for this project.
8
9
Background
10
----------
11
12
Around 2000, the debian-installer (later just "d-i") project started to
13
replace the old Debian "boot-floppies" installer. The goals of this project
14
included long-term maintainability, modularity, and code reuse. After a
15
hiatus during the Debian 3.0 release, this project matured into a usable
16
installer in 2004 in time for, among others, the releases of Debian 3.1 and
17
Ubuntu 4.10. From Ubuntu 4.10 to Ubuntu 5.10, d-i was used as the primary
18
installation program.
19
20
d-i continues to provide flexibility and (for a certain significant class of
21
users) ease of use that a simplified graphical installer will always be
22
hard-pushed to provide. It is therefore important to continue to support it
23
in Ubuntu. From a maintainability point of view, it follows that it is
24
important for any graphical installer supported by Ubuntu to share
25
substantial amounts of code with d-i, particularly where the backend logic
26
is intrinsically difficult and has accumulated large quantities of expertise
27
and bug fixes. Accordingly, Ubiquity is designed to use logic from d-i where
28
possible, and tries to confine itself to being a high-quality frontend.
29
30
(Of course, there remain some areas where d-i does not provide suitable
31
logic, or where its logic has not proven amenable to direct use within
32
Ubiquity, so there is still some backend-style logic and code duplication
33
in Ubiquity. Eventually, as much of this as possible should go away.)
34
35
UI Design
36 by carranza
[project @ 101]
36
---------
37
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
38
The primary focus of Ubiquity's UI is ease of use for new users.
39
Accordingly, it does not try to provide all possible options, deferring
40
advanced installation scenarios to d-i so that it does not have to be all
41
things to all people. See http://wiki.ubuntu.com/UbuntuExpress for the
42
original details of its user interface design.
43
44
Debconf Integration
45
-------------------
46
47
The most challenging part of Ubiquity to understand is undoubtedly its
48
integration with d-i. Before getting to grips with this, I assume that the
49
reader has a basic developer-level grasp of the "debconf" configuration
50
system. Reading the debconf-devel(7) man page is a good idea.
51
52
d-i uses debconf for all user interaction. The extant graphical debconf
53
frontends are functional, but crude from a human interface design
54
perspective; although this could be improved, the problem is to some extent
55
intrinsic because they must generate a user interface based on the questions
56
asked by the confmodule. It is possible to do much better using custom user
57
interface code. However, at present debconf has no support for doing this
58
directly (although cdebconf does).
59
60
To deal with this, Ubiquity uses the noninteractive debconf frontend, and
61
instead uses a layer called the "debconffilter". This sits between d-i code
62
and the debconf frontend, intercepting the debconf protocol, and transforms
63
relevant debconf protocol messages into events which can be handled in much
64
the same way as UI events from widget libraries like GTK+ or Qt. While this
65
requires insider knowledge of the questions which may be asked by each piece
66
of d-i code, which must often be updated as d-i evolves, it seems to be the
67
most practical approach at present.
68
69
Each piece of d-i code used in Ubiquity is accompanied by a "component",
70
written in Python, which defines the backend code to be called and any
71
necessary event handlers. To allow for multiple frontend implementations, it
72
typically calls methods in the frontend when UI operations are needed.
73
74
It is important to remember that each call to component event handlers is
75
blocking (though non-reentrant). If UI interaction is required in order to
76
provide an answer to debconf, this must be handled by calling into suitable
77
frontend functions from the component to wait for the user. The component is
78
responsible for maintaining its own state machine if necessary.
79
80
Partitioning
81
------------
82
2037 by Colin Watson
* Remove the old advanced partitioner.
83
All partitioning is handled by d-i code (partman), with a presentation layer
84
on top. The presentation layer navigates partman's menus under the hood to
85
perform advanced partitioning. See
86
http://wiki.ubuntu.com/Ubiquity/AdvancedPartitionerRewrite for details.
87
88
A graphical disk view has yet to be written for the GTK frontend's advanced
89
partitioner.
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
90
91
Installation
92
------------
93
94
The actual installation takes place by copying the read-only part of the
95
live filesystem. The writable part of the live filesystem (i.e. the running
96
live session) is intentionally not copied, to ensure maximum reproducibility
97
of the installed system. Thus, any customisations applied by the live boot
98
process must be re-applied after the read-only filesystem is copied. The
99
live boot process is responsible for installing hooks in
100
/usr/lib/ubiquity/target-config/ to take care of this.
101
102
After copying the live filesystem, certain unnecessary packages (such as
103
Ubiquity itself) will be removed. The set of packages to be removed is
104
computed by taking those packages present in
4745 by Colin Watson
Support filesystem.manifest-remove (equivalent to the difference between
105
/cdrom/casper/filesystem.manifest-remove (or, in older versions of Ubuntu,
106
those packages present in /cdrom/casper/filesystem.manifest but not present
107
in /cdrom/casper/filesystem.manifest-desktop), and removing any packages
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
108
explicitly requested for installation by installer code. Language packs for
109
languages which are not to be supported on the installed system will also be
110
removed.
111
1500 by Colin Watson
* Remove /var/log/installer/syslog from all error messages etc., as
112
Logs of the installation will be saved in /var/log/syslog (for messages
113
emitted by Ubiquity itself and messages emitted by d-i code), and
114
/var/log/partman (for a trace of the operation of the automatic
115
partitioner). /var/log/syslog and /var/log/partman are saved in
116
/var/log/installer/ on the installed system.
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
117
118
Customisation
36 by carranza
[project @ 101]
119
-------------
120
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
121
Where d-i code is used, it is generally possible to preseed it to change
2719.1.1 by Colin Watson
Update README to document --automatic option.
122
default behaviour. See the installation guide for details. By default,
123
preseeding is confined to setting default values for questions, and Ubiquity
124
will not skip over preseeded steps (this is to allow sensible interpretation
125
of going backward and forward in the UI); if the --automatic option is used,
126
preseeded steps will be skipped.
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
127
128
The read-only live filesystem should generally be mounted on /rofs.
129
Alternatively, an image may be present as /cdrom/casper/filesystem.cloop,
130
/cdrom/casper/filesystem.squashfs, or (for Guadalinex/Metadistros)
1785.1.1 by Colin Watson
* Document live filesystem manifests and installation from media other
131
/cdrom/META/META.squashfs. Ubuntu currently uses
132
/cdrom/casper/filesystem.squashfs. You can preseed
1601 by Colin Watson
* Document ubiquity/install/filesystem-images in doc/README.
133
ubiquity/install/filesystem-images with a space-separated list of image
134
paths to override this; if you provide more than one image, then they will
135
be overlaid using unionfs.
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
136
4745 by Colin Watson
Support filesystem.manifest-remove (equivalent to the difference between
137
/cdrom/casper/filesystem.manifest should be a list of packages in the full
138
live filesystem; the format is that produced by running "dpkg-query -W".
139
/cdrom/casper/filesystem.manifest-remove should be a list of packages to
140
remove from the target system after copying the live filesystem. This allows
141
Ubiquity to ensure that, for example, Ubiquity itself doesn't end up on the
142
target system.
1785.1.1 by Colin Watson
* Document live filesystem manifests and installation from media other
143
1837 by Colin Watson
* doc/README: Add comment about language pack installation following a
144
Language packs for the selected language are installed by default, using the
145
Ubuntu naming scheme of language-pack-$LL and language-support-$LL. If you
146
want to get rid of these (for example because their dependencies are
147
inconvenient), then you can preseed pkgsel/language-packs to the empty
148
string.
149
1770 by Colin Watson
* If /cdrom/.disk/release_notes_url is present, display a link to the
150
If /cdrom/.disk/release_notes_url is present, a link to the release notes
151
will be displayed on the language page. Instances of the string ${LANG} in
152
that URL will be replaced with the locale, with any encoding removed (e.g.
153
en, de, pt_BR, zh_CN).
154
1785.1.1 by Colin Watson
* Document live filesystem manifests and installation from media other
155
If you're installing from a medium other than a CD or DVD (e.g. over NFS),
156
then the path of least resistance is to arrange that something that looks
157
like a CD is available on /cdrom anyway. NFS-mounting an entire CD image is
158
one approach that has worked with relatively little effort, but you could
159
also set up the files listed above in some other way.
160
1600 by Colin Watson
* Add a FAQ about backporting to doc/README.
161
Frequently Asked Questions
162
--------------------------
163
164
Q. Can I backport the version of Ubiquity from the current Ubuntu
165
   development release to the previous stable release?
166
167
A. Not without quite a bit of work. At present, Ubiquity is still a complex
168
   piece of software with several bleeding-edge dependencies, and at the
169
   moment I have no compunctions about making it depend on new packages or
170
   newer versions of existing packages in order to get the job done
171
   properly. In future, things may settle down such that there can be more
172
   compatibility guarantees, particularly if Ubiquity is adopted by other
173
   Debian-based distributions.
174
175
   At the moment, I can think of the following specific issues with
176
   backporting Ubiquity from Ubuntu 6.10 to Ubuntu 6.06:
177
178
     * Ubiquity now uses the new Python policy, which involves a number of
179
       packaging changes and even a couple of code changes that are
180
       incompatible with Ubuntu 6.06. These would need to be reverted.
181
182
     * Ubiquity now uses console-setup as the backend for the keyboard
183
       screen rather than kbd-chooser. console-setup will not work on Ubuntu
184
       6.06, so the kbd-chooser code would need to be resurrected.
185
186
     * Ubiquity's GTK frontend now relies on new features in gparted in
187
       order to fix some user interface bugs.
188
189
     * Ubiquity now integrates with the apport crash reporting facility in
190
       Ubuntu 6.10, which is not available in Ubuntu 6.06. (This would just
191
       be a matter of removing dependencies; it's optional as far as the
192
       code is concerned.)
193
194
     * Ubiquity's debconf template translations now rely on new features in
195
       po-debconf 1.0, which was not available in Ubuntu 6.06.
196
197
   While I'm aware that there were a number of serious issues with the
198
   version of Ubiquity that shipped with Ubuntu 6.06 (many of which were
199
   corrected in Ubuntu 6.06.1), I feel that the right answer to these is to
200
   backport selected fixes to that branch of Ubiquity rather than trying to
201
   backport the whole package.
202
1785.1.2 by Colin Watson
* Extend backporting FAQ in doc/README to cover issues with backporting
203
   Similarly, there are at least the following issues with backporting
204
   Ubiquity from Ubuntu 7.04 to Ubuntu 6.10:
205
206
     * Ubiquity depends on a version of console-setup at least as new as the
207
       one in its own source tree, so the two packages would need to be
208
       backported together. The new version of console-setup in turn relies
209
       on a newer version of xkb-data (although probably not inextricably).
210
211
     * Ubiquity's GTK frontend now uses gtk.LinkButton, which isn't
212
       available in the versions of GTK+/PyGTK in Ubuntu 6.10. Similarly,
213
       you need a more recent version of glade-3 than is available in Ubuntu
214
       6.10 to edit the user interface definition for the GTK frontend.
215
1787 by Colin Watson
correct discussion of automake
216
     * Regenerating Ubiquity's autotools files (configure et al) requires
217
       Automake 1.10, not available in Ubuntu 6.10.
1785.1.2 by Colin Watson
* Extend backporting FAQ in doc/README to cover issues with backporting
218
219
     * Ubiquity's apport crash handler now requires a new Python API
220
       introduced in apport 0.33.
221
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
222
2719.1.2 by Colin Watson
Direct questions to the ubuntu-installer list rather than to me
223
Feel free to ask us (ubuntu-installer@lists.ubuntu.com) if you have any
1483 by Colin Watson
* Rewrite doc/README to be reasonably up to date. Among other things, it
224
questions regarding Ubiquity's workings.