PreseedingUbiquity

Ubuntu Open Week - Preseeding d-i / Ubiquity - Evan Dandrea - Thu, May 1, 2008

=== jcastro changed the topic of #ubuntu-classroom to: Ubuntu Open Week | Information and Logs: https://wiki.ubuntu.com/UbuntuOpenWeek | How to ask questions: https://wiki.ubuntu.com/UbuntuOpenWeek/Rules | Ask questions in #ubuntu-classroom-chat, prefaced with "QUESTION:" |See https://wiki.ubuntu.com/UbuntuOpenWeek/JoiningIn to filter out channel noise | "Preseesing d-i / Ubiquity" - Evan Dandrea


[17:58] <jcastro> evand: ok, you're up!

[17:59] <evand> hooray

[17:59] <evand> Ok, I'm going to be talking about preseeding as a means of automating the alternate and desktop 
installers.

[17:59] <evand> Before I turn this into a Q&A, I am going to briefly speak about the current status of automating the 
installer.

[18:00] <evand> I'd also like to remind you that many common questions can be answered by reading through the 
installation guide, specifically the preseeding section (Appendix B) and the wiki page on preseeding ubiquity 
(https://wiki.ubuntu.com/UbiquityAutomation).

[18:00] <evand> You can read the latest version of the installation guide by typing:

[18:00] <evand> sudo apt-get install installation-guide-i386; w3m /usr/share/doc/installation-guide-i386/en/index.html

[18:00] <evand> Note that this will be the version of the installation guide for your release.

[18:01] <evand> So if you're still on 7.10, you'll get the 7.10 guide by doing that.

[18:01] <evand> There's an older version of the guide on help.ubuntu.com as well.

[18:01] <evand> Ubuntu uses a modified version of Debian's debian-installer system as the basis for our alternate CD.

[18:02] <evand> Preseeding in debian-installer is a way of answering questions that you know the installer will ask 
for the purpose of reducing the amount or type of input the user needs to provide or for completely automating an 
installation for mass deployment.

[18:02] <evand> For example, if I wanted to avoid asking what username to use for the default user on the system, I 
would create a file and put the following in it:

[18:02] <evand> d-i passwd/username string evan

[18:03] <evand> I could then place this file in the initrd as preseed.cfg, or I could reference it on the kernel 
command line.  For example:

[18:03] <evand> url=http://my.server.com/preseed.cfg

[18:03] <evand> Would tell the installer to fetch the preseed file from my webserver.

[18:04] <evand> Note that you can also preseed questions directly on the kernel command line.  For example, I could've 
just put this on the kernel command line and avoided using a file altogether:

[18:04] <evand> passwd/username=evan

[18:05] <evand> While there isn't a canonical list of possible questions, the installation guide should provide you 
with all of the questions you need.  Beyond that, you'll have to look at the "templates" file in the debian directory 
of the source package for the d-i component in question.

[18:06] <evand> For those of you coming from a Red Hat environment, note that kickstart files can be preseeded into an 
install by passing them via the ks= kernel command line parameter.  
https://help.ubuntu.com/community/KickstartCompatibility has more details.

[18:06] <evand> I should note that my experience with that bit of code is minimal.  Though I'll try to answer any 
questions on kickstart to the best of my ability.

[18:07] <evand> I should also mention that I've noted the kernel command line a couple of times.  It can be accessed 
by pressing F6 at the isolinux menu on the CD.

[18:08] <evand> Ok, so the desktop CD installer can be preseeded as well.

[18:08] <evand> Ubiquity, the live CD installer, put simply is actually a layer of GUI code on top of 
debian-installer.  Ubiquity takes the data the user enters on its pages and preseeds it as the answers to the relevant 
debian-installer questions.

[18:09] <evand> Each ubiquity page maps to one d-i component, with the exception being the partitioner, which maps two 
pages to the partman components.

[18:10] <evand> Again, this is greatly simplifying what is actually happening, but I only mention it to explain the 
link between the two installers.  *Most* of the questions you can preseed in d-i can also be preseeded in ubiquity.

[18:10] <evand> The exceptions to this are d-i components that ubiquity does not use and questions that ubiquity 
provides similiar functionality to, but under a different name.

[18:11] <evand> One such example of the latter is ubiquity/success_command, which will run a command or shell script 
upon successful completion of the installation.  This of course is similar to preseed/late_command.

[18:11] <evand> Another example would be ubiquity/reboot, which just as the name suggests, skips the final 
installation completed dialog and triggers a reboot of the system.  This is roughly equivalent to preseeding 
finish-install/reboot_in_progress.

[18:12] <evand> Also note that if you want to skip the usplash "please remove the CD and press any key to reboot" 
message, you'll need to add 'noprompt' to the kernel command line.

[18:13] <evand> Now, by default ubiquity will still ask questions that you've preseeded the answers to.  This can be 
avoided by either passing --automatic to ubiquity in a terminal window, or adding ubiquity-automatic to the kernel 
command line.

[18:14] <evand> Note that ubiquity-automatic gives you the same stripped down enviornment that the new "Install 
Ubuntu" menu option offers.

[18:14] <evand> Once you do this, any page that has had all of its questions answered correctly will not be shown.  An 
invalid answer, such as selecting cupsys for the username, will result in the page being shown with an error message 
and the script or command preseeded in ubiquity/automation_failure_command being called.

[18:15] <evand> FWIW, there is also a generic ubiquity/failure_command preseed key that is called whenever the install 
crashes.

[18:16] <evand> Also worth noting is that a failure to preseed one page properly does not mean the rest of the install 
will be manually done.

[18:16] <evand> Once the user corrects the error and presses next, it will continue along until it encounters another 
page with an unanswered question or starts to install.

[18:17] <evand> If you preseed all of the questions correctly and preseed ubiquity/reboot and add noprompt to the 
kernel command line, you'll have a completely unattended installation.

[18:17] <evand> This is what Wubi, the Windows Ubuntu Installer, does.  Its code, preseed file included, lives at 
https://code.launchpad.net/~ubuntu-installer/wubi/hardy .

[18:18] <evand> One last point -- what to do when things go wrong.  If the installer is still showing a page despite 
all of its questions being preseeded, run the installer in debug mode (ubiquity --debug).

[18:19] <evand> This will tell the installer to print the communication with debconf to /var/log/installer/debug.  You 
can then search the log file for "question will be asked".

[18:19] <evand> This can also be handled on the kernel command line via the debug-ubiquity argument.

[18:20] <evand> Ok, I think that about covers it.  I'm going to open this up to questions.  If you run into trouble 
later or we run out of time before you can ask, the ubuntu-installer mailing list is an appropriate forum for 
preseeding questions.  We also have an IRC channel, #ubuntu-installer.

[18:21] <evand> Do I have someone to help me paste questions?

[18:21] <tonyyarusso> Omahn> QUESTION: In the PXEInstallServer wiki page it mentions using PXE with Kickstart. Is the 
same PXE installation method compatible with  preseeding?

[18:22] <tonyyarusso> evand: (I can for a bit here)

[18:23] <evand> Yes, just replace the ks= with file= and the location of the preseed file.

[18:23] <evand> tonyyarusso: much appreciated.  Let me know when you have to leave and I'll take over.

[18:23] <evand> next.

[18:23] <tonyyarusso> Zelut> QUESTION: How much work is being done on the kickseed (kickstart to preseed) 
compatibility?  I'd argue kickstart syntax is more "human  readable" than preseed, which fits better into the Ubuntu 
ethos.

[18:24] <evand> Zelut: While it's more human readable, preseeding is built into the core of the installer, so 
kickstart compatibility will always be a matter of translation.

[18:24] <evand> Colin Watson has done most of the work on the kickstart compatibility and is always quick to fix any 
bugs that arise.

[18:24] <evand> Should you find an issue with kickseed I strongly encourage you to file a bug.

[18:25] <evand> next.

[18:25] <tonyyarusso> tonyyarusso> QUESTION:  Are there any special concerns when pre-seeding with the OEM install 
option?

[18:25] <evand> I'm not sure I understand the question.  You have to enable oem mode (oem-config/enable=true), but 
beyond that it should be pretty straightforward.

[18:26] <evand> Note that there were a few bugs in 8.04 for this...

[18:26] <tonyyarusso> What would those bugs be filed against?

[18:26] <evand> In particular the default language choice was not being carried over to the oem dialog.  I *think* we 
fixed that, though these kind of bugs often manage to find a way back into the code. :/

[18:27] <evand> Either against ubiquity or oem-config.

[18:27] <tonyyarusso> 'k

[18:27] <tonyyarusso> Omahn> Not sure if this could be answered here or not, but would commercial support from 
Canonical support the PXE and preseeded install process?

[18:27] <evand> Omahn: I *believe* so, but you would have to contact Canonical support for a definitive answer.

[18:27] <evand> next

[18:27] <tonyyarusso> tonyyarusso> QUESTION:  Can preseeding be used to specify packages to install/remove (like dpgk 
--set-selections) ?

[18:28] <evand> tonyyarusso: Yes, pkgsel/include.  See section B.4.10 of the install guide for more details.

[18:29] <tonyyarusso> Omahn> QUESTION: Is it possible to do a manual install and then 'retrieve' a log of preseeded 
options to use in future?

[18:29] <tonyyarusso> Ooh, that's brilliant.

[18:30] <evand> Omahn: debconf-get-selections

[18:30] <evand> So, yes.

[18:31] <evand> Note that you'll have to do that from the install environment and to my knowledge there's no easy menu 
item for doing it and pushing it somewhere.

[18:31] <evand> File a wishlist bug if you believe there should be.

[18:31] <evand> next.

[18:31] <tonyyarusso> Zelut> QUESTION: (building on Omahn's question).  The way anaconda auto-builds a .ks at 
installation would be *awesome* with Ubuntu.

[18:31] <tonyyarusso> That's more of a statement Zelut :)

[18:31] <evand> ^ File a bug and I'll see what I can do :)

[18:32] <evand> next

[18:32] <tonyyarusso> That's all I have at the moment - watching for any last minute ones.

[18:33] <evand> While we're waiting, I never did formally introduce myself...

[18:33] <evand> I'm Evan Dandrea, as you may have gathered I work on the installer, ubiquity specifically but d-i to a 
lesser extent, at Canonical.

[18:34] <evand> I'm also the author of migration-assistant and have been the Ubuntu end of Wubi's development over the 
8.04 cycle.

[18:35] <evand> If you have any questions, feel free to email the mailing list, or if you don't feel that's 
appropriate, email me directly at evand - ubuntu - com.

[18:35] <evand> The mailing list is ubuntu-installer@lists.ubuntu.com

[18:35] <tonyyarusso> evand: Is cjwatson still the d-i guy, or has he succeeded in passing that on?

[18:36] <evand> tonyyarusso: Colin still handles much of d-i, but over the longer term I believe I'll be responsible 
for most of it.

[18:37] <evand> If anyone is interested in getting involved in hacking on any part of the installer or the surrounding 
code (Wubi, Mythbuntu's installer code, etc), please see the wiki:

[18:37] <evand> http://wiki.ubuntu.com/InstallerDevelopment

[18:37] <evand> As mentioned there are a few wiki pages on preseeding, I'll try to organize those better going 
forward.

[18:37] <evand> Debian's wiki is also a great source for information:

[18:37] <evand> http://wiki.debian.org/DebianInstaller

[18:38] <evand> I think that covers it.  Thanks to all for your time.  Thank you tonyyarusso for fielding questions.

MeetingLogs/openweekhardy/PreseedingUbiquity (last edited 2008-08-06 16:19:28 by localhost)