have different dists
[camarabuntu.git] / docs / InstallCDCustomization.html
blob125ce8712e24473e59db59a0cea3ebede6849dff
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html><head>
5 <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
6 <meta name="robots" content="index,nofollow"><title>InstallCDCustomization - Community Ubuntu Documentation</title>
11 <script type="text/javascript">
12 <!--// common functions
14 // We keep here the state of the search box
15 searchIsDisabled = false;
17 function searchChange(e) {
18 // Update search buttons status according to search box content.
19 // Ignore empty or whitespace search term.
20 var value = e.value.replace(/\s+/, '');
21 if (value == '' || searchIsDisabled) {
22 searchSetDisabled(true);
23 } else {
24 searchSetDisabled(false);
28 function searchSetDisabled(flag) {
29 // Enable or disable search
30 document.getElementById('fullsearch').disabled = flag;
31 document.getElementById('titlesearch').disabled = flag;
34 function searchFocus(e) {
35 // Update search input content on focus
36 if (e.value == 'Search') {
37 e.value = '';
38 e.style.color = 'black';
39 searchIsDisabled = false;
43 function searchBlur(e) {
44 // Update search input content on blur
45 if (e.value == '') {
46 e.value = 'Search';
47 e.style.color = 'gray';
48 searchIsDisabled = true;
52 function actionsMenuInit(title) {
53 // Initiliaze action menu
54 for (i = 0; i < document.forms.length; i++) {
55 var form = document.forms[i];
56 if (form.className == 'actionsmenu') {
57 // Check if this form needs update
58 var div = form.getElementsByTagName('div')[0];
59 var label = div.getElementsByTagName('label')[0];
60 if (label) {
61 // This is the first time: remove label and do buton.
62 div.removeChild(label);
63 var dobutton = div.getElementsByTagName('input')[0];
64 div.removeChild(dobutton);
65 // and add menu title
66 var select = div.getElementsByTagName('select')[0];
67 var item = document.createElement('option');
68 item.appendChild(document.createTextNode(title));
69 item.value = 'show';
70 select.insertBefore(item, select.options[0]);
71 select.selectedIndex = 0;
76 //-->
77 </script>
79 <link rel="stylesheet" type="text/css" charset="utf-8" media="all" href="InstallCDCustomization_files/common.css">
80 <link rel="stylesheet" type="text/css" charset="utf-8" media="screen" href="InstallCDCustomization_files/screen.css">
81 <link rel="stylesheet" type="text/css" charset="utf-8" media="print" href="InstallCDCustomization_files/print.css">
82 <link rel="stylesheet" type="text/css" charset="utf-8" media="projection" href="InstallCDCustomization_files/projection.css">
84 <link rel="Start" href="https://help.ubuntu.com/community/UserDocumentation">
85 <link rel="Alternate" title="Wiki Markup" href="https://help.ubuntu.com/community/InstallCDCustomization?action=raw">
86 <link rel="Alternate" media="print" title="Print View" href="https://help.ubuntu.com/community/InstallCDCustomization?action=print">
87 <link rel="Search" href="https://help.ubuntu.com/community/FindPage">
88 <link rel="Index" href="https://help.ubuntu.com/community/TitleIndex">
89 <link rel="Glossary" href="https://help.ubuntu.com/community/WordIndex">
90 <link rel="Help" href="https://help.ubuntu.com/community/HelpOnFormatting"></head><body dir="ltr" lang="en">
92 <script xmlns="" src="InstallCDCustomization_files/urchin.js" type="text/javascript"></script>
93 <script xmlns="" type="text/javascript"><![CDATA[
94 _uacct = "UA-1018242-8";
95 urchinTracker();
96 ]]></script>
97 <div id="header">
98 <div id="mastwrap"><div id="masthead">
99 <div id="logo"><a href="https://help.ubuntu.com/community/UserDocumentation">Community Ubuntu Documentation</a></div>
101 <form id="searchform" method="get" action="">
102 <div>
103 <input name="action" value="fullsearch" type="hidden">
104 <input name="context" value="180" type="hidden">
105 <label style="display: none;" for="searchinput">Search:</label>
106 <input style="color: gray;" id="searchinput" name="value" value="" size="20" onfocus="searchFocus(this)" onblur="searchBlur(this)" onkeyup="searchChange(this)" onchange="searchChange(this)" alt="Search" type="text">
107 <input disabled="disabled" id="titlesearch" name="titlesearch" value="Titles" alt="Search Titles" type="submit">
108 <input disabled="disabled" id="fullsearch" name="fullsearch" value="Text" alt="Search Full Text" type="submit">
109 </div>
110 </form>
111 <script type="text/javascript">
112 <!--// Initialize search form
113 var f = document.getElementById('searchform');
114 f.getElementsByTagName('label')[0].style.display = 'none';
115 var e = document.getElementById('searchinput');
116 searchChange(e);
117 searchBlur(e);
118 //-->
119 </script>
122 <div id="sisternav">
123 <ul>
124 <li id="plain">
125 <a href="https://help.ubuntu.com/6.06" accesskey="t">6.06 LTS</a>
126 </li>
127 <li id="plain">
128 <a href="https://help.ubuntu.com/6.10" accesskey="t">6.10</a>
129 </li>
130 <li id="plain">
131 <a href="https://help.ubuntu.com/7.04" accesskey="t">7.04</a>
132 </li>
133 <li id="current">
134 <a href="https://help.ubuntu.com/community" accesskey="t">Community Docs</a>
135 </li>
136 </ul>
137 </div>
139 </div></div>
141 <ul class="extranav">
142 <li><a href="https://help.ubuntu.com/community/UserDocumentation">User Documentation</a></li>
143 </ul>
144 <ul class="editbar">
145 <li><a href="https://help.ubuntu.com/community/UserPreferences">Login to edit</a></li>
146 </ul>
148 </div>
150 <div id="page" dir="ltr" lang="en"><!-- start page -->
153 <h1 id="title"><a title="Click to do a full-text search for this title" href="https://help.ubuntu.com/community/InstallCDCustomization?action=fullsearch&amp;value=linkto%3A%22InstallCDCustomization%22&amp;context=180">InstallCDCustomization</a></h1>
154 <div id="content" dir="ltr" lang="en">
155 <a id="top"></a>
157 <h2 id="head-5192ce1e24c39e2c219ee84c77d1facc67df36b6">Introduction</h2>
159 <div>
160 <table style="margin: 0pt 0pt 1em 1em; background: rgb(241, 241, 237) none repeat scroll 0%; float: right; font-size: 0.9em; width: 40%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
161 <tbody><tr>
162 <td style="padding: 0.5em;">
163 <p><strong>Contents</strong><br>
164 </p><ol>
166 <li>
167 <a href="#head-5192ce1e24c39e2c219ee84c77d1facc67df36b6">Introduction</a>
168 </li>
170 <li>
171 <a href="#head-9d1a3d714aed40c91816f80ab370b9e2f40a85d7">Copy the CD to your hard drive</a>
172 </li>
174 <li>
175 <a href="#head-d2e2ac6138c17dbdea4fdc90935c64eadf6388d7">Modify installer behaviour using a Preseed file</a>
176 <ol>
178 <li>
179 <a href="#head-7dcb221f59b638ccc230c960b84f7142cb529598">Changing isolinux.cfg to identify your preseed</a>
180 </li>
182 <li>
183 <a href="#head-8146e87a03e53f7f2e8054e8a5357ce73328a069">Writing the preseed file</a>
184 <ol>
186 <li>
187 <a href="#head-ef2e9dd3852d43c576419b138c08a8badb5fb201">Installing extra packages in your preseed file</a>
188 </li>
190 <li>
191 <a href="#head-d4564e7c1ca9ba83039194914c7a038f82386708">Installing language support</a>
192 </li>
194 </ol>
196 </li>
198 </ol>
200 </li><li>
201 <a href="#head-0b4ac1d7b5afcc2896ed74e3f4db510e78b6dbd9">Modify pool structure to include more packages</a>
202 <ol>
204 <li>
205 <a href="#head-a281fb90fe726169881eb2bc5b7538bd2c797894">Create an "Extras" component</a>
206 </li>
208 <li>
209 <a href="#head-c2ca6d4f437c6eb289c74da5e2de3d07e0e7ec6c">Generating a new ubuntu-keyring .deb to sign your CD</a>
210 </li>
212 <li>
213 <a href="#head-64f09b8efc91c8720625d786644a5925baa0e765">Building the repository with apt-ftparchive</a>
214 </li>
216 </ol>
218 </li><li>
219 <a href="#head-30cfb1b3b402eb06607063a07b0be1cf36bf6370">Burning the CD</a>
220 <ol>
222 <li>
223 <a href="#head-5ae85e13446f4f6f4894a0229eaddeebd9110e47">Building the ISO image</a>
224 </li>
226 <li>
227 <a href="#head-b608d9bfa1a6ea622a06fa8eb631b14cfd9a21cd">Burning the image to CD</a>
228 </li>
230 </ol>
232 </li><li>
233 <a href="#head-9737bc717e810989d4b227c3f20f8104fedddbcd">Testing</a>
234 </li>
236 <li>
237 <a href="#head-1bdc2fc30bfeec710e57a255f742eaa29a84dac0">Troubleshooting</a>
238 </li>
240 <li>
241 <a href="#head-5d88ebbde02f5748aa759a85a490ce6e75581e31">See also</a>
242 </li>
244 </ol>
246 </td>
247 </tr>
248 </tbody></table>
249 </div>
250 <p>The process of customizing or "remastering" Ubuntu install CDs is
251 not especially complex, but it is a little tedious and finicky. This
252 page documents all the problems you might find; if it doesn't, please
253 edit it! </p>
254 <p>The Ubuntu install CD (since Ubuntu 6.06, the 'alternative install'
255 or 'server' CD) has three main parts: a boot-loader (ISOLINUX on
256 AMD64/x86 systems, yaboot on PowerPC) and its configuration, which
257 start everything up; debian-installer (also known as d-i), which in
258 this case is really a specialized miniature Ubuntu system; and a
259 Debian-style repository structure, which is what takes up all that
260 space on the disk in the directories "pool" and "dists". Building a new
261 CD may involve modifications to all three parts. </p>
262 <p>This page shows a simple recipe for customizing the CD. It assumes that you copy the contents of the install CD to <tt>/opt/build/</tt> on your local system and create a couple of other dirs in <tt>/opt/</tt>. Modify as needed. </p>
264 <h2 id="head-9d1a3d714aed40c91816f80ab370b9e2f40a85d7">Copy the CD to your hard drive</h2>
266 <p><img src="InstallCDCustomization_files/IconsPage.png" alt="warning.png"> This guide is for the Alternative Install or Server Install CDs; there is another page referrring to <a href="https://help.ubuntu.com/community/LiveCDCustomization"> customization of the Desktop/Live CD</a>. </p>
267 <p>Copy the entire installation CD to a directory on your hard drive.
268 This guide will assume your CD image is in /opt/cd-image/, but you can
269 put it wherever you like. It will take around 1GB of hard drive space. </p>
270 <p>If you have an ISO file, you can mount it and copy files out of it without burning it to CD: <tt>mount&nbsp;-o&nbsp;loop&nbsp;/path/to/iso&nbsp;/some/mountpoint</tt>. </p>
271 <p>You can use <strong>rsync</strong> to copy the CD, or just </p>
273 <pre>mkdir -p /opt/cd-image
274 cp -rT /cdrom /opt/cd-image
275 </pre>
276 <p>Be sure to catch the folder <em>.disk</em> - if you try and copy /cdrom/*, it will ignore the .disk folder, as Bash expands the * to mean "everything it can see". </p>
278 <h2 id="head-d2e2ac6138c17dbdea4fdc90935c64eadf6388d7">Modify installer behaviour using a Preseed file</h2>
280 <p>When the CD boots up, a Linux kernel is started and the installation
281 tasks are initiated. The installer's default behavior can be modified
282 through the use of a "preseed" file, which feeds d-i answers to
283 questions normally asked by debconf, or in other contexts. If you look
284 in the <tt>preseed</tt> folder in the install CD, you'll see that
285 certain options (e.g. "server", "expert", "oem") already have preseed
286 files assigned to them. The Edgy (6.10) <a class="external" href="https://help.ubuntu.com/6.10/ubuntu/installation-guide/i386/appendix-preseed.html"><img src="InstallCDCustomization_files/u-www.png" alt="[WWW]" height="16" width="16"> installation guide</a> has a detailed appendix on preseeding (although see below for details on differences between Edgy and earlier versions). </p>
287 <p>Suppose you are installing Ubuntu on a bunch of identical computers,
288 and you already know the answers to certain questions (what country and
289 time zone you're in, what keyboard you have, how the network should be
290 configured, how you want to partition the hard disk, etc). You can
291 "preseed" the answers to these questions in a very simple configuration
292 file. </p>
294 <h3 id="head-7dcb221f59b638ccc230c960b84f7142cb529598">Changing isolinux.cfg to identify your preseed</h3>
296 <p>We will create a preseed file called 'firewall.seed', which will
297 live in the /preseed folder of the CD-ROM. We tell d-i where to find
298 this file by modifying the boot-loader configuration file, located in
299 isolinux/isolinux.cfg, to pass appropriate parameters on the kernel
300 command line. In /opt/cd-image/isolinux/isolinux.cfg, add a new section
301 labeled like this: </p>
303 <pre>LABEL firewall
304 menu label ^Firewall installation
305 kernel /install/vmlinuz
306 append preseed/file=/cdrom/preseed/firewall.seed debian-installer/locale=en_NZ kbd-chooser/method=us initrd=/install/initrd.gz ramdisk_size=16384 root=/dev/ram rw quiet --
307 </pre>
308 <p>If you want to set the default action to booting with your custom seed, change the DEFAULT line to read 'DEFAULT firewall'. </p>
309 <p>You must specify a locale and keyboard on the command line, as these
310 questions are asked before the seed is loaded. You can also set
311 DEBCONF_PRIORITY here to ensure you don't see any unnecessary debconf
312 questions. </p>
314 <h3 id="head-8146e87a03e53f7f2e8054e8a5357ce73328a069">Writing the preseed file</h3>
316 <p>A preseed file has 4 fields per line: </p>
317 <ol type="1">
318 <li><p>identity of the program which will pick up this command </p>
319 </li>
320 <li><p>name of the variable whose value will be passed </p>
321 </li>
322 <li><p>variable type </p>
323 </li>
324 <li><p>value of variable </p>
325 </li>
326 </ol>
327 <p>It looks something like this (from the default ubuntu-server.seed on the 6.06 CD): </p>
328 <ul>
329 <li style="list-style-type: none;">
330 <pre># Always install the server kernel.
331 d-i base-installer/kernel/override-image string linux-server
332 # Don't install usplash.
333 d-i base-installer/kernel/linux/extra-packages-2.6 string
334 # Desktop system not installed; don't waste time and disk space copying it.
335 d-i archive-copier/desktop-task string ubuntu-standard
336 d-i archive-copier/ship-task string
337 # Only install the standard system and language packs.
338 d-i pkgsel/install-pattern string ~t^ubuntu-standard$
339 d-i pkgsel/language-pack-patterns string
340 # No language support packages.
341 d-i pkgsel/install-language-support boolean false
342 </pre>
343 </li>
344 </ul>
345 <p><img src="InstallCDCustomization_files/IconsPage_002.png" alt="important.png"> The version of this file on some Breezy CD images was buggy: it set base-config/package-selection to <tt>"~tubuntu-standard"</tt> rather than <tt>"~t^ubuntu-standard$"</tt>. Use the new format in preference; the old one will break with Ubuntu 6.06 and newer.) </p>
346 <p><img src="InstallCDCustomization_files/IconsPage_002.png" alt="important.png"> d-i expects there to be <a class="external" href="http://d-i.alioth.debian.org/manual/en.i386/apbs03.html"><img src="InstallCDCustomization_files/u-www.png" alt="[WWW]" height="16" width="16"> exactly one tab or space between variable type and variable value</a> (any other space is seen as being part of the value) </p>
347 <p>The easiest way to create a preseed file is to start with an example and modify it: </p>
348 <ol type="1">
349 <li><p>You could check out <a class="external" href="http://wiki.debian.org/DebianInstaller/Preseed"><img src="InstallCDCustomization_files/u-www.png" alt="[WWW]" height="16" width="16"> Debian's wiki page on preseeding the installer</a> - 6.06 and higher use the Etch version of the Debian installer. </p>
350 </li>
351 <li><p>The Edgy (6.10) <a class="external" href="https://help.ubuntu.com/6.10/ubuntu/installation-guide/i386/preseed-contents.html"><img src="InstallCDCustomization_files/u-www.png" alt="[WWW]" height="16" width="16"> install guide</a> has examples of many common preseed directives. (Bear in mind that you may need to modify some to work on older versions.) </p>
352 </li>
353 <li><p>If you can't find the option you're looking for you can generate
354 a comprehensive preseed file based on your own install time choices by
355 using <tt>debconf-get-selections</tt> </p>
356 </li>
357 </ol>
358 <p><tt>debconf-get-selections</tt> usage:
359 </p>
360 <pre>sudo apt-get install debconf-utils # It is part of the debconf-utils package.
361 debconf-get-selections --installer &gt; somefile.txt
362 debconf-get-selections &gt;&gt; somefile.txt
363 </pre>
364 <p>This will output a list of all debconf options you've chosen
365 throughout your install; you can pick options out of this and put them
366 into your preseed file. </p>
367 <p><img src="InstallCDCustomization_files/IconsPage.png" alt="warning.png"> debconf-get-selections prints <strong>2</strong>
368 spaces between variable type and variable value. You need to change
369 this to one space before putting the line in a preseed file. </p>
371 <h4 id="head-ef2e9dd3852d43c576419b138c08a8badb5fb201">Installing extra packages in your preseed file</h4>
373 <p>base-config has been removed from debian-installer since Ubuntu 6.06. Use: </p>
375 <pre>d-i pkgsel/install-pattern string ~t^ubuntu-standard$|~n^openssh-server$
376 </pre>
378 <h4 id="head-d4564e7c1ca9ba83039194914c7a038f82386708">Installing language support</h4>
380 <p>A different mechanism is used to install additional languages.
381 Preseed the detailed locale question asked by the installer in expert
382 mode. See the first column of <tt>/usr/share/i18n/SUPPORTED</tt> for the locale names you can use here. For example, to add support for Bengali and Tamil, use this line: </p>
384 <pre>d-i localechooser/supported-locales multiselect bn_IN, ta_IN
385 </pre>
387 <h2 id="head-0b4ac1d7b5afcc2896ed74e3f4db510e78b6dbd9">Modify pool structure to include more packages</h2>
389 <p>Probably the prime motivation to build your own install CDs is to
390 modify which packages are installed; in particular you may want to add
391 some packages to the CD. </p>
392 <p>The easiest way to do this is to build an 'extras' repository
393 structure, containing only your extra .debs, and merge these into the
394 CD file hierarchy before rebuilding the .ISO image. This guide will
395 step you through how to do this. </p>
396 <p>This requires you to generate the Packages files that defines what
397 files are in your repository; the Release file that indexes your
398 Packages files, and the signed Release.gpg file, approving the
399 repository as being official. </p>
401 <h3 id="head-a281fb90fe726169881eb2bc5b7538bd2c797894">Create an "Extras" component</h3>
403 <p>Create directories for your new component (substituting your version where appropriate): </p>
404 <ul>
405 <li style="list-style-type: none;">
406 <pre>cd /opt/cd-image
407 mkdir -p dists/dapper/extras/binary-i386 pool/extras/ isolinux preseed
408 </pre>
409 </li>
410 </ul>
411 <p>Put all the extra .debs you want on your CD into <tt>pool/extras</tt>. </p>
412 <p>Create the file <tt>dists/dapper/extras/binary-i386/Release</tt> with the following content: </p>
413 <ul>
414 <li style="list-style-type: none;">
415 <pre>Archive: dapper
416 Version: 6.06
417 Component: extras
418 Origin: Ubuntu
419 Label: Ubuntu
420 Architecture: i386
421 </pre>
422 </li>
423 </ul>
424 <p>On the <a href="https://help.ubuntu.com/community/InstallCDCustomization/Scripts">scripts page</a>
425 there is a useful script that will strip out all of the packages from
426 your CD image that are not currently installed. You will need to run <tt>apt-ftparchive</tt> (below) to generate the Packages file. </p>
428 <h3 id="head-c2ca6d4f437c6eb289c74da5e2de3d07e0e7ec6c">Generating a new ubuntu-keyring .deb to sign your CD</h3>
430 <p>In order to sign the Release file, we need to use GPG. The install
431 system will then check the signature against the public keys held in
432 the package ubuntu-keyring. You do not have a private key that matches
433 one of the ones in the shipped ubuntu-keyring, so we need to build a
434 custom version of the ubuntu-keyring package. Install the <tt>gnupg</tt> package if you do not have it already. </p>
435 <p>To create a signing key, enter <tt>gpg&nbsp;--gen-key</tt>. Accept
436 the defaults, (for this use, it is probably OK to use "No expiry"). For
437 your Real Name and E-mail address, you might like to use something like
438 "XXX Signing Key" and "<a href="mailto:packages@xxx.example.org"><img src="InstallCDCustomization_files/u-email.png" alt="[MAILTO]" height="13" width="23"> packages@xxx.example.org</a>". Enter an appropriate passphrase. </p>
439 <p>In another directory (I use <tt>/opt/build/</tt>), we will download
440 the source for the ubuntu-keyring package, unpack it, add our own GPG
441 key, and rebuild the package. These steps import the 2 Ubuntu public
442 signing keys into your main keyring, then exports them, along with your
443 own public signing key, into a replacement keyring. "YOURKEYID" should
444 be replaced with the 8-digit hexadecimal code that gpg tells you when
445 you do the --list-keys command."Signing Key Name" is what you used in
446 the previous step, when running <tt>gpg&nbsp;--gen-key</tt>. </p>
447 <p>To clarify, below is an example 'gpg --list-keys' response. In this
448 example, "YOURKEYID" immediately follows the '/' on the line beginning
449 with 'pub' (which in this example is '437D05B5'.) </p>
451 <pre>gpg --list-keys
452 pub 1024D/437D05B5 2006-09-08
453 uid XXX Signing Key &lt;packages@xxx.example.org&gt;
454 sub 2048g/79164387 2006-09-08
455 </pre>
456 <p>Here is an example, which you will need to customize to suit your own setup: </p>
458 <pre>cd /opt/build
459 sudo apt-get install fakeroot # requires the fakeroot package which may not be installed on your system.
460 apt-get source ubuntu-keyring
461 cd ubuntu-keyring-2005.01.12.1/keyrings
462 gpg --import &lt; ubuntu-archive-keyring.gpg
463 gpg --list-keys "Signing Key Name"
464 gpg --export FBB75451 437D05B5 YOURKEYID &gt; ubuntu-archive-keyring.gpg
465 cd .. # you are now on ubuntu-keyring-2005.01.12.1
466 dpkg-buildpackage -rfakeroot -m"Your Name &lt;your.email@your.host&gt;" -kYOURKEYID
467 cd .. # you are now on the directory where you started, in the example, /opt/build
468 cp ubuntu-keyring*deb /opt/cd-image/pool/main/u/ubuntu-keyring
469 </pre>
470 <p>You will end up with a udeb file for the installer, and a .deb file for the system. Both files need to be copied into the <strong>main</strong> component of your CD, because the CD will not check the extras directory. </p>
472 <h3 id="head-64f09b8efc91c8720625d786644a5925baa0e765">Building the repository with apt-ftparchive</h3>
474 <p><tt>apt-ftparchive</tt> builds the <tt>Packages</tt> and <tt>Packages.gz</tt> files, needed by the installer. In order to use <tt>apt-ftparchive</tt> we will need to provide it with some configuration and some index files. </p>
475 <p>We will put the index files in <tt>/opt/indices</tt>: </p>
476 <ul>
477 <li style="list-style-type: none;">
478 <pre>mkdir -p /opt/indices /opt/apt-ftparchive
479 cd /opt/indices/
480 DIST=dapper; wget http://archive.ubuntu.com/ubuntu/indices/override.$DIST.{extra.main,main,main.debian-installer,restricted,restricted.debian-installer}
481 </pre>
482 </li>
483 </ul>
484 <p>Create the files <tt>apt-ftparchive-deb.conf</tt>, <tt>apt-ftparchive-udeb.conf</tt>, <tt>apt-ftparchive-extras.conf</tt>, and <tt>release.conf</tt> in a directory (<tt>/opt/apt-ftparchive</tt>), substituting <tt>/opt/cd-image/</tt> for the path to your CD image directory, and <tt>/opt/indices/</tt> for the location of the index files, if they differ. </p>
485 <p><span class="u">/opt/apt-ftparchive/apt-ftparchive-deb.conf:</span> </p>
486 <ul>
487 <li style="list-style-type: none;">
488 <pre>Dir {
489 ArchiveDir "/opt/cd-image/";
492 TreeDefault {
493 Directory "pool/";
496 BinDirectory "pool/main" {
497 Packages "dists/dapper/main/binary-i386/Packages";
498 BinOverride "/opt/indices/override.dapper.main";
499 ExtraOverride "/opt/indices/override.dapper.extra.main";
502 BinDirectory "pool/restricted" {
503 Packages "dists/dapper/restricted/binary-i386/Packages";
504 BinOverride "/opt/indices/override.dapper.restricted";
507 Default {
508 Packages {
509 Extensions ".deb";
510 Compress ". gzip";
514 Contents {
515 Compress "gzip";
517 </pre>
518 </li>
519 </ul>
520 <p>The <a class="nonexistent" href="https://help.ubuntu.com/community/ExtraOverride">ExtraOverride</a>
521 component above is needed to add the Task header to main packages,
522 referenced from the preseed file with ~t&lt;task name&gt;. This is not
523 supplied - but can be extracted from the existing main Packages file
524 with a simple perl script :- </p>
525 <ul>
526 <li style="list-style-type: none;">
527 <pre>#! /usr/bin/perl
528 # extraoverride.pl
529 # generate ExtraOverride file
530 # use as follows :-
531 # extraoverride.pl &lt; /opt/cd-image/dists/dapper/main/binary-i386/Packages &gt; /opt/indices/override.dapper.extra.main
533 while (&lt;&gt;) {
534 chomp;
535 next if /^ /;
536 if (/^$/ &amp;&amp; defined($task)) {
537 print "$package Task $task\n";
538 undef $package;
539 undef $task;
541 ($key, $value) = split /: /, $_, 2;
542 if ($key eq 'Package') {
543 $package = $value;
545 if ($key eq 'Task') {
546 $task = $value;
549 </pre>
550 </li>
551 </ul>
552 <p><span class="u">/opt/apt-ftparchive/apt-ftparchive-udeb.conf:</span> </p>
553 <ul>
554 <li style="list-style-type: none;">
555 <pre>Dir {
556 ArchiveDir "/opt/cd-image/";
559 TreeDefault {
560 Directory "pool/";
563 BinDirectory "pool/main" {
564 Packages "dists/dapper/main/debian-installer/binary-i386/Packages";
565 BinOverride "/opt/indices/override.dapper.main.debian-installer";
568 BinDirectory "pool/restricted" {
569 Packages "dists/dapper/restricted/debian-installer/binary-i386/Packages";
570 BinOverride "/opt/indices/override.dapper.restricted.debian-installer";
573 Default {
574 Packages {
575 Extensions ".udeb";
576 Compress ". gzip";
580 Contents {
581 Compress "gzip";
583 </pre>
584 </li>
585 </ul>
586 <p><span class="u">/opt/apt-ftparchive/apt-ftparchive-extras.conf:</span> </p>
587 <ul>
588 <li style="list-style-type: none;">
589 <pre>Dir {
590 ArchiveDir "/opt/cd-image/";
593 TreeDefault {
594 Directory "pool/";
597 BinDirectory "pool/extras" {
598 Packages "dists/dapper/extras/binary-i386/Packages";
601 Default {
602 Packages {
603 Extensions ".deb";
604 Compress ". gzip";
608 Contents {
609 Compress "gzip";
611 </pre>
612 </li>
613 </ul>
614 <p><span class="u">release.conf</span> </p>
615 <p>This is the configuration file for apt-ftparchive. Change to suit your distribution version: </p>
616 <ul>
617 <li style="list-style-type: none;">
618 <pre>APT::FTPArchive::Release::Origin "Ubuntu";
619 APT::FTPArchive::Release::Label "Ubuntu";
620 APT::FTPArchive::Release::Suite "dapper";
621 APT::FTPArchive::Release::Version "6.06";
622 APT::FTPArchive::Release::Codename "dapper";
623 APT::FTPArchive::Release::Architectures "i386";
624 APT::FTPArchive::Release::Components "main restricted extras";
625 APT::FTPArchive::Release::Description "Ubuntu 6.06 LTS";
626 </pre>
627 </li>
628 </ul>
629 <p>To build the repository, sign it, and update the MD5SUM file, you can use a script like this: </p>
631 <pre>BUILD=/opt/cd-image
632 APTCONF=/opt/apt-ftparchive/release.conf
633 DISTNAME=dapper
635 pushd $BUILD
636 apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-deb.conf
637 apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-udeb.conf
638 apt-ftparchive -c $APTCONF generate /opt/apt-ftparchive/apt-ftparchive-extras.conf
639 apt-ftparchive -c $APTCONF release $BUILD/dists/$DISTNAME &gt; $BUILD/dists/$DISTNAME/Release
641 gpg --default-key "YOURKEYID" --output $BUILD/dists/$DISTNAME/Release.gpg -ba $BUILD/dists/$DISTNAME/Release
642 find . -type f -print0 | xargs -0 md5sum &gt; md5sum.txt
643 popd
644 </pre>
646 <h2 id="head-30cfb1b3b402eb06607063a07b0be1cf36bf6370">Burning the CD</h2>
648 <p>At this point, you have a directory which is ready to be collected into an .ISO file and then burnt to a CD. </p>
650 <h3 id="head-5ae85e13446f4f6f4894a0229eaddeebd9110e47">Building the ISO image</h3>
652 <p><span class="u">x86 and AMD64</span> </p>
654 <pre>IMAGE=custom.iso
655 BUILD=/opt/cd-image/
657 mkisofs -r -V "Custom Ubuntu Install CD" \
658 -cache-inodes \
659 -J -l -b isolinux/isolinux.bin \
660 -c isolinux/boot.cat -no-emul-boot \
661 -boot-load-size 4 -boot-info-table \
662 -o $IMAGE $BUILD
663 </pre>
664 <p><span class="u">Power PC</span> </p>
665 <p>Download <a class="external" href="http://people.ubuntu.com/%7Ecjwatson/hfs.map"><img src="InstallCDCustomization_files/u-www.png" alt="[WWW]" height="16" width="16"> the HFS map</a>, then use the following command:
666 </p>
667 <pre>IMAGE=custom.iso
668 BUILD=/opt/cd-image/
670 mkisofs -r -V "Custom Ubuntu Install CD" \
671 --netatalk -hfs -probe -map hfs.map \
672 -chrp-boot -iso-level 2 -part -no-desktop \
673 -hfs-bless $BUILD/install \
674 -hfs-volid Ubuntu/PowerPC_dapper \
675 -o $IMAGE $BUILD
676 </pre>
677 <p><span class="u">ia64</span>
678 </p>
679 <pre>IMAGE=custom.iso
680 BUILD=/opt/cd-image/
682 mkisofs -r -V 'Custom Ubuntu Install CD' \
683 -o $IMAGE -no-emul-boot \
684 -J -b boot/boot.img -c boot/boot.catalog $BUILD
685 </pre>
686 <ul>
687 <li style="list-style-type: none;"><p>$IMAGE is just the location of your iso image. </p>
688 </li>
689 </ul>
691 <h3 id="head-b608d9bfa1a6ea622a06fa8eb631b14cfd9a21cd">Burning the image to CD</h3>
693 <p>To detect the location of your CD drive, try <tt>cdrecord&nbsp;--scanbus</tt>. For a primary IDE CD drive on /dev/hdc: </p>
695 <pre>sudo nice -18 cdrecord dev=ATA:0,1,0 --speed=24 --blank=fast -v -gracetime=2 -tao $IMAGE
696 </pre>
697 <p>You will burn a lot of coasters in experimenting with this process, so please use rewritable media! </p>
699 <h2 id="head-9737bc717e810989d4b227c3f20f8104fedddbcd">Testing</h2>
701 <p>You can now boot off your CD. Select the new menu item you created.
702 If you've used preseeding to stop the CD asking questions, the
703 installation could be totally automatic. </p>
705 <h2 id="head-1bdc2fc30bfeec710e57a255f742eaa29a84dac0">Troubleshooting</h2>
707 <ul>
708 <li><p> If your CD fails to read, try re-burning it, possibly at a slower speed. </p>
709 </li>
710 <li><p> If you get a red d-i screen, check the error message (use
711 Alt-F2, Alt-F3 etc to cycle through the terminals to read the log), and
712 fix your CD appropriately. </p>
713 </li>
714 </ul>
716 <h2 id="head-5d88ebbde02f5748aa759a85a490ce6e75581e31">See also</h2>
718 <p>Check out some <a href="https://help.ubuntu.com/community/InstallCDCustomization/Scripts">install CD customization scripts</a> that can be used to automate this process. </p>
719 <a id="bottom"></a>
721 </div>
722 <p id="pageinfo" class="info" dir="ltr" lang="en">last edited 2007-06-04 10:03:27 by <span title="202-89-158-1.dyn-dsl.ubs.qsi.net.nz"><a href="https://help.ubuntu.com/community/CraigBox">CraigBox</a></span></p>
724 </div> <!-- end page -->
727 <div id="footer">
729 <div id="ubuntulinks">
730 © 2007 <a href="http://www.canonical.com/">Canonical Ltd</a>. Ubuntu, Kubuntu, Edubuntu and Canonical are registered trademarks of Canonical Ltd.<br>
731 <a href="https://help.ubuntu.com/community/WikiGuide">Feedback</a>
732 <a href="https://help.ubuntu.com/community/License">Legal</a>
733 <a href="https://help.ubuntu.com/community/Credits">Credits</a>
734 <br>
735 <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
736 <img alt="Creative Commons License" style="border-width: 0pt;" src="InstallCDCustomization_files/80x15.png">
737 </a>
738 </div>
741 </div>
742 </body></html>