OnWorks Linux and Windows Online WorkStations

Logo

Free Hosting Online for WorkStations

< Previous | Contents | Next >

There are several features of the Ubuntu Installer that combine to allow fairly simple command lines at the boot prompt to result in arbitrarily complex customized automatic installs.

This is enabled by using the Automated install boot choice, also called auto for some archi- tectures or boot methods. In this section, auto is thus not a parameter, it means selecting that boot choice, and appending the following boot parameters on the boot prompt.

To illustrate this, here are some examples that can be used at the boot prompt:


auto url=autoserver


This relies on there being a DHCP server that will get the machine to the point where autoserver can be resolved by DNS, perhaps after adding the local domain if that was provided by DHCP. If this was done at a site where the domain is example.com, and they


image

1. The owner of a debconf variable (or template) is normally the name of the package that contains the corresponding debconf template. For variables used in the installer itself the owner is “d-i”. Templates and variables can have more than one owner which helps to determine whether they can be removed from the debconf database if the package is purged.


have a reasonably sane DHCP setup, it would result in the preseed file being retrieved from

http://autoserver.example.com/d-i/bionic/./preseed.cfg.

The last part of that url (d-i/bionic/./preseed.cfg) is taken from auto-install/defaultroot. By default this includes the directory bionic to allow future versions to specify their own codename and let people migrate forwards in a controlled manner. The /./ bit is used to indicate a root, relative to which subsequent paths can be anchored (for use in preseed/include and preseed/run). This allows files to be specified either as full URLs, paths starting with / that are thus anchored, or even paths relative to the location where the last preseed file was found. This can be used to construct more portable scripts where an entire hierarchy of scripts can be moved to a new location without breaking it, for example copying the files onto a USB stick when they started out on a web server. In this example, if the preseed file sets preseed/run to /scripts/late_command.sh then the file will be fetched from http://autoserver.example.com/d-i/bionic/./scripts/late_command.sh.

If there is no local DHCP or DNS infrastructure, or if you do not want to use the default path to preseed.cfg, you can still use an explicit url, and if you don’t use the /./ element it will be anchored to the start of the path (i.e. the third / in the URL). Here is an example that requires minimal support from the local network infrastructure:


auto url=http://192.168.1.2/path/to/mypreseed.file


The way this works is that:


• if the URL is missing a protocol, http is assumed,

• if the hostname section contains no periods, it has the domain derived from DHCP appended to it, and

if there’s no /’s after the hostname, then the default path is added.


In addition to specifying the url, you can also specify settings that do not directly affect the behavior of debian-installer itself, but can be passed through to scripts specified using preseed/run in the loaded preseed file. At present, the only example of this is auto-install/classes, which has an alias classes. This can be used thus:


auto url=example.com classes=class_A;class_B


The classes could for example denote the type of system to be installed, or the localization to be used.

It is of course possible to extend this concept, and if you do, it is reasonable to use the auto-install namespace for this. So one might have something like auto-install/style which is then used in your scripts. If you feel the need to do this, please mention it on the

<[email protected]> mailing list so that we can avoid namespace conflicts, and perhaps add an alias for the parameter for you.

The auto boot choice is not yet defined on all arches, but the same effect may be achieved by sim- ply adding the two parameters auto=true priority=critical to the kernel command line. The auto kernel parameter is an alias for auto-install/enable and setting it to true delays the lo- cale and keyboard questions until after there has been a chance to preseed them, while priority is an alias for debconf/priority and setting it to critical stops any questions with a lower priority from being asked.


Additional options that may be of interest while attempting to automate an install while using DHCP are: interface=auto netcfg/dhcp_timeout=60 which makes the machine choose the first vi- able NIC and be more patient about getting a reply to its DHCP query.


Tip: An extensive example of how to use this framework, including example scripts and classes, can be found on the website of its developer (http://hands.com/d-i/). The examples available there also show many other nice effects that can be achieved by creative use of preconfiguration.


B.2.4. Aliases useful with preseeding

Top OS Cloud Computing at OnWorks: