/usr/share/doc/live-manual/html/examples.de.html is in live-manual-html 1:3.0~a9-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
examples -
Debian Live Handbuch
</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="dc.title" content="Debian Live Handbuch" />
<meta name="dc.author" content="Debian Live Projekt <debian-live@lists.debian.org>" />
<meta name="dc.publisher" content="Debian Live Projekt <debian-live@lists.debian.org>" />
<meta name="dc.date" content="2011-12-04" />
<meta name="dc.rights" content="Copyright (C) 2006-2011 Debian Live Projekt;<br> License: Dieses Programm ist freie Software. Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation veröffentlicht, weitergeben und/oder modifizieren, entweder gemäss Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren Version.<br><br>Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, dass es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details finden Sie in der GNU General Public License.<br><br>Sie sollten ein Exemplar der GNU General Public License zusammen mit diesem Programm erhalten haben. Falls nicht, siehe <http://www.gnu.org/licenses/>.<br><br>Der komplette Text der GNU General Public License kann in der Datei /usr/share/common-licenses/GPL-3 gefunden werden." />
<meta name="generator" content="SiSU 3.1.9 of 2011w51/1 (2011-12-19) (n*x and Ruby!)" />
<link rel="generator" href="http://www.sisudoc.org/" />
<link rel="shortcut icon" href="../_sisu/image/rb7.ico" />
<link rel="stylesheet" href="../_sisu/css/html.css" type="text/css" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#003090" lang="en" xml:lang="en">
<a name="top" id="top"></a>
<a name="up" id="up"></a>
<a name="start" id="start"></a><table summary="segment navigation band with banner" bgcolor="#ffffff" width="100%"><tr>
<td width="20%" align="left">
<table summary="band" border="0" cellpadding="3" cellspacing="0"><tr><td align="left" bgcolor="#ffffff"><a href="http://live.debian.net/" target="_top"><img border="0" src="../_sisu/image/debian_home.png" alt="Debian -->" /></a></td></tr>
</table>
</td>
<td width="75%" align="center">
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<td align="center" bgcolor="#ffffff">
<a href="sisu_manifest.de.html" target="_top" >
<font face="verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman" size="2">
[ document manifest ]
</font>
</a>
</td>
</tr></table>
</td>
<td width="5%" align="right">
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<a href="procedures.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="toc.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_up_red.png" alt="TOC" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="metadata.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
</a>
</td>
<td>
</td></tr>
</table>
</td></tr>
</table>
<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#eeeeee align="center">
<tr><td align="left">
<a href="procedures.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="<" />
</a>
</td>
<td align="center">
<a href="toc.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="^" />
</a>
</td>
<td align="right">
<a href="metadata.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt=">" />
</a>
</td></tr>
</table><div class="content">
<h1 class="tiny">
Debian Live Handbuch
</h1>
</div><div class="content">
<h2 class="tiny">
Beispiele
</h2>
</div><div class="content"><div class="substance">
<label class="ocn"><a name="690" href="#690" class="lnkocn">690</a></label>
<h1 class="norm" id="o690"><a name="690"></a>
16. Examples
</h1>
</div><div class="substance">
<label class="ocn"><a name="691" href="#691" class="lnkocn">691</a></label>
<p class="i0" id="o691">
This chapter covers example builds for specific use cases with Debian Live. If you are new to building your own Debian Live images, we recommend you first look at the three tutorials in sequence, as each one teaches new techniques that will help you use and understand the remaining examples.
</p>
</div><div class="substance">
<label class="ocn"><a name="692" href="#692" class="lnkocn">692</a></label>
<p class="bold" id="o692"><a name="692"></a> <a name="husing-the-examples" id="husing-the-examples"></a>
<a name="h16.1" ></a><a name="using-the-examples" ></a>16.1 Using the examples
</p>
</div><div class="substance">
<label class="ocn"><a name="693" href="#693" class="lnkocn">693</a></label>
<p class="i0" id="o693">
To use these examples you need a system to build them on that meets the requirements listed in <a href="installation.html#requirements">Requirements</a> and has <i>live-build</i> installed as described in <a href="installation.html#installing-live-build">Installing live-build</a>.
</p>
</div><div class="substance">
<label class="ocn"><a name="694" href="#694" class="lnkocn">694</a></label>
<p class="i0" id="o694">
Note that, for the sake of brevity, in these examples we do not specify a local mirror to use for the build. You can speed up downloads considerably if you use a local mirror. You may specify the options when you use <tt>lb config</tt>, as described in <a href="customizing-package-installation.html#distribution-mirrors-build-time">Distribution mirrors used at build time</a>, or for more convenience, set the default for your build system in <tt>/etc/live/build.conf</tt>. Simply create this file and in it, set the corresponding <tt>LB_PARENT_MIRROR_*</tt> variables to your preferred mirror. All other mirrors used in the build will be defaulted from these values. For example:
</p>
</div><div class="substance">
<label class="ocn"><a name="695" href="#695" class="lnkocn">695</a></label>
<p class="code" id="o695">
LB_PARENT_MIRROR_BOOTSTRAP="http://mirror/debian" <br />
LB_PARENT_MIRROR_CHROOT_SECURITY="http://mirror/debian-security" <br />
LB_PARENT_MIRROR_CHROOT_BACKPORTS="http://mirror/debian-updates"<br /> <br />
</p>
</div><div class="substance">
<label class="ocn"><a name="696" href="#696" class="lnkocn">696</a></label>
<p class="bold" id="o696"><a name="696"></a> <a name="htutorial-1" id="htutorial-1"></a>
<a name="h16.2" ></a><a name="tutorial-1" ></a>16.2 Tutorial 1: A standard image
</p>
</div><div class="substance">
<label class="ocn"><a name="697" href="#697" class="lnkocn">697</a></label>
<p class="i0" id="o697">
<b>Use case:</b> Create a simple first image, learning the basics of <i>live-build</i>.
</p>
</div><div class="substance">
<label class="ocn"><a name="698" href="#698" class="lnkocn">698</a></label>
<p class="i0" id="o698">
In this tutorial, we will build a default ISO hybrid Debian Live image containing only base packages (no Xorg) and some Debian Live support packages, as a first exercise in using <i>live-build</i>.
</p>
</div><div class="substance">
<label class="ocn"><a name="699" href="#699" class="lnkocn">699</a></label>
<p class="i0" id="o699">
You can't get much simpler than this:
</p>
</div><div class="substance">
<label class="ocn"><a name="700" href="#700" class="lnkocn">700</a></label>
<p class="code" id="o700">
$ mkdir tutorial1 ; cd tutorial1 ; lb config<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="701" href="#701" class="lnkocn">701</a></label>
<p class="i0" id="o701">
Examine the contents of the <tt>config/</tt> directory if you wish. You will see stored here a skeletal configuration, ready to customize or, in this case, use immediately to build a default image.
</p>
</div><div class="substance">
<label class="ocn"><a name="702" href="#702" class="lnkocn">702</a></label>
<p class="i0" id="o702">
Now, as superuser, build the image, saving a log as you build with <tt>tee</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="703" href="#703" class="lnkocn">703</a></label>
<p class="code" id="o703">
# lb build 2>&1 | tee binary.log<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="704" href="#704" class="lnkocn">704</a></label>
<p class="i0" id="o704">
Assuming all goes well, after a while, the current directory will contain <tt>binary-hybrid.iso</tt>. This ISO hybrid image can be booted directly in a virtual machine as described in <a href="the-basics.html#testing-iso-with-qemu">Testing an ISO image with Qemu</a> and <a href="the-basics.html#testing-iso-with-virtualbox">Testing an ISO image with virtualbox-ose</a>, or else imaged onto optical media or a USB flash device as described in <a href="the-basics.html#burning-iso-image">Burning an ISO image to a physical medium</a> and <a href="the-basics.html#copying-iso-hybrid-to-usb">Copying an ISO hybrid image to a USB stick</a>, respectively.
</p>
</div><div class="substance">
<label class="ocn"><a name="705" href="#705" class="lnkocn">705</a></label>
<p class="bold" id="o705"><a name="705"></a> <a name="htutorial-2" id="htutorial-2"></a>
<a name="h16.3" ></a><a name="tutorial-2" ></a>16.3 Tutorial 2: A web browser utility
</p>
</div><div class="substance">
<label class="ocn"><a name="706" href="#706" class="lnkocn">706</a></label>
<p class="i0" id="o706">
<b>Use case:</b> Create a web browser utility image, learning how to apply customizations.
</p>
</div><div class="substance">
<label class="ocn"><a name="707" href="#707" class="lnkocn">707</a></label>
<p class="i0" id="o707">
In this tutorial, we will create an image suitable for use as a web browser utility, serving as an introduction to customizing Debian Live images.
</p>
</div><div class="substance">
<label class="ocn"><a name="708" href="#708" class="lnkocn">708</a></label>
<p class="code" id="o708">
$ mkdir tutorial2<br />
$ cd tutorial2<br />
$ lb config -p lxde<br />
$ echo iceweasel >> config/package-lists/my.list.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="709" href="#709" class="lnkocn">709</a></label>
<p class="i0" id="o709">
Our choice of LXDE for this example reflects our desire to provide a minimal desktop environment, since the focus of the image is the single use we have in mind, the web browser. We could go even further and provide a default configuration for the web browser in <tt>config/includes.chroot/etc/iceweasel/profile/</tt>, or additional support packages for viewing various kinds of web content, but we leave this as an exercise for the reader.
</p>
</div><div class="substance">
<label class="ocn"><a name="710" href="#710" class="lnkocn">710</a></label>
<p class="i0" id="o710">
Build the image, again as superuser, keeping a log as in <a href="examples.html#tutorial-1">Tutorial 1</a>:
</p>
</div><div class="substance">
<label class="ocn"><a name="711" href="#711" class="lnkocn">711</a></label>
<p class="code" id="o711">
# lb build 2>&1 | tee binary.log<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="712" href="#712" class="lnkocn">712</a></label>
<p class="i0" id="o712">
Again, verify the image is OK and test, as in <a href="examples.html#tutorial-1">Tutorial 1</a>.
</p>
</div><div class="substance">
<label class="ocn"><a name="713" href="#713" class="lnkocn">713</a></label>
<p class="bold" id="o713"><a name="713"></a> <a name="htutorial-3" id="htutorial-3"></a>
<a name="h16.4" ></a><a name="tutorial-3" ></a>16.4 Tutorial 3: A personalized image
</p>
</div><div class="substance">
<label class="ocn"><a name="714" href="#714" class="lnkocn">714</a></label>
<p class="i0" id="o714">
<b>Use case:</b> Create a project to build a personalized image, containing your favourite software to take with you on a USB stick wherever you go, and evolving in successive revisions as your needs and preferences change.
</p>
</div><div class="substance">
<label class="ocn"><a name="715" href="#715" class="lnkocn">715</a></label>
<p class="i0" id="o715">
Since we will be changing our personalized image over a number of revisions, and we want to track those changes, trying things experimentally and possibly reverting them if things don't work out, we will keep our configuration in the popular <tt>git</tt> version control system. We will also use the best practice of autoconfiguration via <tt>auto</tt> scripts as described in <a href="managing-a-configuration.html#managing-a-configuration">Managing a configuration</a>.
</p>
</div><div class="substance">
<label class="ocn"><a name="716" href="#716" class="lnkocn">716</a></label>
<p class="bold" id="o716"><a name="716"></a> <a name="h16.4.1" id="h16.4.1"></a>
<a name="16.4.1" ></a><a name="h16.4.1" ></a>16.4.1 First revision
</p>
</div><div class="substance">
<label class="ocn"><a name="717" href="#717" class="lnkocn">717</a></label>
<p class="code" id="o717">
$ mkdir -p tutorial3/auto<br />
$ cp /usr/share/live/build/examples/auto/* tutorial3/auto/<br />
$ cd tutorial3<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="718" href="#718" class="lnkocn">718</a></label>
<p class="i0" id="o718">
Edit <tt>auto/config</tt> to read as follows:
</p>
</div><div class="substance">
<label class="ocn"><a name="719" href="#719" class="lnkocn">719</a></label>
<p class="code" id="o719">
#!/bin/sh<br /><br />
lb config noauto \<br />
--architecture i386 \<br />
--linux-flavours 686-pae \<br />
--package-lists lxde \<br />
"${@}"<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="720" href="#720" class="lnkocn">720</a></label>
<p class="i0" id="o720">
Now populate your local package list:
</p>
</div><div class="substance">
<label class="ocn"><a name="721" href="#721" class="lnkocn">721</a></label>
<p class="code" id="o721">
$ echo "iceweasel xchat" >> config/package-lists/my.list.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="722" href="#722" class="lnkocn">722</a></label>
<p class="i0" id="o722">
First, <tt>--architecture i386</tt> ensures that on our <tt>amd64</tt> build system, we build a 32-bit version suitable for use on most machines. Second, we use <tt>--linux-flavours 686-pae</tt> because we don't anticipate using this image on much older systems. Third, we've chosen the <tt>lxde</tt> package list to give us a minimal desktop. And finally, we have added two initial favourite packages: <tt>iceweasel</tt> and <tt>xchat</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="723" href="#723" class="lnkocn">723</a></label>
<p class="i0" id="o723">
Now, build the image:
</p>
</div><div class="substance">
<label class="ocn"><a name="724" href="#724" class="lnkocn">724</a></label>
<p class="code" id="o724">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="725" href="#725" class="lnkocn">725</a></label>
<p class="i0" id="o725">
Note that unlike in the first two tutorials, we no longer have to type <tt>2>&1 | tee binary.log</tt> as that is now included in <tt>auto/build</tt>.
</p>
</div><div class="substance">
<label class="ocn"><a name="726" href="#726" class="lnkocn">726</a></label>
<p class="i0" id="o726">
Once you've tested the image (as in <a href="examples.html#tutorial-1">Tutorial 1</a>) and are satisfied it works, it's time to initialize our <tt>git</tt> repository, adding only the auto scripts we just created, and then make the first commit:
</p>
</div><div class="substance">
<label class="ocn"><a name="727" href="#727" class="lnkocn">727</a></label>
<p class="code" id="o727">
$ git init<br />
$ git add auto<br />
$ git commit -a -m "Initial import."<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="728" href="#728" class="lnkocn">728</a></label>
<p class="bold" id="o728"><a name="728"></a> <a name="h16.4.2" id="h16.4.2"></a>
<a name="16.4.2" ></a><a name="h16.4.2" ></a>16.4.2 Second revision
</p>
</div><div class="substance">
<label class="ocn"><a name="729" href="#729" class="lnkocn">729</a></label>
<p class="i0" id="o729">
In this revision, we're going to clean up from the first build, add the <tt>vlc</tt> package to our configuration, rebuild, test and commit.
</p>
</div><div class="substance">
<label class="ocn"><a name="730" href="#730" class="lnkocn">730</a></label>
<p class="i0" id="o730">
The <tt>lb clean</tt> command will clean up all generated files from the previous build except for the cache, which saves having to re-download packages. This ensures that the subsequent <tt>lb build</tt> will re-run all stages to regenerate the files from our new configuration.
</p>
</div><div class="substance">
<label class="ocn"><a name="731" href="#731" class="lnkocn">731</a></label>
<p class="code" id="o731">
# lb clean<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="732" href="#732" class="lnkocn">732</a></label>
<p class="i0" id="o732">
Now append the <tt>vlc</tt> package to our local package list in <tt>config/package-lists/my.list.chroot</tt>:
</p>
</div><div class="substance">
<label class="ocn"><a name="733" href="#733" class="lnkocn">733</a></label>
<p class="code" id="o733">
$ echo vlc >> config/package-lists/my.list.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="734" href="#734" class="lnkocn">734</a></label>
<p class="i0" id="o734">
Build again:
</p>
</div><div class="substance">
<label class="ocn"><a name="735" href="#735" class="lnkocn">735</a></label>
<p class="code" id="o735">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="736" href="#736" class="lnkocn">736</a></label>
<p class="i0" id="o736">
Test, and when you're satisfied, commit the next revision:
</p>
</div><div class="substance">
<label class="ocn"><a name="737" href="#737" class="lnkocn">737</a></label>
<p class="code" id="o737">
$ git commit -a -m "Adding vlc media player."<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="738" href="#738" class="lnkocn">738</a></label>
<p class="i0" id="o738">
Of course, more complicated changes to the configuration are possible, perhaps adding files in subdirectories of <tt>config/</tt>. When you commit new revisions, just take care not to hand edit or commit the top-level files in <tt>config</tt> containing <tt>LB_*</tt> variables, as these are build products, too, and are always cleaned up by <tt>lb clean</tt> and re-created with <tt>lb config</tt> via their respective <tt>auto</tt> scripts.
</p>
</div><div class="substance">
<label class="ocn"><a name="739" href="#739" class="lnkocn">739</a></label>
<p class="i0" id="o739">
We've come to the end of our tutorial series. While many more kinds of customization are possible, even just using the few features explored in these simple examples, an almost infinite variety of different images can be created. The remaining examples in this section cover several other use cases drawn from the collected experiences of users of Debian Live.
</p>
</div><div class="substance">
<label class="ocn"><a name="740" href="#740" class="lnkocn">740</a></label>
<p class="bold" id="o740"><a name="740"></a> <a name="h16.5" id="h16.5"></a>
<a name="16.5" ></a><a name="h16.5" ></a>16.5 A VNC Kiosk Client
</p>
</div><div class="substance">
<label class="ocn"><a name="741" href="#741" class="lnkocn">741</a></label>
<p class="i0" id="o741">
<b>Use case:</b> Create an image with <i>live-build</i> to boot directly to a VNC server.
</p>
</div><div class="substance">
<label class="ocn"><a name="742" href="#742" class="lnkocn">742</a></label>
<p class="i0" id="o742">
Make a build directory and create a skeletal configuration in it built around the standard-x11 list, including <tt>gdm3</tt>, <tt>metacity</tt> and <tt>xvnc4viewer</tt>, disabling recommends to make a minimal system:
</p>
</div><div class="substance">
<label class="ocn"><a name="743" href="#743" class="lnkocn">743</a></label>
<p class="code" id="o743">
$ mkdir vnc_kiosk_client<br />
$ cd vnc_kiosk_client<br />
$ lb config -a i386 -k 686-pae -p standard-x11 \<br />
--apt-recommends false<br />
$ echo "gdm3 metacity xvnc4viewer" >> config/package-lists/my.list.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="744" href="#744" class="lnkocn">744</a></label>
<p class="i0" id="o744">
Create the directory <tt>/etc/skel</tt> and put a custom <tt>.xsession</tt> in it for the default user that will launch metacity and start xvncviewer, connecting to port <tt>5901</tt> on a server at <tt>192.168.1.2</tt>:
</p>
</div><div class="substance">
<label class="ocn"><a name="745" href="#745" class="lnkocn">745</a></label>
<p class="code" id="o745">
$ mkdir -p config/includes.chroot/etc/skel<br />
$ cat > config/includes.chroot/etc/skel/.xsession <<END<br />
#!/bin/sh<br /><br />
/usr/bin/metacity &<br />
/usr/bin/xvncviewer 192.168.1.2:1<br /><br />
exit<br />
END<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="746" href="#746" class="lnkocn">746</a></label>
<p class="i0" id="o746">
Build the image:
</p>
</div><div class="substance">
<label class="ocn"><a name="747" href="#747" class="lnkocn">747</a></label>
<p class="code" id="o747">
# lb build<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="748" href="#748" class="lnkocn">748</a></label>
<p class="i0" id="o748">
Enjoy.
</p>
</div><div class="substance">
<label class="ocn"><a name="749" href="#749" class="lnkocn">749</a></label>
<p class="bold" id="o749"><a name="749"></a> <a name="h16.6" id="h16.6"></a>
<a name="16.6" ></a><a name="h16.6" ></a>16.6 A base image for a 128M USB key
</p>
</div><div class="substance">
<label class="ocn"><a name="750" href="#750" class="lnkocn">750</a></label>
<p class="i0" id="o750">
<b>Use case:</b> Create a standard image with some components removed in order to fit on a 128M USB key with space left over to use as you see fit.
</p>
</div><div class="substance">
<label class="ocn"><a name="751" href="#751" class="lnkocn">751</a></label>
<p class="i0" id="o751">
When optimizing an image to fit a certain media size, you need to understand the tradeoffs you are making between size and functionality. In this example, we trim only so much as to make room for additional material within a 128M media size, but without doing anything to destroy integrity of the packages contained within, such as the purging of locale data via the <tt>localepurge</tt> package, or other such "intrusive" optimizations. Of particular note, you should not use <tt>--bootstrap-flavour minimal</tt> unless you really know what you're doing, as omitting priority <tt>important</tt> packages will most likely produce a broken live system.
</p>
</div><div class="substance">
<label class="ocn"><a name="752" href="#752" class="lnkocn">752</a></label>
<p class="code" id="o752">
$ lb config -k 486 -p minimal --apt-indices false \<br />
--memtest none --apt-recommends false --includes none<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="753" href="#753" class="lnkocn">753</a></label>
<p class="i0" id="o753">
Now, build the image in the usual way:
</p>
</div><div class="substance">
<label class="ocn"><a name="754" href="#754" class="lnkocn">754</a></label>
<p class="code" id="o754">
# lb build 2>&1 | tee binary.log<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="755" href="#755" class="lnkocn">755</a></label>
<p class="i0" id="o755">
On the author's system at time of writing, the above configuration produced a 78Mbyte image. This compares favourably with the 166Mbyte image produced by the default configuration in <a href="examples.html#tutorial-1">Tutorial 1</a>.
</p>
</div><div class="substance">
<label class="ocn"><a name="756" href="#756" class="lnkocn">756</a></label>
<p class="i0" id="o756">
The biggest space-saver here, compared to building a standard image on an <tt>i386</tt> architecture system, is to select only the <tt>486</tt> kernel flavour instead of the default <tt>-k "486 686-pae"</tt>. Leaving off APT's indices with <tt>--apt-indices false</tt> also saves a fair amount of space, the tradeoff being that you need to <tt>apt-get update</tt> before using apt in the live system. Choosing the <tt>minimal</tt> package list leaves out the large <tt>locales</tt> package and associated utilities. Dropping recommended packages with <tt>--apt-recommends false</tt> saves some additional space, at the expense of omitting some packages you might otherwise expect to be there, such as <tt>firmware-linux-free</tt> which may be needed to support certain hardware. The remaining options shave off additional small amounts of space. It's up to you to decide if the functionality that is sacrificed with each optimization is worth the loss in functionality.
</p>
</div><div class="substance">
<label class="ocn"><a name="757" href="#757" class="lnkocn">757</a></label>
<p class="bold" id="o757"><a name="757"></a> <a name="h16.7" id="h16.7"></a>
<a name="16.7" ></a><a name="h16.7" ></a>16.7 A localized KDE desktop and installer
</p>
</div><div class="substance">
<label class="ocn"><a name="758" href="#758" class="lnkocn">758</a></label>
<p class="i0" id="o758">
<b>Use case:</b> Create a KDE desktop image, localized for Brazilian Portuguese and including an installer.
</p>
</div><div class="substance">
<label class="ocn"><a name="759" href="#759" class="lnkocn">759</a></label>
<p class="i0" id="o759">
We want to make an iso-hybrid image for i386 architecture using our preferred desktop, in this case KDE, containing all of the same packages that would be installed by the standard Debian installer for KDE.
</p>
</div><div class="substance">
<label class="ocn"><a name="760" href="#760" class="lnkocn">760</a></label>
<p class="i0" id="o760">
Our initial problem is the discovery of the names of the appropriate language tasks. Currently, <i>live-build</i> cannot help with this. While we might get lucky and find this by trial-and-error, there is a tool, <tt>grep-dctrl</tt>, which can be used to dig it out of the task descriptions in tasksel-data, so to prepare, make sure you have both of those things:
</p>
</div><div class="substance">
<label class="ocn"><a name="761" href="#761" class="lnkocn">761</a></label>
<p class="code" id="o761">
# apt-get install dctrl-tools tasksel-data<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="762" href="#762" class="lnkocn">762</a></label>
<p class="i0" id="o762">
Now we can search for the appropriate tasks, first with:
</p>
</div><div class="substance">
<label class="ocn"><a name="763" href="#763" class="lnkocn">763</a></label>
<p class="code" id="o763">
$ grep-dctrl -FTest-lang pt_BR /usr/share/tasksel/descs/debian-tasks.desc -sTask<br />
Task: brazilian-portuguese<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="764" href="#764" class="lnkocn">764</a></label>
<p class="i0" id="o764">
By this command, we discover the task is called, plainly enough, brazilian-portuguese. Now to find the related tasks:
</p>
</div><div class="substance">
<label class="ocn"><a name="765" href="#765" class="lnkocn">765</a></label>
<p class="code" id="o765">
$ grep-dctrl -FEnhances brazilian-portuguese /usr/share/tasksel/descs/debian-tasks.desc -sTask<br />
Task: brazilian-portuguese-desktop<br />
Task: brazilian-portuguese-kde-desktop<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="766" href="#766" class="lnkocn">766</a></label>
<p class="i0" id="o766">
At boot time we will generate the pt_BR.UTF-8 locale and select the pt-latin1 keyboard layout. We will also need to preseed our desktop choice, "kde" so that tasksel will install the correct desktop task, as it differs from the default (see <a href="customizing-package-installation.html#desktop-and-language-tasks">Desktop and languages tasks</a>). Now let's put the pieces together:
</p>
</div><div class="substance">
<label class="ocn"><a name="767" href="#767" class="lnkocn">767</a></label>
<p class="code" id="o767">
$ mkdir live-pt_BR-kde<br />
$ cd live-pt_BR-kde<br />
$ lb config \<br />
-a i386 \<br />
-k 486 \<br />
--bootappend-live "locales=pt_BR.UTF-8 keyboard-layouts=pt-latin1" \<br />
--debian-installer live<br />
$ echo kde-desktop brazilian-portuguese brazilian-portuguese-desktop \<br />
brazilian-portuguese-kde-desktop >> config/task-lists/my.list.chroot<br />
$ echo debian-installer-launcher >> config/package-lists/my.list.chroot<br />
$ echo tasksel tasksel/desktop multiselect kde >> config/preseed/my.preseed.chroot<br /><br />
</p>
</div><div class="substance">
<label class="ocn"><a name="768" href="#768" class="lnkocn">768</a></label>
<p class="i0" id="o768">
Note that we have included the <tt>debian-installer-launcher</tt> package to launch the installer from the live desktop, and have also specified the 486 flavour kernel, as it is currently necessary to make the installer and live system kernels match for the launcher to work properly.
</p>
</div><div class="substance">
<label class=""><a name=""> </a></label>
<p class="norm" id="o">
<hr /><br />
</p>
</div></div><br /><div class="main_column">
<table summary="segment navigation band" bgcolor="#ffffff" width="100%"><tr>
<td width="70%" align="center">
<table summary="segment navigation available documents types: toc,doc,pdf,concordance" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<td align="center" bgcolor="#ffffff">
<a href="sisu_manifest.de.html" target="_top" >
<font face="verdana, arial, georgia, tahoma, sans-serif, helvetica, times, roman" size="2">
[ document manifest ]
</font>
</a>
</td>
</tr></table>
</td>
<td width="5%" align="right">
<table summary="segment navigation pre/next" border="0" cellpadding="3" cellspacing="0">
<tr>
<td align="center" bgcolor="#ffffff">
<a href="procedures.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_prev_red.png" alt="<< previous" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="toc.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_up_red.png" alt="TOC" />
</a>
</td>
<td align="center" bgcolor="#ffffff">
<a href="metadata.de.html" target="_top" >
<img border="0" width="22" height="22" src="../_sisu/image_sys/arrow_next_red.png" alt="next >>" />
</a>
</td>
<td>
</td></tr>
</table>
</td></tr>
</table>
<table summary="segment hidden control pre and next" width="100%" border="0" cellpadding="0" bgcolor=#eeeeee align="center">
<tr><td align="left">
<a href="procedures.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="<" />
</a>
</td>
<td align="center">
<a href="toc.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt="^" />
</a>
</td>
<td align="right">
<a href="metadata.de.html" target="_top" >
<img border="0" width="100%" height="20" src="../_sisu/image_sys/dot_white.png" alt=">" />
</a>
</td></tr>
</table>
</div><div class="main_column">
<a name="bottom" id="bottom"></a>
<a name="down" id="down"></a>
<a name="end" id="end"></a>
<a name="finish" id="finish"></a>
<a name="stop" id="stop"></a>
<a name="credits" id="credits"></a>
</div></div></body>
</html>
|