-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
157 lines (127 loc) · 7.31 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<title>"Hands-off" Debian Installation</title>
<h1>"Hands-off" Debian Installation</h1>
<p><font size="+1"><b>WARNING:</b> <em>don't just blithely try this on a
machine you care about -- it will cheerfully re-partition the hard disk,
and overwrite your data, WITHOUT asking for permission once you've
launched it, and that can include things like external USB-attached
hard drives if you're unlucky, so unplug them if you want to keep them,
unless you mean for it to use them -- you have been warned.</em></font>
<hr>
<p>This site contains a framework for automatically installing Debian
systems, based on Etch (and beyond) versions of debian-installer.
<p>The software is available from the published areas
for <a href="jessie">Jessie</a> (with older areas
for <a href="squeeze">Squeeze</a> and <a href="lenny">lenny</a>. While
<a href="wheezy">Wheezy</a> exists, it's a symlink to the Jessie instance
(or was) and has not been heavilly tested -- reports of
success/failure welcome). You can also look at
the <a href="http://git.hands.com/hands-off">bleeding edge version</a>
in git, which you can clone thus (assuming that you want to publish
your copy from the /var/www/d-i directory on your local server):
<pre>
git clone http://git.hands.com/hands-off.git /var/www/d-i
</pre>
<hr>
<p><em>This is now documented in the <a
href="http://d-i.alioth.debian.org/manual/en.i386/apbs02.html#preseed-auto">debian-installer
manual for squeeze</a>, and the documentation there can be considered
more authoritative than what you find here (if you notice differences,
please mention them)</em>
<p>The features described depend on a new udeb called auto-install,
which is activated by setting the debconf variable
<tt>auto-install/enable</tt> to <tt>true</tt>, which on recent builds
of debian-installer media, is set automatically by selecting the
<tt>auto</tt> image at the boot prompt. This delays the kdb-chooser
and localechooser udebs until after network-preseed, allowing them to
be presseded via the network. Another feature of auto-install is to
expand preseed/url from a hostname to a full URL, if only a hostname
was provided.
<p>For example, assuming you have a recent enough boot medium, you
will be able to type something like the following at the boot prompt:
<pre>
boot: auto url=hands.com classes=xen3;loc/gb
</pre>
and get a Xen3 machine installed, with a UK keyboard and timezone,
without having to type another keystroke until the login prompt pops
up about 10 minutes later.
<h2>Parameters</h2>
<p>The slash-free parameters (like <tt>url</tt>) are actually just
aliases for normal debconf variables. So far the following aliases
have been defined:
<pre>
auto auto-install/enable
classes auto-install/classes
priority debconf/priority
url preseed/url
hostname netcfg/get_hostname
domain netcfg/get_domain
file preseed/file
locale debian-installer/locale
interface netcfg/choose_interface
fb debian-installer/framebuffer
suite mirror/suite
</pre>
<p>by invoking the <tt>auto</tt> target, you're just ensuring that <tt>auto=true
priority=critical</tt> is added to the kernel command line.
<h3>url=<em>magic</em></h3>
<p>The auto-install.udeb package provides some magic for creating full
preseed urls from either just a hostname or a fully qualified domain
name. If you provide a url that contains no slashes, auto-install's
postinst (which is run before network-preseed) assumes that you have
given it a hostname, and replaces it with a URL of the following form:
<pre>
http://<hostname>/d-i/lenny/./preseed.cfg
</pre>
<p>The <tt><hostname></tt> section of that is whatever you
provided as the URL, if it contained any dots, or, if it was without
dots (i.e. it's just the hostname) then the domain is added to it
(with that domain probably being found by netcfg, from a reverse
lookup of your DHCP IP address). The <tt>lenny</tt> bit of the path
matches the release the installer was part of. The <tt>/./</tt> bit
is used by preseed_fetch as the root of the preseed area, so this is
where paths starting with <tt>/</tt> are anchored.
<p>I'll repeat that, as it is quite important. If you want
to specify some other URL, to a directory on your USB stick say, then
you can tell the scripts where the top level of the preseed script
area is by including /./ in the path, thus:
<pre>
file:///hd-media/my_hands-off_path_on_stick/./preseed.cfg
</pre>
and things like preseed_fetch and the preseed includes will take the <tt>/./</tt> as the point to anchor paths starting with a <tt>/</tt>
<h3>Debugging flags:</h3>
<p>If you'd like to enable the -x flag in the top level scripts (or
your own scripts if you use the same technique) you can either do it
globally, by adding <pre> dbg/flags=all-x</pre> or selectively with
<pre> dbg/flags=early-x;late-x</pre> Similarly, you can make the installation
pause a various points with either <pre> dbg/pauses=all</pre>
or (for example) <pre> dbg/pauses=late;myclass</pre> assuming that you
included a pause that checks for the <tt>myclass</tt> flag in your
script(s) somewhere. This can be very handy to allow the chance to
look at the state of the install by flipping to the shell on F2/F3. In
addition to explicitly defined flags in your scripts, you can also pause
just before a class's early or late script by using the name of the class,
with <tt>/late</tt> or <tt>/early</tt> appended, so if you wanted to
pause just before <tt>.../classes/hands.com/general-tweaks/late_script</tt>
runs, you should add <pre> dbg/pauses=hands.com/general-tweaks/late</pre>
<p>To see how this works, look in the scripts for references to <tt>checkflag</tt>:
<pre> checkflag dbg/flags all-x early-x && set -x</pre>
and:
<pre> checkflag dbg/pauses all late && pause "Top Level Late Script"</pre>
<em>these two examples are taken from the top level early and late scripts respectively.</em>
<p>The <tt>checkflag</tt> function checks the named flag (so you can use it for your own purposes too) and if any of the semicolon (;) separated flags you've set match the ones passed to <tt>checkflag</tt> on the command line, then it returns true.
<h4>DEBCONF_DEBUG=5</h4>
If you're debugging a new preseed setup, I suggest that you set this on the kernel command line -- it causes the messages that end up in syslog (and so on the ALT-F4 screen) to be verbose enough that you can generally tell which preseed values you have forgotten when a question pops up. When you're presented with a question, flip to the F4 screen, and the last debconf variable mentioned is probably the one you need to set in order to not see that question again.
<hr>
<p>If you're basing significant effort on the current setup, you should
first mirror all the files (probably with a subversion check-out)
so you're not dependant on me maintaining backwards compatibility.
I'll endeavour to do so, but it would be a shame if I inadvertently broke
your setup the day before an important demo. Of course, you should audit
these scripts before trusting me not to install backdoors etc. and you
need to setup your own passwords and ssh keys.</b>
<p>If you find this useful, and have ideas about how to improve it, or
would like to contribute your recipes, please get in touch with <a
href="mailto:phil@hands.com">Philip
Hands</a>
<p>Have Fun!
<p>Cheers, Phil.