Hacking Ubiquity

Evan Dandrea evand at ubuntu.com
Wed Apr 2 15:47:57 BST 2008


On Wed, 2008-03-12 at 21:29 +0100, mariodebian wrote:
> I'm working on a Ubuntu derivate called MaX (for Madrid Educational
> Goverment, Spain)

Fantastic.

> I need to change some behaviours of ubiquity:
> 
> 1.- Not show Language, Keyboard and TimeZone.
> 
> (this is done preseeding some setings and comenting some code in
> gtk_ui.py)

You should not have to comment any code in ubiquity.  Preseeding the
required questions as specified in appendix B of the installation guide
and running ubiquity with the --automatic option should be sufficient.
Note that adding automatic-ubiquity to the kernel command line will
launch ubiquity in a stripped down environment with --automatic already
set.

Also note that you can provide a preseed file on the kernel command line
(F6 on the isolinux splash) via file= and url=.  For the purpose of
debugging, you can also do `cat your_preseed.seed | sudo
debconf-set-selections` in the live CD environment before launching
ubiquity.

If you're preseeding the language, keyboard, and time zone but they're
not carrying over to the installed system or their respective pages are
still being shown, then that should be considered a bug and filed on
launchpad against the ubiquity source package
(http://launchpad.net/ubuntu/+source/ubiquity/+filebug).

> 2.- Append another step called stepInstallType after stepWelcome which
> contains some radio buttons so select instalation method (for pupils,
> teachers, servers...)
> 
> 3.- Hide User step (using preseed like 1.-)

Provided you have preseeded all the questions on a page and ubiquity is
launched with --automatic, ubiquity will skip the page.  If the page is
still being shown, launch ubiquity with -d --automatic to enable
debugging output and look for INPUT lines followed by a check against
the seen flag that returns false.

> I have some problems.
> 
> My stepInstallType is only a glade file, and I connect radio onchange
> event to gtk_ui method, but I can save this data into debconf because is
> locked by another process.

Right, what you would need to do is have the step run and process before
execution enters the main program loop (note that I do not mean the GTK
event loop).  You seem to have started to do this, but the problem is
that got_intro will never be true.  It's disabled after we enter beta
and it's always disabled when --automatic is set, therefor gtk.main()
never gets called in this particular block of code.

Ideally, for anything more complicated than stepInstallType or any step
that occurred in the middle or end of the steps, you'd want to create a
proper component (see ubiquity/components in bzr for several examples).
Then you would just add the component self.pages and modify set_page
appropriately.

> To not touch Ubuntu packages I build ubiquity-frontend-max with some
> files using dpsyco to overwrite Ubuntu ones:

You're probably best off making a proper frontend package.  See
ubiquity-frontend-mythbuntu in ubiquity bzr for an example.

HTH,
Evan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-installer/attachments/20080402/42a12c37/attachment.pgp 


More information about the Ubuntu-installer mailing list